@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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var legacy_metadata_exports = {};
|
|
20
|
+
__export(legacy_metadata_exports, {
|
|
21
|
+
concealLegacyFormatRefs: () => concealLegacyFormatRefs,
|
|
22
|
+
concealSelectedFormatOptions: () => concealSelectedFormatOptions,
|
|
23
|
+
legacyFormatRefsForDeclaration: () => legacyFormatRefsForDeclaration,
|
|
24
|
+
selectedFormatOptions: () => selectedFormatOptions,
|
|
25
|
+
transferLegacyCreativeMetadata: () => transferLegacyCreativeMetadata
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(legacy_metadata_exports);
|
|
28
|
+
const legacyRefsByDeclaration = /* @__PURE__ */ new WeakMap();
|
|
29
|
+
const selectedOptionsByRefs = /* @__PURE__ */ new WeakMap();
|
|
30
|
+
function concealLegacyFormatRefs(declaration) {
|
|
31
|
+
const { v1_format_ref: refs, ...canonical } = declaration;
|
|
32
|
+
const existingHidden = legacyRefsByDeclaration.get(declaration);
|
|
33
|
+
const refsToConceal = Array.isArray(existingHidden) && existingHidden.length > 0 ? existingHidden : refs;
|
|
34
|
+
if (Array.isArray(refsToConceal) && refsToConceal.length > 0) {
|
|
35
|
+
legacyRefsByDeclaration.set(
|
|
36
|
+
canonical,
|
|
37
|
+
refsToConceal.map((ref) => ({ ...ref }))
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return canonical;
|
|
41
|
+
}
|
|
42
|
+
function legacyFormatRefsForDeclaration(value) {
|
|
43
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
44
|
+
const declaration = value;
|
|
45
|
+
const hidden = legacyRefsByDeclaration.get(declaration);
|
|
46
|
+
if (Array.isArray(hidden)) return hidden;
|
|
47
|
+
return Array.isArray(declaration.v1_format_ref) ? declaration.v1_format_ref : [];
|
|
48
|
+
}
|
|
49
|
+
function selectedFormatOptions(value) {
|
|
50
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
51
|
+
const refs = value.format_option_refs;
|
|
52
|
+
if (!Array.isArray(refs)) return [];
|
|
53
|
+
const selected = selectedOptionsByRefs.get(refs);
|
|
54
|
+
return Array.isArray(selected) ? selected : [];
|
|
55
|
+
}
|
|
56
|
+
function concealSelectedFormatOptions(refs, declarations) {
|
|
57
|
+
selectedOptionsByRefs.set(refs, declarations);
|
|
58
|
+
}
|
|
59
|
+
function transferLegacyCreativeMetadata(source, target) {
|
|
60
|
+
const refs = legacyRefsByDeclaration.get(source);
|
|
61
|
+
if (refs) legacyRefsByDeclaration.set(target, refs);
|
|
62
|
+
const selected = selectedOptionsByRefs.get(source);
|
|
63
|
+
if (selected) selectedOptionsByRefs.set(target, selected);
|
|
64
|
+
}
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
concealLegacyFormatRefs,
|
|
68
|
+
concealSelectedFormatOptions,
|
|
69
|
+
legacyFormatRefsForDeclaration,
|
|
70
|
+
selectedFormatOptions,
|
|
71
|
+
transferLegacyCreativeMetadata
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=legacy-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/v2/projection/legacy-metadata.ts"],"sourcesContent":["import type { ProductFormatDeclaration } from '../../types/tools.generated';\nimport type { V1FormatId, V2ProductFormatDeclaration } from './types';\n\n/**\n * SDK-private downgrade metadata held out-of-band. WeakMaps keep legacy\n * routing identifiers absent from canonical objects even under reflective\n * inspection while still allowing object-spread package authoring.\n */\n\nexport type CanonicalFormatDeclaration = Omit<V2ProductFormatDeclaration, 'v1_format_ref'> & {\n v1_format_ref?: never;\n};\n\ntype DeclarationWithMetadata = CanonicalFormatDeclaration;\n\nexport type PackageSelectionMetadata = {\n format_option_refs?: readonly unknown[];\n};\n\nconst legacyRefsByDeclaration = new WeakMap<object, readonly V1FormatId[]>();\nconst selectedOptionsByRefs = new WeakMap<object, readonly DeclarationWithMetadata[]>();\n\nexport function concealLegacyFormatRefs(\n declaration: ProductFormatDeclaration | V2ProductFormatDeclaration | CanonicalFormatDeclaration\n): DeclarationWithMetadata {\n const { v1_format_ref: refs, ...canonical } = declaration as ProductFormatDeclaration;\n const existingHidden = legacyRefsByDeclaration.get(declaration as object);\n const refsToConceal = Array.isArray(existingHidden) && existingHidden.length > 0 ? existingHidden : refs;\n if (Array.isArray(refsToConceal) && refsToConceal.length > 0) {\n legacyRefsByDeclaration.set(\n canonical,\n refsToConceal.map(ref => ({ ...ref }))\n );\n }\n return canonical as DeclarationWithMetadata;\n}\n\nexport function legacyFormatRefsForDeclaration(value: unknown): readonly V1FormatId[] {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return [];\n const declaration = value as ProductFormatDeclaration & DeclarationWithMetadata;\n const hidden = legacyRefsByDeclaration.get(declaration);\n if (Array.isArray(hidden)) return hidden;\n return Array.isArray(declaration.v1_format_ref) ? declaration.v1_format_ref : [];\n}\n\nexport function selectedFormatOptions(value: unknown): readonly DeclarationWithMetadata[] {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return [];\n const refs = (value as PackageSelectionMetadata).format_option_refs;\n if (!Array.isArray(refs)) return [];\n const selected = selectedOptionsByRefs.get(refs);\n return Array.isArray(selected) ? selected : [];\n}\n\nexport function concealSelectedFormatOptions(\n refs: readonly unknown[],\n declarations: readonly DeclarationWithMetadata[]\n): void {\n selectedOptionsByRefs.set(refs, declarations);\n}\n\n/** Preserve out-of-band downgrade metadata when a canonical sanitizer clones a value. */\nexport function transferLegacyCreativeMetadata(source: object, target: object): void {\n const refs = legacyRefsByDeclaration.get(source);\n if (refs) legacyRefsByDeclaration.set(target, refs);\n const selected = selectedOptionsByRefs.get(source);\n if (selected) selectedOptionsByRefs.set(target, selected);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA,MAAM,0BAA0B,oBAAI,QAAuC;AAC3E,MAAM,wBAAwB,oBAAI,QAAoD;AAE/E,SAAS,wBACd,aACyB;AACzB,QAAM,EAAE,eAAe,MAAM,GAAG,UAAU,IAAI;AAC9C,QAAM,iBAAiB,wBAAwB,IAAI,WAAqB;AACxE,QAAM,gBAAgB,MAAM,QAAQ,cAAc,KAAK,eAAe,SAAS,IAAI,iBAAiB;AACpG,MAAI,MAAM,QAAQ,aAAa,KAAK,cAAc,SAAS,GAAG;AAC5D,4BAAwB;AAAA,MACtB;AAAA,MACA,cAAc,IAAI,UAAQ,EAAE,GAAG,IAAI,EAAE;AAAA,IACvC;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,+BAA+B,OAAuC;AACpF,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,EAAG,QAAO,CAAC;AACzE,QAAM,cAAc;AACpB,QAAM,SAAS,wBAAwB,IAAI,WAAW;AACtD,MAAI,MAAM,QAAQ,MAAM,EAAG,QAAO;AAClC,SAAO,MAAM,QAAQ,YAAY,aAAa,IAAI,YAAY,gBAAgB,CAAC;AACjF;AAEO,SAAS,sBAAsB,OAAoD;AACxF,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,EAAG,QAAO,CAAC;AACzE,QAAM,OAAQ,MAAmC;AACjD,MAAI,CAAC,MAAM,QAAQ,IAAI,EAAG,QAAO,CAAC;AAClC,QAAM,WAAW,sBAAsB,IAAI,IAAI;AAC/C,SAAO,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC;AAC/C;AAEO,SAAS,6BACd,MACA,cACM;AACN,wBAAsB,IAAI,MAAM,YAAY;AAC9C;AAGO,SAAS,+BAA+B,QAAgB,QAAsB;AACnF,QAAM,OAAO,wBAAwB,IAAI,MAAM;AAC/C,MAAI,KAAM,yBAAwB,IAAI,QAAQ,IAAI;AAClD,QAAM,WAAW,sBAAsB,IAAI,MAAM;AACjD,MAAI,SAAU,uBAAsB,IAAI,QAAQ,QAAQ;AAC1D;","names":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const legacyRefsByDeclaration = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
const selectedOptionsByRefs = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function concealLegacyFormatRefs(declaration) {
|
|
4
|
+
const { v1_format_ref: refs, ...canonical } = declaration;
|
|
5
|
+
const existingHidden = legacyRefsByDeclaration.get(declaration);
|
|
6
|
+
const refsToConceal = Array.isArray(existingHidden) && existingHidden.length > 0 ? existingHidden : refs;
|
|
7
|
+
if (Array.isArray(refsToConceal) && refsToConceal.length > 0) {
|
|
8
|
+
legacyRefsByDeclaration.set(
|
|
9
|
+
canonical,
|
|
10
|
+
refsToConceal.map((ref) => ({ ...ref }))
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
return canonical;
|
|
14
|
+
}
|
|
15
|
+
function legacyFormatRefsForDeclaration(value) {
|
|
16
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
17
|
+
const declaration = value;
|
|
18
|
+
const hidden = legacyRefsByDeclaration.get(declaration);
|
|
19
|
+
if (Array.isArray(hidden)) return hidden;
|
|
20
|
+
return Array.isArray(declaration.v1_format_ref) ? declaration.v1_format_ref : [];
|
|
21
|
+
}
|
|
22
|
+
function selectedFormatOptions(value) {
|
|
23
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
24
|
+
const refs = value.format_option_refs;
|
|
25
|
+
if (!Array.isArray(refs)) return [];
|
|
26
|
+
const selected = selectedOptionsByRefs.get(refs);
|
|
27
|
+
return Array.isArray(selected) ? selected : [];
|
|
28
|
+
}
|
|
29
|
+
function concealSelectedFormatOptions(refs, declarations) {
|
|
30
|
+
selectedOptionsByRefs.set(refs, declarations);
|
|
31
|
+
}
|
|
32
|
+
function transferLegacyCreativeMetadata(source, target) {
|
|
33
|
+
const refs = legacyRefsByDeclaration.get(source);
|
|
34
|
+
if (refs) legacyRefsByDeclaration.set(target, refs);
|
|
35
|
+
const selected = selectedOptionsByRefs.get(source);
|
|
36
|
+
if (selected) selectedOptionsByRefs.set(target, selected);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
concealLegacyFormatRefs,
|
|
40
|
+
concealSelectedFormatOptions,
|
|
41
|
+
legacyFormatRefsForDeclaration,
|
|
42
|
+
selectedFormatOptions,
|
|
43
|
+
transferLegacyCreativeMetadata
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=legacy-metadata.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/v2/projection/legacy-metadata.ts"],"sourcesContent":["import type { ProductFormatDeclaration } from '../../types/tools.generated';\nimport type { V1FormatId, V2ProductFormatDeclaration } from './types';\n\n/**\n * SDK-private downgrade metadata held out-of-band. WeakMaps keep legacy\n * routing identifiers absent from canonical objects even under reflective\n * inspection while still allowing object-spread package authoring.\n */\n\nexport type CanonicalFormatDeclaration = Omit<V2ProductFormatDeclaration, 'v1_format_ref'> & {\n v1_format_ref?: never;\n};\n\ntype DeclarationWithMetadata = CanonicalFormatDeclaration;\n\nexport type PackageSelectionMetadata = {\n format_option_refs?: readonly unknown[];\n};\n\nconst legacyRefsByDeclaration = new WeakMap<object, readonly V1FormatId[]>();\nconst selectedOptionsByRefs = new WeakMap<object, readonly DeclarationWithMetadata[]>();\n\nexport function concealLegacyFormatRefs(\n declaration: ProductFormatDeclaration | V2ProductFormatDeclaration | CanonicalFormatDeclaration\n): DeclarationWithMetadata {\n const { v1_format_ref: refs, ...canonical } = declaration as ProductFormatDeclaration;\n const existingHidden = legacyRefsByDeclaration.get(declaration as object);\n const refsToConceal = Array.isArray(existingHidden) && existingHidden.length > 0 ? existingHidden : refs;\n if (Array.isArray(refsToConceal) && refsToConceal.length > 0) {\n legacyRefsByDeclaration.set(\n canonical,\n refsToConceal.map(ref => ({ ...ref }))\n );\n }\n return canonical as DeclarationWithMetadata;\n}\n\nexport function legacyFormatRefsForDeclaration(value: unknown): readonly V1FormatId[] {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return [];\n const declaration = value as ProductFormatDeclaration & DeclarationWithMetadata;\n const hidden = legacyRefsByDeclaration.get(declaration);\n if (Array.isArray(hidden)) return hidden;\n return Array.isArray(declaration.v1_format_ref) ? declaration.v1_format_ref : [];\n}\n\nexport function selectedFormatOptions(value: unknown): readonly DeclarationWithMetadata[] {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return [];\n const refs = (value as PackageSelectionMetadata).format_option_refs;\n if (!Array.isArray(refs)) return [];\n const selected = selectedOptionsByRefs.get(refs);\n return Array.isArray(selected) ? selected : [];\n}\n\nexport function concealSelectedFormatOptions(\n refs: readonly unknown[],\n declarations: readonly DeclarationWithMetadata[]\n): void {\n selectedOptionsByRefs.set(refs, declarations);\n}\n\n/** Preserve out-of-band downgrade metadata when a canonical sanitizer clones a value. */\nexport function transferLegacyCreativeMetadata(source: object, target: object): void {\n const refs = legacyRefsByDeclaration.get(source);\n if (refs) legacyRefsByDeclaration.set(target, refs);\n const selected = selectedOptionsByRefs.get(source);\n if (selected) selectedOptionsByRefs.set(target, selected);\n}\n"],"mappings":"AAmBA,MAAM,0BAA0B,oBAAI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AQ,QAAQ;AAC1D;","names":[]}
|
|
@@ -79,8 +79,9 @@ export interface V1Product {
|
|
|
79
79
|
[k: string]: unknown;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
82
|
+
* Internal structured diagnostic produced by the pure projection algorithms.
|
|
83
|
+
* `toCanonicalOnlyResponse()` flattens this into the protocol `Error` shape
|
|
84
|
+
* (`message` plus top-level `details`) before augmenting `errors[]`.
|
|
84
85
|
* Spec codes — `FORMAT_PROJECTION_FAILED` and `FORMAT_DECLARATION_V1_AMBIGUOUS`
|
|
85
86
|
* — come straight from `enums/error-code.json`. The two SDK-local codes
|
|
86
87
|
* (`*_NOT_APPLICABLE`, `CANONICAL_NOT_V1_TRANSLATABLE`) cover cases the
|
|
@@ -88,10 +89,9 @@ export interface V1Product {
|
|
|
88
89
|
* skip silently") but where buyer-side transparency is more useful
|
|
89
90
|
* than silent product drops.
|
|
90
91
|
*
|
|
91
|
-
* **Never logger-only**, per the resolution-order amendment
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* `errors[]`.
|
|
92
|
+
* **Never logger-only**, per the resolution-order amendment. The internal
|
|
93
|
+
* nesting keeps projection code strongly discriminated; it is not itself a
|
|
94
|
+
* wire/protocol Error and must be normalized before public response emission.
|
|
95
95
|
*/
|
|
96
96
|
export interface ProjectionDiagnosticBase {
|
|
97
97
|
/** Spec-mandated origin marker for SDK-augmented diagnostics. */
|
|
@@ -102,6 +102,19 @@ export interface ProjectionDiagnosticBase {
|
|
|
102
102
|
field: string;
|
|
103
103
|
}
|
|
104
104
|
export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
|
|
105
|
+
/**
|
|
106
|
+
* SDK-local code: a valid seller product cannot be represented on the
|
|
107
|
+
* canonical-only public surface because it has no canonical option.
|
|
108
|
+
* Legacy `format_ids: []` is format-agnostic, not a failed lookup.
|
|
109
|
+
*/
|
|
110
|
+
code: 'CANONICAL_PRODUCT_FORMATS_UNAVAILABLE';
|
|
111
|
+
error: {
|
|
112
|
+
details: {
|
|
113
|
+
product_id: string;
|
|
114
|
+
reason: 'legacy_format_list_empty' | 'canonical_format_list_empty' | 'missing_format_declaration' | 'nested_placement_format_list_empty';
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
}) | (ProjectionDiagnosticBase & {
|
|
105
118
|
/**
|
|
106
119
|
* Spec code (`enums/error-code.json`): registry-coverage gap or
|
|
107
120
|
* v1-catalog-coverage gap depending on `resolution_failure`:
|
|
@@ -119,6 +132,10 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
|
|
|
119
132
|
* possible"; this signals "no v2 form yet."
|
|
120
133
|
* - `no_match` — v1→v2 direction, format not in catalog or
|
|
121
134
|
* registry, no structural match.
|
|
135
|
+
* - `invalid_format_id_parameters` — the legacy ref carries
|
|
136
|
+
* malformed dimensional or duration discriminators.
|
|
137
|
+
* - `catalog_requirement_conflict` — catalog-authored fixed
|
|
138
|
+
* requirements are internally ambiguous or contradict the ref.
|
|
122
139
|
*/
|
|
123
140
|
code: 'FORMAT_PROJECTION_FAILED';
|
|
124
141
|
error: {
|
|
@@ -126,7 +143,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
|
|
|
126
143
|
format_kind: CanonicalFormatKind;
|
|
127
144
|
product_id: string;
|
|
128
145
|
format_option_id?: string;
|
|
129
|
-
resolution_failure: 'no_registry_match' | 'catalog_lacks_canonical_annotation' | 'no_match';
|
|
146
|
+
resolution_failure: 'no_registry_match' | 'catalog_lacks_canonical_annotation' | 'no_match' | 'custom_converter_failed' | 'invalid_format_id_parameters' | 'catalog_requirement_conflict';
|
|
147
|
+
converter_error?: string;
|
|
130
148
|
};
|
|
131
149
|
};
|
|
132
150
|
}) | (ProjectionDiagnosticBase & {
|
|
@@ -226,8 +244,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
|
|
|
226
244
|
}) | (ProjectionDiagnosticBase & {
|
|
227
245
|
/**
|
|
228
246
|
* SDK-local code: canonical-only projection (`toCanonicalOnlyProduct`
|
|
229
|
-
* / `toCanonicalOnlyResponse`)
|
|
230
|
-
*
|
|
247
|
+
* / `toCanonicalOnlyResponse`) found legacy routing metadata that no
|
|
248
|
+
* canonical format option covers. Emitted only on the
|
|
231
249
|
* v2-native pass-through path — a seller that sent `format_options[]`
|
|
232
250
|
* directly but also carried a `format_ids[]` entry with no canonical
|
|
233
251
|
* representation. Without it, canonical-only mode would silently
|
|
@@ -243,20 +261,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
|
|
|
243
261
|
error: {
|
|
244
262
|
details: {
|
|
245
263
|
product_id: string;
|
|
246
|
-
/**
|
|
247
|
-
|
|
248
|
-
* discriminators (`width` / `height` / `duration_ms`) when the
|
|
249
|
-
* input carried them — so a buyer can tell which variant of a
|
|
250
|
-
* multi-size/multi-duration family was lost and re-acquire it on
|
|
251
|
-
* the v1 path. Omitted keys mean the input ref carried no value.
|
|
252
|
-
*/
|
|
253
|
-
dropped_format_id: {
|
|
254
|
-
agent_url: string;
|
|
255
|
-
id: string;
|
|
256
|
-
width?: number;
|
|
257
|
-
height?: number;
|
|
258
|
-
duration_ms?: number;
|
|
259
|
-
};
|
|
264
|
+
/** Stable category only; canonical diagnostics never echo routing identifiers. */
|
|
265
|
+
resolution_failure: 'unmapped_legacy_format';
|
|
260
266
|
};
|
|
261
267
|
};
|
|
262
268
|
});
|
|
@@ -79,8 +79,9 @@ export interface V1Product {
|
|
|
79
79
|
[k: string]: unknown;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
82
|
+
* Internal structured diagnostic produced by the pure projection algorithms.
|
|
83
|
+
* `toCanonicalOnlyResponse()` flattens this into the protocol `Error` shape
|
|
84
|
+
* (`message` plus top-level `details`) before augmenting `errors[]`.
|
|
84
85
|
* Spec codes — `FORMAT_PROJECTION_FAILED` and `FORMAT_DECLARATION_V1_AMBIGUOUS`
|
|
85
86
|
* — come straight from `enums/error-code.json`. The two SDK-local codes
|
|
86
87
|
* (`*_NOT_APPLICABLE`, `CANONICAL_NOT_V1_TRANSLATABLE`) cover cases the
|
|
@@ -88,10 +89,9 @@ export interface V1Product {
|
|
|
88
89
|
* skip silently") but where buyer-side transparency is more useful
|
|
89
90
|
* than silent product drops.
|
|
90
91
|
*
|
|
91
|
-
* **Never logger-only**, per the resolution-order amendment
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* `errors[]`.
|
|
92
|
+
* **Never logger-only**, per the resolution-order amendment. The internal
|
|
93
|
+
* nesting keeps projection code strongly discriminated; it is not itself a
|
|
94
|
+
* wire/protocol Error and must be normalized before public response emission.
|
|
95
95
|
*/
|
|
96
96
|
export interface ProjectionDiagnosticBase {
|
|
97
97
|
/** Spec-mandated origin marker for SDK-augmented diagnostics. */
|
|
@@ -102,6 +102,19 @@ export interface ProjectionDiagnosticBase {
|
|
|
102
102
|
field: string;
|
|
103
103
|
}
|
|
104
104
|
export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
|
|
105
|
+
/**
|
|
106
|
+
* SDK-local code: a valid seller product cannot be represented on the
|
|
107
|
+
* canonical-only public surface because it has no canonical option.
|
|
108
|
+
* Legacy `format_ids: []` is format-agnostic, not a failed lookup.
|
|
109
|
+
*/
|
|
110
|
+
code: 'CANONICAL_PRODUCT_FORMATS_UNAVAILABLE';
|
|
111
|
+
error: {
|
|
112
|
+
details: {
|
|
113
|
+
product_id: string;
|
|
114
|
+
reason: 'legacy_format_list_empty' | 'canonical_format_list_empty' | 'missing_format_declaration' | 'nested_placement_format_list_empty';
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
}) | (ProjectionDiagnosticBase & {
|
|
105
118
|
/**
|
|
106
119
|
* Spec code (`enums/error-code.json`): registry-coverage gap or
|
|
107
120
|
* v1-catalog-coverage gap depending on `resolution_failure`:
|
|
@@ -119,6 +132,10 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
|
|
|
119
132
|
* possible"; this signals "no v2 form yet."
|
|
120
133
|
* - `no_match` — v1→v2 direction, format not in catalog or
|
|
121
134
|
* registry, no structural match.
|
|
135
|
+
* - `invalid_format_id_parameters` — the legacy ref carries
|
|
136
|
+
* malformed dimensional or duration discriminators.
|
|
137
|
+
* - `catalog_requirement_conflict` — catalog-authored fixed
|
|
138
|
+
* requirements are internally ambiguous or contradict the ref.
|
|
122
139
|
*/
|
|
123
140
|
code: 'FORMAT_PROJECTION_FAILED';
|
|
124
141
|
error: {
|
|
@@ -126,7 +143,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
|
|
|
126
143
|
format_kind: CanonicalFormatKind;
|
|
127
144
|
product_id: string;
|
|
128
145
|
format_option_id?: string;
|
|
129
|
-
resolution_failure: 'no_registry_match' | 'catalog_lacks_canonical_annotation' | 'no_match';
|
|
146
|
+
resolution_failure: 'no_registry_match' | 'catalog_lacks_canonical_annotation' | 'no_match' | 'custom_converter_failed' | 'invalid_format_id_parameters' | 'catalog_requirement_conflict';
|
|
147
|
+
converter_error?: string;
|
|
130
148
|
};
|
|
131
149
|
};
|
|
132
150
|
}) | (ProjectionDiagnosticBase & {
|
|
@@ -226,8 +244,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
|
|
|
226
244
|
}) | (ProjectionDiagnosticBase & {
|
|
227
245
|
/**
|
|
228
246
|
* SDK-local code: canonical-only projection (`toCanonicalOnlyProduct`
|
|
229
|
-
* / `toCanonicalOnlyResponse`)
|
|
230
|
-
*
|
|
247
|
+
* / `toCanonicalOnlyResponse`) found legacy routing metadata that no
|
|
248
|
+
* canonical format option covers. Emitted only on the
|
|
231
249
|
* v2-native pass-through path — a seller that sent `format_options[]`
|
|
232
250
|
* directly but also carried a `format_ids[]` entry with no canonical
|
|
233
251
|
* representation. Without it, canonical-only mode would silently
|
|
@@ -243,20 +261,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
|
|
|
243
261
|
error: {
|
|
244
262
|
details: {
|
|
245
263
|
product_id: string;
|
|
246
|
-
/**
|
|
247
|
-
|
|
248
|
-
* discriminators (`width` / `height` / `duration_ms`) when the
|
|
249
|
-
* input carried them — so a buyer can tell which variant of a
|
|
250
|
-
* multi-size/multi-duration family was lost and re-acquire it on
|
|
251
|
-
* the v1 path. Omitted keys mean the input ref carried no value.
|
|
252
|
-
*/
|
|
253
|
-
dropped_format_id: {
|
|
254
|
-
agent_url: string;
|
|
255
|
-
id: string;
|
|
256
|
-
width?: number;
|
|
257
|
-
height?: number;
|
|
258
|
-
duration_ms?: number;
|
|
259
|
-
};
|
|
264
|
+
/** Stable category only; canonical diagnostics never echo routing identifiers. */
|
|
265
|
+
resolution_failure: 'unmapped_legacy_format';
|
|
260
266
|
};
|
|
261
267
|
};
|
|
262
268
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/v2/projection/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC3B,OAAO,GACP,OAAO,GACP,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,aAAa,GACb,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,iBAAiB,GACjB,QAAQ,CAAC;AAEb;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,mBAAmB,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;I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gBAAC,MAAM,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;SAC/D,CAAC;KACH,CAAC;CACH,CAAC,GACF,CAAC,wBAAwB,GAAG;IAC1B;;;;;;;;;;;;;;OAcG;IACH,IAAI,EAAE,mCAAmC,CAAC;IAC1C,KAAK,EAAE;QACL,OAAO,EAAE;YACP,UAAU,EAAE,MAAM,CAAC;YACnB,kFAAkF;YAClF,kBAAkB,EAAE,wBAAwB,CAAC;SAC9C,CAAC;KACH,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/v2/projection/types.ts"],"sourcesContent":["/**\n * Hand-rolled type surface for the v2 → v1 projection layer.\n *\n * These shadow `schemas/cache/3.1.0-beta.0/core/{product,product-format-declaration,format-id}.json`\n * at the precision the projection layer cares about — slot-level fields\n * like `slots[]`, `platform_extensions[]`, and per-canonical params blocks\n * are kept loose (`Record<string, unknown>`) because the projection\n * algorithm doesn't read them. Root-level canonical format builders use the\n * generated `ProductFormatDeclaration` types; these projection-local shapes\n * remain for legacy projection APIs and diagnostics.\n */\n\n/** v1 format_id (`{ agent_url, id }`). Same shape in 3.0 and 3.1. */\nexport interface V1FormatId {\n agent_url: string;\n id: string;\n width?: number;\n height?: number;\n duration_ms?: number;\n}\n\n/**\n * 12 canonical `format_kind` values from\n * `static/schemas/source/formats/canonical/` plus the `custom` escape\n * hatch. Kept as a literal union so a future canonical gets surfaced at\n * the projection's switch statement (exhaustive-check).\n */\nexport type CanonicalFormatKind =\n | 'image'\n | 'html5'\n | 'display_tag'\n | 'image_carousel'\n | 'video_hosted'\n | 'video_vast'\n | 'audio_hosted'\n | 'audio_daast'\n | 'sponsored_placement'\n | 'native_in_feed'\n | 'responsive_creative'\n | 'agent_placement'\n | 'custom';\n\n/**\n * v2 `ProductFormatDeclaration`. The `params` object is canonical-specific\n * and stays loose at this layer — the projection algorithm reads only\n * `format_kind`, `v1_format_ref`, and `canonical_formats_only`. Width /\n * height (for image canonicals) are surfaced as optional top-level fields\n * the registry reverse-lookup can read without unwrapping params.\n */\nexport interface V2ProductFormatDeclaration {\n format_kind: CanonicalFormatKind;\n params: Record<string, unknown>;\n capability_id?: string;\n format_option_id?: string;\n publisher_domain?: string;\n display_name?: string;\n seller_preference?: 'preferred' | 'accepted' | 'discouraged';\n applies_to_channels?: string[];\n canonical_formats_only?: boolean;\n experimental?: boolean;\n format_shape?: string;\n /**\n * Authoritative v2 → v1 link. Always an array (3.1-beta normative): single-ref\n * is `[{...}]`, multi-size carries one entry per size. v1-only buyers see\n * every entry via `format_ids[]` dual-emission. When `v1_format_ref.length <\n * params.sizes.length`, SDKs emit `FORMAT_DECLARATION_V1_LOSSY_MULTI_SIZE`\n * to signal incomplete coverage.\n */\n v1_format_ref?: V1FormatId[];\n format_schema?: { uri: string; digest: string };\n}\n\n/**\n * Public-surface Product (V2-shaped per the 8.0 design at\n * `docs/development/v3.1-sdk-design.md`). All other fields are passthrough.\n */\nexport interface V2Product {\n product_id: string;\n name: string;\n description: string;\n format_options: V2ProductFormatDeclaration[];\n [k: string]: unknown;\n}\n\n/**\n * Wire-level v1 Product. Carries `format_ids` (the v1 path). Other fields\n * are passthrough; we don't model them at the projection layer.\n */\nexport interface V1Product {\n product_id: string;\n name: string;\n description: string;\n format_ids: V1FormatId[];\n [k: string]: unknown;\n}\n\n/**\n * Structured diagnostic shape matching the spec's `errors[]` augmentation\n * contract (`source: \"sdk\"`, `sdk_id`, `code`, `field`, `error.details`).\n * Spec codes — `FORMAT_PROJECTION_FAILED` and `FORMAT_DECLARATION_V1_AMBIGUOUS`\n * — come straight from `enums/error-code.json`. The two SDK-local codes\n * (`*_NOT_APPLICABLE`, `CANONICAL_NOT_V1_TRANSLATABLE`) cover cases the\n * spec leaves to SDK discretion (\"surface as a different diagnostic or\n * skip silently\") but where buyer-side transparency is more useful\n * than silent product drops.\n *\n * **Never logger-only**, per the resolution-order amendment — emitted\n * on the response envelope's `errors[]` array and surfaced on the\n * SDK's `TaskResult` for caller-side handling without re-walking\n * `errors[]`.\n */\nexport interface ProjectionDiagnosticBase {\n /** Spec-mandated origin marker for SDK-augmented diagnostics. */\n source: 'sdk';\n /** Spec-mandated SDK identity for multi-hop deduplication. */\n sdk_id: string;\n /** Field path into the offending declaration. */\n field: string;\n}\n\nexport type ProjectionDiagnostic =\n | (ProjectionDiagnosticBase & {\n /**\n * Spec code (`enums/error-code.json`): registry-coverage gap or\n * v1-catalog-coverage gap depending on `resolution_failure`:\n *\n * - `no_registry_match` — v2→v1 direction. Registry has no\n * entries for this canonical (and v1_translatable is true).\n * - `catalog_lacks_canonical_annotation` — v1→v2 direction.\n * The AAO catalog has this v1 format but hasn't annotated\n * it with a `canonical:` field. Native, DOOH, broadcast,\n * and card-scaffolding categories sit in this bucket at\n * 3.1 GA. Distinct from a generic registry gap — the\n * catalog DOES know the format, it just hasn't blessed a\n * v2 canonical mapping yet. Symmetric counterpart to\n * CANONICAL_NOT_V1_TRANSLATABLE: that signals \"no v1 form\n * possible\"; this signals \"no v2 form yet.\"\n * - `no_match` — v1→v2 direction, format not in catalog or\n * registry, no structural match.\n */\n code: 'FORMAT_PROJECTION_FAILED';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n resolution_failure: 'no_registry_match' | 'catalog_lacks_canonical_annotation' | 'no_match';\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * Spec code (`enums/error-code.json`): registry has family-level\n * structural entries for this canonical (e.g., the VAST entries\n * for `video_vast`), but none are invertible to a specific v1\n * named format. Family is known, specific format isn't pickable.\n * Correctable by the seller adding `v1_format_ref` to the\n * declaration.\n */\n code: 'FORMAT_DECLARATION_V1_AMBIGUOUS';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n registry_matches: number;\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: declaration has `canonical_formats_only: true`.\n * Seller explicitly opted out of v1 emission. Not a registry-\n * coverage gap; not ambiguous. Informational so buyers can see\n * why a product disappeared from a v1-only catalog.\n */\n code: 'FORMAT_DECLARATION_V1_NOT_APPLICABLE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n reason: 'canonical_formats_only';\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: canonical declares `v1_translatable: false`.\n * Structural v1-unreachability — no v1 form is possible for this\n * canonical regardless of registry coverage. The 4 inherently-v2\n * canonicals at 3.1 GA: `image_carousel`, `sponsored_placement`,\n * `responsive_creative`, `agent_placement`. Spec is explicit:\n * **SDKs MUST NOT emit `FORMAT_PROJECTION_FAILED`** for these\n * (they're not coverage gaps).\n */\n code: 'CANONICAL_NOT_V1_TRANSLATABLE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: v2 declaration uses multi-size (`sizes: [...]`)\n * or responsive (`min_width`/`max_width`/`min_height`/`max_height`)\n * params, but `v1_format_ref` is a single catalog entry that can\n * only carry ONE fixed (width, height). The v1 wire emit\n * represents only the seller-chosen representative size; the\n * remaining sizes are **silently dropped on the v1 wire**.\n *\n * This diagnostic is emitted **alongside** the v1 format_id —\n * not instead of it — so the v1 buyer still sees the product\n * but the buyer code is told what coverage was lost. Different\n * from FORMAT_DECLARATION_V1_AMBIGUOUS (no v1 emit) and\n * FORMAT_DECLARATION_V1_NOT_APPLICABLE (seller opt-out).\n *\n * Surface follow-up: an SDK MAY (non-normative) expand multi-\n * size to N v1 format_ids by looking up the catalog for each\n * size. Today's prototype emits only the seller-asserted\n * representative; multi-emit is a follow-up.\n */\n code: 'FORMAT_DECLARATION_V1_LOSSY_MULTI_SIZE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n size_mode: 'sizes' | 'responsive_range';\n declared_sizes_count?: number;\n /**\n * How many v1 format_ids the SDK actually emitted. <\n * `declared_sizes_count` when the catalog doesn't cover every\n * declared size; equal when the catalog has full coverage.\n * The fan-out is non-normative — when this equals 1, only the\n * seller-asserted rep was emitted; v1 buyers lose the rest.\n */\n emitted_sizes_count?: number;\n v1_emit_represents_size?: { width?: number; height?: number };\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: canonical-only projection (`toCanonicalOnlyProduct`\n * / `toCanonicalOnlyResponse`) dropped a legacy `format_id` that no\n * `format_options[].v1_format_ref` covers. Emitted only on the\n * v2-native pass-through path — a seller that sent `format_options[]`\n * directly but also carried a `format_ids[]` entry with no canonical\n * representation. Without it, canonical-only mode would silently\n * discard a format the buyer could still have acted on via the v1\n * path.\n *\n * On the v1 → v2 projection path an unmappable ref is already\n * surfaced as `FORMAT_PROJECTION_FAILED`; this code covers the gap\n * the projection path can't see (no projection runs when the seller\n * is already v2-native).\n */\n code: 'LEGACY_FORMAT_ID_DROPPED_UNMAPPED';\n error: {\n details: {\n product_id: string;\n /**\n * The full ref that was dropped, including the dimensional\n * discriminators (`width` / `height` / `duration_ms`) when the\n * input carried them — so a buyer can tell which variant of a\n * multi-size/multi-duration family was lost and re-acquire it on\n * the v1 path. Omitted keys mean the input ref carried no value.\n */\n dropped_format_id: { agent_url: string; id: string; width?: number; height?: number; duration_ms?: number };\n };\n };\n });\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/v2/projection/types.ts"],"sourcesContent":["/**\n * Hand-rolled type surface for the v2 → v1 projection layer.\n *\n * These shadow `schemas/cache/3.1.0-beta.0/core/{product,product-format-declaration,format-id}.json`\n * at the precision the projection layer cares about — slot-level fields\n * like `slots[]`, `platform_extensions[]`, and per-canonical params blocks\n * are kept loose (`Record<string, unknown>`) because the projection\n * algorithm doesn't read them. Root-level canonical format builders use the\n * generated `ProductFormatDeclaration` types; these projection-local shapes\n * remain for legacy projection APIs and diagnostics.\n */\n\n/** v1 format_id (`{ agent_url, id }`). Same shape in 3.0 and 3.1. */\nexport interface V1FormatId {\n agent_url: string;\n id: string;\n width?: number;\n height?: number;\n duration_ms?: number;\n}\n\n/**\n * 12 canonical `format_kind` values from\n * `static/schemas/source/formats/canonical/` plus the `custom` escape\n * hatch. Kept as a literal union so a future canonical gets surfaced at\n * the projection's switch statement (exhaustive-check).\n */\nexport type CanonicalFormatKind =\n | 'image'\n | 'html5'\n | 'display_tag'\n | 'image_carousel'\n | 'video_hosted'\n | 'video_vast'\n | 'audio_hosted'\n | 'audio_daast'\n | 'sponsored_placement'\n | 'native_in_feed'\n | 'responsive_creative'\n | 'agent_placement'\n | 'custom';\n\n/**\n * v2 `ProductFormatDeclaration`. The `params` object is canonical-specific\n * and stays loose at this layer — the projection algorithm reads only\n * `format_kind`, `v1_format_ref`, and `canonical_formats_only`. Width /\n * height (for image canonicals) are surfaced as optional top-level fields\n * the registry reverse-lookup can read without unwrapping params.\n */\nexport interface V2ProductFormatDeclaration {\n format_kind: CanonicalFormatKind;\n params: Record<string, unknown>;\n capability_id?: string;\n format_option_id?: string;\n publisher_domain?: string;\n display_name?: string;\n seller_preference?: 'preferred' | 'accepted' | 'discouraged';\n applies_to_channels?: string[];\n canonical_formats_only?: boolean;\n experimental?: boolean;\n format_shape?: string;\n /**\n * Authoritative v2 → v1 link. Always an array (3.1-beta normative): single-ref\n * is `[{...}]`, multi-size carries one entry per size. v1-only buyers see\n * every entry via `format_ids[]` dual-emission. When `v1_format_ref.length <\n * params.sizes.length`, SDKs emit `FORMAT_DECLARATION_V1_LOSSY_MULTI_SIZE`\n * to signal incomplete coverage.\n */\n v1_format_ref?: V1FormatId[];\n format_schema?: { uri: string; digest: string };\n}\n\n/**\n * Public-surface Product (V2-shaped per the 8.0 design at\n * `docs/development/v3.1-sdk-design.md`). All other fields are passthrough.\n */\nexport interface V2Product {\n product_id: string;\n name: string;\n description: string;\n format_options: V2ProductFormatDeclaration[];\n [k: string]: unknown;\n}\n\n/**\n * Wire-level v1 Product. Carries `format_ids` (the v1 path). Other fields\n * are passthrough; we don't model them at the projection layer.\n */\nexport interface V1Product {\n product_id: string;\n name: string;\n description: string;\n format_ids: V1FormatId[];\n [k: string]: unknown;\n}\n\n/**\n * Internal structured diagnostic produced by the pure projection algorithms.\n * `toCanonicalOnlyResponse()` flattens this into the protocol `Error` shape\n * (`message` plus top-level `details`) before augmenting `errors[]`.\n * Spec codes — `FORMAT_PROJECTION_FAILED` and `FORMAT_DECLARATION_V1_AMBIGUOUS`\n * — come straight from `enums/error-code.json`. The two SDK-local codes\n * (`*_NOT_APPLICABLE`, `CANONICAL_NOT_V1_TRANSLATABLE`) cover cases the\n * spec leaves to SDK discretion (\"surface as a different diagnostic or\n * skip silently\") but where buyer-side transparency is more useful\n * than silent product drops.\n *\n * **Never logger-only**, per the resolution-order amendment. The internal\n * nesting keeps projection code strongly discriminated; it is not itself a\n * wire/protocol Error and must be normalized before public response emission.\n */\nexport interface ProjectionDiagnosticBase {\n /** Spec-mandated origin marker for SDK-augmented diagnostics. */\n source: 'sdk';\n /** Spec-mandated SDK identity for multi-hop deduplication. */\n sdk_id: string;\n /** Field path into the offending declaration. */\n field: string;\n}\n\nexport type ProjectionDiagnostic =\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: a valid seller product cannot be represented on the\n * canonical-only public surface because it has no canonical option.\n * Legacy `format_ids: []` is format-agnostic, not a failed lookup.\n */\n code: 'CANONICAL_PRODUCT_FORMATS_UNAVAILABLE';\n error: {\n details: {\n product_id: string;\n reason:\n | 'legacy_format_list_empty'\n | 'canonical_format_list_empty'\n | 'missing_format_declaration'\n | 'nested_placement_format_list_empty';\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * Spec code (`enums/error-code.json`): registry-coverage gap or\n * v1-catalog-coverage gap depending on `resolution_failure`:\n *\n * - `no_registry_match` — v2→v1 direction. Registry has no\n * entries for this canonical (and v1_translatable is true).\n * - `catalog_lacks_canonical_annotation` — v1→v2 direction.\n * The AAO catalog has this v1 format but hasn't annotated\n * it with a `canonical:` field. Native, DOOH, broadcast,\n * and card-scaffolding categories sit in this bucket at\n * 3.1 GA. Distinct from a generic registry gap — the\n * catalog DOES know the format, it just hasn't blessed a\n * v2 canonical mapping yet. Symmetric counterpart to\n * CANONICAL_NOT_V1_TRANSLATABLE: that signals \"no v1 form\n * possible\"; this signals \"no v2 form yet.\"\n * - `no_match` — v1→v2 direction, format not in catalog or\n * registry, no structural match.\n * - `invalid_format_id_parameters` — the legacy ref carries\n * malformed dimensional or duration discriminators.\n * - `catalog_requirement_conflict` — catalog-authored fixed\n * requirements are internally ambiguous or contradict the ref.\n */\n code: 'FORMAT_PROJECTION_FAILED';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n resolution_failure:\n | 'no_registry_match'\n | 'catalog_lacks_canonical_annotation'\n | 'no_match'\n | 'custom_converter_failed'\n | 'invalid_format_id_parameters'\n | 'catalog_requirement_conflict';\n converter_error?: string;\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * Spec code (`enums/error-code.json`): registry has family-level\n * structural entries for this canonical (e.g., the VAST entries\n * for `video_vast`), but none are invertible to a specific v1\n * named format. Family is known, specific format isn't pickable.\n * Correctable by the seller adding `v1_format_ref` to the\n * declaration.\n */\n code: 'FORMAT_DECLARATION_V1_AMBIGUOUS';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n registry_matches: number;\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: declaration has `canonical_formats_only: true`.\n * Seller explicitly opted out of v1 emission. Not a registry-\n * coverage gap; not ambiguous. Informational so buyers can see\n * why a product disappeared from a v1-only catalog.\n */\n code: 'FORMAT_DECLARATION_V1_NOT_APPLICABLE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n reason: 'canonical_formats_only';\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: canonical declares `v1_translatable: false`.\n * Structural v1-unreachability — no v1 form is possible for this\n * canonical regardless of registry coverage. The 4 inherently-v2\n * canonicals at 3.1 GA: `image_carousel`, `sponsored_placement`,\n * `responsive_creative`, `agent_placement`. Spec is explicit:\n * **SDKs MUST NOT emit `FORMAT_PROJECTION_FAILED`** for these\n * (they're not coverage gaps).\n */\n code: 'CANONICAL_NOT_V1_TRANSLATABLE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: v2 declaration uses multi-size (`sizes: [...]`)\n * or responsive (`min_width`/`max_width`/`min_height`/`max_height`)\n * params, but `v1_format_ref` is a single catalog entry that can\n * only carry ONE fixed (width, height). The v1 wire emit\n * represents only the seller-chosen representative size; the\n * remaining sizes are **silently dropped on the v1 wire**.\n *\n * This diagnostic is emitted **alongside** the v1 format_id —\n * not instead of it — so the v1 buyer still sees the product\n * but the buyer code is told what coverage was lost. Different\n * from FORMAT_DECLARATION_V1_AMBIGUOUS (no v1 emit) and\n * FORMAT_DECLARATION_V1_NOT_APPLICABLE (seller opt-out).\n *\n * Surface follow-up: an SDK MAY (non-normative) expand multi-\n * size to N v1 format_ids by looking up the catalog for each\n * size. Today's prototype emits only the seller-asserted\n * representative; multi-emit is a follow-up.\n */\n code: 'FORMAT_DECLARATION_V1_LOSSY_MULTI_SIZE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n size_mode: 'sizes' | 'responsive_range';\n declared_sizes_count?: number;\n /**\n * How many v1 format_ids the SDK actually emitted. <\n * `declared_sizes_count` when the catalog doesn't cover every\n * declared size; equal when the catalog has full coverage.\n * The fan-out is non-normative — when this equals 1, only the\n * seller-asserted rep was emitted; v1 buyers lose the rest.\n */\n emitted_sizes_count?: number;\n v1_emit_represents_size?: { width?: number; height?: number };\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: canonical-only projection (`toCanonicalOnlyProduct`\n * / `toCanonicalOnlyResponse`) found legacy routing metadata that no\n * canonical format option covers. Emitted only on the\n * v2-native pass-through path — a seller that sent `format_options[]`\n * directly but also carried a `format_ids[]` entry with no canonical\n * representation. Without it, canonical-only mode would silently\n * discard a format the buyer could still have acted on via the v1\n * path.\n *\n * On the v1 → v2 projection path an unmappable ref is already\n * surfaced as `FORMAT_PROJECTION_FAILED`; this code covers the gap\n * the projection path can't see (no projection runs when the seller\n * is already v2-native).\n */\n code: 'LEGACY_FORMAT_ID_DROPPED_UNMAPPED';\n error: {\n details: {\n product_id: string;\n /** Stable category only; canonical diagnostics never echo routing identifiers. */\n resolution_failure: 'unmapped_legacy_format';\n };\n };\n });\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -45,11 +45,34 @@
|
|
|
45
45
|
* is the most adopter-relevant piece for actual creative
|
|
46
46
|
* submission flows and lands in a follow-up.
|
|
47
47
|
*/
|
|
48
|
-
import type { V1Product, V2Product, V2ProductFormatDeclaration, ProjectionDiagnostic, CanonicalFormatKind } from './types.mjs';
|
|
48
|
+
import type { V1Product, V1FormatId, V2Product, V2ProductFormatDeclaration, ProjectionDiagnostic, CanonicalFormatKind } from './types.mjs';
|
|
49
|
+
import { type ProjectionCatalogSnapshot } from './catalog-snapshot.mjs';
|
|
49
50
|
export interface V1ToV2Result {
|
|
50
51
|
v2: V2Product;
|
|
51
52
|
diagnostics: ProjectionDiagnostic[];
|
|
52
53
|
}
|
|
54
|
+
/** Context passed to an adopter's seller-specific legacy format converter. */
|
|
55
|
+
export interface LegacyFormatConversionContext {
|
|
56
|
+
formatId: Readonly<V1FormatId>;
|
|
57
|
+
productId: string;
|
|
58
|
+
field: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Escape hatch for legacy formats owned by a custom creative agent. The
|
|
62
|
+
* converter returns the canonical product declaration that the legacy ref
|
|
63
|
+
* represents. For bespoke shapes, return `format_kind: 'custom'` with both
|
|
64
|
+
* `format_shape` and an immutable `format_schema` reference.
|
|
65
|
+
*
|
|
66
|
+
* The SDK adds the source `formatId` as `v1_format_ref`; converters must not
|
|
67
|
+
* set `canonical_formats_only: true` because a legacy source is, by
|
|
68
|
+
* definition, round-trippable to that ref.
|
|
69
|
+
*/
|
|
70
|
+
export type LegacyFormatConverter = (context: LegacyFormatConversionContext) => V2ProductFormatDeclaration | null | undefined;
|
|
71
|
+
export interface V1ToV2ProjectionOptions {
|
|
72
|
+
legacyFormatConverter?: LegacyFormatConverter;
|
|
73
|
+
/** Pre-resolved exact-owner publisher/community catalogs, highest precedence first. */
|
|
74
|
+
projectionCatalogs?: readonly ProjectionCatalogSnapshot[];
|
|
75
|
+
}
|
|
53
76
|
/**
|
|
54
77
|
* Project a v1 Product to a v2 Product. Drops `format_ids` from the
|
|
55
78
|
* public output and rebuilds `format_options` per the resolution order.
|
|
@@ -63,17 +86,17 @@ export interface V1ToV2Result {
|
|
|
63
86
|
* @see canonicalDeclarationFromBareId — resolve a single bare format-id
|
|
64
87
|
* string (no surrounding Product) to a declaration or `format_kind`.
|
|
65
88
|
*/
|
|
66
|
-
export declare function projectV1ProductToV2(v1: V1Product): V1ToV2Result;
|
|
89
|
+
export declare function projectV1ProductToV2(v1: V1Product, options?: V1ToV2ProjectionOptions): V1ToV2Result;
|
|
67
90
|
export interface BareFormatIdResolveOptions {
|
|
68
91
|
/**
|
|
69
92
|
* `agent_url` to attach when lifting the bare `id` to a structured
|
|
70
93
|
* {@link V1FormatId} for resolution. Defaults to the canonical AAO host
|
|
71
94
|
* (`https://creative.adcontextprotocol.org/`) — the publisher of every
|
|
72
95
|
* AAO catalog id, and the source of essentially all bare ids persisted
|
|
73
|
-
* before the `{ agent_url, id }` convention.
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
96
|
+
* before the `{ agent_url, id }` convention. When an exact ID has one
|
|
97
|
+
* unique AAO-published meaning, a valid non-AAO `agentUrl` is accepted as
|
|
98
|
+
* a legacy owner alias and is preserved in `v1_format_ref`. Unknown or
|
|
99
|
+
* colliding IDs still resolve to `null`.
|
|
77
100
|
*/
|
|
78
101
|
agentUrl?: string;
|
|
79
102
|
/**
|
|
@@ -45,11 +45,34 @@
|
|
|
45
45
|
* is the most adopter-relevant piece for actual creative
|
|
46
46
|
* submission flows and lands in a follow-up.
|
|
47
47
|
*/
|
|
48
|
-
import type { V1Product, V2Product, V2ProductFormatDeclaration, ProjectionDiagnostic, CanonicalFormatKind } from './types';
|
|
48
|
+
import type { V1Product, V1FormatId, V2Product, V2ProductFormatDeclaration, ProjectionDiagnostic, CanonicalFormatKind } from './types';
|
|
49
|
+
import { type ProjectionCatalogSnapshot } from './catalog-snapshot';
|
|
49
50
|
export interface V1ToV2Result {
|
|
50
51
|
v2: V2Product;
|
|
51
52
|
diagnostics: ProjectionDiagnostic[];
|
|
52
53
|
}
|
|
54
|
+
/** Context passed to an adopter's seller-specific legacy format converter. */
|
|
55
|
+
export interface LegacyFormatConversionContext {
|
|
56
|
+
formatId: Readonly<V1FormatId>;
|
|
57
|
+
productId: string;
|
|
58
|
+
field: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Escape hatch for legacy formats owned by a custom creative agent. The
|
|
62
|
+
* converter returns the canonical product declaration that the legacy ref
|
|
63
|
+
* represents. For bespoke shapes, return `format_kind: 'custom'` with both
|
|
64
|
+
* `format_shape` and an immutable `format_schema` reference.
|
|
65
|
+
*
|
|
66
|
+
* The SDK adds the source `formatId` as `v1_format_ref`; converters must not
|
|
67
|
+
* set `canonical_formats_only: true` because a legacy source is, by
|
|
68
|
+
* definition, round-trippable to that ref.
|
|
69
|
+
*/
|
|
70
|
+
export type LegacyFormatConverter = (context: LegacyFormatConversionContext) => V2ProductFormatDeclaration | null | undefined;
|
|
71
|
+
export interface V1ToV2ProjectionOptions {
|
|
72
|
+
legacyFormatConverter?: LegacyFormatConverter;
|
|
73
|
+
/** Pre-resolved exact-owner publisher/community catalogs, highest precedence first. */
|
|
74
|
+
projectionCatalogs?: readonly ProjectionCatalogSnapshot[];
|
|
75
|
+
}
|
|
53
76
|
/**
|
|
54
77
|
* Project a v1 Product to a v2 Product. Drops `format_ids` from the
|
|
55
78
|
* public output and rebuilds `format_options` per the resolution order.
|
|
@@ -63,17 +86,17 @@ export interface V1ToV2Result {
|
|
|
63
86
|
* @see canonicalDeclarationFromBareId — resolve a single bare format-id
|
|
64
87
|
* string (no surrounding Product) to a declaration or `format_kind`.
|
|
65
88
|
*/
|
|
66
|
-
export declare function projectV1ProductToV2(v1: V1Product): V1ToV2Result;
|
|
89
|
+
export declare function projectV1ProductToV2(v1: V1Product, options?: V1ToV2ProjectionOptions): V1ToV2Result;
|
|
67
90
|
export interface BareFormatIdResolveOptions {
|
|
68
91
|
/**
|
|
69
92
|
* `agent_url` to attach when lifting the bare `id` to a structured
|
|
70
93
|
* {@link V1FormatId} for resolution. Defaults to the canonical AAO host
|
|
71
94
|
* (`https://creative.adcontextprotocol.org/`) — the publisher of every
|
|
72
95
|
* AAO catalog id, and the source of essentially all bare ids persisted
|
|
73
|
-
* before the `{ agent_url, id }` convention.
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
96
|
+
* before the `{ agent_url, id }` convention. When an exact ID has one
|
|
97
|
+
* unique AAO-published meaning, a valid non-AAO `agentUrl` is accepted as
|
|
98
|
+
* a legacy owner alias and is preserved in `v1_format_ref`. Unknown or
|
|
99
|
+
* colliding IDs still resolve to `null`.
|
|
77
100
|
*/
|
|
78
101
|
agentUrl?: string;
|
|
79
102
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1-to-v2.d.ts","sourceRoot":"","sources":["../../../../src/lib/v2/projection/v1-to-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,KAAK,EAC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