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

    Type Alias PromptRequestExperimental

    Request parameters for sending a user prompt to the Agent.

    Contains the user's message and any additional context.

    See protocol docs: User Message

    type PromptRequest = {
        sessionId: SessionId;
        prompt: ContentBlock[];
        idempotencyKey?: IdempotencyKey | null;
        _meta?: { [key: string]: unknown } | null;
    }
    Index
    sessionId: SessionId

    The ID of the session to send this user message to

    prompt: ContentBlock[]

    The blocks of content that compose the user's message.

    As a baseline, the Agent MUST support text and resource_link content blocks, while other variants are optionally enabled via PromptCapabilities.

    The Client MUST adapt its interface according to PromptCapabilities.

    The Client MAY include referenced pieces of context as either resource or resource_link content blocks.

    When available, resource is preferred as it avoids extra round-trips and allows the message to include pieces of context from sources the Agent might not have access to.

    Clients MUST NOT send an empty array. Agents MAY reject one with -32602 without inserting it.

    idempotencyKey?: IdempotencyKey | null

    Identifies one prompt submission within this session.

    Optional. Omitted and null are equivalent and mean no key. The Agent then handles the prompt without duplicate detection.

    The Client generates the key and sends the same key on every attempt for the same submission. Agents that advertise capabilities.session MUST support the key. A retry of a recorded insertion returns the original messageId without inserting another message.

    The Agent MUST recognize the key for as long as it retains the message, including across connections and Agent restarts. For a live-only message, it MUST recognize the key while the session stays active on a connection. A retry with a forgotten key is a new submission, even immediately after reconnecting. If a duplicate would matter and the Client cannot rule it out, it SHOULD NOT retry automatically.

    When present, the value is an opaque, case-sensitive string of 1 to 255 characters. Agents MUST reject any other value with -32602 (Invalid params) and MUST NOT treat it as omitted.

    See protocol docs: Retrying a prompt

    _meta?: { [key: string]: unknown } | null

    The _meta property is reserved by ACP to allow Clients and Agents to attach additional metadata to their interactions. Omitted and null are equivalent and mean no metadata. Implementations MUST NOT assign meaning to keys they do not recognize.

    See protocol docs: Extensibility