client_requests
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| ArchiveSessionRequest aclientp.schema.client_requests **UNSTABLE**: Request parameters for archiving a session. |
||
| AuthStatusRequest aclientp.schema.client_requests **UNSTABLE**: Request the agent's current authentication state. |
||
| AuthenticateRequest aclientp.schema.client_requests Request parameters for the authenticate method. |
||
| CloseSessionRequest aclientp.schema.client_requests Request parameters for closing an active session. |
||
| CustomRequest aclientp.schema.client_requests Request for custom/extension methods. |
||
| DeleteSessionRequest aclientp.schema.client_requests Request parameters for deleting a session from ``session/list``. |
||
| ForkSessionRequest aclientp.schema.client_requests **UNSTABLE**: Request parameters for forking an existing session. |
||
| InitializeRequest aclientp.schema.client_requests Request parameters for the initialize method. |
||
| ListSessionsRequest aclientp.schema.client_requests Request parameters for listing existing sessions. |
||
| LoadSessionRequest aclientp.schema.client_requests Request parameters for loading an existing session. |
||
| LogoutRequest aclientp.schema.client_requests Request parameters for the logout method. |
||
| NewSessionRequest aclientp.schema.client_requests Request parameters for creating a new session. |
||
| PromptRequest aclientp.schema.client_requests Request parameters for sending a user prompt to the agent. |
||
| ResumeSessionRequest aclientp.schema.client_requests Request parameters for resuming an existing session. |
||
| SessionOptionsRequest aclientp.schema.client_requests **UNSTABLE**: Request the modes and config options a session would start with. |
||
| SessionSetupRequest aclientp.schema.client_requests Fields shared by the session lifecycle requests (new, load, resume, fork). |
||
| SessionStatusRequest aclientp.schema.client_requests **UNSTABLE**: Request parameters for checking whether the Agent has a session in memory. |
||
| SetSessionConfigOptionRequest aclientp.schema.client_requests Request parameters for setting a session configuration option. |
||
| SetSessionModeRequest aclientp.schema.client_requests Request parameters for setting a session mode. |
||
| SetSessionTitleRequest aclientp.schema.client_requests **UNSTABLE**: Request parameters for renaming a session. |
||
| SystemPrompt aclientp.schema.client_requests Client-provided system-level instructions for a session. |
||
| UnarchiveSessionRequest aclientp.schema.client_requests **UNSTABLE**: Request parameters for unarchiving a session. |
🛈 DocStrings¶
Client request schema definitions.
SystemPromptMode
module-attribute
¶
How the Agent combines a client-provided system prompt with its own instructions.
append: Add the content to the Agent's own instructions.override: Replace the Agent's built-in default instructions (requiressession_capabilities.system_prompt.mode.override).
ArchiveSessionRequest
¶
Bases: Request
UNSTABLE: Request parameters for archiving a session.
Only available if the Agent supports the session.archive capability.
Source code in src/aclientp/schema/client_requests.py
AuthStatusRequest
¶
Bases: Request
UNSTABLE: Request the agent's current authentication state.
Only available if the Agent supports the auth.status capability.
Source code in src/aclientp/schema/client_requests.py
AuthenticateRequest
¶
Bases: Request
Request parameters for the authenticate method.
Specifies which authentication method to use.
Source code in src/aclientp/schema/client_requests.py
method_id
instance-attribute
¶
The ID of the authentication method to use.
Must be one of the methods advertised in the initialize response.
CloseSessionRequest
¶
Bases: Request
Request parameters for closing an active session.
The agent must cancel any ongoing work related to the session
(treat it as if session/cancel was called) and then free up any resources
associated with the session.
Only available if the Agent supports the session.close capability.
Source code in src/aclientp/schema/client_requests.py
CustomRequest
¶
Bases: Request
Request for custom/extension methods.
Source code in src/aclientp/schema/client_requests.py
DeleteSessionRequest
¶
Bases: Request
Request parameters for deleting a session from session/list.
Only available if the Agent supports the session.delete capability.
Source code in src/aclientp/schema/client_requests.py
ForkSessionRequest
¶
Bases: SessionSetupRequest
UNSTABLE: Request parameters for forking an existing session.
Creates a new, active session based on the context of an existing one.
Only available if the Agent supports the session.fork capability.
Source code in src/aclientp/schema/client_requests.py
cursor_id
class-attribute
instance-attribute
¶
UNSTABLE: Fork at this session cursor instead of the end of the session.
The new session's history is the source history before the cursor. Only IDs of
cursors announced on the source session that currently advertise
capabilities.fork are valid; Agents reject others with -32602.
InitializeRequest
¶
Bases: Request
Request parameters for the initialize method.
Sent by the client to establish connection and negotiate capabilities.
See protocol docs: Initialization
Source code in src/aclientp/schema/client_requests.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 | |
client_capabilities
class-attribute
instance-attribute
¶
client_capabilities: ClientCapabilities | None = Field(default_factory=ClientCapabilities)
Capabilities supported by the client.
client_info
class-attribute
instance-attribute
¶
client_info: Implementation | None = None
Information about the Client name and version sent to the Agent.
Note: in future versions of the protocol, this will be required.
protocol_version
instance-attribute
¶
The latest protocol version supported by the client.
create
classmethod
¶
create(
title: str,
name: str,
version: str,
terminal: bool = True,
read_text_file: bool = True,
write_text_file: bool = True,
protocol_version: int = 1,
terminal_auth: bool = False,
prompt_suggestions: bool = False,
compaction: bool = False,
notices: bool = False,
metadata: dict[str, Any] | None = None,
) -> Self
Create a new InitializeRequest instance.
Source code in src/aclientp/schema/client_requests.py
create_for_package
classmethod
¶
create_for_package(
package_name: str,
allow_terminal: bool = True,
allow_file_operations: bool = True,
terminal_auth: bool = False,
prompt_suggestions: bool = False,
compaction: bool = False,
notices: bool = False,
metadata: dict[str, Any] | None = None,
) -> InitializeRequest
Create ACP initialize request for app with given name (based on pkg metadata).
Source code in src/aclientp/schema/client_requests.py
ListSessionsRequest
¶
Bases: Request
Request parameters for listing existing sessions.
Only available if the Agent supports the session.list capability.
Source code in src/aclientp/schema/client_requests.py
archived
class-attribute
instance-attribute
¶
archived: SessionArchiveFilter | None = None
UNSTABLE: Which sessions to return by archive state. Defaults to exclude.
cursor
class-attribute
instance-attribute
¶
Opaque cursor token from a previous response's nextCursor field for pagination.
cwd
class-attribute
instance-attribute
¶
Filter sessions by working directory. Must be an absolute path.
LoadSessionRequest
¶
Bases: SessionSetupRequest
Request parameters for loading an existing session.
Only available if the Agent supports the loadSession capability.
See protocol docs: Loading Sessions
Source code in src/aclientp/schema/client_requests.py
LogoutRequest
¶
Bases: Request
Request parameters for the logout method.
Terminates the current authenticated session.
After a successful logout, all new sessions will require authentication. There is no guarantee about the behavior of already running sessions.
Source code in src/aclientp/schema/client_requests.py
NewSessionRequest
¶
Bases: SessionSetupRequest
Request parameters for creating a new session.
See protocol docs: Creating a Session
Source code in src/aclientp/schema/client_requests.py
PromptRequest
¶
Bases: Request
Request parameters for sending a user prompt to the agent.
Contains the user's message and any additional context.
See protocol docs: User Message
Source code in src/aclientp/schema/client_requests.py
prompt
instance-attribute
¶
The blocks of content that compose the user's message.
As a baseline, the Agent MUST support [ContentBlock::Text] and
[ContentBlock::ResourceContentBlock],
while other variants are optionally enabled via [PromptCapabilities].
The Client MUST adapt its interface according to [PromptCapabilities].
The client MAY include referenced pieces of context as either
[ContentBlock::Resource] or [ContentBlock::ResourceContentBlock].
When available, [ContentBlock::Resource] is preferred
as it avoids extra round-trips and allows the message to include
pieces of context from sources the agent may not have access to.
ResumeSessionRequest
¶
Bases: SessionSetupRequest
Request parameters for resuming an existing session.
Resumes an existing session without returning previous messages (unlike session/load).
mcp_servers is the complete client-provided set.
Only available if the Agent supports the session.resume capability.
Source code in src/aclientp/schema/client_requests.py
SessionOptionsRequest
¶
Bases: Request
UNSTABLE: Request the modes and config options a session would start with.
Only available if the Agent supports the session.options capability.
Source code in src/aclientp/schema/client_requests.py
additional_directories
class-attribute
instance-attribute
¶
Additional workspace roots to resolve options for. Each path must be absolute.
cwd
instance-attribute
¶
The working directory to resolve options for. Must be an absolute path.
session_id
class-attribute
instance-attribute
¶
The session to resolve options for.
SessionSetupRequest
¶
Bases: Request
Fields shared by the session lifecycle requests (new, load, resume, fork).
Source code in src/aclientp/schema/client_requests.py
additional_directories
class-attribute
instance-attribute
¶
Additional workspace roots for this session. Each path must be absolute.
Requires the session_capabilities.additional_directories capability.
config_options
class-attribute
instance-attribute
¶
config_options: Sequence[InitialSessionConfigOption] = Field(default_factory=list)
UNSTABLE: Config option values to apply when the session is set up.
mcp_servers
class-attribute
instance-attribute
¶
List of MCP (Model Context Protocol) servers the agent should connect to.
system_prompt
class-attribute
instance-attribute
¶
system_prompt: SystemPrompt | None = None
System-level instructions for the session.
Requires the session_capabilities.system_prompt capability.
SessionStatusRequest
¶
Bases: Request
UNSTABLE: Request parameters for checking whether the Agent has a session in memory.
Only available if the Agent supports the session.status capability.
Source code in src/aclientp/schema/client_requests.py
SetSessionConfigOptionRequest
¶
Bases: Request
Request parameters for setting a session configuration option.
Supports both select (string value ID) and boolean config options.
When type is "boolean", value is a bool.
When type is absent or "value_id", value is a string.
See protocol docs: Session Config Options
Source code in src/aclientp/schema/client_requests.py
SetSessionModeRequest
¶
Bases: Request
Request parameters for setting a session mode.
Source code in src/aclientp/schema/client_requests.py
SetSessionTitleRequest
¶
Bases: Request
UNSTABLE: Request parameters for renaming a session.
Only available if the Agent supports the session.title capability.
Source code in src/aclientp/schema/client_requests.py
SystemPrompt
¶
Bases: AnnotatedObject
Client-provided system-level instructions for a session.
Only allowed if the Agent advertises session_capabilities.system_prompt.
Source code in src/aclientp/schema/client_requests.py
mode
instance-attribute
¶
mode: SystemPromptMode
How the Agent combines content with its own instructions.