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

    Type Alias AgentMessageExperimental

    An agent message upsert.

    Only [AgentMessage::message_id] is required. content has patch semantics: an omitted field leaves existing message content unchanged, null clears the value, and a concrete array replaces the previous value. For a new messageId, omitted fields use client defaults. content is replaced as a whole array; send [] or null to clear it.

    Message updates and chunks are applied in the order they are received. When an agent_message update includes content, that array replaces any content previously accumulated for the message, including content from earlier chunks. Later chunks with the same messageId append to the current content.

    type AgentMessage = {
        messageId: MessageId;
        content?: ContentBlock[] | null;
        _meta?: { [key: string]: unknown } | null;
    }
    Index
    messageId: MessageId

    A unique identifier for the message.

    content?: ContentBlock[] | null

    Complete replacement content for this message.

    _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 leaves the stored metadata unchanged; null clears it. An object patches the stored metadata by top-level key: keys it omits are unchanged, a key set to null is removed, and any other value replaces that key's stored value without merging nested objects. Beyond this patch rule, implementations MUST NOT make assumptions about values at these keys.

    See protocol docs: Metadata Patches