ExperimentalExperimental
Experimental
Configures the ACP v1 agent implementation.
Experimental
Configures the experimental draft ACP v2 agent implementation.
Experimental
Routes one ACP transport connection.
The returned closed always resolves once the routed connection ends,
including when the client leaves before initialize or routing fails.
Routes a client connection to a version-specific ACP agent implementation, including the experimental draft ACP v2 API.
The router reads messages until a valid
initializerequest arrives. Before that, notifications and responses are ignored, other requests get-32600, a JSON array (a JSON-RPC batch, which ACP does not use) gets a single-32600withid: null, and aninitializethat fails (malformed params, an unsupported version) gets an error response. None of these close the connection, so the client may sendinitializeagain. Endpoints exposing v2 select the highest configured version at or below the requested version. V1-only endpoints retain the legacy fallback to v1. Only initialize params are normalized. Later messages are forwarded unchanged.When the requested version is newer than the selected one, initialize params that do not parse under the selected version are dropped instead of rejected. A missing or malformed v2
infobecomes{ name: "unknown", version: "unknown" }, and is omitted when downgrading to v1, whereclientInfois optional. Requests for exactly the selected version are validated strictly. On a v2 route, the firstinitializemust have a string or integer ID.The selected implementation handles any repeated
initialize; the router never re-routes a connection. A v2 implementation accepts a repeat that requests v2 or newer before any other request. A repeat that requests a lower version is negotiated like a firstinitializeagainst v2 alone, so it gets-32022withsupported: [2]and the v2 initialization stays in effect. To use v1 after that, the client opens a new connection.