Skip to main content
The IO layer turns an AgentNetwork into an HTTP API. Built-in adapters: NextEndpoint (Next.js) and ExpressEndpoint (Express).

Exposing a Network

registerSSEStream() Options

NextEndpoint

Maps ExposedAPI to Next.js App Router handlers. Handles Request, auth, payload extraction, SSE response.

ExpressEndpoint

Requires express.json() (or body-parser) for POST. Handles client disconnect and res.flush() when available.

Response Format

Events are streamed as SSE:

Full Example: Next.js Streaming API

Migration

Custom Proxies

Use defineProxyKind() when an app needs to build its own transport around the shared event stream machinery.
For inbound human-in-the-loop or control events on a long-lived runtime, expose with a shared plane and publish directly:

See Also