pub enum Payload {
Show 19 variants
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),
Script(ScriptRequest),
Drop(DropRequest),
LaboratoryExportBegin(LaboratoryExportBeginRequest),
LaboratoryExportRead(LaboratoryExportReadRequest),
LaboratoryExportAbort(LaboratoryExportAbortRequest),
LaboratoryImportBegin(LaboratoryImportBeginRequest),
LaboratoryImportWrite(LaboratoryImportWriteRequest),
LaboratoryImportEnd(LaboratoryImportEndRequest),
LaboratoryImportAbort(LaboratoryImportAbortRequest),
LaboratoryTransfer(LaboratoryTransferRequest),
LaboratoryLocalTransfer(LaboratoryLocalTransferRequest),
}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.
Script(ScriptRequest)
Run a SCRIPT agent’s code on the client and return its output
messages. Non-MCP — no mcp_kind: the CLI executes the code
in-process on its embedded runtime (the same one the python
command uses), with the FULL conversation as the script input.
Drop(DropRequest)
Forceful bulk teardown of every upstream connection for one
objectiveai response id. Non-MCP — no mcp_kind (it spans all
kinds for that response id). The CLI removes the whole
response-id bucket from its connection registry, which drops
every connection and kills every plugin subprocess under it.
Distinct from SessionTerminate (graceful per-mcp_kind MCP
DELETE); Drop is drop = kill.
LaboratoryExportBegin(LaboratoryExportBeginRequest)
Begin streaming a tar export OUT of one laboratory on this
conduit. Non-MCP — carries the laboratory id directly. The
conduit opens the laboratory’s /export and parks the byte
stream under a fresh transfer_id; the requester then PULLS
chunks with Payload::LaboratoryExportRead. Fully
independent of any import — the splice (if any) happens on
the requester’s (API/proxy) side, so the peer laboratory may
live on any host.
LaboratoryExportRead(LaboratoryExportReadRequest)
Pull the next chunk of a parked export stream. eof: true on
the reply means the stream completed and the entry is gone
(the final reply’s data may still be non-empty).
LaboratoryExportAbort(LaboratoryExportAbortRequest)
Drop a parked export stream early (requester-side failure).
LaboratoryImportBegin(LaboratoryImportBeginRequest)
Begin streaming a tar import INTO one laboratory on this
conduit: the conduit opens the laboratory’s /import with a
channel-backed body and parks the sender under a fresh
transfer_id; the requester then PUSHES chunks with
Payload::LaboratoryImportWrite and closes with
Payload::LaboratoryImportEnd. Independent of any export.
LaboratoryImportWrite(LaboratoryImportWriteRequest)
Push one chunk into a parked import body.
LaboratoryImportEnd(LaboratoryImportEndRequest)
Close a parked import body and await the laboratory’s unpack result. Replies with the total bytes fed.
LaboratoryImportAbort(LaboratoryImportAbortRequest)
Drop a parked import early — the truncated tar makes the laboratory’s unpack fail, so nothing partial is kept silently.
LaboratoryTransfer(LaboratoryTransferRequest)
Transfer a path between TWO client laboratories on (possibly) different hosts: the CLI daemon drives the whole export→import splice itself with the half-op vocabulary above, holding at most one chunk in transit, and replies once with the byte total. Sent by the API’s proxy when both endpoints are CLIENT laboratories that do NOT share a (machine, state) pair.
LaboratoryLocalTransfer(LaboratoryLocalTransferRequest)
Transfer a path between two client laboratories that share the SAME (machine, state) — i.e. the same laboratory host. The CLI daemon forwards this verbatim to that host, which pipes the source’s export stream straight into the destination’s import (no chunk staging anywhere outside the host). Sent by the API’s proxy when both endpoints are CLIENT laboratories with equal (machine, state) pairs.
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