Skip to content

session_state

Class info

Classes

Name Children Inherits
SessionInfo
aclientp.schema.session_state
Information about a session returned by session/list.
    SessionMode
    aclientp.schema.session_state
    A mode the agent can operate in.
      SessionModeState
      aclientp.schema.session_state
      The set of modes and the one currently active.

        🛈 DocStrings

        Session state schema definitions.

        SessionArchiveFilter module-attribute

        SessionArchiveFilter = Literal['exclude', 'include', 'only'] | str
        

        UNSTABLE: Which sessions session/list returns by archive state.

        exclude (the default) returns only sessions that are not archived.

        SessionStatus module-attribute

        SessionStatus = Literal['open', 'saved'] | str
        

        UNSTABLE: Whether the Agent has the session in memory.

        • open: The Agent has the session in memory, for any connection.
        • saved: The Agent knows the session and can resume it, but does not have it in memory.

        SessionInfo

        Bases: AnnotatedObject

        Information about a session returned by session/list.

        Source code in src/aclientp/schema/session_state.py
        class SessionInfo(AnnotatedObject):
            """Information about a session returned by session/list."""
        
            cwd: str
            """The working directory for this session. Must be an absolute path."""
        
            additional_directories: Sequence[str] = Field(default_factory=list)
            """Additional workspace roots reported for this session. Each path must be absolute."""
        
            session_id: str
            """Unique identifier for the session."""
        
            title: str | None = None
            """Human-readable title for the session."""
        
            updated_at: str | None = None
            """ISO 8601 timestamp of last activity."""
        
            archived: bool | None = None
            """**UNSTABLE**: Whether the session is archived."""
        

        additional_directories class-attribute instance-attribute

        additional_directories: Sequence[str] = Field(default_factory=list)
        

        Additional workspace roots reported for this session. Each path must be absolute.

        archived class-attribute instance-attribute

        archived: bool | None = None
        

        UNSTABLE: Whether the session is archived.

        cwd instance-attribute

        cwd: str
        

        The working directory for this session. Must be an absolute path.

        session_id instance-attribute

        session_id: str
        

        Unique identifier for the session.

        title class-attribute instance-attribute

        title: str | None = None
        

        Human-readable title for the session.

        updated_at class-attribute instance-attribute

        updated_at: str | None = None
        

        ISO 8601 timestamp of last activity.

        SessionMode

        Bases: AnnotatedObject

        A mode the agent can operate in.

        See protocol docs: Session Modes

        Source code in src/aclientp/schema/session_state.py
        class SessionMode(AnnotatedObject):
            """A mode the agent can operate in.
        
            See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
            """
        
            description: str | None = None
            """Optional description of the mode."""
        
            id: str
            """Unique identifier for the mode."""
        
            name: str
            """Human-readable name of the mode."""
        

        description class-attribute instance-attribute

        description: str | None = None
        

        Optional description of the mode.

        id instance-attribute

        id: str
        

        Unique identifier for the mode.

        name instance-attribute

        name: str
        

        Human-readable name of the mode.

        SessionModeState

        Bases: AnnotatedObject

        The set of modes and the one currently active.

        Source code in src/aclientp/schema/session_state.py
        class SessionModeState(AnnotatedObject):
            """The set of modes and the one currently active."""
        
            available_modes: Sequence[SessionMode]
            """The set of modes that the Agent can operate in."""
        
            current_mode_id: str
            """The current mode the Agent is in."""
        

        available_modes instance-attribute

        available_modes: Sequence[SessionMode]
        

        The set of modes that the Agent can operate in.

        current_mode_id instance-attribute

        current_mode_id: str
        

        The current mode the Agent is in.