Expand description
domain::acp::session — the session lifecycle request /
response types.
Source of truth:
crates/protocol-droid-schema/spec/acp/v1.25.0/schema.json
under $defs.NewSessionRequest, $defs.LoadSessionRequest,
$defs.ListSessionsRequest, $defs.DeleteSessionRequest,
$defs.ResumeSessionRequest, $defs.CloseSessionRequest,
$defs.PromptRequest, $defs.CancelNotification,
$defs.LogoutRequest, and the matching *Response
types.
§What this module ships
The 9 agent-side methods the v1.25.0 meta.json lists
(13 agent methods total — the 4 session/set_* and
authenticate methods are intentionally deferred to
keep this commit’s surface focused) plus the
CancelNotification and the auxiliary value objects
the request / response bodies share: SessionId,
StopReason, McpServer (and its three variants),
EnvVariable, HttpHeader, and SessionInfo.
§Why request / response types in the same module
The schema pairs each request with its response; a
module-per-type layout would scatter the round-trip
across files. The application::acp dispatcher
will route by method name and pair the request with
its response in one place, so the consumer sees a
single import.
§Why a single SessionId newtype
Every session-scoped request carries sessionId. A
String would compile, but a SessionId makes the
API self-documenting (fn load(req: LoadSessionRequest)
vs fn load(req: LoadSessionRequest, id: &str)) and
lets the future per-revision codec narrow the type
(a hypothetical SessionId::Uuid variant) without
rewriting every call site.
Structs§
- Cancel
Notification session/cancelnotification. Cancels the in-flight prompt. A notification has no response; the consumer does not await a reply.- Close
Session Request session/closerequest. Closes an active session without deleting it.- Close
Session Response session/closeresponse. Currently empty; the struct exists so a future field the schema adds does not break the consumer.- Delete
Session Request session/deleterequest. Removes a session from the agent’s store.- Delete
Session Response session/deleteresponse. Currently empty; the struct exists so a future field the schema adds does not break the consumer.- EnvVariable
- An environment variable to set on a launched
process. The schema’s
EnvVariableis just a(name, value)pair. - Http
Header - An HTTP header to set when making requests to a
remote MCP server. The schema’s
HttpHeaderis just a(name, value)pair. - List
Sessions Request session/listrequest. Enumerates sessions.- List
Sessions Response session/listresponse. A page of sessions plus the cursor for the next page.- Load
Session Request session/loadrequest. Loads an existing session.- Load
Session Response session/loadresponse.- Logout
Request logoutrequest. Terminates the auth session.- Logout
Response logoutresponse. Currently empty; the struct exists so a future field the schema adds does not break the consumer.- McpServer
Http - HTTP transport configuration for MCP.
- McpServer
Sse - SSE transport configuration for MCP.
- McpServer
Stdio - Stdio transport configuration for MCP. All agents MUST support this transport.
- NewSession
Request session/newrequest. Creates a new session.- NewSession
Response session/newresponse.- Prompt
Request session/promptrequest. Sends a user turn to the agent.- Prompt
Response session/promptresponse. Carries the reason the turn ended.- Resume
Session Request session/resumerequest. Resumes a previously closed session.- Resume
Session Response session/resumeresponse.- Session
Config Option - A session configuration option. The agent
advertises the set of options the consumer can
set via
SetSessionConfigOptionRequest. - Session
Id - A unique identifier for a conversation session.
- Session
Info - Information about a single session, returned by
session/list. - Session
Mode - A single session mode. The agent advertises the
set of modes the session can switch between via
SessionModeState::available_modes. - Session
Mode Id - A unique identifier for a session mode.
- Session
Mode State - The set of session modes the agent supports, plus
the mode that is currently active. Returned by
session/newandsession/loadwhen the agent supports session modes.
Enums§
- McpServer
- Configuration for connecting to an MCP server.
- Stop
Reason - Why an agent stopped processing a prompt turn.