experimental/http library

Experimental ACP HTTP/SSE client APIs.

These APIs may change before a stable release. The transport does not provide authentication, authorization, automatic reconnect, or replay. Browser Fetch uses the browser cookie jar and cannot expose Set-Cookie or attach caller-managed Cookie headers.

Classes

AcpAffinityCookieStore
Minimal URI-scoped storage for server-issued ACP routing-affinity cookies.
AcpHttpAdapter
Platform boundary used by the experimental HTTP/SSE client.
AcpHttpClientLimits
Bounded resource settings for AcpHttpClientTransport.
AcpHttpClientTransport
Experimental ACP client transport over POST plus SSE.
AcpHttpHeaders
Immutable, case-insensitive HTTP headers with preserved repeated values.
AcpHttpRequest
One platform-neutral streaming HTTP request.
AcpHttpResponse
One platform-neutral streaming HTTP response.
AcpRemoteDiagnostic
A safe diagnostic emitted while parsing a remote transport.
AcpSseLimits
Limits applied to one server-sent event stream.

Enums

AcpHttpCookiePolicy
Whether a remote HTTP adapter should use its platform cookie facilities.

Constants

acpConnectionIdHeader → const String
ACP connection-routing header.
acpJsonMediaType → const String
JSON media type used by ACP HTTP requests.
acpSessionIdHeader → const String
ACP session-routing header.
acpSseMediaType → const String
SSE media type used by ACP inbound streams.

Functions

acpApplicationStream(AcpDuplexStream<JsonRpcWireMessage> stream, {JsonRpcCodec codec = const JsonRpcCodec()}) AcpDuplexStream<Object?>
Adapts a typed remote wire stream for an ACP agent or client application.
createPlatformHttpAdapter() AcpHttpAdapter
Creates the HTTP adapter for the current platform.
decodeSseJson(Stream<List<int>> body, {AcpSseLimits limits = const AcpSseLimits(), AcpRemoteDiagnosticHandler? onDiagnostic}) Stream<Object>
Decodes JSON objects and arrays from a byte-oriented SSE response body.
encodeSseEvent(JsonRpcWireMessage message) String
Encodes one JSON-RPC value as an SSE data event.
encodeSseKeepAlive() String
Encodes an SSE keepalive comment.

Typedefs

AcpAffinityCookieDomainPolicy = bool Function(Uri responseUri, String cookieDomain)
Decides whether an explicit server Domain attribute may widen cookie scope beyond the response origin.
AcpRemoteDiagnosticHandler = void Function(AcpRemoteDiagnostic diagnostic)
Receives redacted remote-transport diagnostics.

Exceptions / Errors

AcpHttpTransportException
Safe failure from the experimental HTTP/SSE transport.
AcpSseLimitException
Thrown when a complete SSE event exceeds its configured bound.