@adcp/sdk 8.1.0-beta.13 → 8.1.0-beta.14
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/README.md +1 -1
- package/bin/adcp-registry.js +2 -2
- package/dist/lib/canonical-references/index.d.ts +107 -0
- package/dist/lib/canonical-references/index.d.ts.map +1 -0
- package/dist/lib/canonical-references/index.js +551 -0
- package/dist/lib/canonical-references/index.js.map +1 -0
- package/dist/lib/core/ConversationTypes.d.ts +7 -0
- package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
- package/dist/lib/core/ProtocolResponseParser.d.ts +10 -0
- package/dist/lib/core/ProtocolResponseParser.d.ts.map +1 -1
- package/dist/lib/core/ProtocolResponseParser.js +110 -0
- package/dist/lib/core/ProtocolResponseParser.js.map +1 -1
- package/dist/lib/core/ResponseValidator.d.ts +2 -0
- package/dist/lib/core/ResponseValidator.d.ts.map +1 -1
- package/dist/lib/core/ResponseValidator.js +3 -3
- package/dist/lib/core/ResponseValidator.js.map +1 -1
- package/dist/lib/core/TaskExecutor.d.ts +2 -0
- package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
- package/dist/lib/core/TaskExecutor.js +32 -8
- package/dist/lib/core/TaskExecutor.js.map +1 -1
- package/dist/lib/index.d.ts +5 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +27 -11
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/mock-server/creative-ad-server/server.d.ts +2 -0
- package/dist/lib/mock-server/creative-ad-server/server.d.ts.map +1 -1
- package/dist/lib/mock-server/creative-ad-server/server.js +37 -1
- package/dist/lib/mock-server/creative-ad-server/server.js.map +1 -1
- package/dist/lib/mock-server/creative-template/server.d.ts +2 -0
- package/dist/lib/mock-server/creative-template/server.d.ts.map +1 -1
- package/dist/lib/mock-server/creative-template/server.js +29 -2
- package/dist/lib/mock-server/creative-template/server.js.map +1 -1
- package/dist/lib/mock-server/index.d.ts +10 -1
- package/dist/lib/mock-server/index.d.ts.map +1 -1
- package/dist/lib/mock-server/index.js +38 -8
- package/dist/lib/mock-server/index.js.map +1 -1
- package/dist/lib/mock-server/sales-guaranteed/server.d.ts +2 -0
- package/dist/lib/mock-server/sales-guaranteed/server.d.ts.map +1 -1
- package/dist/lib/mock-server/sales-guaranteed/server.js +64 -7
- package/dist/lib/mock-server/sales-guaranteed/server.js.map +1 -1
- package/dist/lib/mock-server/sales-non-guaranteed/server.d.ts +2 -0
- package/dist/lib/mock-server/sales-non-guaranteed/server.d.ts.map +1 -1
- package/dist/lib/mock-server/sales-non-guaranteed/server.js +44 -1
- package/dist/lib/mock-server/sales-non-guaranteed/server.js.map +1 -1
- package/dist/lib/mock-server/sales-social/server.d.ts +2 -0
- package/dist/lib/mock-server/sales-social/server.d.ts.map +1 -1
- package/dist/lib/mock-server/sales-social/server.js +64 -4
- package/dist/lib/mock-server/sales-social/server.js.map +1 -1
- package/dist/lib/mock-server/scenario.d.ts +97 -0
- package/dist/lib/mock-server/scenario.d.ts.map +1 -0
- package/dist/lib/mock-server/scenario.js +464 -0
- package/dist/lib/mock-server/scenario.js.map +1 -0
- package/dist/lib/mock-server/signal-marketplace/server.d.ts +2 -0
- package/dist/lib/mock-server/signal-marketplace/server.d.ts.map +1 -1
- package/dist/lib/mock-server/signal-marketplace/server.js +29 -1
- package/dist/lib/mock-server/signal-marketplace/server.js.map +1 -1
- package/dist/lib/mock-server/sponsored-intelligence/server.d.ts +2 -0
- package/dist/lib/mock-server/sponsored-intelligence/server.d.ts.map +1 -1
- package/dist/lib/mock-server/sponsored-intelligence/server.js +47 -9
- package/dist/lib/mock-server/sponsored-intelligence/server.js.map +1 -1
- package/dist/lib/protocols/index.d.ts +4 -2
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +10 -3
- package/dist/lib/protocols/index.js.map +1 -1
- package/dist/lib/registry/index.d.ts +42 -16
- package/dist/lib/registry/index.d.ts.map +1 -1
- package/dist/lib/registry/index.js +191 -24
- package/dist/lib/registry/index.js.map +1 -1
- package/dist/lib/registry/types.d.ts +39 -8
- package/dist/lib/registry/types.d.ts.map +1 -1
- package/dist/lib/registry/types.generated.d.ts +2873 -699
- package/dist/lib/registry/types.generated.d.ts.map +1 -1
- package/dist/lib/registry/types.generated.js +2 -2
- package/dist/lib/registry/types.generated.js.map +1 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/a2a-adapter.d.ts +3 -1
- package/dist/lib/server/a2a-adapter.d.ts.map +1 -1
- package/dist/lib/server/a2a-adapter.js +11 -2
- package/dist/lib/server/a2a-adapter.js.map +1 -1
- package/dist/lib/server/adcp-server.js +32 -0
- package/dist/lib/server/adcp-server.js.map +1 -1
- package/dist/lib/server/create-adcp-server.d.ts +12 -6
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +72 -11
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/server/decisioning/account.d.ts +17 -17
- package/dist/lib/server/decisioning/account.d.ts.map +1 -1
- package/dist/lib/server/decisioning/account.js.map +1 -1
- package/dist/lib/server/decisioning/buyer-agent.d.ts +27 -10
- package/dist/lib/server/decisioning/buyer-agent.d.ts.map +1 -1
- package/dist/lib/server/decisioning/buyer-agent.js +25 -7
- package/dist/lib/server/decisioning/buyer-agent.js.map +1 -1
- package/dist/lib/server/decisioning/capabilities.d.ts +35 -7
- package/dist/lib/server/decisioning/capabilities.d.ts.map +1 -1
- package/dist/lib/server/decisioning/errors-typed.d.ts +18 -16
- package/dist/lib/server/decisioning/errors-typed.d.ts.map +1 -1
- package/dist/lib/server/decisioning/errors-typed.js +26 -24
- package/dist/lib/server/decisioning/errors-typed.js.map +1 -1
- package/dist/lib/server/decisioning/index.d.ts +1 -1
- package/dist/lib/server/decisioning/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.js +4 -2
- package/dist/lib/server/decisioning/index.js.map +1 -1
- package/dist/lib/server/decisioning/platform-helpers.d.ts +3 -2
- package/dist/lib/server/decisioning/platform-helpers.d.ts.map +1 -1
- package/dist/lib/server/decisioning/platform-helpers.js +3 -2
- package/dist/lib/server/decisioning/platform-helpers.js.map +1 -1
- package/dist/lib/server/decisioning/platform.d.ts +27 -10
- package/dist/lib/server/decisioning/platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +14 -10
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.js +374 -59
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/validate-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/validate-platform.js +3 -8
- package/dist/lib/server/decisioning/runtime/validate-platform.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.d.ts +9 -11
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.js +9 -11
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.js.map +1 -1
- package/dist/lib/server/operational-platform.d.ts +6 -8
- package/dist/lib/server/operational-platform.d.ts.map +1 -1
- package/dist/lib/server/operational-platform.js +4 -6
- package/dist/lib/server/operational-platform.js.map +1 -1
- package/dist/lib/server/test-controller-bridge.d.ts +14 -14
- package/dist/lib/server/test-controller-bridge.d.ts.map +1 -1
- package/dist/lib/server/test-controller-bridge.js +16 -16
- package/dist/lib/server/test-controller-bridge.js.map +1 -1
- package/dist/lib/server/test-controller.d.ts +31 -9
- package/dist/lib/server/test-controller.d.ts.map +1 -1
- package/dist/lib/server/test-controller.js +106 -54
- package/dist/lib/server/test-controller.js.map +1 -1
- package/dist/lib/signing/canonicalize.d.ts +0 -53
- package/dist/lib/signing/canonicalize.d.ts.map +1 -1
- package/dist/lib/signing/canonicalize.js +1 -33
- package/dist/lib/signing/canonicalize.js.map +1 -1
- package/dist/lib/signing/client.d.ts +5 -5
- package/dist/lib/signing/client.d.ts.map +1 -1
- package/dist/lib/signing/client.js +1 -10
- package/dist/lib/signing/client.js.map +1 -1
- package/dist/lib/signing/errors.d.ts +0 -11
- package/dist/lib/signing/errors.d.ts.map +1 -1
- package/dist/lib/signing/errors.js +1 -11
- package/dist/lib/signing/errors.js.map +1 -1
- package/dist/lib/signing/jwks-helpers.d.ts +2 -4
- package/dist/lib/signing/jwks-helpers.d.ts.map +1 -1
- package/dist/lib/signing/jwks-helpers.js +9 -0
- package/dist/lib/signing/jwks-helpers.js.map +1 -1
- package/dist/lib/signing/provider.d.ts +11 -10
- package/dist/lib/signing/provider.d.ts.map +1 -1
- package/dist/lib/signing/request-context.d.ts +8 -11
- package/dist/lib/signing/request-context.d.ts.map +1 -1
- package/dist/lib/signing/request-context.js +7 -10
- package/dist/lib/signing/request-context.js.map +1 -1
- package/dist/lib/signing/server.d.ts +3 -4
- package/dist/lib/signing/server.d.ts.map +1 -1
- package/dist/lib/signing/server.js +1 -9
- package/dist/lib/signing/server.js.map +1 -1
- package/dist/lib/signing/signer-async.d.ts +2 -8
- package/dist/lib/signing/signer-async.d.ts.map +1 -1
- package/dist/lib/signing/signer-async.js +0 -12
- package/dist/lib/signing/signer-async.js.map +1 -1
- package/dist/lib/signing/signer.d.ts +4 -111
- package/dist/lib/signing/signer.d.ts.map +1 -1
- package/dist/lib/signing/signer.js +2 -98
- package/dist/lib/signing/signer.js.map +1 -1
- package/dist/lib/signing/testing.d.ts +10 -10
- package/dist/lib/signing/testing.d.ts.map +1 -1
- package/dist/lib/signing/testing.js +6 -13
- package/dist/lib/signing/testing.js.map +1 -1
- package/dist/lib/signing/types.d.ts +0 -36
- package/dist/lib/signing/types.d.ts.map +1 -1
- package/dist/lib/signing/types.js +1 -37
- package/dist/lib/signing/types.js.map +1 -1
- package/dist/lib/testing/agent-tester.d.ts +1 -0
- package/dist/lib/testing/agent-tester.d.ts.map +1 -1
- package/dist/lib/testing/agent-tester.js.map +1 -1
- package/dist/lib/testing/client.d.ts +1 -1
- package/dist/lib/testing/client.d.ts.map +1 -1
- package/dist/lib/testing/client.js +4 -2
- package/dist/lib/testing/client.js.map +1 -1
- package/dist/lib/testing/compliance/comply.d.ts +8 -0
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
- package/dist/lib/testing/compliance/comply.js +98 -7
- package/dist/lib/testing/compliance/comply.js.map +1 -1
- package/dist/lib/testing/compliance/spec-conformance.d.ts +6 -6
- package/dist/lib/testing/compliance/spec-conformance.d.ts.map +1 -1
- package/dist/lib/testing/compliance/spec-conformance.js +6 -6
- package/dist/lib/testing/compliance/spec-conformance.js.map +1 -1
- package/dist/lib/testing/compliance/summary.d.ts +5 -0
- package/dist/lib/testing/compliance/summary.d.ts.map +1 -1
- package/dist/lib/testing/compliance/summary.js +17 -0
- package/dist/lib/testing/compliance/summary.js.map +1 -1
- package/dist/lib/testing/comply-controller.d.ts +19 -0
- package/dist/lib/testing/comply-controller.d.ts.map +1 -1
- package/dist/lib/testing/comply-controller.js +11 -8
- package/dist/lib/testing/comply-controller.js.map +1 -1
- package/dist/lib/testing/index.d.ts +4 -3
- package/dist/lib/testing/index.d.ts.map +1 -1
- package/dist/lib/testing/index.js +13 -1
- package/dist/lib/testing/index.js.map +1 -1
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.d.ts +4 -0
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.js +881 -0
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.js.map +1 -0
- package/dist/lib/testing/storyboard/compliance.d.ts +6 -0
- package/dist/lib/testing/storyboard/compliance.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/compliance.js +8 -4
- package/dist/lib/testing/storyboard/compliance.js.map +1 -1
- package/dist/lib/testing/storyboard/index.d.ts +2 -1
- package/dist/lib/testing/storyboard/index.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/index.js +9 -1
- package/dist/lib/testing/storyboard/index.js.map +1 -1
- package/dist/lib/testing/storyboard/loader.d.ts +3 -2
- package/dist/lib/testing/storyboard/loader.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/loader.js +73 -2
- package/dist/lib/testing/storyboard/loader.js.map +1 -1
- package/dist/lib/testing/storyboard/path.d.ts +21 -0
- package/dist/lib/testing/storyboard/path.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/path.js +86 -0
- package/dist/lib/testing/storyboard/path.js.map +1 -1
- package/dist/lib/testing/storyboard/rate-limit-trip.d.ts +92 -0
- package/dist/lib/testing/storyboard/rate-limit-trip.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/rate-limit-trip.js +276 -0
- package/dist/lib/testing/storyboard/rate-limit-trip.js.map +1 -0
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +361 -28
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/seeding.d.ts +5 -4
- package/dist/lib/testing/storyboard/seeding.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/seeding.js +23 -3
- package/dist/lib/testing/storyboard/seeding.js.map +1 -1
- package/dist/lib/testing/storyboard/types.d.ts +108 -20
- package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/types.js +1 -0
- package/dist/lib/testing/storyboard/types.js.map +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +18 -0
- package/dist/lib/testing/storyboard/validations.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/validations.js +238 -33
- package/dist/lib/testing/storyboard/validations.js.map +1 -1
- package/dist/lib/testing/test-controller.d.ts +17 -25
- package/dist/lib/testing/test-controller.d.ts.map +1 -1
- package/dist/lib/testing/test-controller.js.map +1 -1
- package/dist/lib/testing/types.d.ts +13 -1
- package/dist/lib/testing/types.d.ts.map +1 -1
- package/dist/lib/types/check-governance.d.ts +1 -1
- package/dist/lib/types/comply-test-controller.d.ts +243 -3
- package/dist/lib/types/core.generated.d.ts +261 -21
- package/dist/lib/types/core.generated.d.ts.map +1 -1
- package/dist/lib/types/core.generated.js +1 -1
- package/dist/lib/types/create-media-buy.d.ts +107 -3
- package/dist/lib/types/error-codes.d.ts +2 -2
- package/dist/lib/types/get-adcp-capabilities.d.ts +1 -1
- package/dist/lib/types/get-media-buys.d.ts +107 -3
- package/dist/lib/types/get-plan-audit-logs.d.ts +1 -1
- package/dist/lib/types/get-products.d.ts +104 -3
- package/dist/lib/types/inline-enums.generated.d.ts +27 -17
- package/dist/lib/types/inline-enums.generated.d.ts.map +1 -1
- package/dist/lib/types/inline-enums.generated.js +39 -28
- package/dist/lib/types/inline-enums.generated.js.map +1 -1
- package/dist/lib/types/manifest.generated.d.ts +7 -4
- package/dist/lib/types/manifest.generated.d.ts.map +1 -1
- package/dist/lib/types/manifest.generated.js +2 -2
- package/dist/lib/types/manifest.generated.js.map +1 -1
- package/dist/lib/types/report-plan-outcome.d.ts +1 -1
- package/dist/lib/types/schemas.generated.d.ts +714 -193
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +194 -79
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/sync-plans.d.ts +1 -1
- package/dist/lib/types/tools.generated.d.ts +331 -28
- package/dist/lib/types/tools.generated.d.ts.map +1 -1
- package/dist/lib/types/update-media-buy.d.ts +107 -3
- package/dist/lib/types/v3-1-beta/tools.generated.d.ts +20 -0
- package/dist/lib/types/v3-1-beta/tools.generated.d.ts.map +1 -1
- package/dist/lib/upstream-recorder/constants.d.ts +2 -0
- package/dist/lib/upstream-recorder/constants.d.ts.map +1 -0
- package/dist/lib/upstream-recorder/constants.js +5 -0
- package/dist/lib/upstream-recorder/constants.js.map +1 -0
- package/dist/lib/upstream-recorder/index.d.ts +20 -10
- package/dist/lib/upstream-recorder/index.d.ts.map +1 -1
- package/dist/lib/upstream-recorder/index.js +21 -10
- package/dist/lib/upstream-recorder/index.js.map +1 -1
- package/dist/lib/upstream-recorder/recorder.d.ts +65 -0
- package/dist/lib/upstream-recorder/recorder.d.ts.map +1 -1
- package/dist/lib/upstream-recorder/recorder.js +500 -47
- package/dist/lib/upstream-recorder/recorder.js.map +1 -1
- package/dist/lib/upstream-recorder/types.d.ts +109 -13
- package/dist/lib/upstream-recorder/types.d.ts.map +1 -1
- package/dist/lib/upstream-recorder/types.js.map +1 -1
- package/dist/lib/utils/adcp-version-config.d.ts +1 -0
- package/dist/lib/utils/adcp-version-config.d.ts.map +1 -1
- package/dist/lib/utils/adcp-version-config.js +21 -0
- package/dist/lib/utils/adcp-version-config.js.map +1 -1
- package/dist/lib/utils/capability-rollups.d.ts +5 -5
- package/dist/lib/utils/capability-rollups.d.ts.map +1 -1
- package/dist/lib/utils/capability-rollups.js +1 -1
- package/dist/lib/utils/capability-rollups.js.map +1 -1
- package/dist/lib/utils/json-depth.d.ts +2 -0
- package/dist/lib/utils/json-depth.d.ts.map +1 -0
- package/dist/lib/utils/json-depth.js +5 -0
- package/dist/lib/utils/json-depth.js.map +1 -0
- package/dist/lib/utils/media-buy-delivery-notification-builders.d.ts +1 -1
- package/dist/lib/utils/media-buy-delivery-notification-builders.d.ts.map +1 -1
- package/dist/lib/utils/preview-creative-builders.d.ts +1 -1
- package/dist/lib/utils/preview-creative-builders.d.ts.map +1 -1
- package/dist/lib/utils/redact-secrets.d.ts +13 -2
- package/dist/lib/utils/redact-secrets.d.ts.map +1 -1
- package/dist/lib/utils/redact-secrets.js +40 -13
- package/dist/lib/utils/redact-secrets.js.map +1 -1
- package/dist/lib/utils/response-schemas.d.ts +1 -0
- package/dist/lib/utils/response-schemas.d.ts.map +1 -1
- package/dist/lib/utils/response-schemas.js +15 -0
- package/dist/lib/utils/response-schemas.js.map +1 -1
- package/dist/lib/utils/response-unwrapper.d.ts +2 -1
- package/dist/lib/utils/response-unwrapper.d.ts.map +1 -1
- package/dist/lib/utils/response-unwrapper.js +11 -3
- package/dist/lib/utils/response-unwrapper.js.map +1 -1
- package/dist/lib/utils/tool-request-schemas.d.ts +31 -1
- package/dist/lib/utils/tool-request-schemas.d.ts.map +1 -1
- package/dist/lib/v2/format-schema/fetch.d.ts +13 -5
- package/dist/lib/v2/format-schema/fetch.d.ts.map +1 -1
- package/dist/lib/v2/format-schema/fetch.js +27 -16
- package/dist/lib/v2/format-schema/fetch.js.map +1 -1
- package/dist/lib/v2/format-schema/index.d.ts +13 -11
- package/dist/lib/v2/format-schema/index.d.ts.map +1 -1
- package/dist/lib/v2/format-schema/index.js +19 -12
- package/dist/lib/v2/format-schema/index.js.map +1 -1
- package/dist/lib/v2/format-schema/resolver.d.ts +71 -0
- package/dist/lib/v2/format-schema/resolver.d.ts.map +1 -0
- package/dist/lib/v2/format-schema/resolver.js +284 -0
- package/dist/lib/v2/format-schema/resolver.js.map +1 -0
- package/dist/lib/v2/format-schema/sandbox-refs.d.ts +6 -0
- package/dist/lib/v2/format-schema/sandbox-refs.d.ts.map +1 -1
- package/dist/lib/v2/format-schema/sandbox-refs.js +36 -15
- package/dist/lib/v2/format-schema/sandbox-refs.js.map +1 -1
- package/dist/lib/validation/schema-loader.d.ts.map +1 -1
- package/dist/lib/validation/schema-loader.js +48 -3
- package/dist/lib/validation/schema-loader.js.map +1 -1
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/docs/guides/BUILD-AN-AGENT.md +7 -7
- package/docs/guides/CANONICAL-REFERENCE-RESOLVER.md +75 -0
- package/docs/llms.txt +37 -8
- package/examples/README.md +29 -16
- package/examples/hello_creative_adapter_ad_server.ts +8 -2
- package/examples/hello_seller_adapter_guaranteed.ts +26 -18
- package/examples/hello_seller_adapter_multi_tenant.ts +6 -6
- package/examples/hello_seller_adapter_social.ts +80 -4
- package/examples/hello_si_adapter_brand.ts +10 -21
- package/examples/hello_signals_adapter_marketplace.ts +184 -9
- package/examples/proxy-seller-snap/README.md +47 -0
- package/examples/proxy-seller-snap/index.ts +321 -0
- package/package.json +19 -4
- package/skills/build-creative-agent/SKILL.md +1 -15
- package/skills/build-decisioning-platform/SKILL.md +6 -1
- package/skills/build-seller-agent/SKILL.md +5 -2
- package/skills/build-si-agent/SKILL.md +2 -2
- package/skills/call-adcp-agent/SKILL.md +4 -1
- package/dist/lib/signing/response-verifier.d.ts +0 -105
- package/dist/lib/signing/response-verifier.d.ts.map +0 -1
- package/dist/lib/signing/response-verifier.js +0 -271
- package/dist/lib/signing/response-verifier.js.map +0 -1
package/examples/README.md
CHANGED
|
@@ -4,22 +4,23 @@ This directory contains practical examples of how to use the `@adcp/sdk` library
|
|
|
4
4
|
|
|
5
5
|
## Building an AdCP agent — fork-target reference adapters
|
|
6
6
|
|
|
7
|
-
Pick the example whose AdCP role and specialism most closely
|
|
8
|
-
|
|
9
|
-
| If you're claiming… | Fork
|
|
10
|
-
| ---------------------------------------------------------------- |
|
|
11
|
-
| `signal-marketplace` / `signal-owned` | `hello_signals_adapter_marketplace.ts`
|
|
12
|
-
| `creative-template` | `hello_creative_adapter_template.ts`
|
|
13
|
-
| `creative-generative` | `hello_creative_adapter_template.ts`
|
|
14
|
-
| `creative-ad-server` | `hello_creative_adapter_ad_server.ts`
|
|
7
|
+
Pick the example whose AdCP role and specialism most closely matches what you're building, fork it, replace the `// SWAP:` markers, and follow the `FORK CHECKLIST` block for the unmarked but load-bearing constants. The `hello_*_adapter_*` examples are paired with the three-gate CI test (strict tsc / storyboard / upstream-traffic) where a matching mock server exists; examples without one are called out below with the narrower runtime coverage they currently have. `proxy-seller-snap/` is a lighter bridge-pattern fork target: it proves seed-bridge wiring and must be paired with your live-OAuth sandbox runner for upstream health.
|
|
8
|
+
|
|
9
|
+
| If you're claiming… | Fork | Then… |
|
|
10
|
+
| ---------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `signal-marketplace` / `signal-owned` | `hello_signals_adapter_marketplace.ts` | as-is for marketplace; `signal-owned` adopters drop the marketplace-specific tax/rev-share fields |
|
|
12
|
+
| `creative-template` | `hello_creative_adapter_template.ts` | as-is — single-tenant; production adopters add per-tenant workspace binding (see SWAP markers) |
|
|
13
|
+
| `creative-generative` | `hello_creative_adapter_template.ts` | replace template-driven `buildCreative` with brief-driven generation; keep the `previewCreative` shape |
|
|
14
|
+
| `creative-ad-server` | `hello_creative_adapter_ad_server.ts` | as-is — covers the stateful library + tag generation + macro substitution + delivery reporting flow |
|
|
15
15
|
| `sales-non-guaranteed` | `hello_seller_adapter_non_guaranteed.ts` | as-is — covers sync confirmation, floor pricing, spend-only forecast, pacing propagation |
|
|
16
|
-
| `sales-guaranteed` | `hello_seller_adapter_guaranteed.ts`
|
|
17
|
-
| `sales-broadcast-tv` | `hello_seller_adapter_guaranteed.ts`
|
|
18
|
-
| `sales-streaming-tv` | `hello_seller_adapter_guaranteed.ts`
|
|
19
|
-
| `sales-social` | `hello_seller_adapter_social.ts`
|
|
20
|
-
|
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
16
|
+
| `sales-guaranteed` | `hello_seller_adapter_guaranteed.ts` | as-is — covers the HITL flow |
|
|
17
|
+
| `sales-broadcast-tv` | `hello_seller_adapter_guaranteed.ts` | replace `audience_targeting` with broadcast-DMA targeting; replace `Product.channels` with `linear_tv` |
|
|
18
|
+
| `sales-streaming-tv` | `hello_seller_adapter_guaranteed.ts` | adjust `Product.channels` to `ctv` |
|
|
19
|
+
| `sales-social` | `hello_seller_adapter_social.ts` | as-is |
|
|
20
|
+
| Proxy-shaped seller / DSP / walled garden | `proxy-seller-snap/` | start here when reads proxy an upstream platform API and storyboard seeds need `TestControllerBridge` to appear in sandbox reads |
|
|
21
|
+
| `sales-catalog-driven` | `hello_seller_adapter_social.ts` | promote `syncCatalogs` to a real catalog ingestion + `getProducts` reads from the catalog |
|
|
22
|
+
| `audience-sync` | `hello_seller_adapter_social.ts` | strip everything except `syncAudiences` + `pollAudienceStatuses`; this is the standalone audience-sync seller pattern |
|
|
23
|
+
| `governance-spend-authority` / `property-lists` / `brand-rights` | `hello_seller_adapter_multi_tenant.ts` | as-is — multi-specialism + multi-tenant agency / holdco shape; closes adcp-client#1332 (governance) and adcp-client#1334 (brand-rights). Single-specialism adopters fork the relevant handler block out of the same file. |
|
|
23
24
|
|
|
24
25
|
Naming convention: `hello_<role>_adapter_<specialism>.ts` where `<role>` is the AdCP protocol layer (`seller` for `media-buy`, `creative` for `creative`, `signals` for `signals`, `governance` for `governance`, `brand` for `brand`). `<specialism>` strips the role-implied prefix (so `creative-template` → `_template`, `sales-guaranteed` → `_guaranteed`). The multi-tenant holdco adapter sits outside this convention because it spans multiple roles (governance + brand-rights + property-lists) — naming follows the deployment shape rather than a single role.
|
|
25
26
|
|
|
@@ -39,6 +40,16 @@ Real platforms typically claim more than one specialism. Claim a specialism only
|
|
|
39
40
|
|
|
40
41
|
> Each specialism runs its own compliance storyboard independently — no joint multi-specialism storyboard exists yet. For cross-protocol bundles (e.g. DSP-side seller spans `media-buy` + `signals`), run each protocol's storyboard separately.
|
|
41
42
|
|
|
43
|
+
## AdCP 3.1 commercial-state model
|
|
44
|
+
|
|
45
|
+
Keep three axes separate when forking a Hello agent:
|
|
46
|
+
|
|
47
|
+
- `capabilities.account.supported_billing` is the seller-wide wire capability. Set `capabilities.supportedBillings` on decisioning-platform examples when the seller accepts `operator`, `agent`, or `advertiser` billing at all.
|
|
48
|
+
- `BuyerAgentRegistry` is the per-caller commercial relationship. `hello_signals_adapter_marketplace.ts`, `hello_seller_adapter_social.ts`, and `hello_seller_adapter_multi_tenant.ts` show the durable buyer-agent identity seam; `ctx.agent` is the trusted record for status, sandbox-only reach, tenant routing, and billing gates.
|
|
49
|
+
- `fixtures.buyer_agents[]` plus `seed_buyer_agent` is the compliance setup path. The signals Hello agent wires a test-only overlay so a 3.1 storyboard can vary Addie's `status`, `sandbox_only`, or `billing_capabilities` without inventing a special bearer-token prefix. Production agents should back this with their onboarding ledger and invalidate the registry cache after mutation.
|
|
50
|
+
|
|
51
|
+
The framework resolves buyer agents, status-gates them, and enforces `sync_accounts.billing` against both seller-wide `supportedBillings` and the resolved `ctx.agent.billing_capabilities`. The social Hello agent includes a buyer-agent ledger so the framework can exercise the per-agent billing gate; do not fork a separate bearer-token prefix or unscoped test-only shortcut.
|
|
52
|
+
|
|
42
53
|
## Examples
|
|
43
54
|
|
|
44
55
|
### Basic Usage
|
|
@@ -50,7 +61,7 @@ Real platforms typically claim more than one specialism. Claim a specialism only
|
|
|
50
61
|
|
|
51
62
|
### Multi-specialism + multi-tenant (account-routed)
|
|
52
63
|
|
|
53
|
-
`hello_seller_adapter_multi_tenant.ts` demonstrates the **account-routed** multi-tenant model: one server hosts `governance-spend-authority`, `property-lists`, and `brand-rights` for two distinct tenants whose data never crosses. The agency / holdco hub shape. Two resolution paths:
|
|
64
|
+
`hello_seller_adapter_multi_tenant.ts` demonstrates the **account-routed** multi-tenant model: one server hosts `governance-spend-authority`, `property-lists`, and `brand-rights` for two distinct tenants whose data never crosses. The agency / holdco hub shape. It has strict typecheck coverage plus a direct MCP runtime test for buyer-agent-derived no-account tenant routing; full storyboard/façade gates will land once governance / brand-rights mock servers exist. Two resolution paths:
|
|
54
65
|
|
|
55
66
|
- Tools that carry `account` (governance, property-lists, sync_accounts, sync_governance) → `accounts.resolve(ref)` reads `ref.operator` and routes to the matching tenant. Same buyer credential can hit different tenants by varying `account.operator`.
|
|
56
67
|
- Tools without `account` (`get_brand_identity`, `get_rights`) → `accounts.resolve(undefined, ctx)` reads the resolved buyer agent's home tenant from `ctx.agent`. Different credentials → different views of the catalog without any account field on the wire.
|
|
@@ -68,6 +79,8 @@ Start with `createComplyController` (`comply-controller-seller.ts`). Switch to `
|
|
|
68
79
|
|
|
69
80
|
Both wire `comply_test_controller`, both auto-emit the `capabilities.compliance_testing.scenarios` block, both sit on the same primitives. Pick by state shape, not by perceived helper tier.
|
|
70
81
|
|
|
82
|
+
For proxy-shaped sellers where reads go to an upstream platform API, start with **`proxy-seller-snap/`**. It shows the seed bridge pattern: `comply_test_controller` writes storyboard fixtures into a session store, production read handlers call the Snap-shaped client, and `bridgeFromSessionStore` merges seeded products, creatives, and governance lists into sandbox responses after the handler succeeds.
|
|
83
|
+
|
|
71
84
|
Run `npm run typecheck:examples` to validate both examples against the built `dist/`.
|
|
72
85
|
|
|
73
86
|
### Running Examples
|
|
@@ -378,17 +378,23 @@ class CreativeAdServerAdapter implements DecisioningPlatform<Record<string, neve
|
|
|
378
378
|
};
|
|
379
379
|
|
|
380
380
|
accounts: AccountStore<NetworkMeta> = {
|
|
381
|
-
resolve: async ref => {
|
|
381
|
+
resolve: async (ref, ctx) => {
|
|
382
382
|
// No-account tools (`previewCreative`, `listCreativeFormats`) hand
|
|
383
383
|
// `undefined` to resolve. Return the default-listing network so
|
|
384
|
-
// the format catalog query has tenant context.
|
|
384
|
+
// the format catalog query has tenant context. This worked example
|
|
385
|
+
// uses the same auth-derived path for the conformance runner's
|
|
386
|
+
// controller discovery, so authenticated ref-less calls are stamped
|
|
387
|
+
// sandbox. Production sellers replace this with a real principal →
|
|
388
|
+
// account lookup and only stamp sandbox for sandbox tenants.
|
|
385
389
|
if (!ref) {
|
|
390
|
+
if (!ctx?.authInfo) return null;
|
|
386
391
|
const network = await upstream.lookupNetwork(KNOWN_PUBLISHERS[0] ?? 'creative-network.example');
|
|
387
392
|
if (!network) return null;
|
|
388
393
|
return {
|
|
389
394
|
id: network.network_code,
|
|
390
395
|
name: network.display_name,
|
|
391
396
|
status: 'active',
|
|
397
|
+
mode: 'sandbox',
|
|
392
398
|
brand: { domain: network.adcp_publisher },
|
|
393
399
|
ctx_metadata: { network_code: network.network_code, publisher_domain: network.adcp_publisher },
|
|
394
400
|
};
|
|
@@ -104,8 +104,8 @@ const ADCP_AUTH_TOKEN = process.env['ADCP_AUTH_TOKEN'] ?? 'sk_harness_do_not_use
|
|
|
104
104
|
// (adcp#4028). The runner authenticates with this bearer to probe the
|
|
105
105
|
// seller's live-mode denial path. The resolver below stamps
|
|
106
106
|
// `mode: 'live'` on the matching principal so the framework gate inside
|
|
107
|
-
// `createAdcpServerFromPlatform`
|
|
108
|
-
//
|
|
107
|
+
// `createAdcpServerFromPlatform` hides `comply_test_controller` from that
|
|
108
|
+
// principal. Test-kit value pinned by
|
|
109
109
|
// `compliance/cache/<ver>/test-kits/acme-outdoor-live.yaml`.
|
|
110
110
|
//
|
|
111
111
|
// ⚠️ This bearer is published in the open-source SDK and in the public
|
|
@@ -528,6 +528,10 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
|
|
|
528
528
|
specialisms: ['sales-guaranteed'] as const,
|
|
529
529
|
channels: ['olv', 'ctv', 'display'] as const,
|
|
530
530
|
pricingModels: ['cpm'] as const,
|
|
531
|
+
// Storyboard account setup uses operator-billed settlement. Declare it
|
|
532
|
+
// explicitly so the framework-level sync_accounts commercial gate admits
|
|
533
|
+
// rows before this adapter resolves them to upstream network codes.
|
|
534
|
+
supportedBillings: ['operator', 'agent'] as const,
|
|
531
535
|
supportsProposals: false,
|
|
532
536
|
config: {},
|
|
533
537
|
// Declares the comply_test_controller surface so the conformance
|
|
@@ -571,24 +575,27 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
|
|
|
571
575
|
// (1) the cascade-scenario sandbox arm below, keyed by
|
|
572
576
|
// `ref.sandbox === true` and stamped with `mode: 'sandbox'`
|
|
573
577
|
// and a `${SANDBOX_ID_PREFIX}${network_code}` id.
|
|
574
|
-
// (2) the
|
|
578
|
+
// (2) the conformance principal path here, keyed by auth and
|
|
579
|
+
// stamped with `mode: 'sandbox'` but using the bare
|
|
580
|
+
// `network_code` id so tasks/get polls match direct-buy tasks.
|
|
581
|
+
// (3) the production path below, keyed by `ref.brand.domain`
|
|
575
582
|
// and stamped with the bare `network_code` id (no mode).
|
|
576
583
|
// The compliance runner exercises path (2) for the
|
|
577
584
|
// sales_guaranteed HITL flow (no `sandbox: true` on the create
|
|
578
585
|
// step's account), so the auth-derived ref-less fallback
|
|
579
|
-
// returns the matching
|
|
580
|
-
// sellers key this off `ctx.authInfo.credential.key_id`
|
|
581
|
-
// `client_id` against a real tenant store.
|
|
586
|
+
// returns the matching account id with sandbox principal mode here.
|
|
587
|
+
// Production sellers key this off `ctx.authInfo.credential.key_id`
|
|
588
|
+
// / `client_id` against a real tenant store.
|
|
582
589
|
const publisherDomain = 'acmeoutdoor.example';
|
|
583
590
|
const network = await upstream.lookupNetwork(publisherDomain);
|
|
584
591
|
if (!network) return null;
|
|
585
592
|
// Live-mode probe principal (comply_controller_mode_gate
|
|
586
593
|
// storyboard) — stamp `mode: 'live'` so the framework gate inside
|
|
587
|
-
// `createAdcpServerFromPlatform`
|
|
588
|
-
//
|
|
589
|
-
//
|
|
590
|
-
//
|
|
591
|
-
//
|
|
594
|
+
// `createAdcpServerFromPlatform` hides `comply_test_controller`
|
|
595
|
+
// from that principal. The probe never reaches a mutating dispatch
|
|
596
|
+
// path; the live-mode caller is denied before scenario execution.
|
|
597
|
+
// Production sellers source `mode` from their tenant store, not
|
|
598
|
+
// from the principal name.
|
|
592
599
|
//
|
|
593
600
|
// Detection: ResolvedAuthInfo doesn't surface the principal name
|
|
594
601
|
// directly (the framework propagates AuthPrincipal.principal as
|
|
@@ -602,7 +609,7 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
|
|
|
602
609
|
name: network.display_name,
|
|
603
610
|
status: 'active',
|
|
604
611
|
brand: { domain: network.adcp_publisher },
|
|
605
|
-
|
|
612
|
+
mode: isLiveModeProbe ? 'live' : 'sandbox',
|
|
606
613
|
ctx_metadata: {
|
|
607
614
|
network_code: network.network_code,
|
|
608
615
|
publisher_domain: network.adcp_publisher,
|
|
@@ -1246,10 +1253,11 @@ serve(
|
|
|
1246
1253
|
// `createAdcpServerFromPlatform` resolves the calling principal
|
|
1247
1254
|
// through `accounts.resolve` and admits only when the resolved
|
|
1248
1255
|
// account's `mode` is `'sandbox'` or `'mock'` (per `Account.mode`
|
|
1249
|
-
// in AdCP 6.7+). The
|
|
1250
|
-
//
|
|
1251
|
-
// refs flow through the live path with
|
|
1252
|
-
// `'live'`), so the framework gate
|
|
1256
|
+
// in AdCP 6.7+). The auth-derived conformance branch and the
|
|
1257
|
+
// cascade-scenario ref branch in `accounts.resolve` above stamp
|
|
1258
|
+
// `mode: 'sandbox'`; production refs flow through the live path with
|
|
1259
|
+
// the field unset (default `'live'`), so the framework gate hides the
|
|
1260
|
+
// controller for them.
|
|
1253
1261
|
// See `docs/proposals/lifecycle-state-and-sandbox-authority.md`.
|
|
1254
1262
|
complyTest: {
|
|
1255
1263
|
seed: {
|
|
@@ -1306,8 +1314,8 @@ serve(
|
|
|
1306
1314
|
[ADCP_AUTH_TOKEN]: { principal: 'compliance-runner' },
|
|
1307
1315
|
// Live-mode probe principal — see comply_controller_mode_gate
|
|
1308
1316
|
// storyboard. The resolver below stamps `mode: 'live'` when this
|
|
1309
|
-
// bearer is presented; the framework gate then
|
|
1310
|
-
// comply_test_controller
|
|
1317
|
+
// bearer is presented; the framework gate then hides
|
|
1318
|
+
// comply_test_controller from that principal.
|
|
1311
1319
|
[ADCP_LIVE_MODE_AUTH_TOKEN]: { principal: LIVE_MODE_PROBE_PRINCIPAL },
|
|
1312
1320
|
},
|
|
1313
1321
|
}),
|
|
@@ -486,12 +486,12 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
|
|
|
486
486
|
operator,
|
|
487
487
|
...(r?.brand?.domain && { brand: { domain: r.brand.domain } }),
|
|
488
488
|
ctx_metadata: { tenant_id: tenant.id, display_name: tenant.display_name },
|
|
489
|
-
// SWAP: read sandbox flag from your backing store.
|
|
490
|
-
//
|
|
491
|
-
//
|
|
492
|
-
//
|
|
493
|
-
//
|
|
494
|
-
sandbox: r
|
|
489
|
+
// SWAP: read sandbox flag from your backing store. Account-routed
|
|
490
|
+
// calls default false unless the buyer explicitly sets
|
|
491
|
+
// `account.sandbox = true`. No-account demo calls synthesize an
|
|
492
|
+
// auth-derived account for local sandbox buyer credentials, so keep
|
|
493
|
+
// that branch sandboxed.
|
|
494
|
+
sandbox: r ? (r.sandbox ?? false) : true,
|
|
495
495
|
};
|
|
496
496
|
},
|
|
497
497
|
upsertRow: (tenant, ref, _ctx) => {
|
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
* 3. Replace `audience_targeting` and `conversion_tracking` capability
|
|
13
13
|
* declarations with the identifier types / event types your platform
|
|
14
14
|
* actually accepts.
|
|
15
|
-
* 4. Replace
|
|
15
|
+
* 4. Replace `ONBOARDING_LEDGER` and `SELLER_SUPPORTED_BILLING` with your
|
|
16
|
+
* buyer-agent onboarding/commercial-state source of truth.
|
|
17
|
+
* 5. Replace the `m.uids[i]` → `external_id_sha256` projection in
|
|
16
18
|
* `logEvent` with your CAPI's specific UID-to-field mapping.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
+
* 6. Replace `eventSourceMap` with persistent storage (DB / cache).
|
|
20
|
+
* 7. Validate: `node --test test/examples/hello-seller-adapter-social.test.js`
|
|
19
21
|
*
|
|
20
22
|
* Demo:
|
|
21
23
|
* npx @adcp/sdk@latest mock-server sales-social --port 4350
|
|
@@ -36,6 +38,7 @@ import {
|
|
|
36
38
|
createUpstreamHttpClient,
|
|
37
39
|
memoryBackend,
|
|
38
40
|
AdcpError,
|
|
41
|
+
BuyerAgentRegistry,
|
|
39
42
|
defineSalesPlatform,
|
|
40
43
|
defineAudiencePlatform,
|
|
41
44
|
assertNoExampleTlds,
|
|
@@ -47,6 +50,8 @@ import {
|
|
|
47
50
|
type SyncAudiencesRow,
|
|
48
51
|
type SyncCreativesRow,
|
|
49
52
|
type SyncAccountsResultRow,
|
|
53
|
+
type BuyerAgent,
|
|
54
|
+
type BuyerAgentBillingMode,
|
|
50
55
|
} from '@adcp/sdk/server';
|
|
51
56
|
import type {
|
|
52
57
|
SyncCatalogsSuccess,
|
|
@@ -54,6 +59,7 @@ import type {
|
|
|
54
59
|
SyncEventSourcesSuccess,
|
|
55
60
|
GetAccountFinancialsSuccess,
|
|
56
61
|
} from '@adcp/sdk/types';
|
|
62
|
+
import { createHash } from 'node:crypto';
|
|
57
63
|
|
|
58
64
|
const UPSTREAM_URL = process.env['UPSTREAM_URL'] ?? 'http://127.0.0.1:4350';
|
|
59
65
|
const UPSTREAM_CLIENT_ID = process.env['UPSTREAM_OAUTH_CLIENT_ID'] ?? 'walled_garden_test_client_001';
|
|
@@ -61,6 +67,34 @@ const UPSTREAM_CLIENT_SECRET =
|
|
|
61
67
|
process.env['UPSTREAM_OAUTH_CLIENT_SECRET'] ?? 'walled_garden_test_secret_do_not_use_in_prod';
|
|
62
68
|
const PORT = Number(process.env['PORT'] ?? 3003);
|
|
63
69
|
const ADCP_AUTH_TOKEN = process.env['ADCP_AUTH_TOKEN'] ?? 'sk_harness_do_not_use_in_prod';
|
|
70
|
+
const SELLER_SUPPORTED_BILLING = ['operator', 'agent'] as const satisfies readonly BuyerAgentBillingMode[];
|
|
71
|
+
|
|
72
|
+
function hashApiKey(token: string): string {
|
|
73
|
+
return createHash('sha256').update(token).digest('hex').slice(0, 32);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const ONBOARDING_LEDGER = new Map<string, BuyerAgent>([
|
|
77
|
+
[
|
|
78
|
+
hashApiKey(ADCP_AUTH_TOKEN),
|
|
79
|
+
{
|
|
80
|
+
agent_url: 'https://addie.example.com',
|
|
81
|
+
display_name: 'Addie (storyboard runner)',
|
|
82
|
+
status: 'active',
|
|
83
|
+
billing_capabilities: new Set(['operator']),
|
|
84
|
+
sandbox_only: true,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
]);
|
|
88
|
+
|
|
89
|
+
const agentRegistry = BuyerAgentRegistry.cached(
|
|
90
|
+
BuyerAgentRegistry.bearerOnly({
|
|
91
|
+
resolveByCredential: async credential => {
|
|
92
|
+
if (credential.kind !== 'api_key') return null;
|
|
93
|
+
return ONBOARDING_LEDGER.get(credential.key_id) ?? null;
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
{ ttlSeconds: 60 }
|
|
97
|
+
);
|
|
64
98
|
|
|
65
99
|
// ---------------------------------------------------------------------------
|
|
66
100
|
// OAuth token cache — SWAP for production.
|
|
@@ -366,9 +400,12 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
|
|
|
366
400
|
supported_event_types: ['purchase' as const, 'add_to_cart' as const, 'page_view' as const, 'lead' as const],
|
|
367
401
|
supported_action_sources: ['website' as const, 'app' as const],
|
|
368
402
|
},
|
|
403
|
+
supportedBillings: SELLER_SUPPORTED_BILLING,
|
|
369
404
|
config: {},
|
|
370
405
|
};
|
|
371
406
|
|
|
407
|
+
agentRegistry = agentRegistry;
|
|
408
|
+
|
|
372
409
|
accounts: AccountStore<AdvertiserMeta> = {
|
|
373
410
|
/** Translate AdCP `account.brand.domain` → upstream `advertiser_id`.
|
|
374
411
|
* The mock's discovery endpoint is /_lookup/advertiser; production
|
|
@@ -407,6 +444,7 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
|
|
|
407
444
|
status: 'active',
|
|
408
445
|
...(operator !== undefined && { operator }),
|
|
409
446
|
brand: { domain: upstreamAdv.adcp_advertiser },
|
|
447
|
+
sandbox: ref === undefined || !('sandbox' in ref) || ref.sandbox === true,
|
|
410
448
|
ctx_metadata: {
|
|
411
449
|
advertiser_id: upstreamAdv.advertiser_id,
|
|
412
450
|
advertiser_domain: upstreamAdv.adcp_advertiser,
|
|
@@ -439,7 +477,7 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
|
|
|
439
477
|
* advertiser seats out-of-band — this is a discovery/echo, not a
|
|
440
478
|
* provisioning call. Per the storyboard, list_accounts is the
|
|
441
479
|
* canonical alternative (declared via `provides_state_for`). */
|
|
442
|
-
upsert: async refs => {
|
|
480
|
+
upsert: async (refs, ctx) => {
|
|
443
481
|
const out: SyncAccountsResultRow[] = [];
|
|
444
482
|
for (const ref of refs) {
|
|
445
483
|
// sync_accounts always carries the brand+operator arm (the buyer is
|
|
@@ -468,6 +506,42 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
|
|
|
468
506
|
});
|
|
469
507
|
continue;
|
|
470
508
|
}
|
|
509
|
+
const requestedBilling = (ref as { billing?: BuyerAgentBillingMode }).billing ?? 'operator';
|
|
510
|
+
if (!(SELLER_SUPPORTED_BILLING as readonly BuyerAgentBillingMode[]).includes(requestedBilling)) {
|
|
511
|
+
out.push({
|
|
512
|
+
brand: { domain },
|
|
513
|
+
operator,
|
|
514
|
+
action: 'failed',
|
|
515
|
+
status: 'rejected',
|
|
516
|
+
errors: [
|
|
517
|
+
{
|
|
518
|
+
code: 'BILLING_NOT_SUPPORTED',
|
|
519
|
+
message: `Billing '${requestedBilling}' is not supported by this seller.`,
|
|
520
|
+
details: {
|
|
521
|
+
scope: 'capability',
|
|
522
|
+
supported_billing: [...SELLER_SUPPORTED_BILLING],
|
|
523
|
+
},
|
|
524
|
+
} as unknown as { code: string; message: string },
|
|
525
|
+
],
|
|
526
|
+
});
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
if (ctx?.agent && !ctx.agent.billing_capabilities.has(requestedBilling)) {
|
|
530
|
+
out.push({
|
|
531
|
+
brand: { domain },
|
|
532
|
+
operator,
|
|
533
|
+
action: 'failed',
|
|
534
|
+
status: 'rejected',
|
|
535
|
+
errors: [
|
|
536
|
+
{
|
|
537
|
+
code: 'BILLING_NOT_PERMITTED_FOR_AGENT',
|
|
538
|
+
message: `Billing '${requestedBilling}' is not permitted for this buyer agent.`,
|
|
539
|
+
details: { rejected_billing: requestedBilling, suggested_billing: 'operator' },
|
|
540
|
+
} as unknown as { code: string; message: string },
|
|
541
|
+
],
|
|
542
|
+
});
|
|
543
|
+
continue;
|
|
544
|
+
}
|
|
471
545
|
const adv = await upstream.lookupAdvertiser(domain);
|
|
472
546
|
if (!adv) {
|
|
473
547
|
out.push({
|
|
@@ -486,6 +560,8 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
|
|
|
486
560
|
operator,
|
|
487
561
|
action: 'unchanged',
|
|
488
562
|
status: 'active',
|
|
563
|
+
billing: requestedBilling,
|
|
564
|
+
sandbox: (ref as { sandbox?: boolean }).sandbox ?? true,
|
|
489
565
|
});
|
|
490
566
|
}
|
|
491
567
|
return out;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* hello_si_adapter_brand — worked starting point for an AdCP Sponsored
|
|
3
|
-
* Intelligence agent (
|
|
3
|
+
* Intelligence agent (`sponsored-intelligence` specialism / protocol) that wraps an
|
|
4
4
|
* upstream brand-agent platform via HTTP.
|
|
5
5
|
*
|
|
6
6
|
* Fork this. Replace `upstream` with calls to your real backend
|
|
7
7
|
* (Salesforce Agentforce, OpenAI Assistants brand mode, custom brand
|
|
8
8
|
* chat). The AdCP-facing platform methods stay the same.
|
|
9
9
|
*
|
|
10
|
-
* **Status**: SI is
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `platform.sponsoredIntelligence` field's presence — which auto-derives
|
|
14
|
-
* `'sponsored_intelligence'` into the wire-side `supported_protocols`
|
|
15
|
-
* via `detectProtocols`.
|
|
10
|
+
* **Status**: SI is an AdCP 3.1 specialism. The SDK still dispatches off the
|
|
11
|
+
* `platform.sponsoredIntelligence` field's presence, and that field also
|
|
12
|
+
* auto-derives the wire-side `supported_protocols` entry via `detectProtocols`.
|
|
16
13
|
*
|
|
17
14
|
* FORK CHECKLIST
|
|
18
15
|
* 1. Replace every `// SWAP:` marker with calls to your backend.
|
|
@@ -368,11 +365,10 @@ interface SiBrandMeta {
|
|
|
368
365
|
[key: string]: unknown;
|
|
369
366
|
}
|
|
370
367
|
|
|
371
|
-
// SI
|
|
372
|
-
//
|
|
373
|
-
//
|
|
374
|
-
//
|
|
375
|
-
// `RequiredPlatformsFor`'s `[S] extends [never]` short-circuit cleanly.
|
|
368
|
+
// SI is a 3.1 specialism and a protocol-bundle surface. The platform field
|
|
369
|
+
// supplies the four SI tools; claiming `specialisms: ['sponsored-intelligence']`
|
|
370
|
+
// below lets the framework validate the field and auto-derive
|
|
371
|
+
// 'sponsored_intelligence' into wire-side supported_protocols.
|
|
376
372
|
|
|
377
373
|
const accounts: AccountStore<SiBrandMeta> = {
|
|
378
374
|
resolve: async ref => {
|
|
@@ -453,14 +449,7 @@ const sponsoredIntelligence = defineSponsoredIntelligencePlatform<SiBrandMeta>({
|
|
|
453
449
|
...(matching ? { matching_products: matching } : {}),
|
|
454
450
|
total_matching: offering.total_matching,
|
|
455
451
|
};
|
|
456
|
-
|
|
457
|
-
// `offering.offering_id` (above), but the `si_baseline` compliance
|
|
458
|
-
// storyboard captures with `path: 'offering_id'` (top-level). The
|
|
459
|
-
// schema allows `additionalProperties: true` at the response root so
|
|
460
|
-
// the mirror is permitted at the wire layer; the generated TS type
|
|
461
|
-
// doesn't model extra properties, so widen via cast. Drop once the
|
|
462
|
-
// storyboard path is corrected to `offering.offering_id` upstream.
|
|
463
|
-
return Object.assign({}, response, { offering_id: offering.offering_id }) as SIGetOfferingResponse;
|
|
452
|
+
return response;
|
|
464
453
|
},
|
|
465
454
|
|
|
466
455
|
initiateSession: async (req: SIInitiateSessionRequest, ctx): Promise<SIInitiateSessionResponse> => {
|
|
@@ -552,7 +541,7 @@ const sponsoredIntelligence = defineSponsoredIntelligencePlatform<SiBrandMeta>({
|
|
|
552
541
|
// ---------------------------------------------------------------------------
|
|
553
542
|
|
|
554
543
|
const platform = definePlatform<Record<string, never>, SiBrandMeta>({
|
|
555
|
-
capabilities: { specialisms: [] as const, config: {} },
|
|
544
|
+
capabilities: { specialisms: ['sponsored-intelligence'] as const, config: {} },
|
|
556
545
|
accounts,
|
|
557
546
|
sponsoredIntelligence,
|
|
558
547
|
});
|