Agent Client Protocol - v0.28.0
    Preparing search index...

    Class ActiveSession

    Convenience wrapper for an active ACP session.

    An active session routes session/update notifications for one session ID into an async queue. Use prompt(...) to send user content, then read updates with nextUpdate() until a stop message is returned.

    Index

    Accessors

    • get sessionId(): string

      Session ID returned by session/new.

      Returns string

    • get meta(): { [key: string]: unknown } | null | undefined

      Metadata returned when the session was created.

      Returns { [key: string]: unknown } | null | undefined

    Methods

    • Sends a prompt to this session.

      Strings are converted to one text content block. A single content block is wrapped in an array. The returned promise resolves with the final PromptResponse, and the same completion is also queued as a stop message for nextUpdate().

      Parameters

      Returns Promise<PromptResponse>

    • Reads text chunks until the current prompt turn stops.

      Only agent_message_chunk updates with text content are appended. Other update types are ignored by this helper; use nextUpdate() when you need tool calls, plans, or the final PromptResponse.

      Returns Promise<string>

    • Stops routing updates to this active-session helper.

      This does not close the ACP session on the agent. Use ClientContext session lifecycle methods when the protocol session itself should be closed or deleted.

      Returns void

    • Supports explicit resource management with using.

      Returns void