Expand description
Transport-neutral dispatch — the shared core of ATD-speaking servers.
SP-streamable-http §4.3 + §6.3: the body of atd-server::connection.rs’s
per-request switch moves here so the Unix-socket listener and the
Streamable-HTTP listener (atd-server-http) drive the same dispatch
state machine over the same Arc<Registry>. The wire shape returned
is byte-identical regardless of which transport delivered the request —
this property is exercised by atd-server-http’s UDS↔HTTP parity test.
Two entry points:
-
dispatch_request— handles the fullRequestenum (Ping / Hello / ToolList / ToolSchema / RunTool). UDS uses this fromhandle_connection’s read loop; capability set + caller identity are mutated in place becauseHellorewrites both for the lifetime of the connection. -
run_tool— theRunToolarm extracted for HTTP. HTTP requests derive theirCapabilitySetandcaller_idfresh from a Bearer-token lookup per request (SP-streamable-http §4.3), so there is no connection state to carry forward — the listener callsrun_tooldirectly with the freshly-derived inputs.
Both routes share the same audit emission, capability gate, semaphore permit, token-broker resolution, binding-dispatch, middleware, and error mapping. Any future SP that adds a third transport (vsock, quic, …) should reach for these two entry points rather than re-implementing the switch.
Structs§
- Server
State - Shared dispatch state. Listener crates own one
Arc<ServerState>and hand the clone to per-connection / per-request dispatch. - Shared
Server Config - Transport-neutral configuration shared across listeners.
Functions§
- dispatch_
request - Run the full
Requeststate machine and produce aResponse. - run_
tool - Execute one
RunToolrequest against the shared dispatch state. - run_
tool_ continue - SP-pagination-v1 §4.4 — handle a
Request::RunToolContinue.