cursors
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AgentMessageCursorAnchor aclientp.schema.v2.cursors **UNSTABLE**: The cursor is next to an agent message. |
||
| AgentThoughtCursorAnchor aclientp.schema.v2.cursors **UNSTABLE**: The cursor is next to an agent thought. |
||
| CursorCapabilities aclientp.schema.v2.cursors **UNSTABLE**: The methods that currently accept a cursor. |
||
| CursorCompactionAnchor aclientp.schema.v2.cursors **UNSTABLE**: The cursor is next to a context compaction. |
||
| CursorForkCapabilities aclientp.schema.v2.cursors **UNSTABLE**: The cursor can be passed to ``session/fork`` as ``cursorId``. |
||
| CursorMessageAnchor aclientp.schema.v2.cursors **UNSTABLE**: A cursor anchored to a message; ``type`` names the kind of message. |
||
| CursorToolCallAnchor aclientp.schema.v2.cursors **UNSTABLE**: The cursor is next to a tool call. |
||
| CursorUpdate aclientp.schema.v2.cursors **UNSTABLE**: A session cursor upsert, keyed by ``cursor_id``. |
||
| SessionMessageCursorAnchor aclientp.schema.v2.cursors **UNSTABLE**: The cursor is next to a session-directed message. |
||
| UnknownCursorAnchor aclientp.schema.v2.cursors **UNSTABLE**: A custom or future anchor kind; the client cannot place such a cursor. |
||
| UserMessageCursorAnchor aclientp.schema.v2.cursors **UNSTABLE**: The cursor is next to a user message. |
🛈 DocStrings¶
UNSTABLE: v2 session cursors: named positions in a session's timeline.
A cursor is anchored next to an entity the client holds (a message, tool call or
compaction); its capabilities say which methods accept it, e.g. session/fork
with cursorId.
CursorAnchor
module-attribute
¶
CursorAnchor = Annotated[
Annotated[UserMessageCursorAnchor, Tag("user_message")]
| Annotated[AgentMessageCursorAnchor, Tag("agent_message")]
| Annotated[AgentThoughtCursorAnchor, Tag("agent_thought")]
| Annotated[SessionMessageCursorAnchor, Tag("session_message")]
| Annotated[CursorToolCallAnchor, Tag("tool_call")]
| Annotated[CursorCompactionAnchor, Tag("compaction")]
| Annotated[UnknownCursorAnchor, Tag(OTHER_TAG)],
Discriminator(
open_discriminator(
"type",
frozenset({
"user_message",
"agent_message",
"agent_thought",
"session_message",
"tool_call",
"compaction",
}),
)
),
]
UNSTABLE: Where a cursor is, relative to an entity the client holds.
CursorAnchorPosition
module-attribute
¶
UNSTABLE: On which side of the anchored entity the cursor is.
before: the history before the cursor excludes the entity; after: it includes
it and nothing that follows. A client that does not know the value cannot place the
cursor.
AgentMessageCursorAnchor
¶
Bases: CursorMessageAnchor
UNSTABLE: The cursor is next to an agent message.
Source code in src/aclientp/schema/v2/cursors.py
AgentThoughtCursorAnchor
¶
Bases: CursorMessageAnchor
UNSTABLE: The cursor is next to an agent thought.
Source code in src/aclientp/schema/v2/cursors.py
CursorCapabilities
¶
Bases: AnnotatedObject
UNSTABLE: The methods that currently accept a cursor.
A malformed value counts as no capabilities.
Source code in src/aclientp/schema/v2/cursors.py
fork
class-attribute
instance-attribute
¶
fork: CursorForkCapabilities | MISSING | None = MISSING
session/fork accepts this cursor.
CursorCompactionAnchor
¶
Bases: AnnotatedObject
UNSTABLE: The cursor is next to a context compaction.
Source code in src/aclientp/schema/v2/cursors.py
position
instance-attribute
¶
position: CursorAnchorPosition
On which side of the compaction the cursor is.
CursorForkCapabilities
¶
Bases: AnnotatedObject
UNSTABLE: The cursor can be passed to session/fork as cursorId.
Source code in src/aclientp/schema/v2/cursors.py
CursorMessageAnchor
¶
Bases: AnnotatedObject
UNSTABLE: A cursor anchored to a message; type names the kind of message.
Source code in src/aclientp/schema/v2/cursors.py
position
instance-attribute
¶
position: CursorAnchorPosition
On which side of the message the cursor is.
CursorToolCallAnchor
¶
Bases: AnnotatedObject
UNSTABLE: The cursor is next to a tool call.
Source code in src/aclientp/schema/v2/cursors.py
position
instance-attribute
¶
position: CursorAnchorPosition
On which side of the tool call the cursor is.
CursorUpdate
¶
Bases: AnnotatedObject
UNSTABLE: A session cursor upsert, keyed by cursor_id.
The first update for a cursor MUST include anchor, which is fixed afterwards.
capabilities and _meta are patches: omitted leaves them unchanged, None
clears them.
Source code in src/aclientp/schema/v2/cursors.py
anchor
class-attribute
instance-attribute
¶
anchor: CursorAnchor | MISSING | None = MISSING
Where the cursor is; required on the first update for a cursor.
capabilities
class-attribute
instance-attribute
¶
capabilities: CursorCapabilities | MISSING | None = MISSING
The methods that currently accept the cursor; a new cursor starts with none.
SessionMessageCursorAnchor
¶
Bases: CursorMessageAnchor
UNSTABLE: The cursor is next to a session-directed message.
Source code in src/aclientp/schema/v2/cursors.py
UnknownCursorAnchor
¶
Bases: Unknown
UNSTABLE: A custom or future anchor kind; the client cannot place such a cursor.
Source code in src/aclientp/schema/v2/cursors.py
UserMessageCursorAnchor
¶
Bases: CursorMessageAnchor
UNSTABLE: The cursor is next to a user message.