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

    Type Alias ClientRequestHandlersByMethod

    Client request handlers keyed by ACP protocol method name.

    type ClientRequestHandlersByMethod = {
        "session/request_permission": ClientRequestHandler<
            RequestPermissionRequest,
            RequestPermissionResponse,
        >;
        "mcp/message": ClientRequestHandler<MessageMcpRequest, MessageMcpResponse>;
        "elicitation/create": ClientRequestHandler<
            schema.CreateElicitationRequest,
            schema.CreateElicitationResponse,
        >;
    }
    Index
    "session/request_permission": ClientRequestHandler<
        RequestPermissionRequest,
        RequestPermissionResponse,
    >

    Handles session/request_permission.

    Return the selected outcome with the optionId the user chose, also when they chose a reject_once or reject_always option. The Agent matches the optionId against the options it offered and does not perform the operation for a rejection. Return cancelled when no option was selected. An error response is not approval either.

    The handler's signal aborts when the Agent cancels the request with $/cancel_request, for example after session/cancel or before it responds to session/close. The Agent has stopped waiting for the user's choice, so dismiss the prompt and return the cancelled outcome. Sending session/cancel does not require answering every pending permission request: the Agent cancels the ones it stops waiting for.

    "elicitation/create": ClientRequestHandler<
        schema.CreateElicitationRequest,
        schema.CreateElicitationResponse,
    >

    Handles elicitation/create.

    The handler's signal aborts when the Agent cancels the request with $/cancel_request, for example because the work that needed it was cancelled or the session is closing. Dismiss the elicitation and return the cancel action.

    decline and cancel report the user's choice. A Client that cannot render a requested form throws -32602 instead, for example for a required property of a type it does not know.