Public v1 name for TransportAdapter plus optional high-level
capabilities. Renamed to reflect that this interface now denotes the
full agent-server protocol contract (not merely wire transport):
any object that satisfies it can back a useStream call. See
plan-custom-transport.md §4 for the rollout.
The extra optional methods let adapters surface thread state and
history without the framework needing to issue a parallel HTTP
request — useStream.hydrate() calls getState?() when present
and falls back to client.threads.getState otherwise. Adapters
that don't know how to produce these values can simply omit them.
The legacy TransportAdapter export is retained for back-compat and
resolves to the same structural type; new code should prefer
AgentServerAdapter.
interface AgentServerAdapterThread ID this transport is bound to.
Shuts down the transport and releases any underlying resources.
Streams incoming protocol messages from the remote peer. Used by WebSocket transports where all events share one connection.
Get all past states for a thread.
Get state for a thread.
Opens the underlying connection (e.g. WebSocket handshake). For HTTP/SSE transports this is a no-op.
Opens an independent filtered SSE event stream.
Each call creates a new server connection with the given filter.
Returns undefined when the transport does not support per-subscription
streams (e.g. WebSocket), in which case the caller should fall back to
command-based subscriptions over events.
Sends a command and optionally returns an immediate response.
Shuts down the transport and releases any underlying resources.
Streams incoming protocol messages from the remote peer.
Opens the underlying connection (e.g. WebSocket handshake).
Opens an independent filtered SSE event stream.
Sends a command and optionally returns an immediate response.