AAI SDK
    Preparing search index...

    Type Alias SessionSnapshot

    Immutable snapshot of the session state.

    Consumers (e.g. React hooks via useSyncExternalStore) read this to render. A new object reference is created on every state change.

    type SessionSnapshot = {
        agentState: unknown;
        agentTranscript: string | null;
        apiUrl: string;
        contentVersion: number;
        customEvents: AgentCustomEvent[];
        error: SessionError | null;
        messages: ChatMessage[];
        recording: boolean;
        running: boolean;
        started: boolean;
        state: AgentState;
        toolCalls: ToolCallInfo[];
        userTranscript: string | null;
    }
    Index
    agentState: unknown

    Latest state the agent projected via syncState, or null before the first push. A value, not a log — a component that mounts mid-session reads current state rather than replaying events it missed.

    agentTranscript: string | null
    apiUrl: string

    The WebSocket URL a program can connect to directly — the long-living platform endpoint, e.g. wss://host/my-agent/websocket. Derived from platformUrl at construction — available before connecting — and never replaced by the brokered sandbox tunnel URL the session may actually be connected to: that URL is ephemeral (it dies when the sandbox is replaced), while the platform endpoint is stable and upgrades programmatic clients to the current sandbox endpoint itself.

    contentVersion: number

    Monotonically increasing counter bumped whenever rendered conversation content changes (messages, toolCalls, or either live transcript). Cheap dependency for scroll-to-bottom effects — unlike summed lengths it never collides when the capped arrays slide.

    customEvents: AgentCustomEvent[]
    error: SessionError | null
    messages: ChatMessage[]
    recording: boolean

    True while the microphone is live and streaming to the server.

    running: boolean
    started: boolean
    state: AgentState
    toolCalls: ToolCallInfo[]
    userTranscript: string | null