@nextclaw/ncp-http-agent-server
v0.3.10
Published
HTTP/SSE server transport adapter for NCP agent endpoints.
Readme
@nextclaw/ncp-http-agent-server
HTTP/SSE transport adapter for exposing an NcpAgentClientEndpoint over Hono routes.
Build
pnpm -C packages/ncp-packages/nextclaw-ncp-http-agent-server buildAPI
createNcpHttpAgentRouter(options)— options requireagentClientEndpoint: NcpAgentClientEndpointmountNcpHttpAgentRoutes(app, options)
Options:
agentClientEndpoint— client endpoint to forward requests to (in-process adapter or remote HTTP client)streamProvider(optional) — When set,/streamserves stored events instead of forwarding to the agent. Scenario: user reconnects after network drop and wants to continue watching the previous reply; withstreamProviderwe stream from persistence, without it we forward to the agent.basePath,requestTimeoutMs— path and optional forward-stream timeout. By default no server-side timeout is applied; set a positive value only if you explicitly want the server to cut off long-running forward streams.
For in-process agent (NcpAgentServerEndpoint), use createAgentClientFromServer from @nextclaw/ncp-toolkit to wrap it.
