A cross-platform AI chatbot client built with C# (.NET 9) featuring clean architecture, fully pluginable responder system, and a modern terminal-based interface with support for multiple AI backends and unlimited custom chat responders.
graph TB
User([User]) <--> CLI[Jasmine.CLI<br/>Terminal Interface]
CLI <--> Core[Jasmine.Core<br/>AI Services & Logic]
subgraph "Jasmine.CLI - Presentation Layer"
UI[ChatUI<br/>Dynamic Terminal Interface]
Bridge[ChatService<br/>UI Bridge]
Program[Program.cs<br/>DI & Startup]
end
subgraph "Jasmine.Core - Business Layer"
Registry[ResponderRegistry<br/>Dynamic Plugin Management]
PAS[PluginableAIService<br/>Zero Hardcoded References]
Config[Configuration<br/>& Persistence]
Plugins[Plugin System<br/>HTTP & Time & Tools]
Logging[Logging Infrastructure<br/>File & Rotation]
end
subgraph "Pluginable Responders"
Echo[Echo Responder<br/>Testing & Development]
Ollama[Ollama Responder<br/>Local AI Models]
Azure[Azure OpenAI<br/>Cloud AI Models]
Human[Human Chat<br/>Operator Relay*]
Quote[Random Quote<br/>Example Plugin]
Custom[Custom Responders<br/>Unlimited Extensibility]
end
CLI --> UI
CLI --> Bridge
CLI --> Program
Core --> Registry
Core --> PAS
Core --> Config
Core --> Plugins
Core --> Logging
Registry -.-> Echo
Registry -.-> Ollama
Registry -.-> Azure
Registry -.-> Human
Registry -.-> Quote
Registry -.-> Custom
PAS --> Registry
style User fill:#f9f,stroke:#333
style CLI fill:#9cf,stroke:#333
style Core fill:#fc9,stroke:#333
style UI fill:#e1f5fe,stroke:#01579b
style Bridge fill:#e1f5fe,stroke:#01579b
style Program fill:#e1f5fe,stroke:#01579b
style Registry fill:#e8f5e8,stroke:#2e7d32
style PAS fill:#fff3e0,stroke:#e65100
style Config fill:#fff3e0,stroke:#e65100
style Plugins fill:#fff3e0,stroke:#e65100
style Logging fill:#fff3e0,stroke:#e65100
style Custom fill:#f3e5f5,stroke:#7b1fa2
Jasmine is a modern, cross-platform AI chatbot client that provides a truly pluginable responder architecture for seamless integration of AI services, human operators, and unlimited custom chat responders. Built with .NET 9 and leveraging Microsoft Semantic Kernel, it offers clean separation between user interface and AI logic while supporting unlimited extensibility through its fully dynamic plugin system.
- Dynamic Discovery: Responders discovered at runtime with zero core code changes needed
- Zero Hardcoded References: Core service dynamically configures all responders without hardcoded IDs or types
- First-Available Selection: Intelligent default responder selection based on registration order
- Unified Interface: All responders implement
IChatResponderfor consistent behavior and configuration - Runtime Registration: Add new responders by simply implementing interface and registering in DI
- Separation of Concerns: UI layer handles only presentation, Core layer manages all AI logic and responder orchestration
- Dynamic Configuration: Responder configuration applied dynamically based on legacy mappings where applicable
- Event-Driven Updates: Reactive UI programming with clean event handling
- Interface-Based Design: Zero dependencies on concrete implementations
src/
??? Jasmine.CLI/ # Terminal UI (Presentation Layer)
? ??? ChatUI.cs # Dynamic Terminal.Gui interface
? ??? ChatService.cs # UI-Core bridge with responder support
? ??? Program.cs # DI setup with responder registration
??? Jasmine.Core/ # AI Services & Business Logic
? ??? Abstractions/ # Clean interfaces (IChatResponder, IAIService)
? ??? Services/ # PluginableAIService & ResponderRegistry
? ??? Responders/ # Built-in responder implementations
? ? ??? EchoResponder.cs # Testing/development
? ? ??? OllamaResponder.cs # Local AI models
? ? ??? AzureOpenAIResponder.cs # Cloud AI models
? ? ??? HumanChatResponder.cs # Human operator relay (placeholder)
? ? ??? RandomQuoteResponder.cs # Example custom responder
? ??? AI/ # AI configuration and integrations
? ??? Utils/ # Token management, conversation memory
? ??? Plugins/ # Semantic Kernel plugins
??? tests/
??? Jasmine.Tests/ # Comprehensive test suite with 240+ tests
??? Integration/ # Including CustomResponderIntegrationTests
??? Architecture/ # Clean architecture validation
??? Security/ # Data privacy and protection
??? Performance/ # Concurrency and load testing
- True Plugin Architecture: Add new responders without any core code changes
- Dynamic Registration: Responders auto-discovered via dependency injection at startup
- Automatic UI Integration: New responders automatically appear in menus with generated configuration dialogs
- Zero Core Modifications: Proven by comprehensive integration tests with custom responders
- Configuration Flexibility: Each responder defines its own parameters, validation, and defaults
- Legacy Compatibility: Existing enum-based API still works during migration period
- AI Responders:
- ?? Ollama (local models) with full Semantic Kernel integration and streaming
- ?? Azure OpenAI (cloud models) with streaming support and enterprise features
- Utility Responders:
- ?? Echo Service: Simple testing responder that echoes user input with configurable delays
- ?? Random Quote: Example responder demonstrating custom implementation patterns
- ?? Human Chat: Relay system for human operator communication (placeholder with WebSocket/SignalR ready architecture)
- Custom Responders: Unlimited extensibility - implement
IChatResponderand register!
- Dynamic Menu Generation: Menus automatically populated from registered responders at runtime
- Keyboard-Driven Interface: Full Terminal.Gui implementation with comprehensive shortcuts
- Real-time Streaming: Live display of AI responses as they're generated with progress indicators
- Animated Progress: Context-aware progress bars during responder processing
- Smart Text Selection: Multi-line selection with standard copy/paste keyboard shortcuts
- Auto-Generated Dialogs: Configuration dialogs dynamically created from responder parameters
- Adaptive Status Display: Real-time status showing current responder details and configuration state
- Clean Abstractions:
IChatResponderinterface hides implementation complexity completely - Registry Pattern:
ResponderRegistrymanages available responders with thread-safe operations - Backward Compatibility: Legacy
SupportedAIServicesenum fully supported with bidirectional mapping - Robust Configuration: JSON-based settings with automatic saving, loading, and corruption recovery
- Comprehensive Logging: File-based logging with rotation, error handling, and privacy protection
- Tools Integration: OpenAPI and MCP (Model Context Protocol) tools configuration support
- Zero Learning Curve: Implement one interface, get full integration with all features
- No Breaking Changes: Add responders without modifying any existing application code
- Rich Configuration System: Support for parameters, validation, defaults, and UI generation
- Mock-Friendly Testing: Clean interfaces enable comprehensive unit and integration testing
- Modern C# Features: Leverages C# 13 features, .NET 9 capabilities, and latest async patterns
- .NET 9 SDK (latest version)
- Terminal supporting Unicode characters (Windows Terminal, macOS Terminal, or Linux terminal)
- Ollama (optional, for local AI models)
# Clone the repository
git clone <repository-url>
cd Jasmine
# Restore dependencies
dotnet restore
# Build the solution
dotnet build
# Run the CLI application
dotnet run --project src/Jasmine.CLIThe application automatically creates a default ai_services_config.json configuration file on first run. To use AI services:
- For Azure OpenAI: Update the generated config file with your endpoint and API key
- For Ollama: Ensure Ollama is running locally (default:
http://localhost:11434) - For importing settings: Copy your existing
ai_services_config.jsonto the CLI project directory
The configuration file is excluded from version control for security. A template file is provided for reference.
Creating a new responder is incredibly simple and requires no modifications to core code:
- Create the responder:
public class WeatherResponder : IChatResponder
{
private readonly Dictionary<string, string> _parameters = new()
{
["ApiKey"] = "",
["DefaultCity"] = "Seattle",
["Units"] = "metric"
};
public string Id => "weather";
public string DisplayName => "Weather Service";
public string Description => "Get weather information for any city";
public IReadOnlyDictionary<string, string> Parameters => _parameters;
public bool RequiresConfiguration => true;
public bool SupportsStreaming => false;
public Task ConfigureAsync(Dictionary<string, string> parameters) { /* ... */ }
public Task<IChatMessage> RespondAsync(string userInput, IReadOnlyList<IChatMessage> history, Action<string>? onStreamingUpdate = null) { /* ... */ }
public bool IsConfigured() => !string.IsNullOrEmpty(_parameters["ApiKey"]);
public Dictionary<string, string> GetDefaultConfiguration() => new(_parameters);
}- Register in Program.cs:
// Add to DI container
services.AddSingleton<WeatherResponder>();
// Register with the responder registry
registry.Register(serviceProvider.GetRequiredService<WeatherResponder>());- That's it! ? Your responder:
- Automatically appears in the UI menu
- Gets a dynamically generated configuration dialog
- Works with all existing features (streaming, events, error handling)
- Supports all UI operations (switching, configuration, status display)
- Core Project README - AI services, responders, and business logic architecture
- CLI Project README - Terminal interface and dynamic UI architecture
- Test Project README - Testing strategy, patterns, and coverage details
Our architecture is validated by comprehensive tests including:
- Custom Responder Integration Tests: Prove that external responders work seamlessly
- Architecture Boundary Tests: Enforce clean separation and zero forbidden dependencies
- Legacy Compatibility Tests: Ensure backward compatibility during migration
- Performance Tests: Validate concurrent responder operations and registry scalability
- Ollama: Local AI models with configurable endpoints, streaming, and model switching
- Azure OpenAI: Enterprise-grade GPT models with streaming, token management, and tools integration
- Echo: Development and testing responder with configurable prefix and delays
- Random Quote: Demonstrates simple custom responder implementation patterns
- Human Chat: Architecture for human operator integration (WebSocket/SignalR ready)
The pluginable architecture enables any type of responder:
- ??? Weather Services: API-based weather information with geolocation
- ??? Database Responders: Query databases and return formatted results with SQL support
- ?? External APIs: Integration with any REST, GraphQL, or WebSocket service
- ?? Custom AI Models: Integration with any AI service, local models, or custom inference
- ?? Business Logic: Domain-specific responders with complex workflow support
- ?? Interactive Services: Games, quizzes, tutorials, or interactive experiences
Run the comprehensive test suite:
# Run all tests
dotnet test
# Run with detailed output and coverage
dotnet test --verbosity normal --collect:"XPlat Code Coverage"
# Run specific test categories
dotnet test --filter "Category=Integration"
dotnet test --filter "Category=Architecture"
dotnet test --filter "Priority=Critical"The test project includes 240+ tests across multiple categories:
- Unit Tests: Individual component testing with mocked dependencies (60+ tests)
- Integration Tests: Cross-layer interaction validation including custom responders (50+ tests)
- Architecture Tests: Clean architecture boundary enforcement and dependency validation (15+ tests)
- Security Tests: Data privacy, API key protection, and sensitive information handling (15+ tests)
- Streaming Tests: Real-time response validation and edge cases (25+ tests)
- Error Handling Tests: Graceful failure scenarios and resilience testing (20+ tests)
- Performance Tests: Concurrency, load testing, and registry scalability (15+ tests)
- Compatibility Tests: Legacy system integration and backward compatibility (20+ tests)
- Tools Integration Tests: OpenAPI and MCP tools functionality (20+ tests)
- Custom Responder Integration: Proves external responders work without core changes
- Zero Hardcoded Dependencies: Validates dynamic responder discovery and configuration
- Thread Safety: Concurrent responder operations and registry modifications
- Security: API keys never appear in logs, error messages, or debug output
- Legacy Compatibility: Enum-based API continues working during migration
- Maintain Clean Architecture: Keep presentation and business logic completely separated
- Use Pluginable Patterns: All new responder types should implement
IChatResponderinterface only - Zero Breaking Changes: New features must not break existing responders or APIs
- Comprehensive Testing: Add tests for new responders, edge cases, and integration scenarios
- Documentation First: Update relevant README files and add XML documentation for new public APIs
- Security Conscious: Never log sensitive data, always validate responder parameters
- Performance Aware: Consider concurrent usage, memory usage, and responder registry scalability
The pluginable architecture makes it incredibly easy to contribute new responder types:
- Create your responder class implementing
IChatResponder - Add comprehensive tests in the test project with integration validation
- Register in Program.cs for dependency injection and registry registration
- Update documentation with examples and usage patterns
- Submit PR with your responder - no core code changes required!
- Complete Human Chat Implementation: Full WebSocket and SignalR integration for real-time human operator communication
- Additional AI Providers: OpenAI, Claude, Google Gemini, and Cohere responders with streaming support
- Enhanced Tools Integration: Expand OpenAPI and MCP tools with authentication and complex workflow support
- Advanced Configuration: Environment-specific responder configurations and deployment profiles
- Multi-modal Responders: Image processing, document analysis, and file upload responders
- Agent Orchestration: Multi-responder workflows, handoffs, and complex conversation routing
- Voice Interface: Speech-to-text and text-to-speech responder integration with real-time processing
- Web Interface: Browser-based alternative UI with full responder ecosystem support
- Database Integration: Built-in SQL and NoSQL database responders with query builders
- Distributed Responders: Network-based responder deployment, load balancing, and horizontal scaling
- Enterprise Features: Authentication, audit trails, responder permissions, and usage quotas
- Mobile Support: .NET MAUI applications with full responder ecosystem and offline support
- Cloud Deployment: Container-based responder hosting, management, and auto-scaling
- Marketplace: Community responder marketplace with ratings, reviews, and easy installation
MIT License - Feel free to use this pluginable architecture in your own projects!
- ? Zero Hardcoded References: Successfully removed all hardcoded responder dependencies
- ? True Plugin Architecture: Proven by comprehensive integration tests with external responders
- ? Clean Architecture: Validated by architectural boundary tests and dependency analysis
- ? Backward Compatibility: Legacy APIs continue working during migration period
- ? Production Ready: 240+ tests covering all scenarios including security and performance
- ? Developer Friendly: Simple interface implementation provides full feature integration