Skip to content

feat(negotiation): add first-class buyer and seller proposal APIs #2542

Description

@bokelley

Context

AdCP 3.2 adds structured proposal negotiation through refine_proposals (#6450, adcontextprotocol/adcp#6547). @adcp/sdk should make the safe path the easy path for both buyer and seller agents. This is the primary SDK implementation because the AdCP training agent will consume these primitives.

Parent program: adcontextprotocol/adcp#6556

Buyer-side acceptance criteria

  • Expose typed request/result unions for refine_proposals, including revised, partial, unable, and finalized without unsafe field access.
  • Provide capability-aware request construction for total_budget, product_changes, alternatives, and criteria.
  • Reject unsupported dimensions and requests above max_alternatives, the protocol maximum of 10 alternatives, or 25 refinements before transport.
  • Provide response verification helpers for ordering, alternative count, unique terms_digest, total-budget currency/bounds, product include/omit actions, and machine-readable unsatisfied subsets.
  • Provide an orchestration example/helper covering exact idempotent retry, changed-request keys, counteroffer selection, finalization, hold expiry, and acceptance.
  • Surface task-level errors before exposing success fields.

Seller-side acceptance criteria

  • Provide handler/server primitives for declaring proposal_refinement capabilities and validating a complete batch before mutation.
  • Model commercial evaluation as an application callback; the SDK validates and classifies results but does not choose business terms.
  • Provide helpers/hooks for immutable successor creation, source lineage, terms_digest, and staging writes until response validation succeeds.
  • Support atomic finalize batches and rollback/no-write behavior on preflight failure.
  • Validate generated responses against the source request before returning or persisting.

Tests and examples

  • Unit tests cover all reason codes, capability omissions, mixed-batch rejection, 10/25 boundaries, partial alternatives, and finalization atomicity.
  • Add runnable buyer and seller examples that can target the AdCP training agent profile from epic: make proposal negotiation easy to implement, teach, and verify adcp#6556.
  • Document public APIs and migration/fallback behavior for legacy get_products refinement.

Dependency

Blocked on the final 3.2 schema/API shape from adcontextprotocol/adcp#6547.

Out of scope

  • Commercial optimization, pricing strategy, or LLM interpretation policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions