Include Luna AI Assistant design docs covering channels, configuration, core architecture, memory, scheduler, and skills. Add reference docs from OpenClaw and ZeroClaw projects, plus Mistral and OpenAI API specs.
1.1 KiB
1.1 KiB
CLI Channel
The CLI connects to Luna via SignalR. CliChannel is a server-side adapter that bridges the SignalR hub to the IChannel interface defined in Channels.
How It Works
CliChannel wraps IChatHubContext from Core to send streaming responses back to the connected SignalR client. The flow:
- The
ChatHubreceives a message from the CLI client over SignalR. ChatHubcallsRaiseMessageReceivedon theCliChannelinstance.- The Channels picks up the event and routes it through
SessionManager.RouteMessagesAsync. - The resulting
IAsyncEnumerable<ChatStreamUpdate>is passed back toCliChannel.SendStreamingMessageAsync. CliChannelforwards the stream to the SignalR client viaIChatHubContext.
Key Characteristics
- Server-side adapter:
CliChannellives on the server; the actual CLI is a separate SignalR client. - Single connection: One
CliChannelinstance maps to the SignalR hub connection. - No polling: Unlike Telegram Channel, the CLI uses persistent WebSocket connections via SignalR.
Namespace
Luna.Channels.Cli