ACP v1 TypeScript SDK — UNSTABLE - v2.0.1
    Preparing search index...

    Class ClientContext

    Context used by clients to call agent-side ACP methods.

    connectWith passes a ClientContext to the callback. Client handlers also receive one as ctx.agent when they need to call back into the agent.

    Hierarchy

    • AcpContext
      • ClientContext
    Index
    • get requestId(): JsonRpcId | undefined

      JSON-RPC id of the request currently being handled.

      This is undefined for notification handlers and for contexts created outside an inbound request, such as connect(...) and connectWith(...).

      Returns JsonRpcId | undefined

    • Creates a builder for starting and observing an ACP session.

      Pass a string for the common case where only cwd is needed, or pass a full NewSessionRequest when you need MCP servers, _meta, or additional session fields.

      Parameters

      • cwd: string

      Returns SessionBuilder

    • Creates a builder for starting and observing an ACP session.

      Pass a string for the common case where only cwd is needed, or pass a full NewSessionRequest when you need MCP servers, _meta, or additional session fields.

      Parameters

      Returns SessionBuilder

    • Sends a notification to the agent by ACP method name.

      Built-in method literals infer their params type. Custom notifications can specify their params type with a generic.

      Type Parameters

      • Method extends "session/cancel"

      Parameters

      Returns Promise<void>

    • Sends a notification to the agent by ACP method name.

      Built-in method literals infer their params type. Custom notifications can specify their params type with a generic.

      Type Parameters

      • Params = unknown

      Parameters

      • method: string
      • Optionalparams: Params

      Returns Promise<void>