@adcp/sdk 12.1.1 → 13.0.0-rc.0
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 +19 -3
- package/bin/adcp-fuzz.js +3 -1
- package/dist/lib/adapters/content-standards-adapter.d.mts +9 -9
- package/dist/lib/adapters/content-standards-adapter.d.ts +9 -9
- package/dist/lib/adapters/content-standards-adapter.d.ts.map +1 -1
- package/dist/lib/adapters/content-standards-adapter.js +22 -22
- package/dist/lib/adapters/content-standards-adapter.js.map +1 -1
- package/dist/lib/adapters/content-standards-adapter.mjs +18 -18
- package/dist/lib/adapters/content-standards-adapter.mjs.map +1 -1
- package/dist/lib/adapters/index.d.mts +2 -2
- package/dist/lib/adapters/index.d.ts +2 -2
- package/dist/lib/adapters/index.d.ts.map +1 -1
- package/dist/lib/adapters/index.js +10 -10
- package/dist/lib/adapters/index.js.map +1 -1
- package/dist/lib/adapters/index.mjs +9 -9
- package/dist/lib/adapters/index.mjs.map +1 -1
- package/dist/lib/auth/oauth/provider-cache.d.mts +7 -0
- package/dist/lib/auth/oauth/provider-cache.d.ts +8 -0
- package/dist/lib/auth/oauth/provider-cache.d.ts.map +1 -0
- package/dist/lib/auth/oauth/provider-cache.js +44 -0
- package/dist/lib/auth/oauth/provider-cache.js.map +1 -0
- package/dist/lib/auth/oauth/provider-cache.mjs +19 -0
- package/dist/lib/auth/oauth/provider-cache.mjs.map +1 -0
- package/dist/lib/conformance/invariants/uniformError.js +1 -1
- package/dist/lib/conformance/invariants/uniformError.js.map +1 -1
- package/dist/lib/conformance/invariants/uniformError.mjs +1 -1
- package/dist/lib/conformance/invariants/uniformError.mjs.map +1 -1
- package/dist/lib/conformance/runners.js +1 -1
- package/dist/lib/conformance/runners.js.map +1 -1
- package/dist/lib/conformance/runners.mjs +1 -1
- package/dist/lib/conformance/runners.mjs.map +1 -1
- package/dist/lib/conformance/seeder.js +5 -5
- package/dist/lib/conformance/seeder.js.map +1 -1
- package/dist/lib/conformance/seeder.mjs +5 -5
- package/dist/lib/conformance/seeder.mjs.map +1 -1
- package/dist/lib/core/ADCPMultiAgentClient.d.mts +26 -29
- package/dist/lib/core/ADCPMultiAgentClient.d.ts +26 -29
- package/dist/lib/core/ADCPMultiAgentClient.d.ts.map +1 -1
- package/dist/lib/core/ADCPMultiAgentClient.js +27 -19
- package/dist/lib/core/ADCPMultiAgentClient.js.map +1 -1
- package/dist/lib/core/ADCPMultiAgentClient.mjs +27 -19
- package/dist/lib/core/ADCPMultiAgentClient.mjs.map +1 -1
- package/dist/lib/core/AgentClient.d.mts +148 -138
- package/dist/lib/core/AgentClient.d.ts +148 -138
- package/dist/lib/core/AgentClient.d.ts.map +1 -1
- package/dist/lib/core/AgentClient.js +174 -85
- package/dist/lib/core/AgentClient.js.map +1 -1
- package/dist/lib/core/AgentClient.mjs +174 -85
- package/dist/lib/core/AgentClient.mjs.map +1 -1
- package/dist/lib/core/AsyncHandler.d.mts +18 -16
- package/dist/lib/core/AsyncHandler.d.ts +18 -16
- package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
- package/dist/lib/core/AsyncHandler.js +22 -1
- package/dist/lib/core/AsyncHandler.js.map +1 -1
- package/dist/lib/core/AsyncHandler.mjs +22 -1
- package/dist/lib/core/AsyncHandler.mjs.map +1 -1
- package/dist/lib/core/ConversationTypes.d.mts +6 -2
- package/dist/lib/core/ConversationTypes.d.ts +6 -2
- package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
- package/dist/lib/core/ConversationTypes.js.map +1 -1
- package/dist/lib/core/CreativeAgentClient.d.mts +41 -17
- package/dist/lib/core/CreativeAgentClient.d.ts +41 -17
- package/dist/lib/core/CreativeAgentClient.d.ts.map +1 -1
- package/dist/lib/core/CreativeAgentClient.js +39 -12
- package/dist/lib/core/CreativeAgentClient.js.map +1 -1
- package/dist/lib/core/CreativeAgentClient.mjs +39 -12
- package/dist/lib/core/CreativeAgentClient.mjs.map +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +127 -50
- package/dist/lib/core/SingleAgentClient.d.ts +127 -50
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +1617 -177
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/core/SingleAgentClient.mjs +1627 -177
- package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
- package/dist/lib/core/TaskExecutor.d.mts +9 -0
- package/dist/lib/core/TaskExecutor.d.ts +9 -0
- package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
- package/dist/lib/core/TaskExecutor.js +136 -43
- package/dist/lib/core/TaskExecutor.js.map +1 -1
- package/dist/lib/core/TaskExecutor.mjs +136 -43
- package/dist/lib/core/TaskExecutor.mjs.map +1 -1
- package/dist/lib/index.d.mts +111 -17
- package/dist/lib/index.d.ts +111 -17
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +94 -94
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +93 -94
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +6 -15
- package/dist/lib/protocols/index.js.map +1 -1
- package/dist/lib/protocols/index.mjs +6 -16
- package/dist/lib/protocols/index.mjs.map +1 -1
- package/dist/lib/protocols/mcp-modern.d.ts.map +1 -1
- package/dist/lib/protocols/mcp-modern.js +87 -12
- package/dist/lib/protocols/mcp-modern.js.map +1 -1
- package/dist/lib/protocols/mcp-modern.mjs +89 -12
- package/dist/lib/protocols/mcp-modern.mjs.map +1 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/create-adcp-server.d.mts +6 -0
- package/dist/lib/server/create-adcp-server.d.ts +6 -0
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +295 -48
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/server/create-adcp-server.mjs +301 -50
- package/dist/lib/server/create-adcp-server.mjs.map +1 -1
- package/dist/lib/server/decisioning/assembly-helpers.d.mts +27 -13
- package/dist/lib/server/decisioning/assembly-helpers.d.ts +27 -13
- package/dist/lib/server/decisioning/assembly-helpers.d.ts.map +1 -1
- package/dist/lib/server/decisioning/assembly-helpers.js +136 -14
- package/dist/lib/server/decisioning/assembly-helpers.js.map +1 -1
- package/dist/lib/server/decisioning/assembly-helpers.mjs +134 -13
- package/dist/lib/server/decisioning/assembly-helpers.mjs.map +1 -1
- package/dist/lib/server/decisioning/index.d.mts +13 -12
- package/dist/lib/server/decisioning/index.d.ts +13 -12
- package/dist/lib/server/decisioning/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.js +6 -0
- package/dist/lib/server/decisioning/index.js.map +1 -1
- package/dist/lib/server/decisioning/index.mjs +9 -3
- package/dist/lib/server/decisioning/index.mjs.map +1 -1
- package/dist/lib/server/decisioning/list-helpers.d.mts +13 -3
- package/dist/lib/server/decisioning/list-helpers.d.ts +13 -3
- package/dist/lib/server/decisioning/list-helpers.d.ts.map +1 -1
- package/dist/lib/server/decisioning/list-helpers.js +13 -3
- package/dist/lib/server/decisioning/list-helpers.js.map +1 -1
- package/dist/lib/server/decisioning/list-helpers.mjs +11 -2
- package/dist/lib/server/decisioning/list-helpers.mjs.map +1 -1
- package/dist/lib/server/decisioning/manifest-helpers.d.mts +5 -3
- package/dist/lib/server/decisioning/manifest-helpers.d.ts +5 -3
- package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -1
- package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -1
- package/dist/lib/server/decisioning/manifest-helpers.mjs.map +1 -1
- package/dist/lib/server/decisioning/proposal/dispatch.d.mts +2 -2
- package/dist/lib/server/decisioning/proposal/dispatch.d.ts +2 -2
- package/dist/lib/server/decisioning/proposal/dispatch.d.ts.map +1 -1
- package/dist/lib/server/decisioning/proposal/dispatch.js.map +1 -1
- package/dist/lib/server/decisioning/proposal/dispatch.mjs.map +1 -1
- package/dist/lib/server/decisioning/proposal/index.d.mts +1 -1
- package/dist/lib/server/decisioning/proposal/index.d.ts +1 -1
- package/dist/lib/server/decisioning/proposal/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/proposal/index.js.map +1 -1
- package/dist/lib/server/decisioning/proposal/index.mjs.map +1 -1
- package/dist/lib/server/decisioning/proposal/lifecycle.d.mts +3 -2
- package/dist/lib/server/decisioning/proposal/lifecycle.d.ts +3 -2
- package/dist/lib/server/decisioning/proposal/lifecycle.d.ts.map +1 -1
- package/dist/lib/server/decisioning/proposal/lifecycle.js.map +1 -1
- package/dist/lib/server/decisioning/proposal/lifecycle.mjs.map +1 -1
- package/dist/lib/server/decisioning/proposal/mock-manager.d.mts +3 -3
- package/dist/lib/server/decisioning/proposal/mock-manager.d.ts +3 -3
- package/dist/lib/server/decisioning/proposal/mock-manager.d.ts.map +1 -1
- package/dist/lib/server/decisioning/proposal/mock-manager.js.map +1 -1
- package/dist/lib/server/decisioning/proposal/mock-manager.mjs.map +1 -1
- package/dist/lib/server/decisioning/proposal/types.d.mts +10 -6
- package/dist/lib/server/decisioning/proposal/types.d.ts +10 -6
- package/dist/lib/server/decisioning/proposal/types.d.ts.map +1 -1
- package/dist/lib/server/decisioning/proposal/types.js.map +1 -1
- package/dist/lib/server/decisioning/proposal/types.mjs.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.d.mts +21 -2
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +21 -2
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.js +754 -81
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +763 -81
- package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
- package/dist/lib/server/decisioning/specialisms/brand-rights.d.mts +9 -9
- package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +9 -9
- package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/content-standards.d.mts +16 -16
- package/dist/lib/server/decisioning/specialisms/content-standards.d.ts +16 -16
- package/dist/lib/server/decisioning/specialisms/content-standards.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/content-standards.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.mts +15 -13
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +15 -13
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/creative-ad-server.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/creative.d.mts +12 -11
- package/dist/lib/server/decisioning/specialisms/creative.d.ts +12 -11
- package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/creative.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sales.d.mts +25 -15
- package/dist/lib/server/decisioning/specialisms/sales.d.ts +25 -15
- package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
- package/dist/lib/server/index.d.mts +3 -3
- package/dist/lib/server/index.d.ts +3 -3
- package/dist/lib/server/index.d.ts.map +1 -1
- package/dist/lib/server/index.js +72 -72
- package/dist/lib/server/index.js.map +1 -1
- package/dist/lib/server/index.mjs +36 -36
- package/dist/lib/server/index.mjs.map +1 -1
- package/dist/lib/server/legacy/v5/index.d.mts +1 -0
- package/dist/lib/server/legacy/v5/index.d.ts +1 -0
- package/dist/lib/server/legacy/v5/index.d.ts.map +1 -1
- package/dist/lib/server/legacy/v5/index.js +74 -1
- package/dist/lib/server/legacy/v5/index.js.map +1 -1
- package/dist/lib/server/legacy/v5/index.mjs +75 -1
- package/dist/lib/server/legacy/v5/index.mjs.map +1 -1
- package/dist/lib/server/responses.d.mts +2 -2
- package/dist/lib/server/responses.d.ts +2 -2
- package/dist/lib/server/responses.js.map +1 -1
- package/dist/lib/server/responses.mjs.map +1 -1
- package/dist/lib/testing/client.js +1 -1
- package/dist/lib/testing/client.js.map +1 -1
- package/dist/lib/testing/client.mjs +1 -1
- package/dist/lib/testing/client.mjs.map +1 -1
- package/dist/lib/testing/scenarios/brand-rights.js +6 -6
- package/dist/lib/testing/scenarios/brand-rights.js.map +1 -1
- package/dist/lib/testing/scenarios/brand-rights.mjs +6 -6
- package/dist/lib/testing/scenarios/brand-rights.mjs.map +1 -1
- package/dist/lib/testing/scenarios/creative.js +7 -7
- package/dist/lib/testing/scenarios/creative.js.map +1 -1
- package/dist/lib/testing/scenarios/creative.mjs +7 -7
- package/dist/lib/testing/scenarios/creative.mjs.map +1 -1
- package/dist/lib/testing/scenarios/discovery.js +2 -2
- package/dist/lib/testing/scenarios/discovery.js.map +1 -1
- package/dist/lib/testing/scenarios/discovery.mjs +2 -2
- package/dist/lib/testing/scenarios/discovery.mjs.map +1 -1
- package/dist/lib/testing/scenarios/edge-cases.js +11 -11
- package/dist/lib/testing/scenarios/edge-cases.js.map +1 -1
- package/dist/lib/testing/scenarios/edge-cases.mjs +11 -11
- package/dist/lib/testing/scenarios/edge-cases.mjs.map +1 -1
- package/dist/lib/testing/scenarios/governance.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/governance.js +16 -22
- package/dist/lib/testing/scenarios/governance.js.map +1 -1
- package/dist/lib/testing/scenarios/governance.mjs +16 -22
- package/dist/lib/testing/scenarios/governance.mjs.map +1 -1
- package/dist/lib/testing/scenarios/media-buy.js +5 -5
- package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
- package/dist/lib/testing/scenarios/media-buy.mjs +5 -5
- package/dist/lib/testing/scenarios/media-buy.mjs.map +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.js +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.js.map +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.mjs +1 -1
- package/dist/lib/testing/scenarios/schema-compliance.mjs.map +1 -1
- package/dist/lib/testing/scenarios/trusted-match.d.ts.map +1 -1
- package/dist/lib/testing/scenarios/trusted-match.js +4 -3
- package/dist/lib/testing/scenarios/trusted-match.js.map +1 -1
- package/dist/lib/testing/scenarios/trusted-match.mjs +4 -3
- package/dist/lib/testing/scenarios/trusted-match.mjs.map +1 -1
- package/dist/lib/testing/storyboard/shape-drift-hints.d.mts +3 -4
- package/dist/lib/testing/storyboard/shape-drift-hints.d.ts +3 -4
- package/dist/lib/testing/storyboard/shape-drift-hints.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/shape-drift-hints.js +27 -27
- package/dist/lib/testing/storyboard/shape-drift-hints.js.map +1 -1
- package/dist/lib/testing/storyboard/shape-drift-hints.mjs +27 -27
- package/dist/lib/testing/storyboard/shape-drift-hints.mjs.map +1 -1
- package/dist/lib/testing/storyboard/task-map.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/task-map.js +43 -5
- package/dist/lib/testing/storyboard/task-map.js.map +1 -1
- package/dist/lib/testing/storyboard/task-map.mjs +43 -5
- package/dist/lib/testing/storyboard/task-map.mjs.map +1 -1
- package/dist/lib/testing/test-helpers.d.mts +2 -2
- package/dist/lib/testing/test-helpers.d.ts +2 -2
- package/dist/lib/testing/test-helpers.js.map +1 -1
- package/dist/lib/testing/test-helpers.mjs.map +1 -1
- package/dist/lib/types/adcp.d.mts +14 -14
- package/dist/lib/types/adcp.d.ts +14 -14
- package/dist/lib/types/adcp.d.ts.map +1 -1
- package/dist/lib/types/adcp.js.map +1 -1
- package/dist/lib/types/adcp.mjs.map +1 -1
- package/dist/lib/types/index.d.mts +2 -2
- package/dist/lib/types/index.d.ts +2 -2
- package/dist/lib/types/index.d.ts.map +1 -1
- package/dist/lib/types/index.js.map +1 -1
- package/dist/lib/types/index.mjs.map +1 -1
- package/dist/lib/utils/capabilities.d.mts +6 -0
- package/dist/lib/utils/capabilities.d.ts +6 -0
- package/dist/lib/utils/capabilities.d.ts.map +1 -1
- package/dist/lib/utils/capabilities.js +4 -0
- package/dist/lib/utils/capabilities.js.map +1 -1
- package/dist/lib/utils/capabilities.mjs +4 -0
- package/dist/lib/utils/capabilities.mjs.map +1 -1
- package/dist/lib/utils/creative-delivery.d.mts +52 -10
- package/dist/lib/utils/creative-delivery.d.ts +52 -10
- package/dist/lib/utils/creative-delivery.d.ts.map +1 -1
- package/dist/lib/utils/creative-delivery.js +104 -9
- package/dist/lib/utils/creative-delivery.js.map +1 -1
- package/dist/lib/utils/creative-delivery.mjs +104 -8
- package/dist/lib/utils/creative-delivery.mjs.map +1 -1
- package/dist/lib/utils/format-assets.d.mts +41 -38
- package/dist/lib/utils/format-assets.d.ts +41 -38
- package/dist/lib/utils/format-assets.d.ts.map +1 -1
- package/dist/lib/utils/format-assets.js +3 -1
- package/dist/lib/utils/format-assets.js.map +1 -1
- package/dist/lib/utils/format-assets.mjs +3 -1
- package/dist/lib/utils/format-assets.mjs.map +1 -1
- package/dist/lib/utils/index.d.mts +8 -8
- package/dist/lib/utils/index.d.ts +8 -8
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/index.js +11 -9
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/lib/utils/index.mjs +9 -8
- package/dist/lib/utils/index.mjs.map +1 -1
- package/dist/lib/utils/preview-utils.d.mts +11 -8
- package/dist/lib/utils/preview-utils.d.ts +11 -8
- package/dist/lib/utils/preview-utils.d.ts.map +1 -1
- package/dist/lib/utils/preview-utils.js +4 -4
- package/dist/lib/utils/preview-utils.js.map +1 -1
- package/dist/lib/utils/preview-utils.mjs +3 -3
- package/dist/lib/utils/preview-utils.mjs.map +1 -1
- package/dist/lib/utils/tool-request-schemas.d.mts +2 -2
- package/dist/lib/utils/tool-request-schemas.d.ts +2 -2
- package/dist/lib/v2/projection/aao-reference-formats.json +492 -0
- package/dist/lib/v2/projection/augment-response.d.mts +31 -11
- package/dist/lib/v2/projection/augment-response.d.ts +31 -11
- package/dist/lib/v2/projection/augment-response.d.ts.map +1 -1
- package/dist/lib/v2/projection/augment-response.js +233 -27
- package/dist/lib/v2/projection/augment-response.js.map +1 -1
- package/dist/lib/v2/projection/augment-response.mjs +232 -27
- package/dist/lib/v2/projection/augment-response.mjs.map +1 -1
- package/dist/lib/v2/projection/builders.d.mts +7 -6
- package/dist/lib/v2/projection/builders.d.ts +7 -6
- package/dist/lib/v2/projection/builders.d.ts.map +1 -1
- package/dist/lib/v2/projection/builders.js +11 -8
- package/dist/lib/v2/projection/builders.js.map +1 -1
- package/dist/lib/v2/projection/builders.mjs +9 -6
- package/dist/lib/v2/projection/builders.mjs.map +1 -1
- package/dist/lib/v2/projection/catalog-snapshot.d.mts +47 -0
- package/dist/lib/v2/projection/catalog-snapshot.d.ts +48 -0
- package/dist/lib/v2/projection/catalog-snapshot.d.ts.map +1 -0
- package/dist/lib/v2/projection/catalog-snapshot.js +291 -0
- package/dist/lib/v2/projection/catalog-snapshot.js.map +1 -0
- package/dist/lib/v2/projection/catalog-snapshot.mjs +265 -0
- package/dist/lib/v2/projection/catalog-snapshot.mjs.map +1 -0
- package/dist/lib/v2/projection/catalog.d.mts +23 -2
- package/dist/lib/v2/projection/catalog.d.ts +23 -2
- package/dist/lib/v2/projection/catalog.d.ts.map +1 -1
- package/dist/lib/v2/projection/catalog.js +34 -10
- package/dist/lib/v2/projection/catalog.js.map +1 -1
- package/dist/lib/v2/projection/catalog.mjs +33 -10
- package/dist/lib/v2/projection/catalog.mjs.map +1 -1
- package/dist/lib/v2/projection/creative-delivery.d.mts +157 -0
- package/dist/lib/v2/projection/creative-delivery.d.ts +158 -0
- package/dist/lib/v2/projection/creative-delivery.d.ts.map +1 -0
- package/dist/lib/v2/projection/creative-delivery.js +967 -0
- package/dist/lib/v2/projection/creative-delivery.js.map +1 -0
- package/dist/lib/v2/projection/creative-delivery.mjs +941 -0
- package/dist/lib/v2/projection/creative-delivery.mjs.map +1 -0
- package/dist/lib/v2/projection/index.d.mts +8 -6
- package/dist/lib/v2/projection/index.d.ts +8 -6
- package/dist/lib/v2/projection/index.d.ts.map +1 -1
- package/dist/lib/v2/projection/index.js +26 -4
- package/dist/lib/v2/projection/index.js.map +1 -1
- package/dist/lib/v2/projection/index.mjs +28 -4
- package/dist/lib/v2/projection/index.mjs.map +1 -1
- package/dist/lib/v2/projection/legacy-metadata.d.mts +21 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts +22 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts.map +1 -0
- package/dist/lib/v2/projection/legacy-metadata.js +73 -0
- package/dist/lib/v2/projection/legacy-metadata.js.map +1 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs +45 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs.map +1 -0
- package/dist/lib/v2/projection/types.d.mts +29 -23
- package/dist/lib/v2/projection/types.d.ts +29 -23
- package/dist/lib/v2/projection/types.d.ts.map +1 -1
- package/dist/lib/v2/projection/types.js.map +1 -1
- package/dist/lib/v2/projection/v1-to-v2.d.mts +29 -6
- package/dist/lib/v2/projection/v1-to-v2.d.ts +29 -6
- package/dist/lib/v2/projection/v1-to-v2.d.ts.map +1 -1
- package/dist/lib/v2/projection/v1-to-v2.js +218 -9
- package/dist/lib/v2/projection/v1-to-v2.js.map +1 -1
- package/dist/lib/v2/projection/v1-to-v2.mjs +219 -10
- package/dist/lib/v2/projection/v1-to-v2.mjs.map +1 -1
- package/dist/lib/v2/projection/v2-to-v1.d.mts +31 -2
- package/dist/lib/v2/projection/v2-to-v1.d.ts +31 -2
- package/dist/lib/v2/projection/v2-to-v1.d.ts.map +1 -1
- package/dist/lib/v2/projection/v2-to-v1.js +138 -7
- package/dist/lib/v2/projection/v2-to-v1.js.map +1 -1
- package/dist/lib/v2/projection/v2-to-v1.mjs +135 -6
- package/dist/lib/v2/projection/v2-to-v1.mjs.map +1 -1
- package/dist/lib/v2/projection/write-side.d.mts +12 -13
- package/dist/lib/v2/projection/write-side.d.ts +12 -13
- package/dist/lib/v2/projection/write-side.d.ts.map +1 -1
- package/dist/lib/v2/projection/write-side.js +16 -12
- package/dist/lib/v2/projection/write-side.js.map +1 -1
- package/dist/lib/v2/projection/write-side.mjs +16 -12
- package/dist/lib/v2/projection/write-side.mjs.map +1 -1
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.d.ts.map +1 -1
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.js.map +1 -1
- package/dist/lib/version.mjs +3 -3
- package/dist/lib/version.mjs.map +1 -1
- package/docs/guides/BUILD-AN-AGENT.md +7 -2
- package/docs/guides/PREVIEW-ASSET-DURABILITY.md +6 -2
- package/docs/llms.txt +1 -0
- package/examples/README.md +1 -1
- package/examples/batch-preview-test.ts +3 -3
- package/examples/conversation-client.ts +2 -2
- package/examples/debug-preview-response.ts +1 -1
- package/examples/decisioning-platform-broadcast-tv.ts +10 -4
- package/examples/decisioning-platform-mock-seller.ts +16 -9
- package/examples/decisioning-platform-programmatic.ts +18 -7
- package/examples/error-compliant-server.ts +26 -16
- package/examples/generative-creative-demo.ts +7 -19
- package/examples/hello_creative_adapter_ad_server.ts +37 -16
- package/examples/hello_creative_adapter_template.ts +12 -10
- package/examples/hello_seller_adapter_guaranteed.ts +52 -23
- package/examples/hello_seller_adapter_multi_tenant.ts +6 -3
- package/examples/hello_seller_adapter_non_guaranteed.ts +54 -26
- package/examples/hello_seller_adapter_proposal_mode.ts +40 -14
- package/examples/hello_seller_adapter_social.ts +2 -7
- package/examples/inspect-card-formats.ts +1 -1
- package/examples/simple-getting-started.ts +1 -1
- package/examples/test-helpers-demo.ts +1 -1
- package/package.json +2 -2
- package/skills/build-decisioning-creative-template/SKILL.md +11 -11
- package/skills/build-decisioning-platform/advanced/REFERENCE.md +8 -2
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
assertNoExampleTlds,
|
|
42
42
|
type DecisioningPlatform,
|
|
43
43
|
type CreativeBuilderPlatform,
|
|
44
|
-
type
|
|
44
|
+
type LegacyBuildCreativeReturn,
|
|
45
45
|
type AccountStore,
|
|
46
46
|
type Account,
|
|
47
47
|
} from '@adcp/sdk/server';
|
|
@@ -55,13 +55,15 @@ import {
|
|
|
55
55
|
urlRender,
|
|
56
56
|
buildCreativeReturn,
|
|
57
57
|
previewCreative,
|
|
58
|
-
type Format,
|
|
59
|
-
type ListCreativeFormatsResponse,
|
|
60
|
-
type BuildCreativeRequest,
|
|
61
|
-
type CreativeManifest,
|
|
62
|
-
type PreviewCreativeRequest,
|
|
63
|
-
type PreviewCreativeResponse,
|
|
64
58
|
} from '@adcp/sdk';
|
|
59
|
+
import type {
|
|
60
|
+
Format,
|
|
61
|
+
ListCreativeFormatsResponse,
|
|
62
|
+
BuildCreativeRequest,
|
|
63
|
+
CreativeManifest,
|
|
64
|
+
PreviewCreativeRequest,
|
|
65
|
+
PreviewCreativeResponse,
|
|
66
|
+
} from '@adcp/sdk/types';
|
|
65
67
|
import { randomUUID } from 'node:crypto';
|
|
66
68
|
|
|
67
69
|
const UPSTREAM_URL = process.env['UPSTREAM_URL'] ?? 'http://127.0.0.1:4250';
|
|
@@ -410,7 +412,7 @@ class CreativeTemplateAdapter implements DecisioningPlatform<Record<string, neve
|
|
|
410
412
|
};
|
|
411
413
|
|
|
412
414
|
creative: CreativeBuilderPlatform<CreativeMeta> = defineCreativeBuilderPlatform<CreativeMeta>({
|
|
413
|
-
|
|
415
|
+
listCreativeFormatsLegacy: async (_req, ctx): Promise<ListCreativeFormatsResponse> => {
|
|
414
416
|
// `list_creative_formats` is a no-account tool — `ctx.account` is
|
|
415
417
|
// narrowed to `Account<TCtxMeta> | undefined`. The default
|
|
416
418
|
// listing workspace fallback in `accounts.resolve(undefined)` ensures
|
|
@@ -424,7 +426,7 @@ class CreativeTemplateAdapter implements DecisioningPlatform<Record<string, neve
|
|
|
424
426
|
return { status: 'completed', formats: templates.map(templateToFormat) };
|
|
425
427
|
},
|
|
426
428
|
|
|
427
|
-
|
|
429
|
+
buildCreativeLegacy: async (req: BuildCreativeRequest, ctx): Promise<LegacyBuildCreativeReturn> => {
|
|
428
430
|
const workspaceId = ctx.account.ctx_metadata.workspace_id;
|
|
429
431
|
|
|
430
432
|
// Templates the workspace can render. Used to resolve the AdCP
|
|
@@ -472,7 +474,7 @@ class CreativeTemplateAdapter implements DecisioningPlatform<Record<string, neve
|
|
|
472
474
|
return buildCreativeReturn.single(await buildOne(req.target_format_id, 0));
|
|
473
475
|
},
|
|
474
476
|
|
|
475
|
-
|
|
477
|
+
previewCreativeLegacy: async (req: PreviewCreativeRequest, ctx): Promise<PreviewCreativeResponse> => {
|
|
476
478
|
// `preview_creative` is a no-account tool — the wire request schema
|
|
477
479
|
// doesn't carry `account`, so the framework types `ctx.account` as
|
|
478
480
|
// `Account<TCtxMeta> | undefined` per the framework's `NoAccountCtx` narrow.
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
type DecisioningPlatform,
|
|
72
72
|
type SalesCorePlatform,
|
|
73
73
|
type SalesIngestionPlatform,
|
|
74
|
-
type
|
|
74
|
+
type GetProductsHandlerResult,
|
|
75
75
|
type GetMediaBuyDeliveryPayload,
|
|
76
76
|
type GetMediaBuysPayload,
|
|
77
77
|
type AccountStore,
|
|
@@ -80,9 +80,8 @@ import {
|
|
|
80
80
|
type SyncAccountsResultRow,
|
|
81
81
|
} from '@adcp/sdk/server';
|
|
82
82
|
import { buildGAMLikeRecipe, type GAMLikeRecipe } from '@adcp/sdk/mock-server';
|
|
83
|
+
import type { CanonicalProduct, GetProductsRequest } from '@adcp/sdk';
|
|
83
84
|
import type {
|
|
84
|
-
GetProductsRequest,
|
|
85
|
-
GetProductsResponse,
|
|
86
85
|
CreateMediaBuyRequest,
|
|
87
86
|
CreateMediaBuySuccess,
|
|
88
87
|
UpdateMediaBuyRequest,
|
|
@@ -92,15 +91,13 @@ import type {
|
|
|
92
91
|
GetMediaBuyDeliveryResponse,
|
|
93
92
|
} from '@adcp/sdk/types';
|
|
94
93
|
|
|
95
|
-
// `Product` isn't re-exported from `@adcp/sdk/types` (#1254 in the rollup);
|
|
96
|
-
// derive the shape from the response array.
|
|
97
|
-
type Product = NonNullable<GetProductsResponse['products']>[number];
|
|
98
94
|
type AdcpPackage = NonNullable<UpdateMediaBuySuccess['affected_packages']>[number];
|
|
99
95
|
|
|
100
96
|
const UPSTREAM_URL = process.env['UPSTREAM_URL'] ?? 'http://127.0.0.1:4450';
|
|
101
97
|
const UPSTREAM_API_KEY = process.env['UPSTREAM_API_KEY'] ?? 'mock_sales_guaranteed_key_do_not_use_in_prod';
|
|
102
98
|
const PORT = Number(process.env['PORT'] ?? 3004);
|
|
103
99
|
const ADCP_AUTH_TOKEN = process.env['ADCP_AUTH_TOKEN'] ?? 'sk_harness_do_not_use_in_prod';
|
|
100
|
+
const PUBLIC_AGENT_URL = process.env['PUBLIC_AGENT_URL'] ?? `http://127.0.0.1:${PORT}`;
|
|
104
101
|
const DEFAULT_PRICING_OPTION_ID = 'cpm_guaranteed_fixed';
|
|
105
102
|
// Test-kit principal for the `comply_controller_mode_gate` storyboard
|
|
106
103
|
// (adcp#4028). The runner authenticates with this bearer to probe the
|
|
@@ -118,7 +115,6 @@ const DEFAULT_PRICING_OPTION_ID = 'cpm_guaranteed_fixed';
|
|
|
118
115
|
// from a worked example.
|
|
119
116
|
const ADCP_LIVE_MODE_AUTH_TOKEN = 'demo-acme-outdoor-live-v1';
|
|
120
117
|
const LIVE_MODE_PROBE_PRINCIPAL = 'compliance-live-mode-probe' as const;
|
|
121
|
-
const PUBLIC_AGENT_URL = process.env['PUBLIC_AGENT_URL'] ?? `http://127.0.0.1:${PORT}`;
|
|
122
118
|
|
|
123
119
|
const KNOWN_PUBLISHERS = ['acmeoutdoor.example', 'pinnacle-agency.example', 'premium-sports.example'];
|
|
124
120
|
assertNoExampleTlds(
|
|
@@ -447,8 +443,6 @@ interface NetworkMeta {
|
|
|
447
443
|
[key: string]: unknown;
|
|
448
444
|
}
|
|
449
445
|
|
|
450
|
-
const FORMAT_AGENT_URL = PUBLIC_AGENT_URL;
|
|
451
|
-
|
|
452
446
|
/** Project upstream product onto AdCP `Product`. The wire `Product` shape
|
|
453
447
|
* has many optional fields; we populate only the ones the storyboard
|
|
454
448
|
* validates plus the bare-minimum required spec fields. Production
|
|
@@ -462,9 +456,39 @@ const FORMAT_AGENT_URL = PUBLIC_AGENT_URL;
|
|
|
462
456
|
* the `sales_guaranteed` storyboard; the recipe is opt-in carrier the
|
|
463
457
|
* framework reads only when the buyer goes through proposal-mode.
|
|
464
458
|
*/
|
|
465
|
-
function
|
|
459
|
+
function canonicalFormatOptions(p: UpstreamProduct): CanonicalProduct['format_options'] {
|
|
460
|
+
const options = p.format_ids.map(id => {
|
|
461
|
+
const durationSeconds = id.match(/(?:^|_)(\d+)s(?:_|$)/)?.[1];
|
|
462
|
+
if (p.channel === 'video' || p.channel === 'ctv') {
|
|
463
|
+
return {
|
|
464
|
+
format_option_id: id,
|
|
465
|
+
format_kind: 'video_hosted' as const,
|
|
466
|
+
params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
if (p.channel === 'audio') {
|
|
470
|
+
return {
|
|
471
|
+
format_option_id: id,
|
|
472
|
+
format_kind: 'audio_hosted' as const,
|
|
473
|
+
params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
const dimensions = id.match(/(?:^|_)(\d+)x(\d+)(?:_|$)/);
|
|
477
|
+
return {
|
|
478
|
+
format_option_id: id,
|
|
479
|
+
format_kind: 'image' as const,
|
|
480
|
+
params: dimensions ? { width: Number(dimensions[1]), height: Number(dimensions[2]) } : {},
|
|
481
|
+
};
|
|
482
|
+
});
|
|
483
|
+
if (options.length === 0) {
|
|
484
|
+
throw new AdcpError('INVALID_REQUEST', { message: `product ${p.product_id} has no creative formats` });
|
|
485
|
+
}
|
|
486
|
+
return [options[0]!, ...options.slice(1)];
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function projectProduct(p: UpstreamProduct, publisherDomain: string): CanonicalProduct {
|
|
466
490
|
const recipe = buildGAMLikeRecipe(p);
|
|
467
|
-
const product:
|
|
491
|
+
const product: CanonicalProduct = {
|
|
468
492
|
product_id: p.product_id,
|
|
469
493
|
name: p.name,
|
|
470
494
|
description: `${p.name} — ${p.delivery_type} ${p.channel}`,
|
|
@@ -482,7 +506,7 @@ function projectProduct(p: UpstreamProduct, publisherDomain: string): Product {
|
|
|
482
506
|
? 'streaming_audio'
|
|
483
507
|
: 'display',
|
|
484
508
|
],
|
|
485
|
-
|
|
509
|
+
format_options: canonicalFormatOptions(p),
|
|
486
510
|
delivery_type: p.delivery_type,
|
|
487
511
|
pricing_options: [
|
|
488
512
|
{
|
|
@@ -802,7 +826,7 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
|
|
|
802
826
|
// level. See `decisioning.type-checks.ts` for the regression-locked
|
|
803
827
|
// patterns.
|
|
804
828
|
sales: SalesCorePlatform<NetworkMeta> & SalesIngestionPlatform<NetworkMeta> = {
|
|
805
|
-
getProducts: async (req: GetProductsRequest, ctx): Promise<
|
|
829
|
+
getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsHandlerResult> => {
|
|
806
830
|
const networkCode = ctx.account.ctx_metadata.network_code;
|
|
807
831
|
const publisherDomain = ctx.account.ctx_metadata.publisher_domain;
|
|
808
832
|
// Storyboard sends buying_mode: 'brief' with a free-text brief —
|
|
@@ -819,10 +843,17 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
|
|
|
819
843
|
// into `inventoryService` (catalog) + `forecastService.getDeliveryForecast`
|
|
820
844
|
// (per-product forecast). Use the discrete `getForecast` below if
|
|
821
845
|
// your backend can't fold forecast into the catalog response.
|
|
822
|
-
const
|
|
846
|
+
const filters = req['filters'] as
|
|
847
|
+
| {
|
|
848
|
+
budget_range?: { max?: number };
|
|
849
|
+
start_date?: string;
|
|
850
|
+
end_date?: string;
|
|
851
|
+
}
|
|
852
|
+
| undefined;
|
|
853
|
+
const briefBudget = filters?.budget_range?.max;
|
|
823
854
|
const products = await upstream.listProducts(networkCode, {
|
|
824
|
-
...(
|
|
825
|
-
...(
|
|
855
|
+
...(filters?.start_date && { flightStart: filters.start_date }),
|
|
856
|
+
...(filters?.end_date && { flightEnd: filters.end_date }),
|
|
826
857
|
...(briefBudget !== undefined && { budget: briefBudget }),
|
|
827
858
|
});
|
|
828
859
|
return {
|
|
@@ -1166,15 +1197,9 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
|
|
|
1166
1197
|
const rows: SyncCreativesRow[] = [];
|
|
1167
1198
|
for (const c of creatives) {
|
|
1168
1199
|
try {
|
|
1169
|
-
if (!c.format_id) {
|
|
1170
|
-
throw new AdcpError('INVALID_REQUEST', {
|
|
1171
|
-
message: 'format_id required on creative manifest',
|
|
1172
|
-
field: 'format_id',
|
|
1173
|
-
});
|
|
1174
|
-
}
|
|
1175
1200
|
const created = await upstream.createCreative(networkCode, {
|
|
1176
1201
|
name: c.name,
|
|
1177
|
-
format_id: c.
|
|
1202
|
+
format_id: c.format_kind,
|
|
1178
1203
|
advertiser_id: networkCode,
|
|
1179
1204
|
});
|
|
1180
1205
|
rows.push({
|
|
@@ -1336,6 +1361,10 @@ serve(
|
|
|
1336
1361
|
taskRegistry,
|
|
1337
1362
|
idempotency: idempotencyStore,
|
|
1338
1363
|
mediaBuyStore,
|
|
1364
|
+
canonicalFormatLegacyResolver: context => {
|
|
1365
|
+
if (context.source !== 'product' || !context.declaration.format_option_id) return undefined;
|
|
1366
|
+
return { agent_url: PUBLIC_AGENT_URL, id: context.declaration.format_option_id };
|
|
1367
|
+
},
|
|
1339
1368
|
resolveSessionKey: ctx => {
|
|
1340
1369
|
const acct = ctx.account as Account<NetworkMeta> | undefined;
|
|
1341
1370
|
return acct?.id ?? 'anonymous';
|
|
@@ -806,7 +806,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
|
|
|
806
806
|
};
|
|
807
807
|
},
|
|
808
808
|
|
|
809
|
-
|
|
809
|
+
getRightsLegacy: async (req: GetRightsRequest, ctx): Promise<GetRightsSuccess> => {
|
|
810
810
|
const tenant = getTenant(ctx);
|
|
811
811
|
const requestedUses = new Set(req.uses);
|
|
812
812
|
const matches = Array.from(tenant.rights.values()).filter(r => {
|
|
@@ -833,7 +833,10 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
|
|
|
833
833
|
};
|
|
834
834
|
},
|
|
835
835
|
|
|
836
|
-
|
|
836
|
+
acquireRightsLegacy: async (
|
|
837
|
+
req: AcquireRightsRequest,
|
|
838
|
+
ctx
|
|
839
|
+
): Promise<AcquireRightsAcquired | AcquireRightsRejected> => {
|
|
837
840
|
const tenant = getTenant(ctx);
|
|
838
841
|
const offering = tenant.rights.get(req.rights_id);
|
|
839
842
|
if (!offering) {
|
|
@@ -916,7 +919,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
|
|
|
916
919
|
};
|
|
917
920
|
},
|
|
918
921
|
|
|
919
|
-
|
|
922
|
+
updateRightsLegacy: async (req: UpdateRightsRequest, _ctx): Promise<UpdateRightsSuccess> => {
|
|
920
923
|
// Hello adapter doesn't persist a grant ledger; production adopters
|
|
921
924
|
// hydrate by `req.rights_id`, apply the patch (extend dates, adjust
|
|
922
925
|
// impression cap, change pricing, pause/resume), and re-issue
|
|
@@ -67,20 +67,18 @@ import {
|
|
|
67
67
|
type DecisioningPlatform,
|
|
68
68
|
type SalesCorePlatform,
|
|
69
69
|
type SalesIngestionPlatform,
|
|
70
|
-
type
|
|
70
|
+
type GetProductsHandlerResult,
|
|
71
71
|
type GetMediaBuyDeliveryPayload,
|
|
72
72
|
type GetMediaBuysPayload,
|
|
73
|
-
type
|
|
73
|
+
type SalesLegacyListCreativeFormatsPayload,
|
|
74
74
|
type AccountStore,
|
|
75
75
|
type Account,
|
|
76
76
|
type AdcpMediaBuyStatus,
|
|
77
77
|
type SyncCreativesRow,
|
|
78
78
|
type SyncAccountsResultRow,
|
|
79
79
|
} from '@adcp/sdk/server';
|
|
80
|
-
import { FormatAsset } from '@adcp/sdk';
|
|
80
|
+
import { FormatAsset, type CanonicalProduct, type GetProductsRequest } from '@adcp/sdk';
|
|
81
81
|
import type {
|
|
82
|
-
GetProductsRequest,
|
|
83
|
-
GetProductsResponse,
|
|
84
82
|
CreateMediaBuyRequest,
|
|
85
83
|
CreateMediaBuySuccess,
|
|
86
84
|
UpdateMediaBuyRequest,
|
|
@@ -90,8 +88,6 @@ import type {
|
|
|
90
88
|
GetMediaBuyDeliveryResponse,
|
|
91
89
|
} from '@adcp/sdk/types';
|
|
92
90
|
|
|
93
|
-
// `Product` isn't re-exported from `@adcp/sdk/types`; derive from response.
|
|
94
|
-
type Product = NonNullable<GetProductsResponse['products']>[number];
|
|
95
91
|
type AdcpPackage = NonNullable<UpdateMediaBuySuccess['affected_packages']>[number];
|
|
96
92
|
type ViewabilityMetrics = NonNullable<
|
|
97
93
|
GetMediaBuyDeliveryResponse['media_buy_deliveries'][number]['totals']['viewability']
|
|
@@ -380,11 +376,41 @@ const toAdcpDateTime = (value: string, fallback: string): string => {
|
|
|
380
376
|
/** Project upstream product onto AdCP `Product`. Auction-cleared inventory
|
|
381
377
|
* surfaces `min_cpm` as `floor_price` when buyers request auction pricing,
|
|
382
378
|
* while unfiltered protocol storyboards still get a fixed CPM option first. */
|
|
379
|
+
function canonicalFormatOptions(p: UpstreamProduct): CanonicalProduct['format_options'] {
|
|
380
|
+
const options = p.format_ids.map(id => {
|
|
381
|
+
const durationSeconds = id.match(/(?:^|_)(\d+)s(?:_|$)/)?.[1];
|
|
382
|
+
if (p.channel === 'video' || p.channel === 'ctv') {
|
|
383
|
+
return {
|
|
384
|
+
format_option_id: id,
|
|
385
|
+
format_kind: 'video_hosted' as const,
|
|
386
|
+
params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
if (p.channel === 'audio') {
|
|
390
|
+
return {
|
|
391
|
+
format_option_id: id,
|
|
392
|
+
format_kind: 'audio_hosted' as const,
|
|
393
|
+
params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
const dimensions = id.match(/(?:^|_)(\d+)x(\d+)(?:_|$)/);
|
|
397
|
+
return {
|
|
398
|
+
format_option_id: id,
|
|
399
|
+
format_kind: 'image' as const,
|
|
400
|
+
params: dimensions ? { width: Number(dimensions[1]), height: Number(dimensions[2]) } : {},
|
|
401
|
+
};
|
|
402
|
+
});
|
|
403
|
+
if (options.length === 0) {
|
|
404
|
+
throw new AdcpError('INVALID_REQUEST', { message: `product ${p.product_id} has no creative formats` });
|
|
405
|
+
}
|
|
406
|
+
return [options[0]!, ...options.slice(1)];
|
|
407
|
+
}
|
|
408
|
+
|
|
383
409
|
function projectProduct(
|
|
384
410
|
p: UpstreamProduct,
|
|
385
411
|
publisherDomain: string,
|
|
386
412
|
pricingMode: 'fixed' | 'auction' = 'fixed'
|
|
387
|
-
):
|
|
413
|
+
): CanonicalProduct {
|
|
388
414
|
const auctionMidpoint = p.pricing.target_cpm ?? round2(p.pricing.min_cpm * 1.3);
|
|
389
415
|
const pricingOption =
|
|
390
416
|
pricingMode === 'auction'
|
|
@@ -421,7 +447,7 @@ function projectProduct(
|
|
|
421
447
|
? 'streaming_audio'
|
|
422
448
|
: 'display',
|
|
423
449
|
],
|
|
424
|
-
|
|
450
|
+
format_options: canonicalFormatOptions(p),
|
|
425
451
|
delivery_type: 'non_guaranteed',
|
|
426
452
|
pricing_options: [pricingOption],
|
|
427
453
|
reporting_capabilities: {
|
|
@@ -638,20 +664,28 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
|
|
|
638
664
|
// all-optional and `RequiredPlatformsFor<'sales-non-guaranteed'>` requires
|
|
639
665
|
// the closed shape on the way out.
|
|
640
666
|
sales: SalesCorePlatform<NetworkMeta> & SalesIngestionPlatform<NetworkMeta> = {
|
|
641
|
-
getProducts: async (req: GetProductsRequest, ctx): Promise<
|
|
667
|
+
getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsHandlerResult> => {
|
|
642
668
|
const networkCode = ctx.account.ctx_metadata.network_code;
|
|
643
669
|
const publisherDomain = ctx.account.ctx_metadata.publisher_domain;
|
|
644
670
|
// When the buyer provides structured filters (flight dates, budget),
|
|
645
671
|
// forward them so each product comes back with a per-query forecast.
|
|
646
672
|
// Single upstream round-trip surfaces both the catalog and the
|
|
647
673
|
// forecast curve.
|
|
648
|
-
const
|
|
674
|
+
const filters = req['filters'] as
|
|
675
|
+
| {
|
|
676
|
+
budget_range?: { max?: number };
|
|
677
|
+
start_date?: string;
|
|
678
|
+
end_date?: string;
|
|
679
|
+
is_fixed_price?: boolean;
|
|
680
|
+
}
|
|
681
|
+
| undefined;
|
|
682
|
+
const briefBudget = filters?.budget_range?.max;
|
|
649
683
|
const products = await upstream.listProducts(networkCode, {
|
|
650
|
-
...(
|
|
651
|
-
...(
|
|
684
|
+
...(filters?.start_date && { flightStart: filters.start_date }),
|
|
685
|
+
...(filters?.end_date && { flightEnd: filters.end_date }),
|
|
652
686
|
...(briefBudget !== undefined && { budget: briefBudget }),
|
|
653
687
|
});
|
|
654
|
-
const pricingMode =
|
|
688
|
+
const pricingMode = filters?.is_fixed_price === false ? 'auction' : 'fixed';
|
|
655
689
|
return {
|
|
656
690
|
products: products.map(p => projectProduct(p, publisherDomain, pricingMode)),
|
|
657
691
|
cache_scope: 'account',
|
|
@@ -1023,17 +1057,7 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
|
|
|
1023
1057
|
const advertiserId = networkCode; // SWAP: same collapse caveat as createMediaBuy.
|
|
1024
1058
|
const out: SyncCreativesRow[] = [];
|
|
1025
1059
|
for (const c of creatives) {
|
|
1026
|
-
const
|
|
1027
|
-
const formatId = typeof formatRef === 'string' ? formatRef : formatRef?.id;
|
|
1028
|
-
if (!formatId) {
|
|
1029
|
-
out.push({
|
|
1030
|
-
creative_id: (c as { creative_id?: string }).creative_id ?? 'unknown',
|
|
1031
|
-
action: 'failed',
|
|
1032
|
-
status: 'rejected',
|
|
1033
|
-
errors: [{ code: 'CREATIVE_REJECTED', message: 'format_id is required' }],
|
|
1034
|
-
});
|
|
1035
|
-
continue;
|
|
1036
|
-
}
|
|
1060
|
+
const formatId = c.format_kind;
|
|
1037
1061
|
try {
|
|
1038
1062
|
const creativeIdHint = (c as { creative_id?: string }).creative_id;
|
|
1039
1063
|
const created = await upstream.createCreative(networkCode, {
|
|
@@ -1061,7 +1085,7 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
|
|
|
1061
1085
|
return out;
|
|
1062
1086
|
},
|
|
1063
1087
|
|
|
1064
|
-
|
|
1088
|
+
listCreativeFormatsLegacy: async (_req, _ctx): Promise<SalesLegacyListCreativeFormatsPayload> => {
|
|
1065
1089
|
// Publisher-owned format catalog. The mock doesn't have a discrete
|
|
1066
1090
|
// formats endpoint (formats live inline on Product); production sellers
|
|
1067
1091
|
// typically expose `/v1/formats` separately. SWAP: replace with your
|
|
@@ -1153,6 +1177,10 @@ serve(
|
|
|
1153
1177
|
taskStore,
|
|
1154
1178
|
idempotency: idempotencyStore,
|
|
1155
1179
|
mediaBuyStore,
|
|
1180
|
+
canonicalFormatLegacyResolver: context => {
|
|
1181
|
+
if (context.source !== 'product' || !context.declaration.format_option_id) return undefined;
|
|
1182
|
+
return { agent_url: FORMAT_AGENT_URL, id: context.declaration.format_option_id };
|
|
1183
|
+
},
|
|
1156
1184
|
resolveSessionKey: ctx => {
|
|
1157
1185
|
const acct = ctx.account as Account<NetworkMeta> | undefined;
|
|
1158
1186
|
return acct?.id ?? 'anonymous';
|
|
@@ -51,6 +51,7 @@ import {
|
|
|
51
51
|
type ProposalManager,
|
|
52
52
|
type SalesCorePlatform,
|
|
53
53
|
} from '@adcp/sdk/server';
|
|
54
|
+
import type { CanonicalProduct, GetProductsRequest } from '@adcp/sdk';
|
|
54
55
|
import { buildGAMLikeRecipe, GAM_LIKE_OVERLAP, type GAMLikeRecipe } from '@adcp/sdk/mock-server';
|
|
55
56
|
import type {
|
|
56
57
|
AccountReference,
|
|
@@ -60,16 +61,13 @@ import type {
|
|
|
60
61
|
GetMediaBuyDeliveryResponse,
|
|
61
62
|
GetMediaBuysRequest,
|
|
62
63
|
GetMediaBuysResponse,
|
|
63
|
-
GetProductsRequest,
|
|
64
64
|
GetProductsResponse,
|
|
65
65
|
UpdateMediaBuyRequest,
|
|
66
66
|
UpdateMediaBuySuccess,
|
|
67
67
|
} from '@adcp/sdk/types';
|
|
68
68
|
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
// `hello_seller_adapter_guaranteed.ts`).
|
|
72
|
-
type Product = NonNullable<GetProductsResponse['products']>[number];
|
|
69
|
+
// Proposal remains a generated wire type. Products use the SDK's canonical
|
|
70
|
+
// primary surface; legacy format IDs are projected only at the wire boundary.
|
|
73
71
|
type Proposal = NonNullable<GetProductsResponse['proposals']>[number];
|
|
74
72
|
type Package = CreateMediaBuySuccess['packages'][number];
|
|
75
73
|
|
|
@@ -274,13 +272,38 @@ const accounts: AccountStore<NetworkMeta> = {
|
|
|
274
272
|
// recipes onto ctx.recipes for sales.createMediaBuy.
|
|
275
273
|
// ---------------------------------------------------------------------------
|
|
276
274
|
|
|
277
|
-
|
|
275
|
+
function canonicalFormatOptions(p: UpstreamProduct): CanonicalProduct['format_options'] {
|
|
276
|
+
const options = p.format_ids.map(id => {
|
|
277
|
+
const durationSeconds = id.match(/(?:^|_)(\d+)s(?:_|$)/)?.[1];
|
|
278
|
+
if (p.channel === 'video' || p.channel === 'ctv') {
|
|
279
|
+
return {
|
|
280
|
+
format_option_id: id,
|
|
281
|
+
format_kind: 'video_hosted' as const,
|
|
282
|
+
params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
if (p.channel === 'audio') {
|
|
286
|
+
return {
|
|
287
|
+
format_option_id: id,
|
|
288
|
+
format_kind: 'audio_hosted' as const,
|
|
289
|
+
params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
const dimensions = id.match(/(?:^|_)(\d+)x(\d+)(?:_|$)/);
|
|
293
|
+
return {
|
|
294
|
+
format_option_id: id,
|
|
295
|
+
format_kind: 'image' as const,
|
|
296
|
+
params: dimensions ? { width: Number(dimensions[1]), height: Number(dimensions[2]) } : {},
|
|
297
|
+
};
|
|
298
|
+
});
|
|
299
|
+
if (options.length === 0) {
|
|
300
|
+
throw new AdcpError('INVALID_REQUEST', { message: `product ${p.product_id} has no creative formats` });
|
|
301
|
+
}
|
|
302
|
+
return [options[0]!, ...options.slice(1)];
|
|
303
|
+
}
|
|
278
304
|
|
|
279
|
-
function projectProduct(p: UpstreamProduct, publisherDomain: string, recipe: GAMLikeRecipe):
|
|
280
|
-
|
|
281
|
-
// — adapters attach it on the wire and the framework reads it back
|
|
282
|
-
// via cast in the dispatch helpers. We do the same on the way out.
|
|
283
|
-
const product: Product = {
|
|
305
|
+
function projectProduct(p: UpstreamProduct, publisherDomain: string, recipe: GAMLikeRecipe): CanonicalProduct {
|
|
306
|
+
const product: CanonicalProduct = {
|
|
284
307
|
product_id: p.product_id,
|
|
285
308
|
name: p.name,
|
|
286
309
|
description: `${p.name} — ${p.delivery_type} ${p.channel}`,
|
|
@@ -294,7 +317,7 @@ function projectProduct(p: UpstreamProduct, publisherDomain: string, recipe: GAM
|
|
|
294
317
|
? 'streaming_audio'
|
|
295
318
|
: 'display',
|
|
296
319
|
],
|
|
297
|
-
|
|
320
|
+
format_options: canonicalFormatOptions(p),
|
|
298
321
|
delivery_type: p.delivery_type,
|
|
299
322
|
pricing_options: [
|
|
300
323
|
{
|
|
@@ -314,8 +337,7 @@ function projectProduct(p: UpstreamProduct, publisherDomain: string, recipe: GAM
|
|
|
314
337
|
date_range_support: 'date_range',
|
|
315
338
|
},
|
|
316
339
|
};
|
|
317
|
-
//
|
|
318
|
-
// that's not in the generated `Product` interface.
|
|
340
|
+
// implementation_config is an adopter-private recipe carrier.
|
|
319
341
|
(product as { implementation_config?: GAMLikeRecipe }).implementation_config = recipe;
|
|
320
342
|
return product;
|
|
321
343
|
}
|
|
@@ -627,6 +649,10 @@ serve(
|
|
|
627
649
|
stateStore,
|
|
628
650
|
mediaBuyStore,
|
|
629
651
|
proposalStore,
|
|
652
|
+
canonicalFormatLegacyResolver: context => {
|
|
653
|
+
if (context.source !== 'product' || !context.declaration.format_option_id) return undefined;
|
|
654
|
+
return { agent_url: PUBLIC_AGENT_URL, id: context.declaration.format_option_id };
|
|
655
|
+
},
|
|
630
656
|
resolveSessionKey: ctx => {
|
|
631
657
|
const acct = ctx.account as Account<NetworkMeta> | undefined;
|
|
632
658
|
return acct?.id ?? 'anonymous';
|
|
@@ -705,12 +705,6 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
|
|
|
705
705
|
const rows: SyncCreativesRow[] = [];
|
|
706
706
|
for (const c of creatives) {
|
|
707
707
|
try {
|
|
708
|
-
if (!c.format_id) {
|
|
709
|
-
throw new AdcpError('INVALID_REQUEST', {
|
|
710
|
-
message: 'format_id required on creative manifest',
|
|
711
|
-
field: 'format_id',
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
708
|
// Project AdCP `CreativeAsset.assets` (the asset map keyed by
|
|
715
709
|
// asset_id) onto the upstream native creative shape. Asset values
|
|
716
710
|
// carry an `asset_type` discriminator; we read the typed sub-shapes
|
|
@@ -722,11 +716,12 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
|
|
|
722
716
|
const landingPageUrl =
|
|
723
717
|
readUrl(assets['click_url']) ?? readUrl(assets['landing_page']) ?? 'https://example.com';
|
|
724
718
|
const mediaUrl = readUrl(assets['image']) ?? readUrl(assets['video']) ?? 'https://example.com/asset';
|
|
719
|
+
const upstreamFormatId = c.format_kind === 'native_in_feed' ? 'native_feed' : c.format_kind;
|
|
725
720
|
|
|
726
721
|
const created = await upstream.createCreative(advertiserId, {
|
|
727
722
|
creative_id: c.creative_id,
|
|
728
723
|
name: c.name,
|
|
729
|
-
format_id:
|
|
724
|
+
format_id: upstreamFormatId,
|
|
730
725
|
primary_text: primaryText,
|
|
731
726
|
landing_page_url: landingPageUrl,
|
|
732
727
|
media_url: mediaUrl,
|
|
@@ -29,7 +29,7 @@ async function main() {
|
|
|
29
29
|
|
|
30
30
|
// List all formats
|
|
31
31
|
console.log('📋 Fetching all creative formats...');
|
|
32
|
-
const result = await creativeAgent.
|
|
32
|
+
const result = await creativeAgent.listCreativeFormatsLegacy({});
|
|
33
33
|
|
|
34
34
|
if (!result.success || !result.data) {
|
|
35
35
|
console.error('❌ Failed to fetch formats:', result.error);
|
|
@@ -161,7 +161,7 @@ async function campaignWorkflow() {
|
|
|
161
161
|
|
|
162
162
|
// Step 2: Check available creative formats
|
|
163
163
|
console.log('\n2️⃣ Checking creative format options...');
|
|
164
|
-
const formats = await agent.
|
|
164
|
+
const formats = await agent.listCreativeFormatsLegacy(
|
|
165
165
|
{
|
|
166
166
|
type: 'video',
|
|
167
167
|
},
|
|
@@ -180,7 +180,7 @@ async function variousOperations() {
|
|
|
180
180
|
|
|
181
181
|
// List creative formats
|
|
182
182
|
console.log('2. Listing creative formats...');
|
|
183
|
-
const formats = await testAgent.
|
|
183
|
+
const formats = await testAgent.listCreativeFormatsLegacy({});
|
|
184
184
|
console.log(` ${formats.success ? '✅' : '❌'} Formats: ${formats.data.formats?.length || 0}`);
|
|
185
185
|
|
|
186
186
|
// Create a media buy
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adcp/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0-rc.0",
|
|
4
4
|
"description": "AdCP SDK — client, server, and compliance harnesses for the AdContext Protocol (MCP + A2A)",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
".",
|
|
@@ -568,7 +568,7 @@
|
|
|
568
568
|
"email": "bugs@adcontextprotocol.org"
|
|
569
569
|
},
|
|
570
570
|
"dependencies": {
|
|
571
|
-
"@modelcontextprotocol/client": "2.0.0-beta.
|
|
571
|
+
"@modelcontextprotocol/client": "2.0.0-beta.5",
|
|
572
572
|
"@modelcontextprotocol/node": "2.0.0-beta.4",
|
|
573
573
|
"@modelcontextprotocol/server": "2.0.0-beta.4",
|
|
574
574
|
"@types/ws": "^8.18.1",
|
|
@@ -104,7 +104,7 @@ class WatermarkPlatform implements DecisioningPlatform<WatermarkConfig, Watermar
|
|
|
104
104
|
|
|
105
105
|
creative: CreativeBuilderPlatform<WatermarkMeta> = {
|
|
106
106
|
/** Sync transform — fast operation, return result immediately. */
|
|
107
|
-
|
|
107
|
+
buildCreativeLegacy: async (req: BuildCreativeRequest): Promise<CreativeManifest> => {
|
|
108
108
|
// requireAsset throws AdcpError with field path if missing/wrong type.
|
|
109
109
|
// After the call, TS narrows `source` to `ImageAsset` — no cast needed.
|
|
110
110
|
const source = requireAsset(req.creative_manifest, 'source_image', 'image');
|
|
@@ -132,7 +132,7 @@ class WatermarkPlatform implements DecisioningPlatform<WatermarkConfig, Watermar
|
|
|
132
132
|
},
|
|
133
133
|
|
|
134
134
|
/** Always sync — preview is just a sandbox URL. */
|
|
135
|
-
|
|
135
|
+
previewCreativeLegacy: async (req: PreviewCreativeRequest): Promise<PreviewCreativeResponse> => {
|
|
136
136
|
// Soft-form helper — preview is best-effort even if source is missing.
|
|
137
137
|
const source = getAsset(req.creative_manifest, 'source_image', 'image');
|
|
138
138
|
const sourceUrl = source?.url ?? '';
|
|
@@ -228,17 +228,17 @@ return {
|
|
|
228
228
|
|
|
229
229
|
`CreativeBuilderPlatform` has 5 method slots. **For each method-pair you implement EXACTLY ONE — sync OR `*Task`** — `validatePlatform()` will throw at construction if you provide both.
|
|
230
230
|
|
|
231
|
-
| Slot | Sync variant
|
|
232
|
-
| ---------------- |
|
|
233
|
-
| build creative | `
|
|
234
|
-
| preview creative | `
|
|
235
|
-
| sync creatives | `syncCreatives(creatives, ctx)`
|
|
231
|
+
| Slot | Sync variant | HITL `*Task` variant | Required? |
|
|
232
|
+
| ---------------- | --------------------------------- | ------------------------------------------- | ------------ |
|
|
233
|
+
| build creative | `buildCreativeLegacy(req, ctx)` | `buildCreativeTask(taskId, req, ctx)` | One required |
|
|
234
|
+
| preview creative | `previewCreativeLegacy(req, ctx)` | — (always sync) | Required |
|
|
235
|
+
| sync creatives | `syncCreatives(creatives, ctx)` | `syncCreativesTask(taskId, creatives, ctx)` | One required |
|
|
236
236
|
|
|
237
237
|
### Sync vs `*Task` — pick by latency, not by preference
|
|
238
238
|
|
|
239
239
|
| Your operation typically takes... | Pick |
|
|
240
240
|
| ----------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
241
|
-
| Under ~5 seconds (image manipulation, simple template fill) | **Sync** (`
|
|
241
|
+
| Under ~5 seconds (image manipulation, simple template fill) | **Sync** (`buildCreativeLegacy`) |
|
|
242
242
|
| 10-60 seconds (TTS, audio mixing, video transcode) | **Sync** is fine — buyer awaits in the request |
|
|
243
243
|
| 1-30 minutes (heavy generation, multi-pass rendering) | **HITL** (`buildCreativeTask`) — buyer immediately gets a `submitted` envelope with `task_id` |
|
|
244
244
|
| Unknown / variable | Pick sync; switch to `*Task` only if observed latency > 30s |
|
|
@@ -310,7 +310,7 @@ Both helpers preserve the discriminator narrowing — `script.content` types cor
|
|
|
310
310
|
Every method either returns its success type OR throws `AdcpError` for structured rejection. Generic thrown errors map to `SERVICE_UNAVAILABLE` with `recovery: 'transient'`.
|
|
311
311
|
|
|
312
312
|
```ts
|
|
313
|
-
|
|
313
|
+
buildCreativeLegacy: async req => {
|
|
314
314
|
if (!req.format_id?.id?.startsWith('image_')) {
|
|
315
315
|
throw new AdcpError('UNSUPPORTED_FEATURE', {
|
|
316
316
|
recovery: 'terminal',
|
|
@@ -352,7 +352,7 @@ The framework consumes `idempotency_key` on every mutating request before dispat
|
|
|
352
352
|
What you SHOULD do: pass `req.idempotency_key` to your upstream API's idempotency parameter when you call into GAM / Snap / Meta / your internal services. That makes the dedupe story end-to-end — if the AdCP layer dedupes a request, your upstream platform won't double-charge a CPM either.
|
|
353
353
|
|
|
354
354
|
```ts
|
|
355
|
-
|
|
355
|
+
buildCreativeLegacy: async req => {
|
|
356
356
|
// Framework already deduped for the (idempotency_key, account) pair.
|
|
357
357
|
// Thread the same key into the upstream call so YOUR platform's API
|
|
358
358
|
// also dedupes if the same key arrives twice (defensive).
|
|
@@ -489,7 +489,7 @@ For HITL platforms, `server.awaitTask(taskId)` settles the background promise; `
|
|
|
489
489
|
|
|
490
490
|
❌ **Don't use `ctx.runAsync(...)` or `ctx.startTask(...)`.** The async story is dual-method (`xxx` vs `xxxTask`), period.
|
|
491
491
|
|
|
492
|
-
❌ **Don't define both `
|
|
492
|
+
❌ **Don't define both `buildCreativeLegacy` and `buildCreativeTask`.** `validatePlatform()` will throw with a clear diagnostic. Pick one.
|
|
493
493
|
|
|
494
494
|
❌ **Don't return error envelopes manually.** Throw `AdcpError`; the framework projects to the wire shape.
|
|
495
495
|
|