common
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| Annotations aclientp.schema.v2.common Hints for the client on how an object is used or displayed. |
||
| Cost aclientp.schema.v2.common Cumulative cost of a session. |
||
| EnvVariable aclientp.schema.v2.common An environment variable to set when launching a process. |
||
| Error aclientp.schema.v2.common A JSON-RPC error object. |
||
| HttpHeader aclientp.schema.v2.common An HTTP header to send with requests. |
||
| Icon aclientp.schema.v2.common An optionally sized icon a user interface can display. |
||
| Implementation aclientp.schema.v2.common Name and version of a client or agent implementation. |
||
| SessionNotFoundErrorData aclientp.schema.v2.common Data of the ``-32002`` (Resource not found) error for an unknown or inactive session. |
||
| UnsupportedProtocolVersionErrorData aclientp.schema.v2.common Data of the ``-32022`` (Unsupported protocol version) error. |
||
| Usage aclientp.schema.v2.common **UNSTABLE**: Token usage of the foreground work that just completed (not cumulative). |
🛈 DocStrings¶
Shared v2 types: identifiers, errors, implementation info, usage and annotations.
CompactionId
module-attribute
¶
Unique identifier of a context compaction within a session.
CursorId
module-attribute
¶
UNSTABLE: Agent-owned identifier of a session cursor, unique within its session.
ERROR_CODES
module-attribute
¶
ERROR_CODES: dict[int, str] = {
PARSE_ERROR: "Parse error",
INVALID_REQUEST: "Invalid request",
METHOD_NOT_FOUND: "Method not found",
INVALID_PARAMS: "Invalid params",
INTERNAL_ERROR: "Internal error",
REQUEST_CANCELLED: "Request cancelled",
AUTH_REQUIRED: "Authentication required",
RESOURCE_NOT_FOUND: "Resource not found",
UNSUPPORTED_PROTOCOL_VERSION: "Unsupported protocol version",
}
Error codes the protocol defines, with their standard messages.
ErrorCode
module-attribute
¶
A JSON-RPC error code: one of :data:ERROR_CODES or another integer.
ErrorData
module-attribute
¶
ErrorData = UnsupportedProtocolVersionErrorData | SessionNotFoundErrorData | Any
Data of an :class:Error: a shape ACP defines, or any other value.
IconTheme
module-attribute
¶
Theme an icon is designed for. Values starting with _ are extensions.
IdempotencyKey
module-attribute
¶
Client-chosen key that makes a session/prompt retry insert at most one message.
McpRequestId
module-attribute
¶
UNSTABLE: Identifier of an MCP request carried over ACP.
McpServerAcpId
module-attribute
¶
UNSTABLE: Identifier of an MCP server provided over ACP.
PermissionOptionId
module-attribute
¶
Unique identifier of a permission option.
RequestId
module-attribute
¶
A JSON-RPC request ID. Unlike base JSON-RPC, it MUST NOT be null.
Role
module-attribute
¶
Sender or recipient in a conversation. Values starting with _ are extensions.
SessionConfigGroupId
module-attribute
¶
Unique identifier of a group of select config option values.
SessionConfigId
module-attribute
¶
Unique identifier of a session config option.
SessionConfigValueId
module-attribute
¶
Unique identifier of a value of a select config option.
SessionListCursor
module-attribute
¶
Opaque pagination cursor of session/list.
TerminalId
module-attribute
¶
Unique identifier of a display terminal within a session.
Annotations
¶
Bases: AnnotatedObject
Hints for the client on how an object is used or displayed.
Source code in src/aclientp/schema/v2/common.py
audience
class-attribute
instance-attribute
¶
audience: Sequence[Role] | MISSING | None = MISSING
Intended recipients, such as the user or the assistant.
last_modified
class-attribute
instance-attribute
¶
When the underlying resource was last modified (ISO 8601).
priority
class-attribute
instance-attribute
¶
Importance from 0 (least) to 1 (most important).
Cost
¶
Bases: AnnotatedObject
Cumulative cost of a session.
Source code in src/aclientp/schema/v2/common.py
EnvVariable
¶
Bases: AnnotatedObject
An environment variable to set when launching a process.
Source code in src/aclientp/schema/v2/common.py
Error
¶
HttpHeader
¶
Bases: AnnotatedObject
An HTTP header to send with requests.
Source code in src/aclientp/schema/v2/common.py
Icon
¶
Bases: AnnotatedObject
An optionally sized icon a user interface can display.
Source code in src/aclientp/schema/v2/common.py
Implementation
¶
Bases: AnnotatedObject
Name and version of a client or agent implementation.
Source code in src/aclientp/schema/v2/common.py
title
class-attribute
instance-attribute
¶
Human-readable name for user interfaces.
SessionNotFoundErrorData
¶
Bases: AnnotatedObject
Data of the -32002 (Resource not found) error for an unknown or inactive session.
Source code in src/aclientp/schema/v2/common.py
UnsupportedProtocolVersionErrorData
¶
Bases: AnnotatedObject
Data of the -32022 (Unsupported protocol version) error.
Source code in src/aclientp/schema/v2/common.py
requested
instance-attribute
¶
requested: ProtocolVersion
The protocol version the Client requested.
supported
instance-attribute
¶
supported: Sequence[ProtocolVersion]
The protocol versions the Agent supports.
Usage
¶
Bases: AnnotatedObject
UNSTABLE: Token usage of the foreground work that just completed (not cumulative).
Source code in src/aclientp/schema/v2/common.py
cached_read_tokens
class-attribute
instance-attribute
¶
Cache read tokens, if reported.
cached_write_tokens
class-attribute
instance-attribute
¶
Cache write tokens, if reported.
thought_tokens
class-attribute
instance-attribute
¶
Thought/reasoning tokens, if reported.
total_tokens
class-attribute
instance-attribute
¶
Sum of all token types.