@adcp/sdk 14.0.0-rc.37 → 14.0.0-rc.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/adcp-storyboard-summary.js +286 -0
- package/bin/adcp.js +221 -10
- package/dist/lib/conformance/schemaLoader.d.mts +1 -1
- package/dist/lib/conformance/schemaLoader.d.ts +1 -1
- package/dist/lib/core/AgentClient.d.mts +6 -1
- package/dist/lib/core/AgentClient.d.ts +6 -1
- package/dist/lib/core/AgentClient.js +9 -0
- package/dist/lib/core/AgentClient.mjs +9 -0
- package/dist/lib/core/ConversationTypes.d.mts +29 -0
- package/dist/lib/core/ConversationTypes.d.ts +29 -0
- package/dist/lib/core/SingleAgentClient.d.mts +3 -1
- package/dist/lib/core/SingleAgentClient.d.ts +3 -1
- package/dist/lib/core/SingleAgentClient.js +9 -1
- package/dist/lib/core/SingleAgentClient.mjs +9 -1
- package/dist/lib/core/TaskExecutor.d.mts +13 -1
- package/dist/lib/core/TaskExecutor.d.ts +13 -1
- package/dist/lib/core/TaskExecutor.js +216 -18
- package/dist/lib/core/TaskExecutor.mjs +216 -19
- package/dist/lib/index.d.mts +5 -2
- package/dist/lib/index.d.ts +5 -2
- package/dist/lib/index.js +10 -1
- package/dist/lib/index.mjs +10 -1
- package/dist/lib/media-buy/action-assessment.d.mts +77 -0
- package/dist/lib/media-buy/action-assessment.d.ts +77 -0
- package/dist/lib/media-buy/action-assessment.js +300 -0
- package/dist/lib/media-buy/action-assessment.mjs +284 -0
- package/dist/lib/media-buy/action-constraints.d.mts +9 -0
- package/dist/lib/media-buy/action-constraints.d.ts +9 -0
- package/dist/lib/media-buy/action-constraints.js +170 -0
- package/dist/lib/media-buy/action-constraints.mjs +146 -0
- package/dist/lib/media-buy/action-contracts.d.mts +40 -0
- package/dist/lib/media-buy/action-contracts.d.ts +40 -0
- package/dist/lib/media-buy/action-contracts.js +304 -0
- package/dist/lib/media-buy/action-contracts.mjs +267 -0
- package/dist/lib/media-buy/action-metadata.generated.d.mts +37 -0
- package/dist/lib/media-buy/action-metadata.generated.d.ts +37 -0
- package/dist/lib/media-buy/action-metadata.generated.js +128 -0
- package/dist/lib/media-buy/action-metadata.generated.mjs +101 -0
- package/dist/lib/media-buy/action-types.d.mts +106 -0
- package/dist/lib/media-buy/action-types.d.ts +106 -0
- package/dist/lib/{types/v3-1-beta/tools.generated.js → media-buy/action-types.js} +2 -2
- package/dist/lib/media-buy/actions.d.mts +6 -0
- package/dist/lib/media-buy/actions.d.ts +6 -0
- package/dist/lib/media-buy/actions.js +38 -0
- package/dist/lib/media-buy/actions.mjs +9 -0
- package/dist/lib/media-buy/available-actions.d.mts +2 -1
- package/dist/lib/media-buy/available-actions.d.ts +2 -1
- package/dist/lib/media-buy/available-actions.js +4 -3
- package/dist/lib/media-buy/available-actions.mjs +4 -3
- package/dist/lib/media-buy/compatibility.js +3 -0
- package/dist/lib/media-buy/compatibility.mjs +3 -0
- package/dist/lib/media-buy/index.d.mts +4 -0
- package/dist/lib/media-buy/index.d.ts +4 -0
- package/dist/lib/media-buy/index.js +3 -1
- package/dist/lib/media-buy/index.mjs +1 -0
- package/dist/lib/media-buy/legacy-action-ids.d.mts +1 -0
- package/dist/lib/media-buy/legacy-action-ids.d.ts +1 -0
- package/dist/lib/media-buy/legacy-action-ids.js +50 -0
- package/dist/lib/media-buy/legacy-action-ids.mjs +26 -0
- package/dist/lib/media-buy/mutations.d.mts +70 -0
- package/dist/lib/media-buy/mutations.d.ts +70 -0
- package/dist/lib/media-buy/mutations.js +525 -0
- package/dist/lib/media-buy/mutations.mjs +498 -0
- package/dist/lib/media-buy/preflight.d.mts +20 -69
- package/dist/lib/media-buy/preflight.d.ts +20 -69
- package/dist/lib/media-buy/preflight.js +100 -336
- package/dist/lib/media-buy/preflight.mjs +111 -333
- package/dist/lib/media-buy/targeting-input.d.mts +7 -4
- package/dist/lib/media-buy/targeting-input.d.ts +7 -4
- package/dist/lib/media-buy/types.d.mts +55 -7
- package/dist/lib/media-buy/types.d.ts +55 -7
- package/dist/lib/protocols/rawResponseCapture.d.mts +12 -0
- package/dist/lib/protocols/rawResponseCapture.d.ts +12 -0
- package/dist/lib/protocols/rawResponseCapture.js +33 -3
- package/dist/lib/protocols/rawResponseCapture.mjs +32 -3
- package/dist/lib/registry/types.generated.d.mts +377 -9
- package/dist/lib/registry/types.generated.d.ts +377 -9
- package/dist/lib/reporting/content-mismatch.d.mts +126 -0
- package/dist/lib/reporting/content-mismatch.d.ts +126 -0
- package/dist/lib/reporting/content-mismatch.js +90 -0
- package/dist/lib/reporting/content-mismatch.mjs +66 -0
- package/dist/lib/reporting/evidence.d.mts +1 -0
- package/dist/lib/reporting/evidence.d.ts +1 -0
- package/dist/lib/reporting/evidence.js +32 -3
- package/dist/lib/reporting/evidence.mjs +31 -3
- package/dist/lib/reporting/index.d.mts +3 -1
- package/dist/lib/reporting/index.d.ts +3 -1
- package/dist/lib/reporting/index.js +3 -0
- package/dist/lib/reporting/index.mjs +2 -0
- package/dist/lib/reporting/ledger/handler.d.mts +51 -1
- package/dist/lib/reporting/ledger/handler.d.ts +51 -1
- package/dist/lib/reporting/ledger/handler.js +306 -38
- package/dist/lib/reporting/ledger/handler.mjs +304 -37
- package/dist/lib/reporting/ledger/health.d.mts +12 -0
- package/dist/lib/reporting/ledger/health.d.ts +12 -0
- package/dist/lib/reporting/ledger/health.js +15 -2
- package/dist/lib/reporting/ledger/health.mjs +13 -1
- package/dist/lib/reporting/ledger/index.d.mts +3 -0
- package/dist/lib/reporting/ledger/index.d.ts +3 -0
- package/dist/lib/reporting/ledger/index.js +7 -1
- package/dist/lib/reporting/ledger/index.mjs +3 -0
- package/dist/lib/reporting/ledger/lifecycle.d.mts +31 -4
- package/dist/lib/reporting/ledger/lifecycle.d.ts +31 -4
- package/dist/lib/reporting/ledger/lifecycle.js +244 -37
- package/dist/lib/reporting/ledger/lifecycle.mjs +244 -37
- package/dist/lib/reporting/ledger/managed-postgres.d.mts +231 -0
- package/dist/lib/reporting/ledger/managed-postgres.d.ts +231 -0
- package/dist/lib/reporting/ledger/managed-postgres.js +1797 -0
- package/dist/lib/reporting/ledger/managed-postgres.mjs +1776 -0
- package/dist/lib/reporting/ledger/managed.d.mts +355 -0
- package/dist/lib/reporting/ledger/managed.d.ts +355 -0
- package/dist/lib/reporting/ledger/managed.js +661 -0
- package/dist/lib/reporting/ledger/managed.mjs +633 -0
- package/dist/lib/reporting/ledger/notification-activity.d.mts +222 -0
- package/dist/lib/reporting/ledger/notification-activity.d.ts +222 -0
- package/dist/lib/reporting/ledger/notification-activity.js +1139 -0
- package/dist/lib/reporting/ledger/notification-activity.mjs +1110 -0
- package/dist/lib/reporting/ledger/postgres.d.mts +161 -1
- package/dist/lib/reporting/ledger/postgres.d.ts +161 -1
- package/dist/lib/reporting/ledger/postgres.js +1153 -21
- package/dist/lib/reporting/ledger/postgres.mjs +1152 -21
- package/dist/lib/reporting/ledger/producer.d.mts +8 -0
- package/dist/lib/reporting/ledger/producer.d.ts +8 -0
- package/dist/lib/reporting/ledger/producer.js +146 -52
- package/dist/lib/reporting/ledger/producer.mjs +146 -51
- package/dist/lib/reporting/ledger/types.d.mts +358 -1
- package/dist/lib/reporting/ledger/types.d.ts +358 -1
- package/dist/lib/reporting/ledger/types.js +3 -0
- package/dist/lib/reporting/ledger/types.mjs +2 -0
- package/dist/lib/reporting/reconciliation.d.mts +362 -2
- package/dist/lib/reporting/reconciliation.d.ts +362 -2
- package/dist/lib/reporting/reconciliation.js +1051 -7
- package/dist/lib/reporting/reconciliation.mjs +1053 -7
- package/dist/lib/reporting/service/conformance.d.mts +35 -0
- package/dist/lib/reporting/service/conformance.d.ts +35 -0
- package/dist/lib/reporting/service/conformance.js +89 -0
- package/dist/lib/reporting/service/conformance.mjs +68 -0
- package/dist/lib/reporting/service/index.d.mts +182 -0
- package/dist/lib/reporting/service/index.d.ts +182 -0
- package/dist/lib/reporting/service/index.js +793 -0
- package/dist/lib/reporting/service/index.mjs +787 -0
- package/dist/lib/reporting/source/index.d.mts +2 -1
- package/dist/lib/reporting/source/index.d.ts +2 -1
- package/dist/lib/reporting/source/index.js +16 -3
- package/dist/lib/reporting/source/index.mjs +12 -1
- package/dist/lib/reporting/source/inline.d.mts +88 -1
- package/dist/lib/reporting/source/inline.d.ts +88 -1
- package/dist/lib/reporting/source/inline.js +1161 -163
- package/dist/lib/reporting/source/inline.mjs +1166 -163
- package/dist/lib/reporting/source/manifest.js +12 -7
- package/dist/lib/reporting/source/manifest.mjs +12 -7
- package/dist/lib/reporting/source/source.d.mts +26 -0
- package/dist/lib/reporting/source/source.d.ts +26 -0
- package/dist/lib/reporting/source/source.js +71 -2
- package/dist/lib/reporting/source/source.mjs +65 -1
- package/dist/lib/schemas/index.d.mts +22 -1
- package/dist/lib/schemas/index.d.ts +22 -1
- package/dist/lib/schemas/index.js +7 -0
- package/dist/lib/schemas/index.mjs +7 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/create-adcp-server.d.mts +18 -0
- package/dist/lib/server/create-adcp-server.d.ts +18 -0
- package/dist/lib/server/create-adcp-server.js +52 -2
- package/dist/lib/server/create-adcp-server.mjs +52 -2
- package/dist/lib/server/decisioning/account.d.mts +1 -1
- package/dist/lib/server/decisioning/account.d.ts +1 -1
- package/dist/lib/server/decisioning/index.d.mts +1 -0
- package/dist/lib/server/decisioning/index.d.ts +1 -0
- package/dist/lib/server/decisioning/platform.d.mts +3 -0
- package/dist/lib/server/decisioning/platform.d.ts +3 -0
- package/dist/lib/server/decisioning/runtime/from-platform.js +88 -10
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +88 -10
- package/dist/lib/server/decisioning/specialisms/reporting.d.mts +38 -0
- package/dist/lib/server/decisioning/specialisms/reporting.d.ts +38 -0
- package/dist/lib/{types/v3-1-beta/index.js → server/decisioning/specialisms/reporting.js} +2 -8
- package/dist/lib/server/decisioning/specialisms/reporting.mjs +0 -0
- package/dist/lib/server/index.d.mts +4 -2
- package/dist/lib/server/index.d.ts +4 -2
- package/dist/lib/server/index.js +5 -0
- package/dist/lib/server/index.mjs +4 -0
- package/dist/lib/server/media-buy-action-resolver.d.mts +63 -0
- package/dist/lib/server/media-buy-action-resolver.d.ts +63 -0
- package/dist/lib/server/media-buy-action-resolver.js +297 -0
- package/dist/lib/server/media-buy-action-resolver.mjs +285 -0
- package/dist/lib/server/media-buy-actions.d.mts +7 -8
- package/dist/lib/server/media-buy-actions.d.ts +7 -8
- package/dist/lib/server/media-buy-actions.js +57 -14
- package/dist/lib/server/media-buy-actions.mjs +63 -14
- package/dist/lib/server/notification-subscriptions/index.d.mts +2 -2
- package/dist/lib/server/notification-subscriptions/index.d.ts +2 -2
- package/dist/lib/server/notification-subscriptions/index.js +2 -0
- package/dist/lib/server/notification-subscriptions/index.mjs +2 -0
- package/dist/lib/server/notification-subscriptions/postgres-runtime.d.mts +3 -1
- package/dist/lib/server/notification-subscriptions/postgres-runtime.d.ts +3 -1
- package/dist/lib/server/notification-subscriptions/postgres-runtime.js +1 -0
- package/dist/lib/server/notification-subscriptions/postgres-runtime.mjs +1 -0
- package/dist/lib/server/notification-subscriptions/runtime.d.mts +12 -1
- package/dist/lib/server/notification-subscriptions/runtime.d.ts +12 -1
- package/dist/lib/server/notification-subscriptions/runtime.js +102 -16
- package/dist/lib/server/notification-subscriptions/runtime.mjs +101 -16
- package/dist/lib/server/notification-subscriptions/types.d.mts +104 -1
- package/dist/lib/server/notification-subscriptions/types.d.ts +104 -1
- package/dist/lib/server/webhook-emitter.d.mts +40 -5
- package/dist/lib/server/webhook-emitter.d.ts +40 -5
- package/dist/lib/server/webhook-emitter.js +23 -12
- package/dist/lib/server/webhook-emitter.mjs +23 -12
- package/dist/lib/storage/interfaces.d.mts +14 -2
- package/dist/lib/storage/interfaces.d.ts +14 -2
- package/dist/lib/testing/compliance/comply.d.mts +9 -3
- package/dist/lib/testing/compliance/comply.d.ts +9 -3
- package/dist/lib/testing/compliance/comply.js +158 -3
- package/dist/lib/testing/compliance/comply.mjs +159 -4
- package/dist/lib/testing/compliance/storyboard-tracks.js +7 -5
- package/dist/lib/testing/compliance/storyboard-tracks.mjs +7 -5
- package/dist/lib/testing/compliance/summary.js +10 -1
- package/dist/lib/testing/compliance/summary.mjs +10 -1
- package/dist/lib/testing/index.d.mts +1 -1
- package/dist/lib/testing/index.d.ts +1 -1
- package/dist/lib/testing/index.js +2 -0
- package/dist/lib/testing/index.mjs +3 -1
- package/dist/lib/testing/storyboard/agent-routing.d.mts +12 -43
- package/dist/lib/testing/storyboard/agent-routing.d.ts +12 -43
- package/dist/lib/testing/storyboard/agent-routing.js +75 -13
- package/dist/lib/testing/storyboard/agent-routing.mjs +70 -12
- package/dist/lib/testing/storyboard/index.d.mts +1 -0
- package/dist/lib/testing/storyboard/index.d.ts +1 -0
- package/dist/lib/testing/storyboard/index.js +3 -0
- package/dist/lib/testing/storyboard/index.mjs +2 -0
- package/dist/lib/testing/storyboard/junit.d.mts +1 -1
- package/dist/lib/testing/storyboard/junit.d.ts +1 -1
- package/dist/lib/testing/storyboard/junit.js +21 -2
- package/dist/lib/testing/storyboard/junit.mjs +21 -2
- package/dist/lib/testing/storyboard/probes.d.mts +130 -0
- package/dist/lib/testing/storyboard/probes.d.ts +130 -0
- package/dist/lib/testing/storyboard/probes.js +682 -10
- package/dist/lib/testing/storyboard/probes.mjs +683 -3
- package/dist/lib/testing/storyboard/request-signing/builder.d.mts +16 -5
- package/dist/lib/testing/storyboard/request-signing/builder.d.ts +16 -5
- package/dist/lib/testing/storyboard/request-signing/grader.d.mts +44 -1
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts +44 -1
- package/dist/lib/testing/storyboard/request-signing/grader.js +46 -22
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +43 -21
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.mts +86 -11
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.ts +86 -11
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js +119 -25
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs +117 -26
- package/dist/lib/testing/storyboard/request-signing/synthesize.js +22 -2
- package/dist/lib/testing/storyboard/request-signing/synthesize.mjs +22 -2
- package/dist/lib/testing/storyboard/runner.d.mts +103 -0
- package/dist/lib/testing/storyboard/runner.d.ts +103 -0
- package/dist/lib/testing/storyboard/runner.js +1090 -268
- package/dist/lib/testing/storyboard/runner.mjs +1096 -261
- package/dist/lib/testing/storyboard/seeding.d.mts +4 -1
- package/dist/lib/testing/storyboard/seeding.d.ts +4 -1
- package/dist/lib/testing/storyboard/seeding.js +55 -24
- package/dist/lib/testing/storyboard/seeding.mjs +55 -24
- package/dist/lib/testing/storyboard/test-kit.d.mts +37 -3
- package/dist/lib/testing/storyboard/test-kit.d.ts +37 -3
- package/dist/lib/testing/storyboard/test-kit.js +8 -2
- package/dist/lib/testing/storyboard/test-kit.mjs +7 -2
- package/dist/lib/testing/storyboard/types.d.mts +132 -10
- package/dist/lib/testing/storyboard/types.d.ts +132 -10
- package/dist/lib/testing/storyboard/types.js +17 -0
- package/dist/lib/testing/storyboard/types.mjs +16 -0
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/testing/storyboard/validations.js +16 -0
- package/dist/lib/testing/storyboard/validations.mjs +16 -0
- package/dist/lib/testing/test-controller.d.mts +1 -1
- package/dist/lib/testing/test-controller.d.ts +1 -1
- package/dist/lib/types/buy-products.d.ts +71 -6
- package/dist/lib/types/control-media-buy.d.ts +25 -11
- package/dist/lib/types/core.generated.d.mts +69 -10
- package/dist/lib/types/core.generated.d.ts +69 -10
- package/dist/lib/types/create-media-buy.d.ts +71 -6
- package/dist/lib/types/forward-compat-error-codes.d.mts +7 -6
- package/dist/lib/types/forward-compat-error-codes.d.ts +7 -6
- package/dist/lib/types/index.d.mts +2 -2
- package/dist/lib/types/index.d.ts +2 -2
- package/dist/lib/types/schemas.generated.d.ts +8040 -8116
- package/dist/lib/types/schemas.generated.js +1074 -309
- package/dist/lib/types/schemas.generated.mjs +1068 -309
- package/dist/lib/types/tools.generated.d.mts +65 -6
- package/dist/lib/types/tools.generated.d.ts +65 -6
- package/dist/lib/types/update-media-buy.d.ts +71 -6
- package/dist/lib/utils/redact-secrets.d.mts +1 -1
- package/dist/lib/utils/redact-secrets.d.ts +1 -1
- package/dist/lib/utils/redact-secrets.js +1 -1
- package/dist/lib/utils/redact-secrets.mjs +1 -1
- package/dist/lib/v2/projection/cache-versions.d.mts +0 -1
- package/dist/lib/v2/projection/cache-versions.d.ts +0 -1
- package/dist/lib/v2/projection/cache-versions.js +1 -15
- package/dist/lib/v2/projection/cache-versions.mjs +1 -14
- package/dist/lib/v2/projection/canonical-properties.js +2 -2
- package/dist/lib/v2/projection/canonical-properties.mjs +3 -3
- package/dist/lib/v2/projection/registry.d.mts +1 -1
- package/dist/lib/v2/projection/registry.d.ts +1 -1
- package/dist/lib/v2/projection/registry.js +2 -2
- package/dist/lib/v2/projection/registry.mjs +3 -3
- package/dist/lib/validation/schema-loader.d.mts +9 -1
- package/dist/lib/validation/schema-loader.d.ts +9 -1
- package/dist/lib/validation/schema-loader.js +65 -8
- package/dist/lib/validation/schema-loader.mjs +64 -8
- package/dist/lib/version.d.mts +5 -5
- package/dist/lib/version.d.ts +5 -5
- package/dist/lib/version.js +3 -8
- package/dist/lib/version.mjs +3 -8
- package/dist/lib/wholesale-feed-sync/index.d.mts +1 -0
- package/dist/lib/wholesale-feed-sync/index.d.ts +1 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.d.mts +42 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.d.ts +42 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.js +16 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.mjs +0 -0
- package/dist/lib/wholesale-feed-sync/sync.d.mts +6 -6
- package/dist/lib/wholesale-feed-sync/sync.d.ts +6 -6
- package/dist/lib/wholesale-feed-sync/sync.js +3 -1
- package/dist/lib/wholesale-feed-sync/sync.mjs +3 -1
- package/dist/lib/wholesale-feed-sync/types.d.mts +15 -14
- package/dist/lib/wholesale-feed-sync/types.d.ts +15 -14
- package/dist/lib/wholesale-feed-sync/webhook-notification.d.mts +7 -5
- package/dist/lib/wholesale-feed-sync/webhook-notification.d.ts +7 -5
- package/dist/lib/wholesale-feed-sync/webhook-notification.js +45 -0
- package/dist/lib/wholesale-feed-sync/webhook-notification.mjs +44 -0
- package/docs/CLI.md +1 -1
- package/docs/TYPE-SUMMARY.md +118 -4
- package/docs/guides/ASYNC-API-REFERENCE.md +62 -1
- package/docs/guides/ASYNC-DEVELOPER-GUIDE.md +25 -0
- package/docs/guides/ASYNC-DOCUMENTATION-INDEX.md +3 -0
- package/docs/guides/BUYER-QUICKSTART-3.2.md +5 -0
- package/docs/guides/DURABLE-BUYER-WRITES.md +337 -0
- package/docs/guides/EXISTING-PLATFORM.md +80 -1
- package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +57 -0
- package/docs/guides/MEDIA-BUY-ACTION-ASSESSMENT.md +300 -0
- package/docs/guides/REPORTING-LEDGER.md +654 -3
- package/docs/guides/REPORTING-RECONCILIATION.md +50 -0
- package/docs/guides/REPORTING-SOURCE-EXECUTOR.md +63 -1
- package/docs/guides/SELLER-QUICKSTART-3.2.md +2 -0
- package/docs/guides/VALIDATE-YOUR-AGENT.md +35 -0
- package/docs/guides/idempotency-crash-recovery.md +4 -0
- package/docs/llms.txt +4 -2
- package/docs/migration-14.x-rc-worksheet.md +60 -5
- package/docs/migration-7.9-to-7.10.md +7 -5
- package/examples/README.md +17 -0
- package/examples/durable-buyer-writes/caller.ts +745 -0
- package/examples/durable-buyer-writes/worker.ts +240 -0
- package/examples/reliable-reporting-service/README.md +100 -0
- package/examples/seller-3.2-starter.ts +7 -8
- package/examples/targeting-input-existing-platform.ts +153 -0
- package/package.json +41 -29
- package/skills/build-seller-agent/SKILL.md +2 -0
- package/skills/build-seller-agent/specialisms/signed-requests.md +11 -1
- package/skills/cross-cutting.md +28 -11
- package/compliance/cache/3.1.0-beta.7/domains/brand/index.yaml +0 -160
- package/compliance/cache/3.1.0-beta.7/domains/brand/scenarios/distributed_brand_resolution.yaml +0 -415
- package/compliance/cache/3.1.0-beta.7/domains/brand/scenarios/single_side_trust_extension.yaml +0 -454
- package/compliance/cache/3.1.0-beta.7/domains/creative/index.yaml +0 -339
- package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/billing_out_of_band.yaml +0 -153
- package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -389
- package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/native_in_feed.yaml +0 -543
- package/compliance/cache/3.1.0-beta.7/domains/governance/index.yaml +0 -682
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/index.yaml +0 -781
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/audience_buy_flow.yaml +0 -380
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/available_actions.yaml +0 -565
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/billing_finality_delivery.yaml +0 -354
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/canonical_formats.yaml +0 -711
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/clicks_buy_flow.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/completed_views_buy_flow.yaml +0 -344
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/create_media_buy_async.yaml +0 -234
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -419
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/creative_reception.yaml +0 -247
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/delivery_reporting.yaml +0 -357
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/dependency_impairment.yaml +0 -633
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -800
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/event_dedup_flow.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -309
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_approved.yaml +0 -214
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_conditions.yaml +0 -199
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_denied.yaml +0 -204
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_denied_recovery.yaml +0 -252
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/invalid_transitions.yaml +0 -289
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/inventory_list_no_match.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/inventory_list_targeting.yaml +0 -276
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/measurement_accountability.yaml +0 -244
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/measurement_terms_rejected.yaml +0 -203
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/pending_creatives_to_start.yaml +0 -274
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -500
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/performance_buy_flow.yaml +0 -428
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -470
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/product_signal_targeting.yaml +0 -373
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_finalize.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_not_found_errors.yaml +0 -257
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_audit_observation.yaml +0 -333
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_enforcement.yaml +0 -517
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -294
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/reach_buy_flow.yaml +0 -823
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -360
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/refine_products.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_accountability.yaml +0 -293
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -576
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/state-machine.yaml +0 -442
- package/compliance/cache/3.1.0-beta.7/domains/signals/index.yaml +0 -266
- package/compliance/cache/3.1.0-beta.7/domains/sponsored-intelligence/index.yaml +0 -256
- package/compliance/cache/3.1.0-beta.7/index.json +0 -356
- package/compliance/cache/3.1.0-beta.7/protocols/brand/index.yaml +0 -160
- package/compliance/cache/3.1.0-beta.7/protocols/brand/scenarios/distributed_brand_resolution.yaml +0 -415
- package/compliance/cache/3.1.0-beta.7/protocols/brand/scenarios/single_side_trust_extension.yaml +0 -454
- package/compliance/cache/3.1.0-beta.7/protocols/creative/index.yaml +0 -339
- package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/billing_out_of_band.yaml +0 -153
- package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -389
- package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/native_in_feed.yaml +0 -543
- package/compliance/cache/3.1.0-beta.7/protocols/governance/index.yaml +0 -682
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/index.yaml +0 -781
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/audience_buy_flow.yaml +0 -380
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/available_actions.yaml +0 -565
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/billing_finality_delivery.yaml +0 -354
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/canonical_formats.yaml +0 -711
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/clicks_buy_flow.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/completed_views_buy_flow.yaml +0 -344
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/create_media_buy_async.yaml +0 -234
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -419
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/creative_reception.yaml +0 -247
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/delivery_reporting.yaml +0 -357
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/dependency_impairment.yaml +0 -633
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -800
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/event_dedup_flow.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -309
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_approved.yaml +0 -214
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_conditions.yaml +0 -199
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_denied.yaml +0 -204
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_denied_recovery.yaml +0 -252
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/invalid_transitions.yaml +0 -289
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/inventory_list_no_match.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/inventory_list_targeting.yaml +0 -276
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/measurement_accountability.yaml +0 -244
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/measurement_terms_rejected.yaml +0 -203
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/pending_creatives_to_start.yaml +0 -274
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -500
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/performance_buy_flow.yaml +0 -428
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -470
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/product_signal_targeting.yaml +0 -373
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_finalize.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_not_found_errors.yaml +0 -257
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_audit_observation.yaml +0 -333
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_enforcement.yaml +0 -517
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -294
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/reach_buy_flow.yaml +0 -823
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -360
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/refine_products.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_accountability.yaml +0 -293
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -576
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/state-machine.yaml +0 -442
- package/compliance/cache/3.1.0-beta.7/protocols/signals/index.yaml +0 -266
- package/compliance/cache/3.1.0-beta.7/protocols/sponsored-intelligence/index.yaml +0 -256
- package/compliance/cache/3.1.0-beta.7/specialisms/audience-sync/index.yaml +0 -313
- package/compliance/cache/3.1.0-beta.7/specialisms/brand-rights/index.yaml +0 -350
- package/compliance/cache/3.1.0-beta.7/specialisms/brand-rights/scenarios/governance_denied.yaml +0 -226
- package/compliance/cache/3.1.0-beta.7/specialisms/collection-lists/index.yaml +0 -359
- package/compliance/cache/3.1.0-beta.7/specialisms/content-standards/index.yaml +0 -572
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-ad-server/index.yaml +0 -409
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-generative/generative-seller.yaml +0 -807
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-generative/index.yaml +0 -758
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-template/index.yaml +0 -510
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-aware-seller/index.yaml +0 -143
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-aware-seller/scenarios/governance_multi_agent_rejected.yaml +0 -117
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-delivery-monitor/index.yaml +0 -441
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-spend-authority/denied.yaml +0 -221
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-spend-authority/index.yaml +0 -330
- package/compliance/cache/3.1.0-beta.7/specialisms/property-lists/index.yaml +0 -482
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-broadcast-tv/index.yaml +0 -738
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-catalog-driven/index.yaml +0 -840
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-guaranteed/index.yaml +0 -601
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-non-guaranteed/index.yaml +0 -546
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-proposal-mode/index.yaml +0 -586
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-social/index.yaml +0 -919
- package/compliance/cache/3.1.0-beta.7/specialisms/signal-marketplace/index.yaml +0 -424
- package/compliance/cache/3.1.0-beta.7/specialisms/signal-marketplace/scenarios/governance_denied.yaml +0 -211
- package/compliance/cache/3.1.0-beta.7/specialisms/signal-owned/index.yaml +0 -317
- package/compliance/cache/3.1.0-beta.7/specialisms/sponsored-intelligence/index.yaml +0 -59
- package/compliance/cache/3.1.0-beta.7/test-kits/acme-outdoor-live.yaml +0 -78
- package/compliance/cache/3.1.0-beta.7/test-kits/acme-outdoor.yaml +0 -223
- package/compliance/cache/3.1.0-beta.7/test-kits/billing-gate-runner.yaml +0 -115
- package/compliance/cache/3.1.0-beta.7/test-kits/bistro-oranje.yaml +0 -126
- package/compliance/cache/3.1.0-beta.7/test-kits/distributed-brand-runner.yaml +0 -281
- package/compliance/cache/3.1.0-beta.7/test-kits/nova-motors.yaml +0 -262
- package/compliance/cache/3.1.0-beta.7/test-kits/osei-natural.yaml +0 -126
- package/compliance/cache/3.1.0-beta.7/test-kits/parallel-dispatch-runner.yaml +0 -196
- package/compliance/cache/3.1.0-beta.7/test-kits/rate-limit-trip-runner.yaml +0 -172
- package/compliance/cache/3.1.0-beta.7/test-kits/signed-requests-runner.yaml +0 -155
- package/compliance/cache/3.1.0-beta.7/test-kits/single-side-trust-runner.yaml +0 -294
- package/compliance/cache/3.1.0-beta.7/test-kits/substitution-observer-runner.yaml +0 -688
- package/compliance/cache/3.1.0-beta.7/test-kits/summit-foods.yaml +0 -125
- package/compliance/cache/3.1.0-beta.7/test-kits/webhook-receiver-runner.yaml +0 -265
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/001-minimal-plan.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/002-full-plan.json +0 -217
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/003-bookkeeping-stripped.json +0 -60
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/004a-human-review-omitted.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/004b-human-review-explicit-null.json +0 -49
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/005a-policy-categories-order-1.json +0 -53
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/005b-policy-categories-order-2.json +0 -57
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/006a-ext-trace-v1.json +0 -49
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/006b-ext-trace-v2.json +0 -53
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/007-unicode-objectives.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/008-numeric-canonicalization.json +0 -65
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/README.md +0 -220
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/canonicalization.json +0 -241
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/keys.json +0 -60
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/001-no-signature-header.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/002-wrong-tag.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/003-expired-signature.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/004-window-too-long.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/005-alg-not-allowed.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/006-missing-covered-component.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/007-missing-content-digest.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/008-unknown-keyid.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/009-key-ops-missing-verify.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/010-content-digest-mismatch.json +0 -33
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/011-malformed-header.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/012-missing-expires-param.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/013-expires-le-created.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/014-missing-nonce-param.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/015-signature-invalid.json +0 -28
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/016-replayed-nonce.json +0 -35
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/017-key-revoked.json +0 -38
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/018-digest-covered-when-forbidden.json +0 -28
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/019-signature-without-signature-input.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/020-rate-abuse.json +0 -34
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/021-duplicate-signature-input-label.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/022-multi-valued-content-type.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/023-multi-valued-content-digest.json +0 -32
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/024-unquoted-string-param.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/025-jwk-alg-crv-mismatch.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/026-non-ascii-host.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/027-webhook-registration-authentication-unsigned.json +0 -25
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/028-unsigned-protocol-method-required.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/001-basic-post.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/002-post-with-content-digest.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/003-es256-post.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/004-multiple-signature-labels.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/005-default-port-stripped.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/006-dot-segment-path.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/007-query-byte-preserved.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/008-percent-encoded-path.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/009-percent-encoded-unreserved-decoded.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/010-percent-encoded-slash-preserved.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/011-ipv6-authority.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/012-ipv6-authority-default-port-stripped.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/README.md +0 -211
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/keys.json +0 -61
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/001-wrong-tag.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/002-expired-signature.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/003-window-too-long.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/004-alg-not-allowed.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/005-missing-authority-component.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/006-missing-content-digest.json +0 -25
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/007-unknown-keyid.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/008-wrong-adcp-use.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/009-content-digest-mismatch.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/010-malformed-signature-input.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/011-signature-without-input.json +0 -25
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/012-missing-expires-param.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/013-expires-le-created.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/014-missing-nonce-param.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/015-signature-invalid.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/016-replayed-nonce.json +0 -37
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/017-key-revoked.json +0 -32
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/018-rate-abuse.json +0 -33
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/019-revocation-stale.json +0 -32
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/020-key-ops-missing-verify.json +0 -41
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/021-base64-alphabet-mixing.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/001-basic-post.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/002-es256-post.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/003-multiple-signature-labels.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/004-default-port-stripped.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/005-percent-encoded-path.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/006-query-byte-preserved.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/007-body-without-idempotency-key.json +0 -25
- package/compliance/cache/3.1.0-beta.7/universal/billing-gate-dispatch.yaml +0 -450
- package/compliance/cache/3.1.0-beta.7/universal/canonical-format-validate-input.yaml +0 -640
- package/compliance/cache/3.1.0-beta.7/universal/capability-discovery.yaml +0 -125
- package/compliance/cache/3.1.0-beta.7/universal/collection-lists-pagination-integrity.yaml +0 -306
- package/compliance/cache/3.1.0-beta.7/universal/comply-controller-mode-gate.yaml +0 -141
- package/compliance/cache/3.1.0-beta.7/universal/content-standards-pagination-integrity.yaml +0 -326
- package/compliance/cache/3.1.0-beta.7/universal/deterministic-testing.yaml +0 -1430
- package/compliance/cache/3.1.0-beta.7/universal/error-compliance-signals.yaml +0 -377
- package/compliance/cache/3.1.0-beta.7/universal/error-compliance.yaml +0 -528
- package/compliance/cache/3.1.0-beta.7/universal/fictional-entities.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/universal/get-media-buys-pagination-integrity.yaml +0 -160
- package/compliance/cache/3.1.0-beta.7/universal/get-signals-pagination-integrity.yaml +0 -211
- package/compliance/cache/3.1.0-beta.7/universal/idempotency.yaml +0 -861
- package/compliance/cache/3.1.0-beta.7/universal/notification-config-event-scope.yaml +0 -119
- package/compliance/cache/3.1.0-beta.7/universal/notification-config-lifecycle.yaml +0 -337
- package/compliance/cache/3.1.0-beta.7/universal/notification-config-rejections.yaml +0 -107
- package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity-creative-formats.yaml +0 -265
- package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity-list-accounts.yaml +0 -245
- package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity.yaml +0 -263
- package/compliance/cache/3.1.0-beta.7/universal/property-lists-pagination-integrity.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/universal/read-tool-idempotency.yaml +0 -405
- package/compliance/cache/3.1.0-beta.7/universal/runner-output-contract.yaml +0 -1266
- package/compliance/cache/3.1.0-beta.7/universal/schema-validation-signals.yaml +0 -181
- package/compliance/cache/3.1.0-beta.7/universal/schema-validation.yaml +0 -548
- package/compliance/cache/3.1.0-beta.7/universal/security.yaml +0 -539
- package/compliance/cache/3.1.0-beta.7/universal/signed-requests.yaml +0 -217
- package/compliance/cache/3.1.0-beta.7/universal/stale-response-advisory.yaml +0 -295
- package/compliance/cache/3.1.0-beta.7/universal/storyboard-schema.yaml +0 -2136
- package/compliance/cache/3.1.0-beta.7/universal/v3-envelope-integrity.yaml +0 -117
- package/compliance/cache/3.1.0-beta.7/universal/version-negotiation.yaml +0 -130
- package/compliance/cache/3.1.0-beta.7/universal/webhook-emission.yaml +0 -411
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-bulk-webhooks.yaml +0 -82
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-product-webhooks.yaml +0 -83
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-products.yaml +0 -151
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-signal-webhooks.yaml +0 -83
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-signals.yaml +0 -149
- package/dist/lib/types/v3-1-beta/index.d.mts +0 -1
- package/dist/lib/types/v3-1-beta/index.d.ts +0 -1
- package/dist/lib/types/v3-1-beta/index.mjs +0 -1
- package/dist/lib/types/v3-1-beta/tools.generated.d.mts +0 -26788
- package/dist/lib/types/v3-1-beta/tools.generated.d.ts +0 -26788
- /package/dist/lib/{types/v3-1-beta/tools.generated.mjs → media-buy/action-types.mjs} +0 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
|
|
3
|
+
import { randomUUID } from 'node:crypto';
|
|
4
|
+
|
|
5
|
+
import { ADCP_VERSION, TaskExecutor, type AgentConfig, type TaskResult, type WebhookHandlerRequest } from '@adcp/sdk';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
STORE_NAMES,
|
|
9
|
+
assertSameAuthorization,
|
|
10
|
+
createDurableAgent,
|
|
11
|
+
DEFAULT_CONTINUATION_CLAIM_SECONDS,
|
|
12
|
+
PostgresOperationLedger,
|
|
13
|
+
TERMINAL_TASK_STATUSES,
|
|
14
|
+
type DurableBuyerDependencies,
|
|
15
|
+
} from './caller.js';
|
|
16
|
+
|
|
17
|
+
type PolledTask = Awaited<ReturnType<TaskExecutor['getTaskStatus']>>;
|
|
18
|
+
|
|
19
|
+
function registeredCallbackUrl(template: string, taskType: string, sellerId: string, operationId: string): string {
|
|
20
|
+
return template
|
|
21
|
+
.replaceAll('{task_type}', taskType)
|
|
22
|
+
.replaceAll('{agent_id}', sellerId)
|
|
23
|
+
.replaceAll('{operation_id}', operationId);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface WebhookResponse {
|
|
27
|
+
status(code: number): { json(body: unknown): void };
|
|
28
|
+
writeHead(code: number, headers: Record<string, string>): void;
|
|
29
|
+
end(body: string): void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function sendStaticError(response: WebhookResponse, status: number, message: string): void {
|
|
33
|
+
response.status(status).json({ error: message });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Fresh callback process. Route parameters are trusted only as lookup keys;
|
|
38
|
+
* the SDK then verifies them against the durable registration and signature.
|
|
39
|
+
*/
|
|
40
|
+
export async function receiveTaskWebhook(
|
|
41
|
+
dependencies: DurableBuyerDependencies,
|
|
42
|
+
request: WebhookHandlerRequest,
|
|
43
|
+
response: WebhookResponse
|
|
44
|
+
): Promise<void> {
|
|
45
|
+
const sellerId = request.params?.['agent_id'];
|
|
46
|
+
const taskType = request.params?.['task_type'];
|
|
47
|
+
const operationId = request.params?.['operation_id'];
|
|
48
|
+
if (!sellerId || !taskType || !operationId) {
|
|
49
|
+
sendStaticError(response, 400, 'Invalid callback route.');
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (taskType !== 'buy_products') {
|
|
53
|
+
sendStaticError(response, 404, 'Callback route not found.');
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const ledger = new PostgresOperationLedger(dependencies.pool);
|
|
58
|
+
const operation = await ledger.getBySdkOperation(sellerId, operationId);
|
|
59
|
+
if (!operation) {
|
|
60
|
+
sendStaticError(response, 404, 'Callback route not found.');
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const session = await dependencies.resolveSellerSession(operation);
|
|
64
|
+
if (!session) {
|
|
65
|
+
sendStaticError(response, 404, 'Callback route not found.');
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
assertSameAuthorization(operation, session);
|
|
70
|
+
} catch {
|
|
71
|
+
sendStaticError(response, 404, 'Callback route not found.');
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const seller = await createDurableAgent(dependencies, ledger, session);
|
|
75
|
+
const handler = seller.createWebhookHandler({
|
|
76
|
+
getTaskType: () => taskType,
|
|
77
|
+
getOperationId: () => operationId,
|
|
78
|
+
getRequestMethod: () => request.method,
|
|
79
|
+
// Construct from server-owned configuration, never Host/X-Forwarded-*.
|
|
80
|
+
getRequestUrl: () => registeredCallbackUrl(dependencies.callbackUrlTemplate, taskType, sellerId, operationId),
|
|
81
|
+
});
|
|
82
|
+
await handler(request, response);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Fresh polling process used when no callback arrives. */
|
|
86
|
+
export async function recoverByPolling(
|
|
87
|
+
dependencies: DurableBuyerDependencies,
|
|
88
|
+
logicalOperationId: string,
|
|
89
|
+
signal?: AbortSignal
|
|
90
|
+
): Promise<PolledTask> {
|
|
91
|
+
const ledger = new PostgresOperationLedger(dependencies.pool);
|
|
92
|
+
const operation = await ledger.get(logicalOperationId);
|
|
93
|
+
if (!operation) throw new Error('Unknown durable operation.');
|
|
94
|
+
const session = await dependencies.resolveSellerSession(operation);
|
|
95
|
+
if (!session) throw new Error('The durable operation is no longer authorized.');
|
|
96
|
+
assertSameAuthorization(operation, session);
|
|
97
|
+
if (!operation.sellerTaskId) throw new Error('The operation has no seller task handle to poll.');
|
|
98
|
+
const seller: AgentConfig = {
|
|
99
|
+
id: session.sellerId,
|
|
100
|
+
name: session.sellerId,
|
|
101
|
+
agent_uri: session.sellerUrl,
|
|
102
|
+
protocol: session.sellerProtocol,
|
|
103
|
+
auth_token: session.authToken,
|
|
104
|
+
};
|
|
105
|
+
const task = await new TaskExecutor({ adcpVersion: ADCP_VERSION }).getTaskStatus(
|
|
106
|
+
seller,
|
|
107
|
+
operation.sellerTaskId,
|
|
108
|
+
undefined,
|
|
109
|
+
signal
|
|
110
|
+
);
|
|
111
|
+
await ledger.observe(
|
|
112
|
+
logicalOperationId,
|
|
113
|
+
task.status === 'cancelled' ? 'canceled' : task.status,
|
|
114
|
+
task.result,
|
|
115
|
+
operation.sellerTaskId
|
|
116
|
+
);
|
|
117
|
+
return task;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Fresh A2A continuation process. The injected DeferredTaskStorage must be the
|
|
122
|
+
* same atomic, encrypted-at-rest store used by the caller. MCP pauses and A2A
|
|
123
|
+
* pauses without native continuation identity are intentionally nonresumable.
|
|
124
|
+
*/
|
|
125
|
+
export async function resumePendingInput(
|
|
126
|
+
dependencies: DurableBuyerDependencies,
|
|
127
|
+
logicalOperationId: string,
|
|
128
|
+
input: unknown
|
|
129
|
+
): Promise<TaskResult<unknown>> {
|
|
130
|
+
const ledger = new PostgresOperationLedger(dependencies.pool);
|
|
131
|
+
const operation = await ledger.get(logicalOperationId);
|
|
132
|
+
if (!operation) throw new Error('Unknown durable operation.');
|
|
133
|
+
const session = await dependencies.resolveSellerSession(operation);
|
|
134
|
+
if (!session) throw new Error('The durable operation is no longer authorized.');
|
|
135
|
+
assertSameAuthorization(operation, session);
|
|
136
|
+
if (!operation.deferredToken) throw new Error('The operation has no resumable deferred token.');
|
|
137
|
+
const seller = await createDurableAgent(dependencies, ledger, session);
|
|
138
|
+
const claimSeconds = dependencies.continuationClaimSeconds ?? DEFAULT_CONTINUATION_CLAIM_SECONDS;
|
|
139
|
+
const claimToken = await ledger.claimContinuation(logicalOperationId, claimSeconds);
|
|
140
|
+
let renewalFailure: unknown;
|
|
141
|
+
let renewal: Promise<void> | undefined;
|
|
142
|
+
const renewalTimer = setInterval(
|
|
143
|
+
() => {
|
|
144
|
+
if (renewal) return;
|
|
145
|
+
renewal = ledger
|
|
146
|
+
.renewContinuationClaim(logicalOperationId, claimToken, claimSeconds)
|
|
147
|
+
.catch(error => {
|
|
148
|
+
renewalFailure = error;
|
|
149
|
+
})
|
|
150
|
+
.finally(() => {
|
|
151
|
+
renewal = undefined;
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
Math.floor((claimSeconds * 1000) / 3)
|
|
155
|
+
);
|
|
156
|
+
renewalTimer.unref();
|
|
157
|
+
try {
|
|
158
|
+
const result = await seller.resumeDeferredTask<unknown>(operation.deferredToken, input);
|
|
159
|
+
clearInterval(renewalTimer);
|
|
160
|
+
await renewal;
|
|
161
|
+
if (renewalFailure) throw renewalFailure;
|
|
162
|
+
await ledger.observeByLogicalOperation(logicalOperationId, result, claimToken);
|
|
163
|
+
return result;
|
|
164
|
+
} finally {
|
|
165
|
+
clearInterval(renewalTimer);
|
|
166
|
+
await renewal;
|
|
167
|
+
await ledger.releaseContinuationClaim(logicalOperationId, claimToken);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface Publication {
|
|
172
|
+
logicalOperationId: string;
|
|
173
|
+
terminalFingerprint: string;
|
|
174
|
+
payload: unknown;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Publish one host outbox row. The downstream sink must atomically deduplicate
|
|
179
|
+
* logicalOperationId. That closes the unavoidable crash-after-send/before-ACK
|
|
180
|
+
* window without pretending a database and an external sink share a transaction.
|
|
181
|
+
*/
|
|
182
|
+
export async function publishOne(
|
|
183
|
+
dependencies: DurableBuyerDependencies,
|
|
184
|
+
publishIdempotently: (publication: Publication) => Promise<void>
|
|
185
|
+
): Promise<boolean> {
|
|
186
|
+
const claimToken = randomUUID();
|
|
187
|
+
const claimed = await dependencies.pool.query(
|
|
188
|
+
`WITH candidate AS (
|
|
189
|
+
SELECT deployment_namespace, logical_operation_id
|
|
190
|
+
FROM ${STORE_NAMES.publications}
|
|
191
|
+
WHERE deployment_namespace = $1 AND published_at IS NULL
|
|
192
|
+
AND (claim_expires_at IS NULL OR claim_expires_at <= clock_timestamp())
|
|
193
|
+
ORDER BY updated_at
|
|
194
|
+
FOR UPDATE SKIP LOCKED
|
|
195
|
+
LIMIT 1
|
|
196
|
+
)
|
|
197
|
+
UPDATE ${STORE_NAMES.publications} AS publication
|
|
198
|
+
SET claim_token = $2,
|
|
199
|
+
claim_expires_at = clock_timestamp() + INTERVAL '60 seconds',
|
|
200
|
+
attempts = attempts + 1,
|
|
201
|
+
updated_at = clock_timestamp()
|
|
202
|
+
FROM candidate
|
|
203
|
+
WHERE publication.deployment_namespace = candidate.deployment_namespace
|
|
204
|
+
AND publication.logical_operation_id = candidate.logical_operation_id
|
|
205
|
+
RETURNING publication.logical_operation_id, publication.terminal_fingerprint, publication.payload`,
|
|
206
|
+
[STORE_NAMES.deployment, claimToken]
|
|
207
|
+
);
|
|
208
|
+
const row = claimed.rows[0];
|
|
209
|
+
if (!row) return false;
|
|
210
|
+
const publication: Publication = {
|
|
211
|
+
logicalOperationId: String(row.logical_operation_id),
|
|
212
|
+
terminalFingerprint: String(row.terminal_fingerprint),
|
|
213
|
+
payload: row.payload,
|
|
214
|
+
};
|
|
215
|
+
try {
|
|
216
|
+
await publishIdempotently(publication);
|
|
217
|
+
const acknowledged = await dependencies.pool.query(
|
|
218
|
+
`UPDATE ${STORE_NAMES.publications}
|
|
219
|
+
SET published_at = clock_timestamp(), claim_token = NULL,
|
|
220
|
+
claim_expires_at = NULL, updated_at = clock_timestamp()
|
|
221
|
+
WHERE deployment_namespace = $1 AND logical_operation_id = $2
|
|
222
|
+
AND claim_token = $3 AND published_at IS NULL`,
|
|
223
|
+
[STORE_NAMES.deployment, publication.logicalOperationId, claimToken]
|
|
224
|
+
);
|
|
225
|
+
if (acknowledged.rowCount !== 1) throw new Error('Publication lease was lost before acknowledgement.');
|
|
226
|
+
return true;
|
|
227
|
+
} catch (error) {
|
|
228
|
+
await dependencies.pool.query(
|
|
229
|
+
`UPDATE ${STORE_NAMES.publications}
|
|
230
|
+
SET claim_token = NULL, claim_expires_at = NULL, updated_at = clock_timestamp()
|
|
231
|
+
WHERE deployment_namespace = $1 AND logical_operation_id = $2 AND claim_token = $3`,
|
|
232
|
+
[STORE_NAMES.deployment, publication.logicalOperationId, claimToken]
|
|
233
|
+
);
|
|
234
|
+
throw error;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function isTerminalTask(task: PolledTask): boolean {
|
|
239
|
+
return TERMINAL_TASK_STATUSES.has(task.status === 'cancelled' ? 'canceled' : task.status);
|
|
240
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Adapter-first Reliable Reporting Core
|
|
2
|
+
|
|
3
|
+
This is the minimal production assembly. The provider adapter returns only
|
|
4
|
+
real upstream results: `null` means not ready, `[]` is an observed zero-row
|
|
5
|
+
period, and a populated response carries the provider's rows and temporal
|
|
6
|
+
evidence. It never manufactures fallback delivery.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { Pool } from 'pg';
|
|
10
|
+
import { createAdcpServerFromPlatform } from '@adcp/sdk/server';
|
|
11
|
+
import { PostgresReportingLedgerStore } from '@adcp/sdk/reporting/ledger';
|
|
12
|
+
import { createReliableReportingService, type ReliableReportingAdapterV1 } from '@adcp/sdk/reporting/service';
|
|
13
|
+
|
|
14
|
+
// Your provider integration owns these immutable declarations and the real
|
|
15
|
+
// bounded API read. The fetch context contains only durable, non-secret
|
|
16
|
+
// routing IDs; derive OAuth/bearer credentials inside the provider client.
|
|
17
|
+
const providerAdapter: ReliableReportingAdapterV1 = {
|
|
18
|
+
sourceOffering: provider.reportingSourceOffering,
|
|
19
|
+
deliveryOffering: provider.reportingDeliveryOffering,
|
|
20
|
+
fetchSlice: (request, context) =>
|
|
21
|
+
provider.fetchReportingSlice(request, {
|
|
22
|
+
signal: context.signal,
|
|
23
|
+
networkId: String(context.sourceScope.network_id),
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
|
28
|
+
const reporting = createReliableReportingService({
|
|
29
|
+
store: new PostgresReportingLedgerStore(pool, {
|
|
30
|
+
acknowledgeIsolatedDatabase: true,
|
|
31
|
+
}),
|
|
32
|
+
adapters: { provider: providerAdapter },
|
|
33
|
+
contact: { name: 'Reporting operations', email: 'reporting@example.com' },
|
|
34
|
+
automatedRecoveryWindowSeconds: 86_400,
|
|
35
|
+
statusRetentionDays: 90, // enforce the same or longer retention in the ledger database
|
|
36
|
+
resolveSource: account => ({
|
|
37
|
+
adapterId: 'provider',
|
|
38
|
+
sourceScope: { network_id: account.ctx_metadata.provider.networkId },
|
|
39
|
+
sourceTimezone: account.ctx_metadata.provider.timezone,
|
|
40
|
+
}),
|
|
41
|
+
resolveCurrency: account => account.ctx_metadata.provider.currency,
|
|
42
|
+
// Authorization boundary: the constituents this account may report on, read
|
|
43
|
+
// from your booking system rather than echoed from the buyer's declaration.
|
|
44
|
+
resolveCoverage: async account => ({
|
|
45
|
+
constituents: await bookings.authorizedReportingConstituents(account.id),
|
|
46
|
+
}),
|
|
47
|
+
resolveConsumerId: ctx => {
|
|
48
|
+
if (!ctx.agent) throw new Error('Authenticated buyer-agent registry required');
|
|
49
|
+
return ctx.agent.agent_url;
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
await pool.query(reporting.setup.migrations[0]);
|
|
54
|
+
const installedPlatform = reporting.install(platform);
|
|
55
|
+
const server = createAdcpServerFromPlatform(installedPlatform, serverOptions);
|
|
56
|
+
|
|
57
|
+
// Pick exactly one operational ownership model.
|
|
58
|
+
reporting.start({
|
|
59
|
+
intervalMilliseconds: 60_000,
|
|
60
|
+
deploymentWide: true,
|
|
61
|
+
maxObligationsPerAccount: 500,
|
|
62
|
+
maxWorkerIterationsPerAccount: 100,
|
|
63
|
+
onError: error => operations.capture(error),
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
process.once('SIGTERM', async () => {
|
|
67
|
+
await reporting.stop();
|
|
68
|
+
await pool.end();
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
For tenant-partitioned scheduling, replace `deploymentWide: true` with
|
|
73
|
+
`accountIds: () => tenantDirectory.reportingAccountIds()`. A resolver must
|
|
74
|
+
return an array; it can never fall back to a deployment-wide scan, and an
|
|
75
|
+
empty or missing account ID is refused rather than widened. One account's
|
|
76
|
+
failed cycle reaches `onError` without skipping the accounts behind it. Configure an
|
|
77
|
+
authenticated `agentRegistry` before using the `ctx.agent` consumer identity
|
|
78
|
+
shown above.
|
|
79
|
+
|
|
80
|
+
`platform.accounts.upsert` must be installed: it is the native
|
|
81
|
+
`sync_accounts` implementation advertised by the Core capability. Its
|
|
82
|
+
authenticated reporting-configuration path calls `installConfiguration` as
|
|
83
|
+
shown below.
|
|
84
|
+
|
|
85
|
+
During authenticated `sync_accounts` handling, validate the requested
|
|
86
|
+
offering and resolve its media-buy/package denominator, then call:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
const frozen = await reporting.installConfiguration(resolvedConfiguration, {
|
|
90
|
+
account: ctx.account,
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`resolvedConfiguration` contains reporting semantics only: no account identity,
|
|
95
|
+
source scope, source contract, timezone, currency, `constituents`, or
|
|
96
|
+
`mediaBuyIds`. The denominator comes from `resolveCoverage`, so a buyer cannot
|
|
97
|
+
name another buyer's media buys on a shared upstream network. The service derives those only from the already-resolved account.
|
|
98
|
+
See [the ledger guide](../../docs/guides/REPORTING-LEDGER.md) for the complete
|
|
99
|
+
input shape, per-account scheduling, migration from manual wiring, and the
|
|
100
|
+
conformance helper.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// prettier-ignore
|
|
2
2
|
import { AdcpError, createAdcpServerFromPlatform, createIdempotencyStore, createInMemoryTaskRegistry,
|
|
3
|
-
definePlatform, memoryBackend, proposalTermsDigest,
|
|
4
|
-
type
|
|
3
|
+
definePlatform, memoryBackend, proposalTermsDigest, serve, verifyApiKey, type BuyProductsPayload,
|
|
4
|
+
type GetMediaBuysPayload, type ListProductsPayload } from '@adcp/sdk/server';
|
|
5
5
|
const TOKEN = process.env.ADCP_AUTH_TOKEN;
|
|
6
6
|
if (!TOKEN) throw new Error('Set ADCP_AUTH_TOKEN before starting the seller');
|
|
7
7
|
const ACCOUNT_ID = process.env.ADCP_ACCOUNT_ID;
|
|
@@ -80,12 +80,11 @@ const platform = definePlatform({
|
|
|
80
80
|
for (const field of ['measurement_terms', 'performance_standards'] as const) {
|
|
81
81
|
if (purchase[field] !== undefined && !sameTerms(purchase[field], published[field])) throw new AdcpError('TERMS_REJECTED', { message: `${field} must match the published product terms` });
|
|
82
82
|
}
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
...(targetingOverlay ? { targeting_overlay: targetingOverlay } : { targeting_overlay: undefined }) };
|
|
83
|
+
// Build the supported effective snapshot. Request-only targeting clear
|
|
84
|
+
// commands cannot be copied into accepted terms; overlays were rejected above.
|
|
85
|
+
return { product_id: purchase.product_id, pricing_option_id: purchase.pricing_option_id,
|
|
86
|
+
budget: purchase.budget, ...(purchase.context !== undefined && { context: purchase.context }),
|
|
87
|
+
pricing, ...published, start_time: resolvedStart, end_time: req.end_time };
|
|
89
88
|
}),
|
|
90
89
|
...(req.total_budget && { total_budget: req.total_budget }),
|
|
91
90
|
...(req.invoice_recipient && { invoice_recipient: req.invoice_recipient }),
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Existing-platform targeting boundary for AdCP 3.2.
|
|
3
|
+
*
|
|
4
|
+
* Mutation input is a command shape: omitted dimensions are unchanged, `null`
|
|
5
|
+
* clears, and a value replaces. Provider state and AdCP readback are strict
|
|
6
|
+
* state shapes, so they never retain or return a `null` command.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
applyTargetingInput,
|
|
11
|
+
hasTargetingClears,
|
|
12
|
+
type BuyProductsRequest,
|
|
13
|
+
type ControlMediaBuyRequest,
|
|
14
|
+
type ResolvedTargetingInput,
|
|
15
|
+
} from '@adcp/sdk';
|
|
16
|
+
|
|
17
|
+
type ProductPurchase = BuyProductsRequest['purchases'][number];
|
|
18
|
+
type PackageControl = NonNullable<ControlMediaBuyRequest['packages']>[number];
|
|
19
|
+
|
|
20
|
+
/** Canonical request shapes; derive these instead of copying generated types. */
|
|
21
|
+
export type CreateTargetingInput = ProductPurchase['targeting_overlay'];
|
|
22
|
+
export type UpdateTargetingInput = PackageControl['targeting_overlay'];
|
|
23
|
+
export type AcceptedTargeting = ResolvedTargetingInput<NonNullable<CreateTargetingInput>>;
|
|
24
|
+
|
|
25
|
+
type ProviderTargetingField = 'countryCodes' | 'metroCodes' | 'languageCodes' | 'keywordTargets' | 'negativeKeywords';
|
|
26
|
+
|
|
27
|
+
/** One concrete translation into an existing provider's mutation language. */
|
|
28
|
+
export type ProviderTargetingOperation =
|
|
29
|
+
| { kind: 'set'; field: ProviderTargetingField; value: unknown }
|
|
30
|
+
| { kind: 'clear'; field: ProviderTargetingField };
|
|
31
|
+
|
|
32
|
+
export interface ExistingProviderClient {
|
|
33
|
+
/**
|
|
34
|
+
* Atomically applies the exact supplied values or rejects the whole call;
|
|
35
|
+
* omitted dimensions never appear. If a provider normalizes accepted values,
|
|
36
|
+
* change this seam to return its canonical readback and persist that instead.
|
|
37
|
+
*/
|
|
38
|
+
applyPackageTargeting(packageId: string, operations: readonly ProviderTargetingOperation[]): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ExistingTargetingStore {
|
|
42
|
+
readAcceptedTargeting(packageId: string): Promise<AcceptedTargeting | undefined>;
|
|
43
|
+
/** Persist only after the provider accepted the replacement. */
|
|
44
|
+
saveAcceptedTargeting(packageId: string, targeting: AcceptedTargeting | undefined): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export class UnsupportedTargetingClearError extends Error {
|
|
48
|
+
readonly field: string;
|
|
49
|
+
|
|
50
|
+
constructor(field: string) {
|
|
51
|
+
super(`The provider cannot clear targeting dimension ${field}`);
|
|
52
|
+
this.name = 'UnsupportedTargetingClearError';
|
|
53
|
+
this.field = field;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export class UnsupportedTargetingDimensionError extends Error {
|
|
58
|
+
readonly field: string;
|
|
59
|
+
|
|
60
|
+
constructor(field: string) {
|
|
61
|
+
super(`The provider adapter does not translate targeting dimension ${field}`);
|
|
62
|
+
this.name = 'UnsupportedTargetingDimensionError';
|
|
63
|
+
this.field = field;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const PROVIDER_FIELD_BY_DIMENSION: Readonly<Record<string, ProviderTargetingField>> = {
|
|
68
|
+
geo_countries: 'countryCodes',
|
|
69
|
+
geo_metros: 'metroCodes',
|
|
70
|
+
language: 'languageCodes',
|
|
71
|
+
keyword_targets: 'keywordTargets',
|
|
72
|
+
negative_keywords: 'negativeKeywords',
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Preserve nullable commands while translating to provider operations. Add a
|
|
77
|
+
* provider mapping here before advertising support for another dimension.
|
|
78
|
+
*/
|
|
79
|
+
export function toProviderTargetingOperations(
|
|
80
|
+
input: object | undefined,
|
|
81
|
+
clearableDimensions: ReadonlySet<string>,
|
|
82
|
+
fieldPrefix: string
|
|
83
|
+
): ProviderTargetingOperation[] {
|
|
84
|
+
if (input === undefined) return [];
|
|
85
|
+
|
|
86
|
+
const operations: ProviderTargetingOperation[] = [];
|
|
87
|
+
for (const [dimension, value] of Object.entries(input)) {
|
|
88
|
+
if (value === undefined) continue;
|
|
89
|
+
const field = PROVIDER_FIELD_BY_DIMENSION[dimension];
|
|
90
|
+
if (!field) throw new UnsupportedTargetingDimensionError(`${fieldPrefix}.${dimension}`);
|
|
91
|
+
if (value === null) {
|
|
92
|
+
if (!clearableDimensions.has(dimension)) {
|
|
93
|
+
throw new UnsupportedTargetingClearError(`${fieldPrefix}.${dimension}`);
|
|
94
|
+
}
|
|
95
|
+
operations.push({ kind: 'clear', field });
|
|
96
|
+
} else {
|
|
97
|
+
operations.push({ kind: 'set', field, value });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return operations;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Thin orchestration around application-owned provider and durable-store
|
|
105
|
+
* adapters. The outer control handler must serialize/CAS the read-provider-save
|
|
106
|
+
* block using the request revision. A production store should also reconcile a
|
|
107
|
+
* provider success if its subsequent local commit fails.
|
|
108
|
+
*/
|
|
109
|
+
export class ExistingPlatformTargeting {
|
|
110
|
+
constructor(
|
|
111
|
+
private readonly provider: ExistingProviderClient,
|
|
112
|
+
private readonly store: ExistingTargetingStore,
|
|
113
|
+
/** Dimensions that both product policy and the provider allow clearing. */
|
|
114
|
+
private readonly clearableDimensions: ReadonlySet<string>
|
|
115
|
+
) {}
|
|
116
|
+
|
|
117
|
+
async create(
|
|
118
|
+
packageId: string,
|
|
119
|
+
configuredProductTargeting: AcceptedTargeting | undefined,
|
|
120
|
+
input: CreateTargetingInput
|
|
121
|
+
): Promise<AcceptedTargeting | undefined> {
|
|
122
|
+
const operations = toProviderTargetingOperations(input, this.clearableDimensions, 'purchases[].targeting_overlay');
|
|
123
|
+
if (operations.length > 0) await this.provider.applyPackageTargeting(packageId, operations);
|
|
124
|
+
|
|
125
|
+
// Start with the selected product's strict defaults: omission inherits a
|
|
126
|
+
// default, null suppresses it, and a value replaces it. The provider has
|
|
127
|
+
// now executed every explicit command, so this result is safe to persist.
|
|
128
|
+
const accepted = applyTargetingInput(configuredProductTargeting, input);
|
|
129
|
+
await this.store.saveAcceptedTargeting(packageId, accepted);
|
|
130
|
+
return accepted;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
async update(packageId: string, input: UpdateTargetingInput): Promise<AcceptedTargeting | undefined> {
|
|
134
|
+
const prior = await this.store.readAcceptedTargeting(packageId);
|
|
135
|
+
|
|
136
|
+
// Omitted targeting is a true no-op: do not call the provider or rewrite
|
|
137
|
+
// durable state. This differs from an explicit `null` inside the overlay.
|
|
138
|
+
if (input === undefined) return prior;
|
|
139
|
+
|
|
140
|
+
const operations = toProviderTargetingOperations(input, this.clearableDimensions, 'packages[].targeting_overlay');
|
|
141
|
+
if (operations.length > 0) await this.provider.applyPackageTargeting(packageId, operations);
|
|
142
|
+
const accepted = applyTargetingInput(prior, input);
|
|
143
|
+
await this.store.saveAcceptedTargeting(packageId, accepted);
|
|
144
|
+
return accepted;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** AdCP response handlers read this strict state; no request command leaks. */
|
|
148
|
+
async readback(packageId: string): Promise<AcceptedTargeting | undefined> {
|
|
149
|
+
const targeting = await this.store.readAcceptedTargeting(packageId);
|
|
150
|
+
if (hasTargetingClears(targeting)) throw new Error('Durable targeting state contains a request-only clear command');
|
|
151
|
+
return targeting;
|
|
152
|
+
}
|
|
153
|
+
}
|