ACP v2 TypeScript SDK — UNSTABLE DRAFT - v2.0.0
    Preparing search index...

    Class AgentContextExperimental

    Experimental draft ACP v2 context passed to agent-side handlers.

    Agents use this context to call client-side ACP methods while handling requests such as session/prompt.

    Hierarchy

    • AcpContext
      • AgentContext
    Index
    • get requestId(): JsonRpcId | undefined
      Experimental

      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

    • Experimental

      Sends a notification to the client by ACP method name.

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

      Type Parameters

      Parameters

      Returns Promise<void>

    • Experimental

      Sends a notification to the client by ACP method name.

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

      Parameters

      Returns Promise<void>

    • Experimental

      Sends a notification to the client 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>

    • Experimental

      Sends a notification to the client 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
      • const Method extends string = never

      Parameters

      Returns Promise<void>

    • Experimental

      Sends requests and notifications to the client as one JSON-RPC batch.

      Type Parameters

      Parameters

      • entries: Entries & { "0": BatchEntry } & {
            [Index in string | number | symbol]: Entries[Index] extends BatchEntry
                ? string extends any[any]["method"]
                    ? any[any]
                    : any[any]["method"] extends | "initialize"
                    | "session/new"
                    | "session/set_config_option"
                    | "session/prompt"
                    | "session/cancel"
                    | "session/list"
                    | "session/delete"
                    | "session/resume"
                    | "session/close"
                    | "session/request_permission"
                    | "session/update"
                    | "elicitation/create"
                    | "elicitation/complete"
                    | "$/cancel_request"
                    | "providers/list"
                    | "providers/set"
                    | "providers/disable"
                    | "mcp/message"
                    | "session/fork"
                    | "auth/login"
                    | "auth/logout"
                        ? any[any] extends ClientBatchEntry<never> ? any[any] : never
                        : any[any]
                : never
        }

      Returns Promise<BatchOutputs<Entries>>