#[non_exhaustive]pub enum ClientResponse {
WriteTextFileResponse(WriteTextFileResponse),
ReadTextFileResponse(ReadTextFileResponse),
RequestPermissionResponse(RequestPermissionResponse),
CreateTerminalResponse(CreateTerminalResponse),
TerminalOutputResponse(TerminalOutputResponse),
ReleaseTerminalResponse(ReleaseTerminalResponse),
WaitForTerminalExitResponse(WaitForTerminalExitResponse),
KillTerminalResponse(KillTerminalResponse),
CreateElicitationResponse(CreateElicitationResponse),
MessageMcpResponse(MessageMcpResponse),
ExtMethodResponse(ExtResponse),
}Expand description
All possible responses that a client can send to an agent.
This enum is used internally for routing RPC responses. You typically won’t need to use this directly - the responses are handled automatically by the connection.
These are responses to the corresponding AgentRequest variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
WriteTextFileResponse(WriteTextFileResponse)
Successful result returned for a fs/write_text_file request.
ReadTextFileResponse(ReadTextFileResponse)
Successful result returned for a fs/read_text_file request.
RequestPermissionResponse(RequestPermissionResponse)
Successful result returned for a session/request_permission request.
CreateTerminalResponse(CreateTerminalResponse)
Successful result returned for a terminal/create request.
TerminalOutputResponse(TerminalOutputResponse)
Successful result returned for a terminal/output request.
ReleaseTerminalResponse(ReleaseTerminalResponse)
Successful result returned for a terminal/release request.
WaitForTerminalExitResponse(WaitForTerminalExitResponse)
Successful result returned for a terminal/wait_for_exit request.
KillTerminalResponse(KillTerminalResponse)
Successful result returned for a terminal/kill request.
CreateElicitationResponse(CreateElicitationResponse)
Successful result returned for a elicitation/create request.
MessageMcpResponse(MessageMcpResponse)
unstable_mcp_over_acp only.Successful result returned by an MCP-over-ACP mcp/message request.
ExtMethodResponse(ExtResponse)
Successful result returned by an extension method outside the core ACP method set.
Implementations§
Source§impl ClientResponse
impl ClientResponse
Sourcepub fn from_method_and_result(
method: &str,
result: Value,
) -> Result<Self, MethodDispatchError>
pub fn from_method_and_result( method: &str, result: Value, ) -> Result<Self, MethodDispatchError>
Parses a successful result using the originating request’s method.
Responses do not carry a method. The caller must retain it when sending the request and supply it here when the response arrives. This does not parse JSON-RPC error responses.
Use this instead of the enum’s untagged Deserialize
implementation, which can silently select an unrelated variant.
The result is deserialized unchanged, including null.
§Errors
Returns crate::MethodDispatchError::UnknownMethod for an
unsupported method, or crate::MethodDispatchError::InvalidPayload
for a malformed result.
Trait Implementations§
Source§impl Clone for ClientResponse
impl Clone for ClientResponse
Source§impl Debug for ClientResponse
impl Debug for ClientResponse
Source§impl<'de> Deserialize<'de> for ClientResponse
impl<'de> Deserialize<'de> for ClientResponse
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 ClientResponse
Available on crate feature schemars only.
impl JsonSchema for ClientResponse
schemars only.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 more