Skip to main content

Payload

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).

Fields

§mcp_kind: McpKind
§

ToolsList

POST tools/list.

Fields

§mcp_kind: McpKind
§

ToolsCall

POST tools/call.

Fields

§mcp_kind: McpKind
§

ResourcesList

POST resources/list.

Fields

§mcp_kind: McpKind
§

ResourcesRead

POST resources/read.

Fields

§mcp_kind: McpKind
§

SessionTerminate

DELETE on the routed MCP URL — the proxy closing the session. No body beyond mcp_kind.

Fields

§mcp_kind: McpKind
§

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§

Source§

impl Payload

Source

pub fn mcp_kind(&self) -> Option<McpKind>

Which CLI-hosted MCP server this payload targets. Some for the MCP-routed variants; None for ReadMessageQueue which hits the CLI’s own local state.

Trait Implementations§

Source§

impl Clone for Payload

Source§

fn clone(&self) -> Payload

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Payload

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Payload

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Payload

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for Payload

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

Source§

impl<T> ToAst for T

Source§

fn ast(self, begin: usize, end: usize) -> Spanned<Self>

Source§

impl<T> ToJmespath for T
where T: Serialize,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more