Skip to content

v5.16.0

Choose a tag to compare

@github-actions github-actions released this 24 Apr 13:40
· 1389 commits to main since this release
af12e13

Minor Changes

  • d88f67b: Added field_value_or_absent storyboard check matcher. Passes when the field is absent OR present with a value in allowed_values / matching value; fails only when present with a disallowed value. Use it for envelope-tolerant assertions (e.g. fresh-path replayed) where the spec allows omission but forbids a wrong value. Closes #873.

  • 713be7b: Runner emits non-fatal context_value_rejected hints when a seller's error
    response lists the values it would have accepted (available / allowed /
    accepted_values) and the rejected request value traces back to a prior-step
    $context.* write. Collapses the "SDK bug vs seller bug" triage (issue #870)
    — the hint cites which step wrote the context key and, for context_outputs,
    the YAML response path. Pass/fail is unchanged; hints surface on
    StoryboardStepResult.hints[].

    Also aligns context extraction with the rest of the pipeline: convention
    extractors now resolve the effective task name from $test_kit.* references
    consistently with validation and enrichment (previously the extractor lookup
    used the pre-resolution token and silently missed in that case).

    New exports on @adcp/client/testing:

    • Types: StoryboardStepHint, ContextValueRejectedHint, ContextProvenanceEntry
    • Runtime: detectContextRejectionHints, extractContextWithProvenance,
      applyContextOutputsWithProvenance
  • b7a3424: SDK ergonomics fixes addressing feedback on 5.15.0.

    Root re-exports. The Success / Error / Submitted arms of every *Response discriminated union now export from the @adcp/client root (previously only the full *Response unions did). AdcpServer handler returns no longer need as any to narrow off the union. Covered arms include SyncCreativesSuccess, SyncAudiencesSuccess, CreateMediaBuy{Success,Error,Submitted}, UpdateMediaBuy{Success,Error}, BuildCreative{Success,MultiSuccess,Error}, ActivateSignal{Success,Error}, ProvidePerformanceFeedback{Success,Error}, SyncEventSources{Success,Error}, LogEvent{Success,Error}, SyncAccounts{Success,Error}, SyncGovernance{Success,Error}, UpdateContentStandards{Success,Error}, SyncAudiences{Success,Error}, and SyncCreatives{Success,Error,Submitted}.

    Idempotency store dual-export. createIdempotencyStore, memoryBackend, pgBackend, getIdempotencyMigration, IDEMPOTENCY_MIGRATION, cleanupExpiredIdempotency, hashPayload, plus IdempotencyStore / IdempotencyStoreConfig / IdempotencyBackend / IdempotencyCacheEntry / IdempotencyCheckResult / MemoryBackendOptions / PgBackendOptions now re-export from the @adcp/client root (previously only @adcp/client/server), matching the dual-export treatment of createAdcpServer.

    Widened handler return types + response-union narrowing. DomainHandler<K> now accepts Promise<AdcpToolMap[K]['result'] | AdcpToolMap[K]['response'] | McpToolResponse>. Adapter-style handlers that return Result<CreateMediaBuyResponse, ...> where CreateMediaBuyResponse = Success | Error | Submitted type-check without as any. The dispatcher narrows at runtime:

    • status === 'submitted' && typeof task_id === 'string' → Submitted envelope. Framework wraps without the Success-builder defaults (revision, confirmed_at, valid_actions) so async-task shapes round-trip correctly.
    • errors: Error[] with no Success-arm fields → Error arm. Framework wraps as { isError: true, structuredContent: { errors: [...] } }, preserving the typed-union shape the spec defines.
    • Otherwise → Success arm, response builder applies as before.

    AdcpToolMap entries gained a response field (full union) alongside the existing result (narrow Success). Handlers and response builders continue to type-check against result; callers that want the permissive shape reach for response.

    extractResult(toolCallResult) helper. New lightweight companion to unwrapProtocolResponse — prefers structuredContent, falls back to JSON-parsing content[0].text, returns undefined otherwise. Use it on the client side of mcpClient.callTool(...) instead of writing the extraction by hand. unwrapProtocolResponse remains available when you also want schema validation and extraction-path provenance.

    VALIDATION_ERROR.issues surfaced at top level. Strict-mode validation errors now expose adcp_error.issues (RFC 6901 pointer list) at the top level of the envelope so operators see it on the first render. The same list is still mirrored at adcp_error.details.issues for buyers that index into details per AdCP spec convention — existing details.issues readers continue to work, no migration required. adcp_error.details also gains the { tool, side } metadata. schemaPath gating is unchanged: stripped when exposeErrorDetails is off; request-side and response-side now thread the same exposeSchemaPath policy (previously request-side stripped schemaPath even in dev).

    Handlers that return a tool's *Error arm with spec-violating items (missing code or message) get a dev-log warning at dispatch — the envelope still ships unchanged, matching the handler's intent, but drift is surfaced in logs.

Patch Changes

  • 156d87b: Triage routine now runs a mandatory pre-PR build+test gate (npm run ci:quick) before expert review, capped at 2 build→fix iterations.