Skip to main content

Module protocol

Module protocol 

Source
Expand description

session.* JSON-RPC method handlers (#2054, vision spec Axiom 4 / §4.3).

Why: this is the API surface Axiom 4 requires — every session operation goes through JSON-RPC, reachable identically over STDIO and HTTP, so the CLI (and later TUI/TELGUI/REST) never touch SessionRegistry directly. What: register wires session.create, session.list, session.status, session.send, session.attach, session.detach, session.cancel, (#2058) session.get_transcript, and (#2350) session.set_goal/session.clear_goal/session.get_goals onto a Router, all closed over the SAME Arc<SessionRegistry> so every method sees a consistent view. Each handler parses its typed params, forwards to the matching SessionRegistry method, and maps the result onto the JSON-RPC result shape the vision spec’s §4.3 examples describe. The three goal methods’ handler bodies live in the sibling protocol_goals module (kept out of this file purely for the 500-SLOC cap — see that module’s docs), but are registered here alongside every other session.* method so this remains the one place listing the full surface. Test: protocol::tests::* (parameter validation, error mapping); protocol_goals::tests::* (the three goal methods); the full attach/detach streaming behaviour is covered by session::registry_tests (registry-level) and tests/session_e2e.rs/tests/task_e2e.rs (API-driven, real daemon).

Functions§

register
Register every session.* method onto router, all sharing registry.