Expand description
The kernel’s request/event interface — one protocol for every peer.
The kernel already exposes one half of a protocol: AgentEvent is a
typed, serializable stream of everything a session does (text deltas, tool
lifecycle, turn boundaries). This module adds the inbound half, Request,
and a versioned, addressed envelope, Frame, so that a client and a peer
become the same kind of thing:
- a request goes into a session’s mailbox,
- an event comes out of its stream.
A TUI client, a script, and another session differ only in which address
(Frame::session) they hold and how they render the stream — not in the
protocol they speak. That is what lets the client seam and the future
agent-to-agent seam share one implementation.
Transport is deliberately absent: today the seam is an in-process
tokio::mpsc; framing and sockets live above the kernel (a future
wcode-protocol crate). This module is serde types only, so it adds no
behavior — it is the shape the actor (S1) and the socket (S2) will speak.
See docs/interface-protocol-brainstorm.md for the design and the staged
path that lands these types.
Structs§
- Frame
- Versioned, addressed envelope around a
Requestor anAgentEvent. - Session
Id - A session’s stable address.
- Session
Info - A served session’s address plus the little metadata a roster shows: its
effective model, reasoning effort, and context window (each
Nonewhen the server does not know it). Carried bycrate::event::AgentEvent::Sessions, so a client can label each member by its own model instead of substituting the root’s.
Enums§
- Member
State - A session’s run-state — the server-side liveness fact (bug 2).
- Request
- Inbound intent: the requests a session’s mailbox accepts.
Constants§
- PROTOCOL_
VERSION - Wire-protocol major version. Bumped only by a breaking change; additive
changes leave it alone.
Requestalready carries aRequest::Unknownfallback so an older peer survives a newer request; the matching catch-all on the event side lands with the actor (S1), where an unknown event can be handled rather than silently dropped. - USER
- The well-known address of the human peer (brainstorm §5.2): the sender an in-process actor attributes an inbound message to until addressing lands (S4-2).
Functions§
- is_
inbound - Whether
requestis an A2A inbound message — the delivery verbs a peer sends (Notify/Interrupt/Wake), as opposed to a local command. The actor runs itsbefore_inboundpolicy on exactly these.
Type Aliases§
- Event
Frame - A session-to-client frame.
- Request
Frame - A client-to-session frame.