Skip to main content

Module chat

Module chat 

Source
Expand description

Chat HTTP surface for trusty-memory: OpenRouter/Ollama SSE chat, tool dispatch, chat-session CRUD, and inter-project messaging endpoints.

Why: Extracted from web.rs to keep the HTTP router thin and isolate the tool-calling loop (which is by far the largest single concern in this crate’s HTTP surface) behind its own module. The router still owns wiring, but the chat-specific request/response handlers, the tool dispatcher, and the inter-project messaging handlers all live here. What: Re-exports chat_handler, provider/session handlers, the execute_* dispatcher set, and the /api/v1/messages* handlers. Items kept pub(crate) so web::router() and the cross-palace recall handler can reference them without enlarging the public crate surface. Test: Behaviour is covered by web::tests::all_tools_returns_expected_set and web::tests::execute_tool_dispatches_known_tools, which still call into this module via the pub(crate) re-exports.

Modules§

handler
The SSE-streaming chat handler (chat_handler).
messaging
Inter-project messaging HTTP handlers (issue #99).
sessions
Provider probe + chat-session CRUD handlers.
tools
Chat tool definitions + the execute_* dispatcher set.