pub enum Payload {
Initialize {
mcp_kind: McpKind,
params: InitializeRequest,
},
ToolsList {
mcp_kind: McpKind,
params: ListToolsRequest,
},
ToolsCall {
mcp_kind: McpKind,
params: CallToolRequestParams,
},
ResourcesList {
mcp_kind: McpKind,
params: ListResourcesRequest,
},
ResourcesRead {
mcp_kind: McpKind,
params: ReadResourceRequestParams,
},
SessionTerminate {
mcp_kind: McpKind,
},
ReadMessageQueue(ReadMessageQueueRequest),
Retrieve(Request),
}Expand description
Tagged union of every JSON-RPC request the API forwards to the
client over the reverse-attach WS. Variant names follow the same
snake_case convention client_request::Payload uses; the
serde(tag = "type") discriminator pairs with
super::super::server_response::Payload by name.
MCP-routed variants carry mcp_kind directly on the variant
(alongside the typed params via #[serde(flatten)]). The non-MCP
ReadMessageQueue variant doesn’t carry mcp_kind at all — it
hits the CLI’s own local state and never routes to an upstream
MCP server. Use Payload::mcp_kind to retrieve it generically.
Variants§
Initialize
POST initialize. The proxy’s protocolVersion doesn’t ride
across this hop — the API discards it on the way in and
substitutes its own canonical_initialize_result on the way
out. The variant carries the plugin arguments the CLI needs at
dial time (parsed by the API off the URL query string).
ToolsList
POST tools/list.
ToolsCall
POST tools/call.
ResourcesList
POST resources/list.
ResourcesRead
POST resources/read.
SessionTerminate
DELETE on the routed MCP URL — the proxy closing the
session. No body beyond mcp_kind.
ReadMessageQueue(ReadMessageQueueRequest)
Read the CLI’s local message queue for a given agent
hierarchy. Non-MCP — no mcp_kind. Non-destructive: the
API stamps the consumed ids onto the first
AssistantResponseChunk.request_message_ids it emits so
the downstream consumer owns row deletion; no separate
release RPC.
Retrieve(Request)
Resolve a Client remote from the client’s own local storage
(agent / swarm / function / profile). Non-MCP — no mcp_kind.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Payload
impl<'de> Deserialize<'de> for Payload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Payload
impl JsonSchema for Payload
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for Payload
impl RefUnwindSafe for Payload
impl Send for Payload
impl Sync for Payload
impl Unpin for Payload
impl UnsafeUnpin for Payload
impl UnwindSafe for Payload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more