ExperimentalExperimental
Session ID returned by session/new.
Experimental
Configuration options returned when the session was created, if provided.
Experimental
Metadata returned when the session was created.
Experimental
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 inserted user
message's ID once the agent inserts it into the ACP conversation, not when
processing finishes. Session updates remain independent of this request;
an idle state_update does not establish that this message was processed.
Rejection is reported only by this promise, not by the session update queue.
Optionaloptions: SendRequestOptionsExperimental
Reads the next update or stop message for this session.
Idle updates are always returned as stop messages, whether or not a prompt
is pending. Queued updates are consumed in arrival order. An abort signal
cancels this read without cancelling session work or discarding updates.
Optionalsignal: AbortSignalExperimental
Collects agent text from the session queue until the next idle update.
This consumes the same queue as nextUpdate(), including already queued
updates. It does not associate output or idle with any submitted prompt,
skip updates when a prompt is sent, or wait for a prompt to be inserted.
Use one reader at a time to avoid splitting the session's updates.
An abort signal cancels the read without cancelling session work.
Full agent_message updates replace content for their messageId, while
agent_message_chunk updates append to it. Non-text content and other
update types are ignored; use nextUpdate() when you need them.
Optionalsignal: AbortSignalExperimental
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.
Experimental
Supports explicit resource management with using.
Experimental draft ACP v2 convenience wrapper for an active session.
An active session routes
session/updatenotifications for one session ID into an async queue. Useprompt(...)to submit user content andnextUpdate()to observe the session independently of prompt requests. Astopmessage reports idle foreground work, not per-prompt completion.