cursors
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AgentMessageCursorAnchor aclientp.schema.cursors **UNSTABLE**: The cursor is next to an agent message. |
||
| AgentThoughtCursorAnchor aclientp.schema.cursors **UNSTABLE**: The cursor is next to an agent thought. |
||
| CompactionCursorAnchor aclientp.schema.cursors **UNSTABLE**: The cursor is next to a context compaction. |
||
| CursorCapabilities aclientp.schema.cursors **UNSTABLE**: The methods that currently accept a cursor. |
||
| CursorForkCapabilities aclientp.schema.cursors **UNSTABLE**: The cursor can be passed to ``session/fork`` as ``cursorId``. |
||
| CursorMessageAnchor aclientp.schema.cursors **UNSTABLE**: A cursor anchored to a message; ``type`` names the kind of message. |
||
| SessionMessageCursorAnchor aclientp.schema.cursors **UNSTABLE**: The cursor is next to a session-directed message. |
||
| ToolCallCursorAnchor aclientp.schema.cursors **UNSTABLE**: The cursor is next to a tool call. |
||
| UnknownCursorAnchor aclientp.schema.cursors **UNSTABLE**: A cursor anchored to a custom or future kind of entity. |
||
| UserMessageCursorAnchor aclientp.schema.cursors **UNSTABLE**: The cursor is next to a user message. |
🛈 DocStrings¶
UNSTABLE: Session cursors: named positions in a session's timeline.
An Agent announces cursors with cursor_update session updates (only to Clients
that advertise session.cursors). A cursor is anchored next to an entity the
Client holds (a message, tool call or compaction), and its capabilities say which
methods accept it, e.g. session/fork with cursorId.
See the Session Cursors RFD.
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[ToolCallCursorAnchor, Tag("tool_call")]
| Annotated[CompactionCursorAnchor, Tag("compaction")]
| Annotated[UnknownCursorAnchor, Tag("unknown")],
Discriminator(_anchor_discriminator),
]
UNSTABLE: Where a cursor is, relative to an entity the Client holds.
A known type with a malformed payload is an error; it does not fall back to
:class:UnknownCursorAnchor.
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
the entity and nothing that follows it. Values starting with _ are extensions;
a Client that does not recognize the value cannot place the cursor.
CursorId
module-attribute
¶
UNSTABLE: Agent-owned ID of a cursor, unique within its session.
Never reused for another position. Clients MUST NOT parse, change or construct it.
AgentMessageCursorAnchor
¶
Bases: CursorMessageAnchor
UNSTABLE: The cursor is next to an agent message.
Source code in src/aclientp/schema/cursors.py
AgentThoughtCursorAnchor
¶
Bases: CursorMessageAnchor
UNSTABLE: The cursor is next to an agent thought.
Source code in src/aclientp/schema/cursors.py
CompactionCursorAnchor
¶
Bases: AnnotatedObject
UNSTABLE: The cursor is next to a context compaction.
Source code in src/aclientp/schema/cursors.py
position
instance-attribute
¶
position: CursorAnchorPosition
On which side of the compaction the cursor is.
CursorCapabilities
¶
Bases: AnnotatedObject
UNSTABLE: The methods that currently accept a cursor.
Source code in src/aclientp/schema/cursors.py
fork
class-attribute
instance-attribute
¶
fork: CursorForkCapabilities | None = None
session/fork accepts this cursor. None means unsupported.
CursorForkCapabilities
¶
Bases: AnnotatedObject
UNSTABLE: The cursor can be passed to session/fork as cursorId.
Source code in src/aclientp/schema/cursors.py
CursorMessageAnchor
¶
Bases: AnnotatedObject
UNSTABLE: A cursor anchored to a message; type names the kind of message.
Source code in src/aclientp/schema/cursors.py
position
instance-attribute
¶
position: CursorAnchorPosition
On which side of the message the cursor is.
SessionMessageCursorAnchor
¶
Bases: CursorMessageAnchor
UNSTABLE: The cursor is next to a session-directed message.
Source code in src/aclientp/schema/cursors.py
ToolCallCursorAnchor
¶
Bases: AnnotatedObject
UNSTABLE: The cursor is next to a tool call.
Source code in src/aclientp/schema/cursors.py
position
instance-attribute
¶
position: CursorAnchorPosition
On which side of the tool call the cursor is.
UnknownCursorAnchor
¶
Bases: AnnotatedObject
UNSTABLE: A cursor anchored to a custom or future kind of entity.
The raw kind is kept in type; values starting with _ are extensions.
A Client that does not recognize it cannot place the cursor.
Source code in src/aclientp/schema/cursors.py
UserMessageCursorAnchor
¶
Bases: CursorMessageAnchor
UNSTABLE: The cursor is next to a user message.