v5.16.0
Minor Changes
-
d88f67b: Added
field_value_or_absentstoryboard check matcher. Passes when the field is absent OR present with a value inallowed_values/ matchingvalue; fails only when present with a disallowed value. Use it for envelope-tolerant assertions (e.g. fresh-pathreplayed) where the spec allows omission but forbids a wrong value. Closes #873. -
713be7b: Runner emits non-fatal
context_value_rejectedhints 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, forcontext_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
- Types:
-
b7a3424: SDK ergonomics fixes addressing feedback on 5.15.0.
Root re-exports. The
Success/Error/Submittedarms of every*Responsediscriminated union now export from the@adcp/clientroot (previously only the full*Responseunions did).AdcpServerhandler returns no longer needas anyto narrow off the union. Covered arms includeSyncCreativesSuccess,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}, andSyncCreatives{Success,Error,Submitted}.Idempotency store dual-export.
createIdempotencyStore,memoryBackend,pgBackend,getIdempotencyMigration,IDEMPOTENCY_MIGRATION,cleanupExpiredIdempotency,hashPayload, plusIdempotencyStore/IdempotencyStoreConfig/IdempotencyBackend/IdempotencyCacheEntry/IdempotencyCheckResult/MemoryBackendOptions/PgBackendOptionsnow re-export from the@adcp/clientroot (previously only@adcp/client/server), matching the dual-export treatment ofcreateAdcpServer.Widened handler return types + response-union narrowing.
DomainHandler<K>now acceptsPromise<AdcpToolMap[K]['result'] | AdcpToolMap[K]['response'] | McpToolResponse>. Adapter-style handlers that returnResult<CreateMediaBuyResponse, ...>whereCreateMediaBuyResponse = Success | Error | Submittedtype-check withoutas 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.
AdcpToolMapentries gained aresponsefield (full union) alongside the existingresult(narrow Success). Handlers and response builders continue to type-check againstresult; callers that want the permissive shape reach forresponse.extractResult(toolCallResult)helper. New lightweight companion tounwrapProtocolResponse— prefersstructuredContent, falls back to JSON-parsingcontent[0].text, returnsundefinedotherwise. Use it on the client side ofmcpClient.callTool(...)instead of writing the extraction by hand.unwrapProtocolResponseremains available when you also want schema validation and extraction-path provenance.VALIDATION_ERROR.issuessurfaced at top level. Strict-mode validation errors now exposeadcp_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 atadcp_error.details.issuesfor buyers that index intodetailsper AdCP spec convention — existingdetails.issuesreaders continue to work, no migration required.adcp_error.detailsalso gains the{ tool, side }metadata.schemaPathgating is unchanged: stripped whenexposeErrorDetailsis off; request-side and response-side now thread the sameexposeSchemaPathpolicy (previously request-side stripped schemaPath even in dev).Handlers that return a tool's *Error arm with spec-violating items (missing
codeormessage) 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.