ACP v2 (Preview) TypeScript SDK — UNSTABLE - v2.12.1
    Preparing search index...

    Class ClientAppExperimental

    Client-side app builder for the experimental draft ACP v2 API.

    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 a ClientContext for calling agent-side requests and session helpers.

    Index
    • Experimental

      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.

      Parameters

      Returns this

    • Experimental

      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. ACP requires a session's session/update notifications to be applied in the order they are received, so a session/update 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.

      Parameters

      Returns this

    • Experimental

      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. ACP requires a session's session/update notifications to be applied in the order they are received, so a session/update 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.

      Type Parameters

      Parameters

      Returns this

    • Experimental

      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. ACP requires a session's session/update notifications to be applied in the order they are received, so a session/update 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.

      Type Parameters

      • Params

      Parameters

      Returns this

    • Experimental

      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. ACP requires a session's session/update notifications to be applied in the order they are received, so a session/update 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.

      Type Parameters

      • Params
      • const Method extends string = never

      Returns this