@adcp/sdk API Reference - v14.3.0
    Preparing search index...

    Class ProtocolResponseParser

    Simple parser that follows ADCP spec exactly

    Index
    • Extract the replayed field from a protocol response envelope.

      Returns true if the seller set replayed: true on the envelope, false if explicitly set to false, undefined if not present. Callers with side effects on response (notifications, LLM memory writes, downstream tool calls) MUST treat undefined as false — the spec says fresh executions MAY omit the field.

      Parameters

      • response: any

      Returns boolean | undefined

    • Extract the seller-served AdCP release echo from the response envelope.

      This is the response-side adcp_version value, not necessarily the caller's configured pin. Multi-version sellers can downshift within the same major; callers that care should compare this value to their request's release-precision wire version (for example, wireVersion.normalize(pin)), not to a raw full-semver configuration value.

      Parameters

      • response: any

      Returns string | undefined

    • Extract the A2A contextId / AdCP context_id that binds the response to a server-side conversation. Buyers retain this across calls on the same AgentClient so the server can route subsequent sends to the same session. Returns undefined when the server did not surface one (e.g., MCP completed responses that don't need conversation continuity).

      Values that fail isSafeSessionId (overlong, control characters, non-string) are rejected and return undefined — retention falls back to the previously retained id. The server is the authoritative issuer but a compromised or buggy seller shouldn't be able to exhaust buyer memory or inject control sequences into buyer debug logs.

      Parameters

      • response: any

      Returns string | undefined

    • Extract the AdCP work handle used by tasks/get. For official A2A results, this never falls back to the transport Task.id / Message.taskId.

      Same sanitization rules as getContextId: malformed ids return undefined.

      Parameters

      • response: any

      Returns string | undefined

    • Return the A2A transport Task.id that may receive a continuation message. This is deliberately separate from getTaskId, which returns the AdCP work handle used by tasks/get. Only a live A2A task paused for input can be resumed; artifact-level AdCP pauses on a completed transport task are display-only.

      Parameters

      • response: any

      Returns string | undefined