experimental/server library
Experimental ACP HTTP/SSE and WebSocket server APIs.
Native listeners default to loopback and are unavailable in browser builds. These APIs provide routing, not authentication or authorization. Hosts remain responsible for TLS, origin/CORS policy, credentials, rate limits, quotas, privileged handler policy, and audit logging.
Classes
- AcpConnectionRoute
- The connection-level response/event stream.
- AcpHttpHeaders
- Immutable, case-insensitive HTTP headers with preserved repeated values.
- AcpHttpRequest
- One platform-neutral streaming HTTP request.
- AcpHttpResponse
- One platform-neutral streaming HTTP response.
- AcpHttpServer
- Adapter-neutral experimental ACP HTTP/SSE server.
- AcpHttpServerAdapter
- Platform boundary for hosting AcpHttpServer.
- AcpHttpServerBinding
- A running platform HTTP listener serving experimental ACP transports.
-
AcpOutboundHub<
T> - A bounded one-to-many outbound hub.
- AcpOutboundOverflow
- Details about a subscriber queue that dropped its oldest value.
-
AcpOutboundSubscription<
T> - One subscription to an AcpOutboundHub.
- AcpPreparedWebSocketUpgrade
- A connection reserved before an HTTP adapter accepts its upgrade.
- AcpRemoteServerLimits
- Bounded resource settings shared by experimental remote ACP servers.
- AcpServerConnectionRegistry
- Tracks pending-handshake and active remote ACP connections.
- AcpServerConnectionState
- Internal state for one remotely transported ACP connection.
- AcpServerRoute
- A destination for messages leaving a remotely hosted ACP connection.
- AcpSessionRoute
- A session-specific response/event stream.
- AcpSsePeriodicTimer
- A cancellable periodic timer used by server-side SSE streams.
- AcpWebSocketBinaryFrame
- One unsupported binary frame.
- AcpWebSocketChannel
- One connected WebSocket channel.
- AcpWebSocketFrame
- One inbound WebSocket frame.
- AcpWebSocketServer
- Adapter-neutral experimental ACP WebSocket server.
- AcpWebSocketServerSession
- Lifecycle handle for one accepted ACP WebSocket.
- AcpWebSocketTextFrame
- One UTF-8 text frame.
- AcpWebSocketUpgradeContext
- Context passed to a WebSocket origin/authentication preflight.
Functions
-
createAcpServerSseBody(
AcpOutboundSubscription< Object?> outbound, {Duration keepAliveInterval = const Duration(seconds: 15), AcpSsePeriodicTimerFactory timerFactory = _createPeriodicTimer}) → Stream<List< int> > - Encodes a platform-neutral server-sent event response body.
-
createPlatformAcpHttpServerAdapter(
) → AcpHttpServerAdapter - Creates the native ACP server adapter for this platform.
Typedefs
-
AcpHttpRequestPolicy
= FutureOr<
bool> Function(AcpHttpRequest request) - Decides whether an HTTP request may reach the ACP routing core.
- AcpOutboundOverflowHandler = void Function(AcpOutboundOverflow overflow)
- Reports a bounded outbound queue overflow.
-
AcpServerConnectionFactory
= FutureOr<
AcpServerConnectionState> Function(String connectionId) - Creates the transport state for one accepted remote ACP connection.
- AcpSsePeriodicTimerFactory = AcpSsePeriodicTimer Function(Duration interval, void onTick())
- Creates a periodic SSE timer.
-
AcpWebSocketUpgradePolicy
= FutureOr<
bool> Function(AcpWebSocketUpgradeContext context) - Decides whether a WebSocket upgrade may create an ACP connection.
Exceptions / Errors
- AcpServerRouteError
- A client-supplied route cannot be applied safely.
- AcpWebSocketUpgradeRejected
- Safe rejection from an ACP WebSocket preflight.