@ade-dev/sdk/server exports createAdeServer() and createAdeRemoteClient(). The SDK handles the chat RPC contract; your app owns the WebSocket listener, authentication and network policy.
handleConnection() accepts a browser WebSocket or Node ws socket. Closing the bridge removes its listeners and per-connection thread handles; the host still owns and disposes the client.
authorize runs before every built-in, custom or unsupported RPC. allowThreadKey runs on each thread-key call and can filter threads.list(). A connection can only use a thread after calling threads.open through that connection. openOptions(key, rendererOptions, context) lets the host add trusted options or constrain what a renderer may choose.
You can add host-owned RPCs through methods. They use the same authorization check:
{ "id", "ok": false, "error": { "code", "message" } }. The server sends thread events and provider/client changes as pushes. createAdeRemoteClient(url) returns the remote client; pass { WebSocket } if the environment has no global WebSocket. A compatible transport object can be passed instead of a URL.
call(method, params) for host-defined methods. Its thread.usage() is asynchronous because it makes an RPC. Use wss:// for remote networks and authenticate before accepting a connection; the SDK does not add TLS or user authentication.