Connects this client app directly to an agent app.
This is useful for tests and in-process examples that do not need a transport.
Connects this client app to a stream or agent app for the lifetime of op.
The callback receives a ClientContext for calling agent-side methods.
When op resolves or rejects, the connection is closed.
Registers a handler that runs when this client app opens a connection.
Use this for connection-scoped work that needs to call agent-side ACP methods outside an inbound request handler.
Registers a client request handler by ACP method name.
Built-in method literals infer their params and response types from
method. Pass a parser as the second argument to register custom extension
methods.
Use "*" without a parser for a raw fallback after normal dispatch.
Registers a client request handler by ACP method name.
Built-in method literals infer their params and response types from
method. Pass a parser as the second argument to register custom extension
methods.
Use "*" without a parser for a raw fallback after normal dispatch.
Registers a client request handler by ACP method name.
Built-in method literals infer their params and response types from
method. Pass a parser as the second argument to register custom extension
methods.
Use "*" without a parser for a raw fallback after normal dispatch.
Registers a client notification handler by ACP method name.
Built-in method literals infer their params type from method. Pass a
parser as the second argument to register custom extension notifications.
Use "*" without a parser for a raw fallback after normal dispatch.
The connection dispatches one message per event-loop task, in the order
received, so handlers start in that order across all methods. It does not
wait for an async handler to settle before dispatching the next message,
so async handlers can run concurrently. To apply a session's
session/update notifications in the order they are received, a handler
that awaits before applying an update must serialize that work itself, for
example by chaining it onto a per-session promise. ActiveSession
already queues updates in arrival order.
Registers a client notification handler by ACP method name.
Built-in method literals infer their params type from method. Pass a
parser as the second argument to register custom extension notifications.
Use "*" without a parser for a raw fallback after normal dispatch.
The connection dispatches one message per event-loop task, in the order
received, so handlers start in that order across all methods. It does not
wait for an async handler to settle before dispatching the next message,
so async handlers can run concurrently. To apply a session's
session/update notifications in the order they are received, a handler
that awaits before applying an update must serialize that work itself, for
example by chaining it onto a per-session promise. ActiveSession
already queues updates in arrival order.
Registers a client notification handler by ACP method name.
Built-in method literals infer their params type from method. Pass a
parser as the second argument to register custom extension notifications.
Use "*" without a parser for a raw fallback after normal dispatch.
The connection dispatches one message per event-loop task, in the order
received, so handlers start in that order across all methods. It does not
wait for an async handler to settle before dispatching the next message,
so async handlers can run concurrently. To apply a session's
session/update notifications in the order they are received, a handler
that awaits before applying an update must serialize that work itself, for
example by chaining it onto a per-session promise. ActiveSession
already queues updates in arrival order.
Client-side app builder.
Methods on this class register typed client handlers and return
this, so apps can be built with a fluent chain.connectWith(...)is the usual entry point for clients because it provides aClientContextfor calling agent-side requests and session helpers.