@adcp/sdk 12.1.0 → 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/authorization-required.d.mts +3 -0
- package/dist/lib/auth/oauth/authorization-required.d.ts +3 -0
- package/dist/lib/auth/oauth/authorization-required.d.ts.map +1 -1
- package/dist/lib/auth/oauth/authorization-required.js +12 -9
- package/dist/lib/auth/oauth/authorization-required.js.map +1 -1
- package/dist/lib/auth/oauth/authorization-required.mjs +12 -9
- package/dist/lib/auth/oauth/authorization-required.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 +129 -52
- package/dist/lib/core/SingleAgentClient.d.ts +129 -52
- package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
- package/dist/lib/core/SingleAgentClient.js +1748 -218
- package/dist/lib/core/SingleAgentClient.js.map +1 -1
- package/dist/lib/core/SingleAgentClient.mjs +1758 -218
- 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 +137 -44
- package/dist/lib/core/TaskExecutor.js.map +1 -1
- package/dist/lib/core/TaskExecutor.mjs +137 -44
- 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/net/ssrf-fetch.d.mts +13 -1
- package/dist/lib/net/ssrf-fetch.d.ts +13 -1
- package/dist/lib/net/ssrf-fetch.d.ts.map +1 -1
- package/dist/lib/net/ssrf-fetch.js +14 -7
- package/dist/lib/net/ssrf-fetch.js.map +1 -1
- package/dist/lib/net/ssrf-fetch.mjs +14 -7
- package/dist/lib/net/ssrf-fetch.mjs.map +1 -1
- package/dist/lib/protocols/a2a.d.mts +2 -2
- package/dist/lib/protocols/a2a.d.ts +2 -2
- package/dist/lib/protocols/a2a.d.ts.map +1 -1
- package/dist/lib/protocols/a2a.js +14 -9
- package/dist/lib/protocols/a2a.js.map +1 -1
- package/dist/lib/protocols/a2a.mjs +14 -9
- package/dist/lib/protocols/a2a.mjs.map +1 -1
- package/dist/lib/protocols/index.d.mts +20 -3
- package/dist/lib/protocols/index.d.ts +20 -3
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +44 -31
- package/dist/lib/protocols/index.js.map +1 -1
- package/dist/lib/protocols/index.mjs +44 -32
- 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/protocols/mcp-tasks.d.mts +3 -0
- package/dist/lib/protocols/mcp-tasks.d.ts +3 -0
- package/dist/lib/protocols/mcp-tasks.d.ts.map +1 -1
- package/dist/lib/protocols/mcp-tasks.js +21 -11
- package/dist/lib/protocols/mcp-tasks.js.map +1 -1
- package/dist/lib/protocols/mcp-tasks.mjs +21 -11
- package/dist/lib/protocols/mcp-tasks.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.d.ts.map +1 -1
- package/dist/lib/testing/client.js +13 -5
- package/dist/lib/testing/client.js.map +1 -1
- package/dist/lib/testing/client.mjs +13 -5
- package/dist/lib/testing/client.mjs.map +1 -1
- package/dist/lib/testing/compliance/comply.d.mts +1 -1
- package/dist/lib/testing/compliance/comply.d.ts +1 -1
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
- package/dist/lib/testing/compliance/comply.js +16 -6
- package/dist/lib/testing/compliance/comply.js.map +1 -1
- package/dist/lib/testing/compliance/comply.mjs +16 -6
- package/dist/lib/testing/compliance/comply.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/probes.d.mts +6 -0
- package/dist/lib/testing/storyboard/probes.d.ts +6 -0
- package/dist/lib/testing/storyboard/probes.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/probes.js +16 -5
- package/dist/lib/testing/storyboard/probes.js.map +1 -1
- package/dist/lib/testing/storyboard/probes.mjs +16 -5
- package/dist/lib/testing/storyboard/probes.mjs.map +1 -1
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +6 -2
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.mjs +6 -2
- package/dist/lib/testing/storyboard/runner.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/testing/types.d.mts +7 -1
- package/dist/lib/testing/types.d.ts +7 -1
- package/dist/lib/testing/types.d.ts.map +1 -1
- package/dist/lib/testing/types.js.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/testing/scenarios/creative.ts"],"sourcesContent":["/**\n * Creative Agent Testing Scenarios\n *\n * Tests creative agent capabilities including:\n * - list_creative_formats / list_formats\n * - build_creative\n * - preview_creative\n *\n * Enhanced to:\n * - Test multiple formats from the agent's actual catalog\n * - Test with both required and optional assets\n * - Validate preview renders\n */\n\nimport type { BuildCreativeRequest, PreviewCreativeRequest } from '../../types/tools.generated';\nimport type { TestOptions, TestStepResult, AgentProfile, TaskResult } from '../types';\nimport { getOrCreateClient, runStep, getOrDiscoverProfile, discoverCreativeFormats, resolveBrand } from '../client';\n\n/**\n * Test: Creative Flow (for creative agents)\n *\n * Flow: list_formats -> build_creative (multiple formats) -> preview_creative (with assets)\n */\nexport async function testCreativeFlow(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n // Discover agent profile\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Discover creative formats with full details\n const { formats, step: formatStep } = await discoverCreativeFormats(client, profile);\n steps.push(formatStep);\n\n if (!formatStep.passed || !formats || formats.length === 0) {\n return { steps, profile: { ...profile, supported_formats: formats || [] } };\n }\n\n // Store discovered formats in profile\n profile.supported_formats = formats;\n\n // Determine which formats to test\n const formatsToTest = selectFormatsToTest(formats || [], options);\n\n // Build creative for each selected format\n if (profile.tools.includes('build_creative')) {\n for (const format of formatsToTest) {\n const formatDisplayName = format.name || format.format_id.id;\n const { result, step } = await runStep<TaskResult>(\n `Build creative: ${formatDisplayName}`,\n 'build_creative',\n async () =>\n client.buildCreative({\n target_format_id: format.format_id,\n brand: resolveBrand(options),\n message: `Create an ad for an e-commerce brand promoting summer sale`,\n quality: 'draft',\n include_preview: true,\n } as unknown as BuildCreativeRequest) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data as {\n creative_manifest?: { format_id?: unknown; assets?: Record<string, unknown> };\n creative_manifests?: Array<{ format_id?: unknown; assets?: Record<string, unknown> }>;\n preview?: { previews?: unknown[] };\n };\n const manifest = data.creative_manifest || data.creative_manifests?.[0];\n step.details = `Built creative manifest for format ${formatDisplayName}`;\n step.response_preview = JSON.stringify(\n {\n format_id: manifest?.format_id || format.format_id,\n asset_keys: Object.keys(manifest?.assets || {}),\n has_preview: !!data.preview,\n preview_count: data.preview?.previews?.length || 0,\n },\n null,\n 2\n );\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'build_creative failed';\n }\n steps.push(step);\n }\n }\n\n // Preview creative with various asset configurations\n if (profile.tools.includes('preview_creative')) {\n // Test 1: Preview with minimal assets (empty)\n const { step: minimalStep } = await runStep<TaskResult>(\n 'Preview creative: minimal assets',\n 'preview_creative',\n async () =>\n client.previewCreative({\n request_type: 'single',\n creative_manifest: {\n format_id: formatsToTest[0]?.format_id || {\n agent_url: 'https://creative.adcontextprotocol.org',\n id: 'display_300x250',\n },\n name: 'Minimal Test Creative',\n assets: {},\n },\n } as unknown as PreviewCreativeRequest) as Promise<TaskResult>\n );\n steps.push(minimalStep);\n\n // Test 2: Preview with sample assets\n const sampleFormat = formatsToTest[0];\n if (sampleFormat) {\n const { result, step } = await runStep<TaskResult>(\n `Preview creative: with assets (${sampleFormat.format_id.id})`,\n 'preview_creative',\n async () =>\n client.previewCreative({\n request_type: 'single',\n creative_manifest: {\n format_id: sampleFormat.format_id,\n name: 'Full Test Creative',\n assets: buildTestAssets(sampleFormat) as unknown as Record<string, unknown>,\n },\n } as unknown as PreviewCreativeRequest) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data as {\n previews?: Array<{ renders?: unknown[] }>;\n interactive_url?: string;\n };\n const previews = data.previews || [];\n const renderCount = previews.reduce((count, preview) => count + (preview.renders?.length || 0), 0);\n step.details = `Generated preview with ${previews.length} variant(s)`;\n step.response_preview = JSON.stringify(\n {\n has_renders: renderCount > 0,\n preview_count: previews.length,\n render_count: renderCount,\n interactive_url: data.interactive_url,\n },\n null,\n 2\n );\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'preview_creative failed';\n }\n steps.push(step);\n }\n\n // Test 3: Preview with invalid format_id (error case)\n const { result: errorResult, step: errorStep } = await runStep<TaskResult>(\n 'Preview creative: invalid format (error expected)',\n 'preview_creative',\n async () =>\n client.previewCreative({\n request_type: 'single',\n creative_manifest: {\n format_id: { agent_url: 'https://creative.adcontextprotocol.org', id: 'INVALID_FORMAT_ID_12345' },\n name: 'Error Test Creative',\n assets: {},\n },\n } as unknown as PreviewCreativeRequest) as Promise<TaskResult>\n );\n\n // This should fail - if it succeeds with invalid format, that's a bug\n if (errorResult?.success) {\n errorStep.passed = false;\n errorStep.error = 'Expected error for invalid format_id but got success';\n } else {\n errorStep.passed = true;\n errorStep.details = 'Correctly rejected invalid format_id';\n }\n steps.push(errorStep);\n }\n\n return { steps, profile };\n}\n\n/**\n * Test: Creative Lifecycle\n *\n * Chains creative protocol operations end-to-end:\n * 1. list_creative_formats → verify format schema\n * 2. sync_creatives with multiple creatives → verify per-creative status\n * 3. list_creatives (no snapshot) → verify basic fields\n * 4. list_creatives (include_snapshot: true) → verify snapshot or snapshot_unavailable_reason\n * 5. build_creative or preview_creative on synced creative → adapt to agent capabilities\n */\nexport async function testCreativeLifecycle(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n // Discover agent profile\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Step 1: Discover creative formats\n const { formats, step: formatStep } = await discoverCreativeFormats(client, profile);\n steps.push(formatStep);\n\n if (!formatStep.passed || !formats || formats.length === 0) {\n return { steps, profile };\n }\n\n profile.supported_formats = formats;\n\n // Validate format schema: each format should have format_id\n const formatSchemaIssues: string[] = [];\n for (const format of formats) {\n if (!format.format_id) formatSchemaIssues.push('Missing format_id');\n }\n\n steps.push({\n step: 'Validate format schema',\n passed: formatSchemaIssues.length === 0,\n duration_ms: 0,\n details:\n formatSchemaIssues.length === 0\n ? `All ${formats.length} format(s) have required fields`\n : formatSchemaIssues.join('; '),\n warnings: formatSchemaIssues.length > 0 ? formatSchemaIssues : undefined,\n });\n\n // Step 2: Sync multiple creatives (image + video if formats allow)\n if (profile.tools.includes('sync_creatives')) {\n const imageFormat = formats[0]!;\n const videoFormat = formats.length > 1 ? formats[1] : undefined;\n\n const creativesToSync = [\n {\n creative_id: `lifecycle-img-${Date.now()}`,\n name: 'Lifecycle Test Image Creative',\n format_id: imageFormat.format_id,\n assets: {\n primary: {\n url: 'https://via.placeholder.com/300x250.png?text=Lifecycle+Image',\n width: 300,\n height: 250,\n format: 'png',\n },\n },\n },\n ];\n\n if (videoFormat) {\n creativesToSync.push({\n creative_id: `lifecycle-vid-${Date.now()}`,\n name: 'Lifecycle Test Video Creative',\n format_id: videoFormat.format_id,\n assets: {\n primary: {\n url: 'https://storage.googleapis.com/webfundamentals-assets/videos/chrome.mp4',\n width: 1920,\n height: 1080,\n format: 'mp4',\n },\n },\n });\n }\n\n const { result: syncResult, step: syncStep } = await runStep<TaskResult>(\n `Sync ${creativesToSync.length} creative(s) to library`,\n 'sync_creatives',\n async () =>\n client.executeTask('sync_creatives', {\n creatives: creativesToSync,\n }) as Promise<TaskResult>\n );\n\n if (syncResult?.success && syncResult?.data) {\n const data = syncResult.data;\n const creatives = data.creatives || [];\n const actions = creatives.map((c: any) => c.action);\n const failed = creatives.filter((c: any) => c.action === 'failed');\n\n syncStep.details = `Synced ${creatives.length} creative(s), actions: ${actions.join(', ')}`;\n syncStep.response_preview = JSON.stringify(\n {\n synced_count: creatives.length,\n actions,\n creative_ids: creatives.map((c: any) => c.creative_id),\n failed_count: failed.length,\n failed_errors: failed.map((c: any) => ({ creative_id: c.creative_id, errors: c.errors })),\n },\n null,\n 2\n );\n } else if (syncResult && !syncResult.success) {\n syncStep.passed = false;\n syncStep.error = syncResult.error || 'sync_creatives returned unsuccessful result';\n }\n steps.push(syncStep);\n\n // Step 3: list_creatives without snapshot\n if (profile.tools.includes('list_creatives')) {\n const { result: listResult, step: listStep } = await runStep<TaskResult>(\n 'List creatives (no snapshot)',\n 'list_creatives',\n async () => client.executeTask('list_creatives', {}) as Promise<TaskResult>\n );\n\n if (listResult?.success && listResult?.data) {\n const data = listResult.data;\n const creatives = data.creatives || [];\n\n // Validate basic fields on each creative\n const fieldIssues: string[] = [];\n for (const creative of creatives.slice(0, 5)) {\n if (!creative.creative_id) fieldIssues.push('Creative missing creative_id');\n if (!creative.name) fieldIssues.push(`Creative ${creative.creative_id}: missing name`);\n if (!creative.format_id) fieldIssues.push(`Creative ${creative.creative_id}: missing format_id`);\n }\n\n // Verify snapshot is absent when not requested\n const hasUnexpectedSnapshot = creatives.some((c: any) => c.snapshot !== undefined);\n\n if (fieldIssues.length > 0) {\n listStep.passed = false;\n listStep.error = `Creative field validation: ${fieldIssues.join('; ')}`;\n } else {\n listStep.details = `Found ${creatives.length} creative(s) with valid fields`;\n }\n\n listStep.response_preview = JSON.stringify(\n {\n creatives_count: creatives.length,\n statuses: Array.from(new Set(creatives.map((c: any) => c.status))),\n has_unexpected_snapshot: hasUnexpectedSnapshot,\n query_summary: data.query_summary,\n },\n null,\n 2\n );\n\n if (hasUnexpectedSnapshot) {\n listStep.warnings = ['snapshot field present on creatives without include_snapshot=true'];\n }\n } else if (listResult && !listResult.success) {\n listStep.passed = false;\n listStep.error = listResult.error || 'list_creatives returned unsuccessful result';\n }\n steps.push(listStep);\n\n // Step 4: list_creatives with include_snapshot: true\n const { result: snapshotResult, step: snapshotStep } = await runStep<TaskResult>(\n 'List creatives (include_snapshot: true)',\n 'list_creatives',\n async () => client.executeTask('list_creatives', { include_snapshot: true }) as Promise<TaskResult>\n );\n\n if (snapshotResult?.success && snapshotResult?.data) {\n const data = snapshotResult.data;\n const creatives = data.creatives || [];\n\n // Each creative should have either snapshot data or snapshot_unavailable_reason\n const invalidCreatives = creatives.filter((c: any) => {\n if (c.snapshot) {\n return !c.snapshot.as_of || c.snapshot.staleness_seconds === undefined;\n }\n return !c.snapshot_unavailable_reason;\n });\n\n if (invalidCreatives.length > 0) {\n snapshotStep.passed = false;\n snapshotStep.error = `${invalidCreatives.length} creative(s) missing both snapshot and snapshot_unavailable_reason`;\n } else {\n const withSnapshot = creatives.filter((c: any) => !!c.snapshot).length;\n const withReason = creatives.filter((c: any) => !!c.snapshot_unavailable_reason).length;\n snapshotStep.details = `${creatives.length} creative(s): ${withSnapshot} with snapshot, ${withReason} with unavailable_reason`;\n }\n\n snapshotStep.response_preview = JSON.stringify(\n {\n creatives_count: creatives.length,\n with_snapshot: creatives.filter((c: any) => !!c.snapshot).length,\n with_unavailable_reason: creatives.filter((c: any) => !!c.snapshot_unavailable_reason).length,\n snapshot_reasons: Array.from(\n new Set(creatives.map((c: any) => c.snapshot_unavailable_reason).filter(Boolean))\n ),\n },\n null,\n 2\n );\n } else if (snapshotResult && !snapshotResult.success) {\n snapshotStep.passed = false;\n snapshotStep.error = snapshotResult.error || 'list_creatives with snapshot returned unsuccessful result';\n }\n steps.push(snapshotStep);\n }\n }\n\n // Step 5: build_creative or preview_creative (adapt to agent capabilities)\n if (profile.tools.includes('build_creative')) {\n const targetFormat = formats[0]!;\n const { result, step } = await runStep<TaskResult>(\n `Build creative for lifecycle (${targetFormat.format_id})`,\n 'build_creative',\n async () =>\n client.executeTask('build_creative', {\n target_format_id: targetFormat.format_id,\n brand: resolveBrand(options),\n message: `Create an ad for lifecycle testing`,\n quality: 'draft',\n include_preview: true,\n }) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data;\n const manifest = data.creative_manifest || data.creative_manifests?.[0];\n step.details = `Built creative manifest for format ${manifest?.format_id || targetFormat.format_id}`;\n step.response_preview = JSON.stringify(\n {\n format_id: manifest?.format_id || targetFormat.format_id,\n asset_keys: Object.keys(manifest?.assets || {}),\n has_preview: !!data.preview,\n },\n null,\n 2\n );\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'build_creative failed';\n }\n steps.push(step);\n } else if (profile.tools.includes('preview_creative')) {\n // Tag-serving agents may only support preview, not build\n const targetFormat = formats[0]!;\n const { result, step } = await runStep<TaskResult>(\n `Preview creative for lifecycle (${targetFormat.format_id})`,\n 'preview_creative',\n async () =>\n client.executeTask('preview_creative', {\n request_type: 'single',\n creative_manifest: {\n format_id: targetFormat.format_id,\n name: 'Lifecycle Test Preview',\n assets: buildTestAssets(targetFormat),\n },\n }) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data;\n step.details = `Generated preview with ${data.renders?.length || 0} render(s)`;\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'preview_creative failed';\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n\n/**\n * Select which formats to test based on options\n */\nfunction selectFormatsToTest(\n formats: NonNullable<AgentProfile['supported_formats']>,\n options: TestOptions\n): NonNullable<AgentProfile['supported_formats']> {\n // If specific format_ids provided, use those\n if (options.format_ids?.length) {\n return formats.filter(f => options.format_ids!.includes(f.format_id.id));\n }\n\n // If test_all_formats, test up to max_formats_to_test\n if (options.test_all_formats) {\n const maxFormats = options.max_formats_to_test || 5;\n return formats.slice(0, maxFormats);\n }\n\n // Default: test up to 3 formats\n return formats.slice(0, 3);\n}\n\n/**\n * Build test assets for a format based on its requirements\n */\nfunction buildTestAssets(\n format: NonNullable<AgentProfile['supported_formats']>[0]\n): Array<{ asset_id: string; asset_type: string; url: string }> {\n const assets: Array<{ asset_id: string; asset_type: string; url: string }> = [];\n\n // Add required assets\n if (format.required_assets?.length) {\n for (const assetName of format.required_assets) {\n assets.push({\n asset_id: assetName,\n asset_type: guessAssetType(assetName),\n url: getTestAssetUrl(assetName),\n });\n }\n }\n\n // If no required assets, add a default image\n if (assets.length === 0) {\n assets.push({\n asset_id: 'primary_image',\n asset_type: 'image',\n url: 'https://via.placeholder.com/300x250.png?text=Test+Creative',\n });\n }\n\n return assets;\n}\n\n/**\n * Guess asset type from asset name\n */\nfunction guessAssetType(assetName: string): string {\n const lower = assetName.toLowerCase();\n if (lower.includes('video') || lower.includes('clip')) return 'video';\n if (lower.includes('audio') || lower.includes('sound')) return 'audio';\n if (lower.includes('logo')) return 'image';\n if (lower.includes('text') || lower.includes('headline') || lower.includes('copy')) return 'text';\n return 'image';\n}\n\n/**\n * Get a test asset URL for testing\n */\nfunction getTestAssetUrl(assetName: string): string {\n const type = guessAssetType(assetName);\n switch (type) {\n case 'video':\n return 'https://storage.googleapis.com/webfundamentals-assets/videos/chrome.mp4';\n case 'audio':\n return 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3';\n default:\n return 'https://via.placeholder.com/300x250.png?text=Test+Asset';\n }\n}\n"],"mappings":"AAgBA,SAAS,mBAAmB,SAAS,sBAAsB,yBAAyB,oBAAoB;AAOxG,eAAsB,iBACpB,UACA,SAC8D;AAC9D,QAAM,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B;AAC5B,UAAM,aAAa,QAAQ,uBAAuB;AAClD,WAAO,QAAQ,MAAM,GAAG,UAAU;AAAA,EACpC;AAGA,SAAO,QAAQ,MAAM,GAAG,CAAC;AAC3B;AAKA,SAAS,gBACP,QAC8D;AAC9D,QAAM,SAAuE,CAAC;AAG9E,MAAI,OAAO,iBAAiB,QAAQ;AAClC,eAAW,aAAa,OAAO,iBAAiB;AAC9C,aAAO,KAAK;AAAA,QACV,UAAU;AAAA,QACV,YAAY,eAAe,SAAS;AAAA,QACpC,KAAK,gBAAgB,SAAS;AAAA,MAChC,CAAC;AAAA,IACH;AAAA,EACF;AAGA,MAAI,OAAO,WAAW,GAAG;AACvB,WAAO,KAAK;AAAA,MACV,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,KAAK;AAAA,IACP,CAAC;AAAA,EACH;AAEA,SAAO;AACT;AAKA,SAAS,eAAe,WAA2B;AACjD,QAAM,QAAQ,UAAU,YAAY;AACpC,MAAI,MAAM,SAAS,OAAO,KAAK,MAAM,SAAS,MAAM,EAAG,QAAO;AAC9D,MAAI,MAAM,SAAS,OAAO,KAAK,MAAM,SAAS,OAAO,EAAG,QAAO;AAC/D,MAAI,MAAM,SAAS,MAAM,EAAG,QAAO;AACnC,MAAI,MAAM,SAAS,MAAM,KAAK,MAAM,SAAS,UAAU,KAAK,MAAM,SAAS,MAAM,EAAG,QAAO;AAC3F,SAAO;AACT;AAKA,SAAS,gBAAgB,WAA2B;AAClD,QAAM,OAAO,eAAe,SAAS;AACrC,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/testing/scenarios/creative.ts"],"sourcesContent":["/**\n * Creative Agent Testing Scenarios\n *\n * Tests creative agent capabilities including:\n * - list_creative_formats / list_formats\n * - build_creative\n * - preview_creative\n *\n * Enhanced to:\n * - Test multiple formats from the agent's actual catalog\n * - Test with both required and optional assets\n * - Validate preview renders\n */\n\nimport type { BuildCreativeRequest, PreviewCreativeRequest } from '../../types/tools.generated';\nimport type { TestOptions, TestStepResult, AgentProfile, TaskResult } from '../types';\nimport { getOrCreateClient, runStep, getOrDiscoverProfile, discoverCreativeFormats, resolveBrand } from '../client';\n\n/**\n * Test: Creative Flow (for creative agents)\n *\n * Flow: list_formats -> build_creative (multiple formats) -> preview_creative (with assets)\n */\nexport async function testCreativeFlow(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n // Discover agent profile\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Discover creative formats with full details\n const { formats, step: formatStep } = await discoverCreativeFormats(client, profile);\n steps.push(formatStep);\n\n if (!formatStep.passed || !formats || formats.length === 0) {\n return { steps, profile: { ...profile, supported_formats: formats || [] } };\n }\n\n // Store discovered formats in profile\n profile.supported_formats = formats;\n\n // Determine which formats to test\n const formatsToTest = selectFormatsToTest(formats || [], options);\n\n // Build creative for each selected format\n if (profile.tools.includes('build_creative')) {\n for (const format of formatsToTest) {\n const formatDisplayName = format.name || format.format_id.id;\n const { result, step } = await runStep<TaskResult>(\n `Build creative: ${formatDisplayName}`,\n 'build_creative',\n async () =>\n client.buildCreativeLegacy({\n target_format_id: format.format_id,\n brand: resolveBrand(options),\n message: `Create an ad for an e-commerce brand promoting summer sale`,\n quality: 'draft',\n include_preview: true,\n } as unknown as BuildCreativeRequest) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data as {\n creative_manifest?: { format_id?: unknown; assets?: Record<string, unknown> };\n creative_manifests?: Array<{ format_id?: unknown; assets?: Record<string, unknown> }>;\n preview?: { previews?: unknown[] };\n };\n const manifest = data.creative_manifest || data.creative_manifests?.[0];\n step.details = `Built creative manifest for format ${formatDisplayName}`;\n step.response_preview = JSON.stringify(\n {\n format_id: manifest?.format_id || format.format_id,\n asset_keys: Object.keys(manifest?.assets || {}),\n has_preview: !!data.preview,\n preview_count: data.preview?.previews?.length || 0,\n },\n null,\n 2\n );\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'build_creative failed';\n }\n steps.push(step);\n }\n }\n\n // Preview creative with various asset configurations\n if (profile.tools.includes('preview_creative')) {\n // Test 1: Preview with minimal assets (empty)\n const { step: minimalStep } = await runStep<TaskResult>(\n 'Preview creative: minimal assets',\n 'preview_creative',\n async () =>\n client.previewCreativeLegacy({\n request_type: 'single',\n creative_manifest: {\n format_id: formatsToTest[0]?.format_id || {\n agent_url: 'https://creative.adcontextprotocol.org',\n id: 'display_300x250',\n },\n name: 'Minimal Test Creative',\n assets: {},\n },\n } as unknown as PreviewCreativeRequest) as Promise<TaskResult>\n );\n steps.push(minimalStep);\n\n // Test 2: Preview with sample assets\n const sampleFormat = formatsToTest[0];\n if (sampleFormat) {\n const { result, step } = await runStep<TaskResult>(\n `Preview creative: with assets (${sampleFormat.format_id.id})`,\n 'preview_creative',\n async () =>\n client.previewCreativeLegacy({\n request_type: 'single',\n creative_manifest: {\n format_id: sampleFormat.format_id,\n name: 'Full Test Creative',\n assets: buildTestAssets(sampleFormat) as unknown as Record<string, unknown>,\n },\n } as unknown as PreviewCreativeRequest) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data as {\n previews?: Array<{ renders?: unknown[] }>;\n interactive_url?: string;\n };\n const previews = data.previews || [];\n const renderCount = previews.reduce((count, preview) => count + (preview.renders?.length || 0), 0);\n step.details = `Generated preview with ${previews.length} variant(s)`;\n step.response_preview = JSON.stringify(\n {\n has_renders: renderCount > 0,\n preview_count: previews.length,\n render_count: renderCount,\n interactive_url: data.interactive_url,\n },\n null,\n 2\n );\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'preview_creative failed';\n }\n steps.push(step);\n }\n\n // Test 3: Preview with invalid format_id (error case)\n const { result: errorResult, step: errorStep } = await runStep<TaskResult>(\n 'Preview creative: invalid format (error expected)',\n 'preview_creative',\n async () =>\n client.previewCreativeLegacy({\n request_type: 'single',\n creative_manifest: {\n format_id: { agent_url: 'https://creative.adcontextprotocol.org', id: 'INVALID_FORMAT_ID_12345' },\n name: 'Error Test Creative',\n assets: {},\n },\n } as unknown as PreviewCreativeRequest) as Promise<TaskResult>\n );\n\n // This should fail - if it succeeds with invalid format, that's a bug\n if (errorResult?.success) {\n errorStep.passed = false;\n errorStep.error = 'Expected error for invalid format_id but got success';\n } else {\n errorStep.passed = true;\n errorStep.details = 'Correctly rejected invalid format_id';\n }\n steps.push(errorStep);\n }\n\n return { steps, profile };\n}\n\n/**\n * Test: Creative Lifecycle\n *\n * Chains creative protocol operations end-to-end:\n * 1. list_creative_formats → verify format schema\n * 2. sync_creatives with multiple creatives → verify per-creative status\n * 3. list_creatives (no snapshot) → verify basic fields\n * 4. list_creatives (include_snapshot: true) → verify snapshot or snapshot_unavailable_reason\n * 5. build_creative or preview_creative on synced creative → adapt to agent capabilities\n */\nexport async function testCreativeLifecycle(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n // Discover agent profile\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Step 1: Discover creative formats\n const { formats, step: formatStep } = await discoverCreativeFormats(client, profile);\n steps.push(formatStep);\n\n if (!formatStep.passed || !formats || formats.length === 0) {\n return { steps, profile };\n }\n\n profile.supported_formats = formats;\n\n // Validate format schema: each format should have format_id\n const formatSchemaIssues: string[] = [];\n for (const format of formats) {\n if (!format.format_id) formatSchemaIssues.push('Missing format_id');\n }\n\n steps.push({\n step: 'Validate format schema',\n passed: formatSchemaIssues.length === 0,\n duration_ms: 0,\n details:\n formatSchemaIssues.length === 0\n ? `All ${formats.length} format(s) have required fields`\n : formatSchemaIssues.join('; '),\n warnings: formatSchemaIssues.length > 0 ? formatSchemaIssues : undefined,\n });\n\n // Step 2: Sync multiple creatives (image + video if formats allow)\n if (profile.tools.includes('sync_creatives')) {\n const imageFormat = formats[0]!;\n const videoFormat = formats.length > 1 ? formats[1] : undefined;\n\n const creativesToSync = [\n {\n creative_id: `lifecycle-img-${Date.now()}`,\n name: 'Lifecycle Test Image Creative',\n format_id: imageFormat.format_id,\n assets: {\n primary: {\n url: 'https://via.placeholder.com/300x250.png?text=Lifecycle+Image',\n width: 300,\n height: 250,\n format: 'png',\n },\n },\n },\n ];\n\n if (videoFormat) {\n creativesToSync.push({\n creative_id: `lifecycle-vid-${Date.now()}`,\n name: 'Lifecycle Test Video Creative',\n format_id: videoFormat.format_id,\n assets: {\n primary: {\n url: 'https://storage.googleapis.com/webfundamentals-assets/videos/chrome.mp4',\n width: 1920,\n height: 1080,\n format: 'mp4',\n },\n },\n });\n }\n\n const { result: syncResult, step: syncStep } = await runStep<TaskResult>(\n `Sync ${creativesToSync.length} creative(s) to library`,\n 'sync_creatives',\n async () =>\n client.executeTaskLegacy('sync_creatives', {\n creatives: creativesToSync,\n }) as Promise<TaskResult>\n );\n\n if (syncResult?.success && syncResult?.data) {\n const data = syncResult.data;\n const creatives = data.creatives || [];\n const actions = creatives.map((c: any) => c.action);\n const failed = creatives.filter((c: any) => c.action === 'failed');\n\n syncStep.details = `Synced ${creatives.length} creative(s), actions: ${actions.join(', ')}`;\n syncStep.response_preview = JSON.stringify(\n {\n synced_count: creatives.length,\n actions,\n creative_ids: creatives.map((c: any) => c.creative_id),\n failed_count: failed.length,\n failed_errors: failed.map((c: any) => ({ creative_id: c.creative_id, errors: c.errors })),\n },\n null,\n 2\n );\n } else if (syncResult && !syncResult.success) {\n syncStep.passed = false;\n syncStep.error = syncResult.error || 'sync_creatives returned unsuccessful result';\n }\n steps.push(syncStep);\n\n // Step 3: list_creatives without snapshot\n if (profile.tools.includes('list_creatives')) {\n const { result: listResult, step: listStep } = await runStep<TaskResult>(\n 'List creatives (no snapshot)',\n 'list_creatives',\n async () => client.executeTask('list_creatives', {}) as Promise<TaskResult>\n );\n\n if (listResult?.success && listResult?.data) {\n const data = listResult.data;\n const creatives = data.creatives || [];\n\n // Validate basic fields on each creative\n const fieldIssues: string[] = [];\n for (const creative of creatives.slice(0, 5)) {\n if (!creative.creative_id) fieldIssues.push('Creative missing creative_id');\n if (!creative.name) fieldIssues.push(`Creative ${creative.creative_id}: missing name`);\n if (!creative.format_id) fieldIssues.push(`Creative ${creative.creative_id}: missing format_id`);\n }\n\n // Verify snapshot is absent when not requested\n const hasUnexpectedSnapshot = creatives.some((c: any) => c.snapshot !== undefined);\n\n if (fieldIssues.length > 0) {\n listStep.passed = false;\n listStep.error = `Creative field validation: ${fieldIssues.join('; ')}`;\n } else {\n listStep.details = `Found ${creatives.length} creative(s) with valid fields`;\n }\n\n listStep.response_preview = JSON.stringify(\n {\n creatives_count: creatives.length,\n statuses: Array.from(new Set(creatives.map((c: any) => c.status))),\n has_unexpected_snapshot: hasUnexpectedSnapshot,\n query_summary: data.query_summary,\n },\n null,\n 2\n );\n\n if (hasUnexpectedSnapshot) {\n listStep.warnings = ['snapshot field present on creatives without include_snapshot=true'];\n }\n } else if (listResult && !listResult.success) {\n listStep.passed = false;\n listStep.error = listResult.error || 'list_creatives returned unsuccessful result';\n }\n steps.push(listStep);\n\n // Step 4: list_creatives with include_snapshot: true\n const { result: snapshotResult, step: snapshotStep } = await runStep<TaskResult>(\n 'List creatives (include_snapshot: true)',\n 'list_creatives',\n async () => client.executeTask('list_creatives', { include_snapshot: true }) as Promise<TaskResult>\n );\n\n if (snapshotResult?.success && snapshotResult?.data) {\n const data = snapshotResult.data;\n const creatives = data.creatives || [];\n\n // Each creative should have either snapshot data or snapshot_unavailable_reason\n const invalidCreatives = creatives.filter((c: any) => {\n if (c.snapshot) {\n return !c.snapshot.as_of || c.snapshot.staleness_seconds === undefined;\n }\n return !c.snapshot_unavailable_reason;\n });\n\n if (invalidCreatives.length > 0) {\n snapshotStep.passed = false;\n snapshotStep.error = `${invalidCreatives.length} creative(s) missing both snapshot and snapshot_unavailable_reason`;\n } else {\n const withSnapshot = creatives.filter((c: any) => !!c.snapshot).length;\n const withReason = creatives.filter((c: any) => !!c.snapshot_unavailable_reason).length;\n snapshotStep.details = `${creatives.length} creative(s): ${withSnapshot} with snapshot, ${withReason} with unavailable_reason`;\n }\n\n snapshotStep.response_preview = JSON.stringify(\n {\n creatives_count: creatives.length,\n with_snapshot: creatives.filter((c: any) => !!c.snapshot).length,\n with_unavailable_reason: creatives.filter((c: any) => !!c.snapshot_unavailable_reason).length,\n snapshot_reasons: Array.from(\n new Set(creatives.map((c: any) => c.snapshot_unavailable_reason).filter(Boolean))\n ),\n },\n null,\n 2\n );\n } else if (snapshotResult && !snapshotResult.success) {\n snapshotStep.passed = false;\n snapshotStep.error = snapshotResult.error || 'list_creatives with snapshot returned unsuccessful result';\n }\n steps.push(snapshotStep);\n }\n }\n\n // Step 5: build_creative or preview_creative (adapt to agent capabilities)\n if (profile.tools.includes('build_creative')) {\n const targetFormat = formats[0]!;\n const { result, step } = await runStep<TaskResult>(\n `Build creative for lifecycle (${targetFormat.format_id})`,\n 'build_creative',\n async () =>\n client.executeTaskLegacy('build_creative', {\n target_format_id: targetFormat.format_id,\n brand: resolveBrand(options),\n message: `Create an ad for lifecycle testing`,\n quality: 'draft',\n include_preview: true,\n }) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data;\n const manifest = data.creative_manifest || data.creative_manifests?.[0];\n step.details = `Built creative manifest for format ${manifest?.format_id || targetFormat.format_id}`;\n step.response_preview = JSON.stringify(\n {\n format_id: manifest?.format_id || targetFormat.format_id,\n asset_keys: Object.keys(manifest?.assets || {}),\n has_preview: !!data.preview,\n },\n null,\n 2\n );\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'build_creative failed';\n }\n steps.push(step);\n } else if (profile.tools.includes('preview_creative')) {\n // Tag-serving agents may only support preview, not build\n const targetFormat = formats[0]!;\n const { result, step } = await runStep<TaskResult>(\n `Preview creative for lifecycle (${targetFormat.format_id})`,\n 'preview_creative',\n async () =>\n client.executeTaskLegacy('preview_creative', {\n request_type: 'single',\n creative_manifest: {\n format_id: targetFormat.format_id,\n name: 'Lifecycle Test Preview',\n assets: buildTestAssets(targetFormat),\n },\n }) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data;\n step.details = `Generated preview with ${data.renders?.length || 0} render(s)`;\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'preview_creative failed';\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n\n/**\n * Select which formats to test based on options\n */\nfunction selectFormatsToTest(\n formats: NonNullable<AgentProfile['supported_formats']>,\n options: TestOptions\n): NonNullable<AgentProfile['supported_formats']> {\n // If specific format_ids provided, use those\n if (options.format_ids?.length) {\n return formats.filter(f => options.format_ids!.includes(f.format_id.id));\n }\n\n // If test_all_formats, test up to max_formats_to_test\n if (options.test_all_formats) {\n const maxFormats = options.max_formats_to_test || 5;\n return formats.slice(0, maxFormats);\n }\n\n // Default: test up to 3 formats\n return formats.slice(0, 3);\n}\n\n/**\n * Build test assets for a format based on its requirements\n */\nfunction buildTestAssets(\n format: NonNullable<AgentProfile['supported_formats']>[0]\n): Array<{ asset_id: string; asset_type: string; url: string }> {\n const assets: Array<{ asset_id: string; asset_type: string; url: string }> = [];\n\n // Add required assets\n if (format.required_assets?.length) {\n for (const assetName of format.required_assets) {\n assets.push({\n asset_id: assetName,\n asset_type: guessAssetType(assetName),\n url: getTestAssetUrl(assetName),\n });\n }\n }\n\n // If no required assets, add a default image\n if (assets.length === 0) {\n assets.push({\n asset_id: 'primary_image',\n asset_type: 'image',\n url: 'https://via.placeholder.com/300x250.png?text=Test+Creative',\n });\n }\n\n return assets;\n}\n\n/**\n * Guess asset type from asset name\n */\nfunction guessAssetType(assetName: string): string {\n const lower = assetName.toLowerCase();\n if (lower.includes('video') || lower.includes('clip')) return 'video';\n if (lower.includes('audio') || lower.includes('sound')) return 'audio';\n if (lower.includes('logo')) return 'image';\n if (lower.includes('text') || lower.includes('headline') || lower.includes('copy')) return 'text';\n return 'image';\n}\n\n/**\n * Get a test asset URL for testing\n */\nfunction getTestAssetUrl(assetName: string): string {\n const type = guessAssetType(assetName);\n switch (type) {\n case 'video':\n return 'https://storage.googleapis.com/webfundamentals-assets/videos/chrome.mp4';\n case 'audio':\n return 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3';\n default:\n return 'https://via.placeholder.com/300x250.png?text=Test+Asset';\n }\n}\n"],"mappings":"AAgBA,SAAS,mBAAmB,SAAS,sBAAsB,yBAAyB,oBAAoB;AAOxG,eAAsB,iBACpB,UACA,SAC8D;AAC9D,QAAM,QAA0B,CAAC;AACjC,QAAM,SAAS,kBAAkB,UAAU,OAAO;AAGlD,QAAM,EAAE,SAAS,MAAM,YAAY,IAAI,MAAM,qBAAqB,QAAQ,OAAO;AACjF,QAAM,KAAK,WAAW;AAEtB,MAAI,CAAC,YAAY,QAAQ;AACvB,WAAO,EAAE,OAAO,QAAQ;AAAA,EAC1B;AAGA,QAAM,EAAE,SAAS,MAAM,WAAW,IAAI,MAAM,wBAAwB,QAAQ,OAAO;AACnF,QAAM,KAAK,UAAU;AAErB,MAAI,CAAC,WAAW,UAAU,CAAC,WAAW,QAAQ,WAAW,GAAG;AAC1D,WAAO,EAAE,OAAO,SAAS,EAAE,GAAG,SAAS,mBAAmB,WAAW,CAAC,EAAE,EAAE;AAAA,EAC5E;AAGA,UAAQ,oBAAoB;AAG5B,QAAM,gBAAgB,oBAAoB,WAAW,CAAC,GAAG,OAAO;AAGhE,MAAI,QAAQ,MAAM,SAAS,gBAAgB,GAAG;AAC5C,eAAW,UAAU,eAAe;AAClC,YAAM,oBAAoB,OAAO,QAAQ,OAAO,UAAU;AAC1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9D,MAAI,MAAM,SAAS,OAAO,KAAK,MAAM,SAAS,OAAO,EAAG,QAAO;AAC/D,MAAI,MAAM,SAAS,MAAM,EAAG,QAAO;AACnC,MAAI,MAAM,SAAS,MAAM,KAAK,MAAM,SAAS,UAAU,KAAK,MAAM,SAAS,MAAM,EAAG,QAAO;AAC3F,SAAO;AACT;AAKA,SAAS,gBAAgB,WAA2B;AAClD,QAAM,OAAO,eAAe,SAAS;AACrC,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
|
|
@@ -37,7 +37,7 @@ async function testDiscovery(agentUrl, options) {
|
|
|
37
37
|
const { result, step } = await (0, import_client.runStep)(
|
|
38
38
|
"List creative formats",
|
|
39
39
|
"list_creative_formats",
|
|
40
|
-
async () => client.
|
|
40
|
+
async () => client.listCreativeFormatsLegacy({})
|
|
41
41
|
);
|
|
42
42
|
if (result?.success && result?.data) {
|
|
43
43
|
const data = result.data;
|
|
@@ -63,7 +63,7 @@ async function testDiscovery(agentUrl, options) {
|
|
|
63
63
|
const { result, step } = await (0, import_client.runStep)(
|
|
64
64
|
"List authorized properties",
|
|
65
65
|
"list_authorized_properties",
|
|
66
|
-
async () => client.
|
|
66
|
+
async () => client.executeCustomTask("list_authorized_properties", {})
|
|
67
67
|
);
|
|
68
68
|
const data = result?.data;
|
|
69
69
|
const publisherDomains = data?.publisher_domains;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/testing/scenarios/discovery.ts"],"sourcesContent":["/**\n * Discovery Testing Scenario\n *\n * Tests product discovery, format listing, and property listing.\n */\n\nimport type { ListCreativeFormatsResponse, Format } from '../../types/tools.generated';\nimport type { TestOptions, TestStepResult, AgentProfile, TaskResult } from '../types';\nimport { getOrCreateClient, runStep, getOrDiscoverProfile, discoverAgentCapabilities } from '../client';\n\n/**\n * Test: Discovery\n * Tests product discovery, format listing, and property listing\n */\nexport async function testDiscovery(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n // Discover agent profile\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Discover capabilities\n const { capabilities, steps: capSteps } = await discoverAgentCapabilities(client, profile, options);\n steps.push(...capSteps);\n\n // Merge capabilities into profile\n Object.assign(profile, capabilities);\n\n // List creative formats (if available)\n if (profile.tools.includes('list_creative_formats')) {\n const { result, step } = await runStep<TaskResult>(\n 'List creative formats',\n 'list_creative_formats',\n async () => client.
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/testing/scenarios/discovery.ts"],"sourcesContent":["/**\n * Discovery Testing Scenario\n *\n * Tests product discovery, format listing, and property listing.\n */\n\nimport type { ListCreativeFormatsResponse, Format } from '../../types/tools.generated';\nimport type { TestOptions, TestStepResult, AgentProfile, TaskResult } from '../types';\nimport { getOrCreateClient, runStep, getOrDiscoverProfile, discoverAgentCapabilities } from '../client';\n\n/**\n * Test: Discovery\n * Tests product discovery, format listing, and property listing\n */\nexport async function testDiscovery(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n // Discover agent profile\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Discover capabilities\n const { capabilities, steps: capSteps } = await discoverAgentCapabilities(client, profile, options);\n steps.push(...capSteps);\n\n // Merge capabilities into profile\n Object.assign(profile, capabilities);\n\n // List creative formats (if available)\n if (profile.tools.includes('list_creative_formats')) {\n const { result, step } = await runStep<TaskResult>(\n 'List creative formats',\n 'list_creative_formats',\n async () => client.listCreativeFormatsLegacy({}) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data as ListCreativeFormatsResponse;\n const formats: Format[] = data.formats || [];\n const creativeAgents = data.creative_agents || [];\n const formatCount = formats.length;\n step.details = `Found ${formatCount} format(s), ${creativeAgents.length} creative agent(s)`;\n step.response_preview = JSON.stringify(\n {\n format_ids: formats.map(f => f.format_id).slice(0, 5),\n creative_agents: creativeAgents.map(a => a.agent_url),\n },\n null,\n 2\n );\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'list_creative_formats returned unsuccessful result';\n }\n steps.push(step);\n }\n\n // List authorized properties (if available)\n if (profile.tools.includes('list_authorized_properties')) {\n const { result, step } = await runStep<TaskResult>(\n 'List authorized properties',\n 'list_authorized_properties',\n async () => client.executeCustomTask('list_authorized_properties', {}) as Promise<TaskResult>\n );\n\n const data = result?.data as unknown as Record<string, unknown> | undefined;\n const publisherDomains = data?.publisher_domains as string[] | undefined;\n if (result?.success && publisherDomains) {\n step.details = `Found ${publisherDomains.length} publisher domain(s)`;\n step.response_preview = JSON.stringify(\n {\n publisher_domains_count: publisherDomains.length,\n domains: publisherDomains.slice(0, 3),\n },\n null,\n 2\n );\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'list_authorized_properties returned unsuccessful result';\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,oBAA4F;AAM5F,eAAsB,cACpB,UACA,SAC8D;AAC9D,QAAM,QAA0B,CAAC;AACjC,QAAM,aAAS,iCAAkB,UAAU,OAAO;AAGlD,QAAM,EAAE,SAAS,MAAM,YAAY,IAAI,UAAM,oCAAqB,QAAQ,OAAO;AACjF,QAAM,KAAK,WAAW;AAEtB,MAAI,CAAC,YAAY,QAAQ;AACvB,WAAO,EAAE,OAAO,QAAQ;AAAA,EAC1B;AAGA,QAAM,EAAE,cAAc,OAAO,SAAS,IAAI,UAAM,yCAA0B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AA,QACtC;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF,WAAW,UAAU,CAAC,OAAO,SAAS;AACpC,WAAK,SAAS;AACd,WAAK,QAAQ,OAAO,SAAS;AAAA,IAC/B;AACA,UAAM,KAAK,IAAI;AAAA,EACjB;AAEA,SAAO,EAAE,OAAO,QAAQ;AAC1B;","names":[]}
|
|
@@ -14,7 +14,7 @@ async function testDiscovery(agentUrl, options) {
|
|
|
14
14
|
const { result, step } = await runStep(
|
|
15
15
|
"List creative formats",
|
|
16
16
|
"list_creative_formats",
|
|
17
|
-
async () => client.
|
|
17
|
+
async () => client.listCreativeFormatsLegacy({})
|
|
18
18
|
);
|
|
19
19
|
if (result?.success && result?.data) {
|
|
20
20
|
const data = result.data;
|
|
@@ -40,7 +40,7 @@ async function testDiscovery(agentUrl, options) {
|
|
|
40
40
|
const { result, step } = await runStep(
|
|
41
41
|
"List authorized properties",
|
|
42
42
|
"list_authorized_properties",
|
|
43
|
-
async () => client.
|
|
43
|
+
async () => client.executeCustomTask("list_authorized_properties", {})
|
|
44
44
|
);
|
|
45
45
|
const data = result?.data;
|
|
46
46
|
const publisherDomains = data?.publisher_domains;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/testing/scenarios/discovery.ts"],"sourcesContent":["/**\n * Discovery Testing Scenario\n *\n * Tests product discovery, format listing, and property listing.\n */\n\nimport type { ListCreativeFormatsResponse, Format } from '../../types/tools.generated';\nimport type { TestOptions, TestStepResult, AgentProfile, TaskResult } from '../types';\nimport { getOrCreateClient, runStep, getOrDiscoverProfile, discoverAgentCapabilities } from '../client';\n\n/**\n * Test: Discovery\n * Tests product discovery, format listing, and property listing\n */\nexport async function testDiscovery(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n // Discover agent profile\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Discover capabilities\n const { capabilities, steps: capSteps } = await discoverAgentCapabilities(client, profile, options);\n steps.push(...capSteps);\n\n // Merge capabilities into profile\n Object.assign(profile, capabilities);\n\n // List creative formats (if available)\n if (profile.tools.includes('list_creative_formats')) {\n const { result, step } = await runStep<TaskResult>(\n 'List creative formats',\n 'list_creative_formats',\n async () => client.
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/testing/scenarios/discovery.ts"],"sourcesContent":["/**\n * Discovery Testing Scenario\n *\n * Tests product discovery, format listing, and property listing.\n */\n\nimport type { ListCreativeFormatsResponse, Format } from '../../types/tools.generated';\nimport type { TestOptions, TestStepResult, AgentProfile, TaskResult } from '../types';\nimport { getOrCreateClient, runStep, getOrDiscoverProfile, discoverAgentCapabilities } from '../client';\n\n/**\n * Test: Discovery\n * Tests product discovery, format listing, and property listing\n */\nexport async function testDiscovery(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n // Discover agent profile\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Discover capabilities\n const { capabilities, steps: capSteps } = await discoverAgentCapabilities(client, profile, options);\n steps.push(...capSteps);\n\n // Merge capabilities into profile\n Object.assign(profile, capabilities);\n\n // List creative formats (if available)\n if (profile.tools.includes('list_creative_formats')) {\n const { result, step } = await runStep<TaskResult>(\n 'List creative formats',\n 'list_creative_formats',\n async () => client.listCreativeFormatsLegacy({}) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data as ListCreativeFormatsResponse;\n const formats: Format[] = data.formats || [];\n const creativeAgents = data.creative_agents || [];\n const formatCount = formats.length;\n step.details = `Found ${formatCount} format(s), ${creativeAgents.length} creative agent(s)`;\n step.response_preview = JSON.stringify(\n {\n format_ids: formats.map(f => f.format_id).slice(0, 5),\n creative_agents: creativeAgents.map(a => a.agent_url),\n },\n null,\n 2\n );\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'list_creative_formats returned unsuccessful result';\n }\n steps.push(step);\n }\n\n // List authorized properties (if available)\n if (profile.tools.includes('list_authorized_properties')) {\n const { result, step } = await runStep<TaskResult>(\n 'List authorized properties',\n 'list_authorized_properties',\n async () => client.executeCustomTask('list_authorized_properties', {}) as Promise<TaskResult>\n );\n\n const data = result?.data as unknown as Record<string, unknown> | undefined;\n const publisherDomains = data?.publisher_domains as string[] | undefined;\n if (result?.success && publisherDomains) {\n step.details = `Found ${publisherDomains.length} publisher domain(s)`;\n step.response_preview = JSON.stringify(\n {\n publisher_domains_count: publisherDomains.length,\n domains: publisherDomains.slice(0, 3),\n },\n null,\n 2\n );\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'list_authorized_properties returned unsuccessful result';\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n"],"mappings":"AAQA,SAAS,mBAAmB,SAAS,sBAAsB,iCAAiC;AAM5F,eAAsB,cACpB,UACA,SAC8D;AAC9D,QAAM,QAA0B,CAAC;AACjC,QAAM,SAAS,kBAAkB,UAAU,OAAO;AAGlD,QAAM,EAAE,SAAS,MAAM,YAAY,IAAI,MAAM,qBAAqB,QAAQ,OAAO;AACjF,QAAM,KAAK,WAAW;AAEtB,MAAI,CAAC,YAAY,QAAQ;AACvB,WAAO,EAAE,OAAO,QAAQ;AAAA,EAC1B;AAGA,QAAM,EAAE,cAAc,OAAO,SAAS,IAAI,MAAM,0BAA0B,QAAQ,SAAS,OAAO;AAClG,QAAM,KAAK,GAAG,QAAQ;AAGtB,SAAO,OAAO,SAAS,YAAY;AAGnC,MAAI,QAAQ,MAAM,SAAS,uBAAuB,GAAG;AACnD,UAAM,EAAE,QAAQ,KAAK,IAAI,MAAM;AAAA,MAC7B;AAAA,MACA;AAAA,MACA,Y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;AAC1B;","names":[]}
|
|
@@ -40,7 +40,7 @@ async function testErrorHandling(agentUrl, options) {
|
|
|
40
40
|
const { result, step } = await (0, import_client.runStep)(
|
|
41
41
|
"Invalid product_id error response",
|
|
42
42
|
"create_media_buy",
|
|
43
|
-
async () => client.
|
|
43
|
+
async () => client.createMediaBuyLegacy({
|
|
44
44
|
idempotency_key: `error-test-${Date.now()}`,
|
|
45
45
|
brand_manifest: {
|
|
46
46
|
name: "Error Test Brand",
|
|
@@ -87,7 +87,7 @@ async function testErrorHandling(agentUrl, options) {
|
|
|
87
87
|
const { result, step } = await (0, import_client.runStep)(
|
|
88
88
|
"Invalid format_id error response",
|
|
89
89
|
"sync_creatives",
|
|
90
|
-
async () => client.
|
|
90
|
+
async () => client.syncCreativesLegacy({
|
|
91
91
|
account: (0, import_client.resolveAccount)(options),
|
|
92
92
|
creatives: [
|
|
93
93
|
{
|
|
@@ -155,7 +155,7 @@ async function testValidation(agentUrl, options) {
|
|
|
155
155
|
const { result, step } = await (0, import_client.runStep)(
|
|
156
156
|
"Invalid pacing enum value",
|
|
157
157
|
"create_media_buy",
|
|
158
|
-
async () => client.
|
|
158
|
+
async () => client.createMediaBuyLegacy({
|
|
159
159
|
idempotency_key: `validation-test-${Date.now()}`,
|
|
160
160
|
brand_manifest: { name: "Validation Test", url: "https://test.example" },
|
|
161
161
|
start_time: new Date(Date.now() + 864e5).toISOString(),
|
|
@@ -183,7 +183,7 @@ async function testValidation(agentUrl, options) {
|
|
|
183
183
|
const { result, step } = await (0, import_client.runStep)(
|
|
184
184
|
"Negative budget rejection",
|
|
185
185
|
"create_media_buy",
|
|
186
|
-
async () => client.
|
|
186
|
+
async () => client.createMediaBuyLegacy({
|
|
187
187
|
idempotency_key: `negative-budget-test-${Date.now()}`,
|
|
188
188
|
brand_manifest: { name: "Negative Budget Test", url: "https://test.example" },
|
|
189
189
|
start_time: new Date(Date.now() + 864e5).toISOString(),
|
|
@@ -210,7 +210,7 @@ async function testValidation(agentUrl, options) {
|
|
|
210
210
|
const { result, step } = await (0, import_client.runStep)(
|
|
211
211
|
"Invalid creative weight (> 100)",
|
|
212
212
|
"sync_creatives",
|
|
213
|
-
async () => client.
|
|
213
|
+
async () => client.syncCreativesLegacy({
|
|
214
214
|
account: (0, import_client.resolveAccount)(options),
|
|
215
215
|
creatives: [
|
|
216
216
|
{
|
|
@@ -243,7 +243,7 @@ async function testValidation(agentUrl, options) {
|
|
|
243
243
|
const { result, step } = await (0, import_client.runStep)(
|
|
244
244
|
"Empty creatives array handling",
|
|
245
245
|
"sync_creatives",
|
|
246
|
-
async () => client.
|
|
246
|
+
async () => client.syncCreativesLegacy({
|
|
247
247
|
account: (0, import_client.resolveAccount)(options),
|
|
248
248
|
creatives: []
|
|
249
249
|
})
|
|
@@ -323,7 +323,7 @@ async function testPricingEdgeCases(agentUrl, options) {
|
|
|
323
323
|
const { result, step } = await (0, import_client.runStep)(
|
|
324
324
|
"Auction pricing without bid_price",
|
|
325
325
|
"create_media_buy",
|
|
326
|
-
async () => client.
|
|
326
|
+
async () => client.createMediaBuyLegacy({
|
|
327
327
|
idempotency_key: `auction-no-bid-${Date.now()}`,
|
|
328
328
|
brand_manifest: { name: "Auction Test", url: "https://test.example" },
|
|
329
329
|
start_time: new Date(Date.now() + 864e5).toISOString(),
|
|
@@ -352,7 +352,7 @@ async function testPricingEdgeCases(agentUrl, options) {
|
|
|
352
352
|
const { result, step } = await (0, import_client.runStep)(
|
|
353
353
|
"Budget below min_spend_per_package",
|
|
354
354
|
"create_media_buy",
|
|
355
|
-
async () => client.
|
|
355
|
+
async () => client.createMediaBuyLegacy({
|
|
356
356
|
idempotency_key: `under-min-spend-${Date.now()}`,
|
|
357
357
|
brand_manifest: { name: "Min Spend Test", url: "https://test.example" },
|
|
358
358
|
start_time: new Date(Date.now() + 864e5).toISOString(),
|
|
@@ -388,7 +388,7 @@ async function testTemporalValidation(agentUrl, options) {
|
|
|
388
388
|
const { result: endBeforeStart, step: step1 } = await (0, import_client.runStep)(
|
|
389
389
|
"End time before start time",
|
|
390
390
|
"create_media_buy",
|
|
391
|
-
async () => client.
|
|
391
|
+
async () => client.createMediaBuyLegacy({
|
|
392
392
|
idempotency_key: `temporal-test-${Date.now()}`,
|
|
393
393
|
brand_manifest: { name: "Temporal Test", url: "https://test.example" },
|
|
394
394
|
start_time: new Date(Date.now() + 6048e5).toISOString(),
|
|
@@ -418,7 +418,7 @@ async function testTemporalValidation(agentUrl, options) {
|
|
|
418
418
|
const { result: pastStart, step: step2 } = await (0, import_client.runStep)(
|
|
419
419
|
"Start time in the past",
|
|
420
420
|
"create_media_buy",
|
|
421
|
-
async () => client.
|
|
421
|
+
async () => client.createMediaBuyLegacy({
|
|
422
422
|
idempotency_key: `past-start-${Date.now()}`,
|
|
423
423
|
brand_manifest: { name: "Past Start Test", url: "https://test.example" },
|
|
424
424
|
start_time: new Date(Date.now() - 864e5).toISOString(),
|
|
@@ -518,7 +518,7 @@ async function testResponseConsistency(agentUrl, options) {
|
|
|
518
518
|
const { result, step } = await (0, import_client.runStep)(
|
|
519
519
|
"Check list_authorized_properties consistency",
|
|
520
520
|
"list_authorized_properties",
|
|
521
|
-
async () => client.
|
|
521
|
+
async () => client.executeCustomTask("list_authorized_properties", {})
|
|
522
522
|
);
|
|
523
523
|
if (result?.success && result?.data) {
|
|
524
524
|
const data = result.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/testing/scenarios/edge-cases.ts"],"sourcesContent":["/**\n * Edge Case Testing Scenarios\n *\n * Tests various edge cases, error handling, and validation:\n * - Error handling (invalid inputs, non-existent IDs)\n * - Schema validation (negative values, invalid enums)\n * - Pricing edge cases (auction vs fixed, min spend, floor prices)\n * - Behavior analysis\n * - Temporal validation\n * - Response consistency\n *\n * These scenarios are designed to find bugs and ensure agents\n * properly handle edge cases according to the AdCP spec.\n */\n\nimport type { Product, PricingOption } from '../../types/core.generated';\nimport type {\n CreateMediaBuyRequest,\n GetProductsRequest,\n SyncCreativesRequest,\n GetMediaBuyDeliveryRequest,\n GetProductsResponse,\n ListCreativesResponse,\n} from '../../types/tools.generated';\nimport type { TestOptions, TestStepResult, AgentProfile, TaskResult } from '../types';\nimport { getOrCreateClient, runStep, resolveBrand, resolveAccount, getOrDiscoverProfile } from '../client';\nimport { testDiscovery } from './discovery';\n\n/**\n * Test: Error Handling\n * Verifies the agent returns proper discriminated union error responses\n */\nexport async function testErrorHandling(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Test 1: Invalid product_id in create_media_buy\n if (profile.tools.includes('create_media_buy')) {\n const { result, step } = await runStep<TaskResult>(\n 'Invalid product_id error response',\n 'create_media_buy',\n async () =>\n client.createMediaBuy({\n idempotency_key: `error-test-${Date.now()}`,\n brand_manifest: {\n name: 'Error Test Brand',\n url: 'https://test.example',\n },\n start_time: new Date(Date.now() + 86400000).toISOString(),\n end_time: new Date(Date.now() + 604800000).toISOString(),\n packages: [\n {\n product_id: 'NONEXISTENT_PRODUCT_ID_12345',\n budget: 1000,\n pricing_option_id: 'nonexistent-pricing',\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = 'Agent accepted invalid product_id - should have returned error';\n } else {\n // !result (threw) or result.success === false — both count as rejection\n step.passed = true;\n step.details = `Agent correctly rejected invalid product_id${result?.error ? `: ${result.error}` : ''}`;\n if (result?.error) step.response_preview = JSON.stringify({ error: result.error }, null, 2);\n }\n steps.push(step);\n }\n\n // Test 2: Missing required field in get_products\n if (profile.tools.includes('get_products')) {\n const { result, step } = await runStep<TaskResult>(\n 'Empty request handling',\n 'get_products',\n async () => client.getProducts({} as unknown as GetProductsRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = true;\n step.details = 'Agent accepts empty get_products request (permissive)';\n } else {\n // !result (threw) or result.success === false — both mean stricter validation\n step.passed = true;\n step.details = `Agent requires brief or brand (stricter validation)${result?.error ? `: ${result.error}` : ''}`;\n if (result?.error) step.response_preview = JSON.stringify({ error: result.error }, null, 2);\n }\n steps.push(step);\n }\n\n // Test 3: Invalid format_id in sync_creatives\n if (profile.tools.includes('sync_creatives')) {\n const { result, step } = await runStep<TaskResult>(\n 'Invalid format_id error response',\n 'sync_creatives',\n async () =>\n client.syncCreatives({\n account: resolveAccount(options),\n creatives: [\n {\n creative_id: `invalid-format-test-${Date.now()}`,\n name: 'Invalid Format Test',\n format_id: { id: 'TOTALLY_INVALID_FORMAT_ID_999' },\n assets: {\n primary: {\n url: 'https://via.placeholder.com/300x250',\n width: 300,\n height: 250,\n format: 'png',\n },\n },\n },\n ],\n } as unknown as SyncCreativesRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = true;\n step.details = 'Agent accepts unknown format_ids (permissive mode)';\n } else {\n // !result (threw) or result.success === false — both count as rejection\n step.passed = true;\n step.details = `Agent correctly rejected invalid format_id${result?.error ? `: ${result.error}` : ''}`;\n if (result?.error) step.response_preview = JSON.stringify({ error: result.error }, null, 2);\n }\n steps.push(step);\n }\n\n // Test 4: get_media_buy_delivery with non-existent media_buy_id\n if (profile.tools.includes('get_media_buy_delivery')) {\n const { result, step } = await runStep<TaskResult>(\n 'Non-existent media_buy_id error',\n 'get_media_buy_delivery',\n async () =>\n client.getMediaBuyDelivery({\n media_buy_ids: ['NONEXISTENT_MEDIA_BUY_ID_99999'],\n } as unknown as GetMediaBuyDeliveryRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n const data = result.data as unknown as Record<string, unknown> | undefined;\n const deliveries = (data?.deliveries || data?.media_buys || []) as unknown[];\n if (deliveries.length === 0) {\n step.passed = true;\n step.details = 'Agent returned empty deliveries for non-existent media buy';\n } else {\n step.passed = false;\n step.error = 'Agent returned deliveries for non-existent media_buy_id';\n }\n } else {\n // !result (threw) or result.success === false — both count as rejection\n step.passed = true;\n step.details = `Agent correctly returned error for non-existent media buy${result?.error ? `: ${result.error}` : ''}`;\n if (result?.error) step.response_preview = JSON.stringify({ error: result.error }, null, 2);\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n\n/**\n * Test: Validation\n * Tests that agents properly validate inputs and reject malformed requests\n */\nexport async function testValidation(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Test 1: Invalid enum value for pacing\n if (profile.tools.includes('create_media_buy')) {\n const { result, step } = await runStep<TaskResult>(\n 'Invalid pacing enum value',\n 'create_media_buy',\n async () =>\n client.createMediaBuy({\n idempotency_key: `validation-test-${Date.now()}`,\n brand_manifest: { name: 'Validation Test', url: 'https://test.example' },\n start_time: new Date(Date.now() + 86400000).toISOString(),\n end_time: new Date(Date.now() + 604800000).toISOString(),\n packages: [\n {\n product_id: 'test-product',\n budget: 1000,\n pricing_option_id: 'test-pricing',\n pacing: 'INVALID_PACING_VALUE' as unknown as string,\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = 'Agent accepted invalid pacing value - should validate enums';\n } else {\n step.passed = true;\n step.details = `Agent rejected invalid pacing enum value${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n // Test 2: Negative budget (definitely invalid)\n if (profile.tools.includes('create_media_buy')) {\n const { result, step } = await runStep<TaskResult>(\n 'Negative budget rejection',\n 'create_media_buy',\n async () =>\n client.createMediaBuy({\n idempotency_key: `negative-budget-test-${Date.now()}`,\n brand_manifest: { name: 'Negative Budget Test', url: 'https://test.example' },\n start_time: new Date(Date.now() + 86400000).toISOString(),\n end_time: new Date(Date.now() + 604800000).toISOString(),\n packages: [\n {\n product_id: 'test-product',\n budget: -500,\n pricing_option_id: 'test-pricing',\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = 'CRITICAL: Agent accepted negative budget - must validate minimum: 0';\n } else {\n step.passed = true;\n step.details = `Agent correctly rejected negative budget${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n // Test 3: Invalid creative weight (> 100)\n if (profile.tools.includes('sync_creatives')) {\n const { result, step } = await runStep<TaskResult>(\n 'Invalid creative weight (> 100)',\n 'sync_creatives',\n async () =>\n client.syncCreatives({\n account: resolveAccount(options),\n creatives: [\n {\n creative_id: `weight-test-${Date.now()}`,\n name: 'Weight Test Creative',\n format_id: { agent_url: 'https://creative.adcontextprotocol.org', id: 'display_300x250' },\n weight: 150,\n assets: {\n primary: {\n url: 'https://via.placeholder.com/300x250',\n width: 300,\n height: 250,\n format: 'png',\n },\n },\n },\n ],\n } as unknown as SyncCreativesRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = 'Agent accepted weight > 100 - should validate maximum: 100';\n } else {\n step.passed = true;\n step.details = `Agent rejected weight > 100${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n // Test 4: Empty creatives array\n if (profile.tools.includes('sync_creatives')) {\n const { result, step } = await runStep<TaskResult>(\n 'Empty creatives array handling',\n 'sync_creatives',\n async () =>\n client.syncCreatives({\n account: resolveAccount(options),\n creatives: [],\n } as unknown as SyncCreativesRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = true;\n step.details = 'Agent accepts empty creatives array (returns empty result)';\n } else {\n // !result (threw) or result.success === false — both mean agent rejected\n step.passed = true;\n step.details = `Agent rejected empty creatives array${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n\n/**\n * Test: Pricing Edge Cases\n * Tests auction vs fixed pricing, min spend requirements, bid_price handling\n */\nexport async function testPricingEdgeCases(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { steps: discoverySteps, profile } = await testDiscovery(agentUrl, options);\n steps.push(...discoverySteps);\n\n if (!profile?.tools.includes('create_media_buy') || !profile?.tools.includes('get_products')) {\n steps.push({\n step: 'Pricing edge cases',\n passed: false,\n duration_ms: 0,\n error: 'Agent does not support create_media_buy or get_products',\n });\n return { steps, profile };\n }\n\n // Get products to find actual pricing options\n const { result: productsResult } = await runStep<TaskResult>(\n 'Fetch products for pricing analysis',\n 'get_products',\n async () =>\n client.getProducts({\n buying_mode: 'brief',\n brief: 'Show all products with pricing details',\n brand: resolveBrand(options),\n } as unknown as GetProductsRequest) as Promise<TaskResult>\n );\n\n const productsData = productsResult?.data as GetProductsResponse | undefined;\n const products = productsData?.products;\n if (!products?.length) {\n steps.push({\n step: 'Pricing edge cases',\n passed: false,\n duration_ms: 0,\n error: 'No products available for pricing tests',\n });\n return { steps, profile };\n }\n\n // Analyze products for auction vs fixed pricing\n const auctionProducts: { product: Product; pricingOption: PricingOption }[] = [];\n const fixedProducts: { product: Product; pricingOption: PricingOption }[] = [];\n const productsWithMinSpend: { product: Product; pricingOption: PricingOption; minSpend: number }[] = [];\n\n for (const product of products) {\n for (const po of product.pricing_options || []) {\n if (!('fixed_price' in po) && (po.floor_price !== undefined || po.price_guidance !== undefined)) {\n auctionProducts.push({ product, pricingOption: po });\n } else if ('fixed_price' in po) {\n fixedProducts.push({ product, pricingOption: po });\n }\n if (po.min_spend_per_package != null && po.min_spend_per_package > 0) {\n productsWithMinSpend.push({\n product,\n pricingOption: po,\n minSpend: po.min_spend_per_package,\n });\n }\n }\n }\n\n steps.push({\n step: 'Analyze pricing options',\n passed: true,\n duration_ms: 0,\n details: `Found ${fixedProducts.length} fixed, ${auctionProducts.length} auction, ${productsWithMinSpend.length} with min spend`,\n });\n\n // Test 1: Auction pricing without bid_price (should fail)\n if (auctionProducts.length > 0) {\n const { product, pricingOption } = auctionProducts[0]!;\n const { result, step } = await runStep<TaskResult>(\n 'Auction pricing without bid_price',\n 'create_media_buy',\n async () =>\n client.createMediaBuy({\n idempotency_key: `auction-no-bid-${Date.now()}`,\n brand_manifest: { name: 'Auction Test', url: 'https://test.example' },\n start_time: new Date(Date.now() + 86400000).toISOString(),\n end_time: new Date(Date.now() + 604800000).toISOString(),\n packages: [\n {\n product_id: product.product_id,\n budget: 5000,\n pricing_option_id: pricingOption.pricing_option_id,\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = 'Agent accepted auction pricing without bid_price - should require it';\n } else {\n step.passed = true;\n step.details = `Agent correctly requires bid_price for auction pricing${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n // Test 2: Budget below min_spend_per_package\n if (productsWithMinSpend.length > 0) {\n const { product, pricingOption, minSpend } = productsWithMinSpend[0]!;\n const underBudget = minSpend * 0.5;\n\n const { result, step } = await runStep<TaskResult>(\n 'Budget below min_spend_per_package',\n 'create_media_buy',\n async () =>\n client.createMediaBuy({\n idempotency_key: `under-min-spend-${Date.now()}`,\n brand_manifest: { name: 'Min Spend Test', url: 'https://test.example' },\n start_time: new Date(Date.now() + 86400000).toISOString(),\n end_time: new Date(Date.now() + 604800000).toISOString(),\n packages: [\n {\n product_id: product.product_id,\n budget: underBudget,\n pricing_option_id: pricingOption.pricing_option_id,\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = `Agent accepted budget ${underBudget} below min_spend ${minSpend}`;\n } else {\n step.passed = true;\n step.details = `Agent rejected budget ${underBudget} below min_spend ${minSpend}${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n\n/**\n * Test: Temporal Validation\n * Tests date/time ordering and format validation\n */\nexport async function testTemporalValidation(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed || !profile.tools.includes('create_media_buy')) {\n return { steps, profile };\n }\n\n // Test 1: End time before start time\n const { result: endBeforeStart, step: step1 } = await runStep<TaskResult>(\n 'End time before start time',\n 'create_media_buy',\n async () =>\n client.createMediaBuy({\n idempotency_key: `temporal-test-${Date.now()}`,\n brand_manifest: { name: 'Temporal Test', url: 'https://test.example' },\n start_time: new Date(Date.now() + 604800000).toISOString(), // 7 days from now\n end_time: new Date(Date.now() + 86400000).toISOString(), // 1 day from now (before start!)\n packages: [\n {\n product_id: 'test-product',\n budget: 1000,\n pricing_option_id: 'test-pricing',\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (!endBeforeStart) {\n // runStep caught an exception — agent rejected at transport level, which counts as rejection\n step1.passed = true;\n step1.details = `Agent rejected end_time before start_time (threw error)`;\n } else if (endBeforeStart.success) {\n step1.passed = false;\n step1.error = 'Agent accepted end_time before start_time - must validate';\n } else {\n step1.passed = true;\n step1.details = `Agent correctly rejected end_time before start_time${endBeforeStart.error ? `: ${endBeforeStart.error}` : ''}`;\n }\n steps.push(step1);\n\n // Test 2: Start time in the past\n const { result: pastStart, step: step2 } = await runStep<TaskResult>(\n 'Start time in the past',\n 'create_media_buy',\n async () =>\n client.createMediaBuy({\n idempotency_key: `past-start-${Date.now()}`,\n brand_manifest: { name: 'Past Start Test', url: 'https://test.example' },\n start_time: new Date(Date.now() - 86400000).toISOString(), // Yesterday\n end_time: new Date(Date.now() + 604800000).toISOString(), // 7 days from now\n packages: [\n {\n product_id: 'test-product',\n budget: 1000,\n pricing_option_id: 'test-pricing',\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (!pastStart) {\n // runStep caught an exception — agent rejected at transport level\n step2.passed = true;\n step2.details = 'Agent rejected start_time in the past (threw error)';\n } else if (pastStart.success) {\n step2.passed = true;\n step2.details = 'Agent accepts start_time in past (may auto-adjust)';\n } else {\n step2.passed = true;\n step2.details = `Agent rejected start_time in the past${pastStart.error ? `: ${pastStart.error}` : ''}`;\n }\n steps.push(step2);\n\n return { steps, profile };\n}\n\n/**\n * Test: Behavior Analysis\n * Analyzes agent behavioral characteristics\n */\nexport async function testBehaviorAnalysis(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Test 1: Does get_products require brand?\n if (profile.tools.includes('get_products')) {\n const { result: withoutBrand, step: step1 } = await runStep<TaskResult>(\n 'get_products without brand',\n 'get_products',\n async () =>\n client.getProducts({\n buying_mode: 'brief',\n brief: 'Show me all available products',\n } as unknown as GetProductsRequest) as Promise<TaskResult>\n );\n\n const withoutBrandProducts = (withoutBrand?.data as GetProductsResponse | undefined)?.products;\n if (withoutBrand?.success && withoutBrandProducts?.length) {\n step1.details = `Returns ${withoutBrandProducts.length} products without brand`;\n } else if (withoutBrand && !withoutBrand.success) {\n step1.details = 'Requires brand for product discovery';\n }\n steps.push(step1);\n\n // Test 2: Are results filtered by brief?\n const { result: specificBrief, step: step2 } = await runStep<TaskResult>(\n 'get_products with specific brief',\n 'get_products',\n async () =>\n client.getProducts({\n buying_mode: 'brief',\n brief: 'Looking specifically for podcast audio advertising only',\n brand: resolveBrand(options),\n } as unknown as GetProductsRequest) as Promise<TaskResult>\n );\n\n const { result: broadBrief } = await runStep<TaskResult>(\n 'get_products with broad brief',\n 'get_products',\n async () =>\n client.getProducts({\n buying_mode: 'brief',\n brief: 'Show all products across all channels and formats',\n brand: resolveBrand(options),\n } as unknown as GetProductsRequest) as Promise<TaskResult>\n );\n\n const specificProducts = (specificBrief?.data as GetProductsResponse | undefined)?.products;\n const broadProducts = (broadBrief?.data as GetProductsResponse | undefined)?.products;\n const specificCount = specificProducts?.length || 0;\n const broadCount = broadProducts?.length || 0;\n\n if (specificCount < broadCount) {\n step2.passed = true;\n step2.details = `Brief filtering: specific=${specificCount}, broad=${broadCount} (filtered)`;\n } else if (specificCount === broadCount && broadCount > 0) {\n step2.passed = true;\n step2.details = `No brief filtering: specific=${specificCount}, broad=${broadCount} (same)`;\n } else {\n step2.details = `Brief filtering unclear: specific=${specificCount}, broad=${broadCount}`;\n }\n steps.push(step2);\n }\n\n return { steps, profile };\n}\n\n/**\n * Test: Response Consistency\n * Checks for schema errors, pagination bugs, data mismatches\n */\nexport async function testResponseConsistency(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Test list_authorized_properties consistency\n if (profile.tools.includes('list_authorized_properties')) {\n const { result, step } = await runStep<TaskResult>(\n 'Check list_authorized_properties consistency',\n 'list_authorized_properties',\n async () => client.executeTask('list_authorized_properties', {}) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data as unknown as Record<string, unknown>;\n const publisherDomains = (data.publisher_domains || []) as unknown[];\n const issues: string[] = [];\n\n // Check for undefined elements\n for (let i = 0; i < publisherDomains.length; i++) {\n if (publisherDomains[i] === undefined || publisherDomains[i] === null) {\n issues.push(`publisher_domains[${i}] is ${String(publisherDomains[i])}`);\n }\n }\n\n if (issues.length > 0) {\n step.passed = false;\n step.error = `Schema validation errors: ${issues.slice(0, 3).join(', ')}`;\n step.response_preview = JSON.stringify(\n {\n issues: issues.slice(0, 10),\n publisher_domains_count: publisherDomains.length,\n },\n null,\n 2\n );\n } else {\n step.details = `Publisher domains consistent: ${publisherDomains.length} domain(s)`;\n }\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'list_authorized_properties failed';\n }\n steps.push(step);\n }\n\n // Test list_creatives pagination consistency\n if (profile.tools.includes('list_creatives')) {\n const { result, step } = await runStep<TaskResult>(\n 'Check list_creatives pagination consistency',\n 'list_creatives',\n async () => client.listCreatives({}) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data as ListCreativesResponse;\n const creatives = data.creatives || [];\n const querySummary = data.query_summary;\n const totalMatching = querySummary?.total_matching;\n const returned = querySummary?.returned ?? creatives.length;\n\n if (totalMatching !== undefined && totalMatching > 0 && returned === 0) {\n step.passed = false;\n step.error = `Pagination bug: total_matching=${totalMatching} but returned=${returned}`;\n } else if (returned !== creatives.length) {\n step.passed = false;\n step.error = `Mismatch: returned=${returned} but creatives.length=${creatives.length}`;\n } else {\n step.details = `Pagination consistent: ${creatives.length} creatives`;\n }\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA,oBAA+F;AAC/F,uBAA8B;AAM9B,eAAsB,kBACpB,UACA,SAC8D;AAC9D,QAAM,QAA0B,CAAC;AACjC,QAAM,aAAS,iCAAkB,UAAU,OAAO;AAElD,QAAM,EAAE,SAAS,MAAM,YAAY,IAAI,UAAM,oCAAqB,QAAQ,OAAO;AACjF,QAAM,KAAK,WAAW;AAEtB,MAAI,CAAC,YAAY,QAAQ;AACvB,WAAO,EAAE,OAAO,QAAQ;AAAA,EAC1B;AAGA,MAAI,QAAQ,MAAM,SAAS,kBAAkB,GAAG;AAC9C,UAAM,EA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UAAU,CAAC,OAAO,SAAS;AACpC,WAAK,SAAS;AACd,WAAK,QAAQ,OAAO,SAAS;AAAA,IAC/B;AACA,UAAM,KAAK,IAAI;AAAA,EACjB;AAGA,MAAI,QAAQ,MAAM,SAAS,gBAAgB,GAAG;AAC5C,UAAM,EAAE,QAAQ,KAAK,IAAI,UAAM;AAAA,MAC7B;AAAA,MACA;AAAA,MACA,YAAY,OAAO,cAAc,CAAC,CAAC;AAAA,IACrC;AAEA,QAAI,QAAQ,WAAW,QAAQ,MAAM;AACnC,YAAM,OAAO,OAAO;AACpB,YAAM,YAAY,KAAK,aAAa,CAAC;AACrC,YAAM,eAAe,KAAK;AAC1B,YAAM,gBAAgB,cAAc;AACpC,YAAM,WAAW,cAAc,YAAY,UAAU;AAErD,UAAI,kBAAkB,UAAa,gBAAgB,KAAK,aAAa,GAAG;AACtE,aAAK,SAAS;AACd,aAAK,QAAQ,kCAAkC,aAAa,iBAAiB,QAAQ;AAAA,MACvF,WAAW,aAAa,UAAU,QAAQ;AACxC,aAAK,SAAS;AACd,aAAK,QAAQ,sBAAsB,QAAQ,yBAAyB,UAAU,MAAM;AAAA,MACtF,OAAO;AACL,aAAK,UAAU,0BAA0B,UAAU,MAAM;AAAA,MAC3D;AAAA,IACF;AACA,UAAM,KAAK,IAAI;AAAA,EACjB;AAEA,SAAO,EAAE,OAAO,QAAQ;AAC1B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/testing/scenarios/edge-cases.ts"],"sourcesContent":["/**\n * Edge Case Testing Scenarios\n *\n * Tests various edge cases, error handling, and validation:\n * - Error handling (invalid inputs, non-existent IDs)\n * - Schema validation (negative values, invalid enums)\n * - Pricing edge cases (auction vs fixed, min spend, floor prices)\n * - Behavior analysis\n * - Temporal validation\n * - Response consistency\n *\n * These scenarios are designed to find bugs and ensure agents\n * properly handle edge cases according to the AdCP spec.\n */\n\nimport type { Product, PricingOption } from '../../types/core.generated';\nimport type {\n CreateMediaBuyRequest,\n SyncCreativesRequest,\n GetMediaBuyDeliveryRequest,\n GetProductsResponse,\n ListCreativesResponse,\n} from '../../types/tools.generated';\nimport type { CanonicalGetProductsRequest } from '../../v2/projection/creative-delivery';\nimport type { TestOptions, TestStepResult, AgentProfile, TaskResult } from '../types';\nimport { getOrCreateClient, runStep, resolveBrand, resolveAccount, getOrDiscoverProfile } from '../client';\nimport { testDiscovery } from './discovery';\n\n/**\n * Test: Error Handling\n * Verifies the agent returns proper discriminated union error responses\n */\nexport async function testErrorHandling(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Test 1: Invalid product_id in create_media_buy\n if (profile.tools.includes('create_media_buy')) {\n const { result, step } = await runStep<TaskResult>(\n 'Invalid product_id error response',\n 'create_media_buy',\n async () =>\n client.createMediaBuyLegacy({\n idempotency_key: `error-test-${Date.now()}`,\n brand_manifest: {\n name: 'Error Test Brand',\n url: 'https://test.example',\n },\n start_time: new Date(Date.now() + 86400000).toISOString(),\n end_time: new Date(Date.now() + 604800000).toISOString(),\n packages: [\n {\n product_id: 'NONEXISTENT_PRODUCT_ID_12345',\n budget: 1000,\n pricing_option_id: 'nonexistent-pricing',\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = 'Agent accepted invalid product_id - should have returned error';\n } else {\n // !result (threw) or result.success === false — both count as rejection\n step.passed = true;\n step.details = `Agent correctly rejected invalid product_id${result?.error ? `: ${result.error}` : ''}`;\n if (result?.error) step.response_preview = JSON.stringify({ error: result.error }, null, 2);\n }\n steps.push(step);\n }\n\n // Test 2: Missing required field in get_products\n if (profile.tools.includes('get_products')) {\n const { result, step } = await runStep<TaskResult>(\n 'Empty request handling',\n 'get_products',\n async () => client.getProducts({} as unknown as CanonicalGetProductsRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = true;\n step.details = 'Agent accepts empty get_products request (permissive)';\n } else {\n // !result (threw) or result.success === false — both mean stricter validation\n step.passed = true;\n step.details = `Agent requires brief or brand (stricter validation)${result?.error ? `: ${result.error}` : ''}`;\n if (result?.error) step.response_preview = JSON.stringify({ error: result.error }, null, 2);\n }\n steps.push(step);\n }\n\n // Test 3: Invalid format_id in sync_creatives\n if (profile.tools.includes('sync_creatives')) {\n const { result, step } = await runStep<TaskResult>(\n 'Invalid format_id error response',\n 'sync_creatives',\n async () =>\n client.syncCreativesLegacy({\n account: resolveAccount(options),\n creatives: [\n {\n creative_id: `invalid-format-test-${Date.now()}`,\n name: 'Invalid Format Test',\n format_id: { id: 'TOTALLY_INVALID_FORMAT_ID_999' },\n assets: {\n primary: {\n url: 'https://via.placeholder.com/300x250',\n width: 300,\n height: 250,\n format: 'png',\n },\n },\n },\n ],\n } as unknown as SyncCreativesRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = true;\n step.details = 'Agent accepts unknown format_ids (permissive mode)';\n } else {\n // !result (threw) or result.success === false — both count as rejection\n step.passed = true;\n step.details = `Agent correctly rejected invalid format_id${result?.error ? `: ${result.error}` : ''}`;\n if (result?.error) step.response_preview = JSON.stringify({ error: result.error }, null, 2);\n }\n steps.push(step);\n }\n\n // Test 4: get_media_buy_delivery with non-existent media_buy_id\n if (profile.tools.includes('get_media_buy_delivery')) {\n const { result, step } = await runStep<TaskResult>(\n 'Non-existent media_buy_id error',\n 'get_media_buy_delivery',\n async () =>\n client.getMediaBuyDelivery({\n media_buy_ids: ['NONEXISTENT_MEDIA_BUY_ID_99999'],\n } as unknown as GetMediaBuyDeliveryRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n const data = result.data as unknown as Record<string, unknown> | undefined;\n const deliveries = (data?.deliveries || data?.media_buys || []) as unknown[];\n if (deliveries.length === 0) {\n step.passed = true;\n step.details = 'Agent returned empty deliveries for non-existent media buy';\n } else {\n step.passed = false;\n step.error = 'Agent returned deliveries for non-existent media_buy_id';\n }\n } else {\n // !result (threw) or result.success === false — both count as rejection\n step.passed = true;\n step.details = `Agent correctly returned error for non-existent media buy${result?.error ? `: ${result.error}` : ''}`;\n if (result?.error) step.response_preview = JSON.stringify({ error: result.error }, null, 2);\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n\n/**\n * Test: Validation\n * Tests that agents properly validate inputs and reject malformed requests\n */\nexport async function testValidation(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Test 1: Invalid enum value for pacing\n if (profile.tools.includes('create_media_buy')) {\n const { result, step } = await runStep<TaskResult>(\n 'Invalid pacing enum value',\n 'create_media_buy',\n async () =>\n client.createMediaBuyLegacy({\n idempotency_key: `validation-test-${Date.now()}`,\n brand_manifest: { name: 'Validation Test', url: 'https://test.example' },\n start_time: new Date(Date.now() + 86400000).toISOString(),\n end_time: new Date(Date.now() + 604800000).toISOString(),\n packages: [\n {\n product_id: 'test-product',\n budget: 1000,\n pricing_option_id: 'test-pricing',\n pacing: 'INVALID_PACING_VALUE' as unknown as string,\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = 'Agent accepted invalid pacing value - should validate enums';\n } else {\n step.passed = true;\n step.details = `Agent rejected invalid pacing enum value${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n // Test 2: Negative budget (definitely invalid)\n if (profile.tools.includes('create_media_buy')) {\n const { result, step } = await runStep<TaskResult>(\n 'Negative budget rejection',\n 'create_media_buy',\n async () =>\n client.createMediaBuyLegacy({\n idempotency_key: `negative-budget-test-${Date.now()}`,\n brand_manifest: { name: 'Negative Budget Test', url: 'https://test.example' },\n start_time: new Date(Date.now() + 86400000).toISOString(),\n end_time: new Date(Date.now() + 604800000).toISOString(),\n packages: [\n {\n product_id: 'test-product',\n budget: -500,\n pricing_option_id: 'test-pricing',\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = 'CRITICAL: Agent accepted negative budget - must validate minimum: 0';\n } else {\n step.passed = true;\n step.details = `Agent correctly rejected negative budget${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n // Test 3: Invalid creative weight (> 100)\n if (profile.tools.includes('sync_creatives')) {\n const { result, step } = await runStep<TaskResult>(\n 'Invalid creative weight (> 100)',\n 'sync_creatives',\n async () =>\n client.syncCreativesLegacy({\n account: resolveAccount(options),\n creatives: [\n {\n creative_id: `weight-test-${Date.now()}`,\n name: 'Weight Test Creative',\n format_id: { agent_url: 'https://creative.adcontextprotocol.org', id: 'display_300x250' },\n weight: 150,\n assets: {\n primary: {\n url: 'https://via.placeholder.com/300x250',\n width: 300,\n height: 250,\n format: 'png',\n },\n },\n },\n ],\n } as unknown as SyncCreativesRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = 'Agent accepted weight > 100 - should validate maximum: 100';\n } else {\n step.passed = true;\n step.details = `Agent rejected weight > 100${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n // Test 4: Empty creatives array\n if (profile.tools.includes('sync_creatives')) {\n const { result, step } = await runStep<TaskResult>(\n 'Empty creatives array handling',\n 'sync_creatives',\n async () =>\n client.syncCreativesLegacy({\n account: resolveAccount(options),\n creatives: [],\n } as unknown as SyncCreativesRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = true;\n step.details = 'Agent accepts empty creatives array (returns empty result)';\n } else {\n // !result (threw) or result.success === false — both mean agent rejected\n step.passed = true;\n step.details = `Agent rejected empty creatives array${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n\n/**\n * Test: Pricing Edge Cases\n * Tests auction vs fixed pricing, min spend requirements, bid_price handling\n */\nexport async function testPricingEdgeCases(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { steps: discoverySteps, profile } = await testDiscovery(agentUrl, options);\n steps.push(...discoverySteps);\n\n if (!profile?.tools.includes('create_media_buy') || !profile?.tools.includes('get_products')) {\n steps.push({\n step: 'Pricing edge cases',\n passed: false,\n duration_ms: 0,\n error: 'Agent does not support create_media_buy or get_products',\n });\n return { steps, profile };\n }\n\n // Get products to find actual pricing options\n const { result: productsResult } = await runStep<TaskResult>(\n 'Fetch products for pricing analysis',\n 'get_products',\n async () =>\n client.getProducts({\n buying_mode: 'brief',\n brief: 'Show all products with pricing details',\n brand: resolveBrand(options),\n } as unknown as CanonicalGetProductsRequest) as Promise<TaskResult>\n );\n\n const productsData = productsResult?.data as GetProductsResponse | undefined;\n const products = productsData?.products;\n if (!products?.length) {\n steps.push({\n step: 'Pricing edge cases',\n passed: false,\n duration_ms: 0,\n error: 'No products available for pricing tests',\n });\n return { steps, profile };\n }\n\n // Analyze products for auction vs fixed pricing\n const auctionProducts: { product: Product; pricingOption: PricingOption }[] = [];\n const fixedProducts: { product: Product; pricingOption: PricingOption }[] = [];\n const productsWithMinSpend: { product: Product; pricingOption: PricingOption; minSpend: number }[] = [];\n\n for (const product of products) {\n for (const po of product.pricing_options || []) {\n if (!('fixed_price' in po) && (po.floor_price !== undefined || po.price_guidance !== undefined)) {\n auctionProducts.push({ product, pricingOption: po });\n } else if ('fixed_price' in po) {\n fixedProducts.push({ product, pricingOption: po });\n }\n if (po.min_spend_per_package != null && po.min_spend_per_package > 0) {\n productsWithMinSpend.push({\n product,\n pricingOption: po,\n minSpend: po.min_spend_per_package,\n });\n }\n }\n }\n\n steps.push({\n step: 'Analyze pricing options',\n passed: true,\n duration_ms: 0,\n details: `Found ${fixedProducts.length} fixed, ${auctionProducts.length} auction, ${productsWithMinSpend.length} with min spend`,\n });\n\n // Test 1: Auction pricing without bid_price (should fail)\n if (auctionProducts.length > 0) {\n const { product, pricingOption } = auctionProducts[0]!;\n const { result, step } = await runStep<TaskResult>(\n 'Auction pricing without bid_price',\n 'create_media_buy',\n async () =>\n client.createMediaBuyLegacy({\n idempotency_key: `auction-no-bid-${Date.now()}`,\n brand_manifest: { name: 'Auction Test', url: 'https://test.example' },\n start_time: new Date(Date.now() + 86400000).toISOString(),\n end_time: new Date(Date.now() + 604800000).toISOString(),\n packages: [\n {\n product_id: product.product_id,\n budget: 5000,\n pricing_option_id: pricingOption.pricing_option_id,\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = 'Agent accepted auction pricing without bid_price - should require it';\n } else {\n step.passed = true;\n step.details = `Agent correctly requires bid_price for auction pricing${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n // Test 2: Budget below min_spend_per_package\n if (productsWithMinSpend.length > 0) {\n const { product, pricingOption, minSpend } = productsWithMinSpend[0]!;\n const underBudget = minSpend * 0.5;\n\n const { result, step } = await runStep<TaskResult>(\n 'Budget below min_spend_per_package',\n 'create_media_buy',\n async () =>\n client.createMediaBuyLegacy({\n idempotency_key: `under-min-spend-${Date.now()}`,\n brand_manifest: { name: 'Min Spend Test', url: 'https://test.example' },\n start_time: new Date(Date.now() + 86400000).toISOString(),\n end_time: new Date(Date.now() + 604800000).toISOString(),\n packages: [\n {\n product_id: product.product_id,\n budget: underBudget,\n pricing_option_id: pricingOption.pricing_option_id,\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (result?.success) {\n step.passed = false;\n step.error = `Agent accepted budget ${underBudget} below min_spend ${minSpend}`;\n } else {\n step.passed = true;\n step.details = `Agent rejected budget ${underBudget} below min_spend ${minSpend}${result?.error ? `: ${result.error}` : ''}`;\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n\n/**\n * Test: Temporal Validation\n * Tests date/time ordering and format validation\n */\nexport async function testTemporalValidation(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed || !profile.tools.includes('create_media_buy')) {\n return { steps, profile };\n }\n\n // Test 1: End time before start time\n const { result: endBeforeStart, step: step1 } = await runStep<TaskResult>(\n 'End time before start time',\n 'create_media_buy',\n async () =>\n client.createMediaBuyLegacy({\n idempotency_key: `temporal-test-${Date.now()}`,\n brand_manifest: { name: 'Temporal Test', url: 'https://test.example' },\n start_time: new Date(Date.now() + 604800000).toISOString(), // 7 days from now\n end_time: new Date(Date.now() + 86400000).toISOString(), // 1 day from now (before start!)\n packages: [\n {\n product_id: 'test-product',\n budget: 1000,\n pricing_option_id: 'test-pricing',\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (!endBeforeStart) {\n // runStep caught an exception — agent rejected at transport level, which counts as rejection\n step1.passed = true;\n step1.details = `Agent rejected end_time before start_time (threw error)`;\n } else if (endBeforeStart.success) {\n step1.passed = false;\n step1.error = 'Agent accepted end_time before start_time - must validate';\n } else {\n step1.passed = true;\n step1.details = `Agent correctly rejected end_time before start_time${endBeforeStart.error ? `: ${endBeforeStart.error}` : ''}`;\n }\n steps.push(step1);\n\n // Test 2: Start time in the past\n const { result: pastStart, step: step2 } = await runStep<TaskResult>(\n 'Start time in the past',\n 'create_media_buy',\n async () =>\n client.createMediaBuyLegacy({\n idempotency_key: `past-start-${Date.now()}`,\n brand_manifest: { name: 'Past Start Test', url: 'https://test.example' },\n start_time: new Date(Date.now() - 86400000).toISOString(), // Yesterday\n end_time: new Date(Date.now() + 604800000).toISOString(), // 7 days from now\n packages: [\n {\n product_id: 'test-product',\n budget: 1000,\n pricing_option_id: 'test-pricing',\n },\n ],\n } as unknown as CreateMediaBuyRequest) as Promise<TaskResult>\n );\n\n if (!pastStart) {\n // runStep caught an exception — agent rejected at transport level\n step2.passed = true;\n step2.details = 'Agent rejected start_time in the past (threw error)';\n } else if (pastStart.success) {\n step2.passed = true;\n step2.details = 'Agent accepts start_time in past (may auto-adjust)';\n } else {\n step2.passed = true;\n step2.details = `Agent rejected start_time in the past${pastStart.error ? `: ${pastStart.error}` : ''}`;\n }\n steps.push(step2);\n\n return { steps, profile };\n}\n\n/**\n * Test: Behavior Analysis\n * Analyzes agent behavioral characteristics\n */\nexport async function testBehaviorAnalysis(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Test 1: Does get_products require brand?\n if (profile.tools.includes('get_products')) {\n const { result: withoutBrand, step: step1 } = await runStep<TaskResult>(\n 'get_products without brand',\n 'get_products',\n async () =>\n client.getProducts({\n buying_mode: 'brief',\n brief: 'Show me all available products',\n } as unknown as CanonicalGetProductsRequest) as Promise<TaskResult>\n );\n\n const withoutBrandProducts = (withoutBrand?.data as GetProductsResponse | undefined)?.products;\n if (withoutBrand?.success && withoutBrandProducts?.length) {\n step1.details = `Returns ${withoutBrandProducts.length} products without brand`;\n } else if (withoutBrand && !withoutBrand.success) {\n step1.details = 'Requires brand for product discovery';\n }\n steps.push(step1);\n\n // Test 2: Are results filtered by brief?\n const { result: specificBrief, step: step2 } = await runStep<TaskResult>(\n 'get_products with specific brief',\n 'get_products',\n async () =>\n client.getProducts({\n buying_mode: 'brief',\n brief: 'Looking specifically for podcast audio advertising only',\n brand: resolveBrand(options),\n } as unknown as CanonicalGetProductsRequest) as Promise<TaskResult>\n );\n\n const { result: broadBrief } = await runStep<TaskResult>(\n 'get_products with broad brief',\n 'get_products',\n async () =>\n client.getProducts({\n buying_mode: 'brief',\n brief: 'Show all products across all channels and formats',\n brand: resolveBrand(options),\n } as unknown as CanonicalGetProductsRequest) as Promise<TaskResult>\n );\n\n const specificProducts = (specificBrief?.data as GetProductsResponse | undefined)?.products;\n const broadProducts = (broadBrief?.data as GetProductsResponse | undefined)?.products;\n const specificCount = specificProducts?.length || 0;\n const broadCount = broadProducts?.length || 0;\n\n if (specificCount < broadCount) {\n step2.passed = true;\n step2.details = `Brief filtering: specific=${specificCount}, broad=${broadCount} (filtered)`;\n } else if (specificCount === broadCount && broadCount > 0) {\n step2.passed = true;\n step2.details = `No brief filtering: specific=${specificCount}, broad=${broadCount} (same)`;\n } else {\n step2.details = `Brief filtering unclear: specific=${specificCount}, broad=${broadCount}`;\n }\n steps.push(step2);\n }\n\n return { steps, profile };\n}\n\n/**\n * Test: Response Consistency\n * Checks for schema errors, pagination bugs, data mismatches\n */\nexport async function testResponseConsistency(\n agentUrl: string,\n options: TestOptions\n): Promise<{ steps: TestStepResult[]; profile?: AgentProfile }> {\n const steps: TestStepResult[] = [];\n const client = getOrCreateClient(agentUrl, options);\n\n const { profile, step: profileStep } = await getOrDiscoverProfile(client, options);\n steps.push(profileStep);\n\n if (!profileStep.passed) {\n return { steps, profile };\n }\n\n // Test list_authorized_properties consistency\n if (profile.tools.includes('list_authorized_properties')) {\n const { result, step } = await runStep<TaskResult>(\n 'Check list_authorized_properties consistency',\n 'list_authorized_properties',\n async () => client.executeCustomTask('list_authorized_properties', {}) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data as unknown as Record<string, unknown>;\n const publisherDomains = (data.publisher_domains || []) as unknown[];\n const issues: string[] = [];\n\n // Check for undefined elements\n for (let i = 0; i < publisherDomains.length; i++) {\n if (publisherDomains[i] === undefined || publisherDomains[i] === null) {\n issues.push(`publisher_domains[${i}] is ${String(publisherDomains[i])}`);\n }\n }\n\n if (issues.length > 0) {\n step.passed = false;\n step.error = `Schema validation errors: ${issues.slice(0, 3).join(', ')}`;\n step.response_preview = JSON.stringify(\n {\n issues: issues.slice(0, 10),\n publisher_domains_count: publisherDomains.length,\n },\n null,\n 2\n );\n } else {\n step.details = `Publisher domains consistent: ${publisherDomains.length} domain(s)`;\n }\n } else if (result && !result.success) {\n step.passed = false;\n step.error = result.error || 'list_authorized_properties failed';\n }\n steps.push(step);\n }\n\n // Test list_creatives pagination consistency\n if (profile.tools.includes('list_creatives')) {\n const { result, step } = await runStep<TaskResult>(\n 'Check list_creatives pagination consistency',\n 'list_creatives',\n async () => client.listCreatives({}) as Promise<TaskResult>\n );\n\n if (result?.success && result?.data) {\n const data = result.data as ListCreativesResponse;\n const creatives = data.creatives || [];\n const querySummary = data.query_summary;\n const totalMatching = querySummary?.total_matching;\n const returned = querySummary?.returned ?? creatives.length;\n\n if (totalMatching !== undefined && totalMatching > 0 && returned === 0) {\n step.passed = false;\n step.error = `Pagination bug: total_matching=${totalMatching} but returned=${returned}`;\n } else if (returned !== creatives.length) {\n step.passed = false;\n step.error = `Mismatch: returned=${returned} but creatives.length=${creatives.length}`;\n } else {\n step.details = `Pagination consistent: ${creatives.length} creatives`;\n }\n }\n steps.push(step);\n }\n\n return { steps, profile };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA,oBAA+F;AAC/F,uBAA8B;AAM9B,eAAsB,kBACpB,UACA,SAC8D;AAC9D,QAAM,QAA0B,CAAC;AACjC,QAAM,aAAS,iCAAkB,UAAU,OAAO;AAElD,QAAM,EAAE,SAAS,MAAM,YAAY,IAAI,UAAM,oCAAqB,QAAQ,OAAO;AACjF,QAAM,KAAK,WAAW;AAEtB,MAAI,CAA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