@adcp/sdk 8.1.0-beta.13 → 8.1.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/adcp-registry.js +2 -2
- package/dist/lib/canonical-references/index.d.ts +107 -0
- package/dist/lib/canonical-references/index.d.ts.map +1 -0
- package/dist/lib/canonical-references/index.js +551 -0
- package/dist/lib/canonical-references/index.js.map +1 -0
- package/dist/lib/core/ConversationTypes.d.ts +7 -0
- package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
- package/dist/lib/core/ProtocolResponseParser.d.ts +10 -0
- package/dist/lib/core/ProtocolResponseParser.d.ts.map +1 -1
- package/dist/lib/core/ProtocolResponseParser.js +110 -0
- package/dist/lib/core/ProtocolResponseParser.js.map +1 -1
- package/dist/lib/core/ResponseValidator.d.ts +2 -0
- package/dist/lib/core/ResponseValidator.d.ts.map +1 -1
- package/dist/lib/core/ResponseValidator.js +3 -3
- package/dist/lib/core/ResponseValidator.js.map +1 -1
- package/dist/lib/core/TaskExecutor.d.ts +2 -0
- package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
- package/dist/lib/core/TaskExecutor.js +32 -8
- package/dist/lib/core/TaskExecutor.js.map +1 -1
- package/dist/lib/index.d.ts +5 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +27 -11
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/mock-server/creative-ad-server/server.d.ts +2 -0
- package/dist/lib/mock-server/creative-ad-server/server.d.ts.map +1 -1
- package/dist/lib/mock-server/creative-ad-server/server.js +37 -1
- package/dist/lib/mock-server/creative-ad-server/server.js.map +1 -1
- package/dist/lib/mock-server/creative-template/server.d.ts +2 -0
- package/dist/lib/mock-server/creative-template/server.d.ts.map +1 -1
- package/dist/lib/mock-server/creative-template/server.js +29 -2
- package/dist/lib/mock-server/creative-template/server.js.map +1 -1
- package/dist/lib/mock-server/index.d.ts +10 -1
- package/dist/lib/mock-server/index.d.ts.map +1 -1
- package/dist/lib/mock-server/index.js +38 -8
- package/dist/lib/mock-server/index.js.map +1 -1
- package/dist/lib/mock-server/sales-guaranteed/server.d.ts +2 -0
- package/dist/lib/mock-server/sales-guaranteed/server.d.ts.map +1 -1
- package/dist/lib/mock-server/sales-guaranteed/server.js +64 -7
- package/dist/lib/mock-server/sales-guaranteed/server.js.map +1 -1
- package/dist/lib/mock-server/sales-non-guaranteed/server.d.ts +2 -0
- package/dist/lib/mock-server/sales-non-guaranteed/server.d.ts.map +1 -1
- package/dist/lib/mock-server/sales-non-guaranteed/server.js +44 -1
- package/dist/lib/mock-server/sales-non-guaranteed/server.js.map +1 -1
- package/dist/lib/mock-server/sales-social/server.d.ts +2 -0
- package/dist/lib/mock-server/sales-social/server.d.ts.map +1 -1
- package/dist/lib/mock-server/sales-social/server.js +64 -4
- package/dist/lib/mock-server/sales-social/server.js.map +1 -1
- package/dist/lib/mock-server/scenario.d.ts +97 -0
- package/dist/lib/mock-server/scenario.d.ts.map +1 -0
- package/dist/lib/mock-server/scenario.js +464 -0
- package/dist/lib/mock-server/scenario.js.map +1 -0
- package/dist/lib/mock-server/signal-marketplace/server.d.ts +2 -0
- package/dist/lib/mock-server/signal-marketplace/server.d.ts.map +1 -1
- package/dist/lib/mock-server/signal-marketplace/server.js +29 -1
- package/dist/lib/mock-server/signal-marketplace/server.js.map +1 -1
- package/dist/lib/mock-server/sponsored-intelligence/server.d.ts +2 -0
- package/dist/lib/mock-server/sponsored-intelligence/server.d.ts.map +1 -1
- package/dist/lib/mock-server/sponsored-intelligence/server.js +47 -9
- package/dist/lib/mock-server/sponsored-intelligence/server.js.map +1 -1
- package/dist/lib/protocols/index.d.ts +4 -2
- package/dist/lib/protocols/index.d.ts.map +1 -1
- package/dist/lib/protocols/index.js +10 -3
- package/dist/lib/protocols/index.js.map +1 -1
- package/dist/lib/registry/index.d.ts +42 -16
- package/dist/lib/registry/index.d.ts.map +1 -1
- package/dist/lib/registry/index.js +191 -24
- package/dist/lib/registry/index.js.map +1 -1
- package/dist/lib/registry/types.d.ts +39 -8
- package/dist/lib/registry/types.d.ts.map +1 -1
- package/dist/lib/registry/types.generated.d.ts +2873 -699
- package/dist/lib/registry/types.generated.d.ts.map +1 -1
- package/dist/lib/registry/types.generated.js +2 -2
- package/dist/lib/registry/types.generated.js.map +1 -1
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/a2a-adapter.d.ts +3 -1
- package/dist/lib/server/a2a-adapter.d.ts.map +1 -1
- package/dist/lib/server/a2a-adapter.js +11 -2
- package/dist/lib/server/a2a-adapter.js.map +1 -1
- package/dist/lib/server/adcp-server.js +32 -0
- package/dist/lib/server/adcp-server.js.map +1 -1
- package/dist/lib/server/create-adcp-server.d.ts +12 -6
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +72 -11
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/server/decisioning/account.d.ts +17 -17
- package/dist/lib/server/decisioning/account.d.ts.map +1 -1
- package/dist/lib/server/decisioning/account.js.map +1 -1
- package/dist/lib/server/decisioning/buyer-agent.d.ts +27 -10
- package/dist/lib/server/decisioning/buyer-agent.d.ts.map +1 -1
- package/dist/lib/server/decisioning/buyer-agent.js +25 -7
- package/dist/lib/server/decisioning/buyer-agent.js.map +1 -1
- package/dist/lib/server/decisioning/capabilities.d.ts +35 -7
- package/dist/lib/server/decisioning/capabilities.d.ts.map +1 -1
- package/dist/lib/server/decisioning/errors-typed.d.ts +18 -16
- package/dist/lib/server/decisioning/errors-typed.d.ts.map +1 -1
- package/dist/lib/server/decisioning/errors-typed.js +26 -24
- package/dist/lib/server/decisioning/errors-typed.js.map +1 -1
- package/dist/lib/server/decisioning/index.d.ts +1 -1
- package/dist/lib/server/decisioning/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.js +4 -2
- package/dist/lib/server/decisioning/index.js.map +1 -1
- package/dist/lib/server/decisioning/platform-helpers.d.ts +3 -2
- package/dist/lib/server/decisioning/platform-helpers.d.ts.map +1 -1
- package/dist/lib/server/decisioning/platform-helpers.js +3 -2
- package/dist/lib/server/decisioning/platform-helpers.js.map +1 -1
- package/dist/lib/server/decisioning/platform.d.ts +27 -10
- package/dist/lib/server/decisioning/platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +14 -10
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.js +374 -59
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/validate-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/validate-platform.js +3 -8
- package/dist/lib/server/decisioning/runtime/validate-platform.js.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.d.ts +9 -11
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.js +9 -11
- package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.js.map +1 -1
- package/dist/lib/server/operational-platform.d.ts +6 -8
- package/dist/lib/server/operational-platform.d.ts.map +1 -1
- package/dist/lib/server/operational-platform.js +4 -6
- package/dist/lib/server/operational-platform.js.map +1 -1
- package/dist/lib/server/test-controller-bridge.d.ts +14 -14
- package/dist/lib/server/test-controller-bridge.d.ts.map +1 -1
- package/dist/lib/server/test-controller-bridge.js +16 -16
- package/dist/lib/server/test-controller-bridge.js.map +1 -1
- package/dist/lib/server/test-controller.d.ts +31 -9
- package/dist/lib/server/test-controller.d.ts.map +1 -1
- package/dist/lib/server/test-controller.js +106 -54
- package/dist/lib/server/test-controller.js.map +1 -1
- package/dist/lib/signing/canonicalize.d.ts +0 -53
- package/dist/lib/signing/canonicalize.d.ts.map +1 -1
- package/dist/lib/signing/canonicalize.js +1 -33
- package/dist/lib/signing/canonicalize.js.map +1 -1
- package/dist/lib/signing/client.d.ts +5 -5
- package/dist/lib/signing/client.d.ts.map +1 -1
- package/dist/lib/signing/client.js +1 -10
- package/dist/lib/signing/client.js.map +1 -1
- package/dist/lib/signing/errors.d.ts +0 -11
- package/dist/lib/signing/errors.d.ts.map +1 -1
- package/dist/lib/signing/errors.js +1 -11
- package/dist/lib/signing/errors.js.map +1 -1
- package/dist/lib/signing/jwks-helpers.d.ts +2 -4
- package/dist/lib/signing/jwks-helpers.d.ts.map +1 -1
- package/dist/lib/signing/jwks-helpers.js +9 -0
- package/dist/lib/signing/jwks-helpers.js.map +1 -1
- package/dist/lib/signing/provider.d.ts +11 -10
- package/dist/lib/signing/provider.d.ts.map +1 -1
- package/dist/lib/signing/request-context.d.ts +8 -11
- package/dist/lib/signing/request-context.d.ts.map +1 -1
- package/dist/lib/signing/request-context.js +7 -10
- package/dist/lib/signing/request-context.js.map +1 -1
- package/dist/lib/signing/server.d.ts +3 -4
- package/dist/lib/signing/server.d.ts.map +1 -1
- package/dist/lib/signing/server.js +1 -9
- package/dist/lib/signing/server.js.map +1 -1
- package/dist/lib/signing/signer-async.d.ts +2 -8
- package/dist/lib/signing/signer-async.d.ts.map +1 -1
- package/dist/lib/signing/signer-async.js +0 -12
- package/dist/lib/signing/signer-async.js.map +1 -1
- package/dist/lib/signing/signer.d.ts +4 -111
- package/dist/lib/signing/signer.d.ts.map +1 -1
- package/dist/lib/signing/signer.js +2 -98
- package/dist/lib/signing/signer.js.map +1 -1
- package/dist/lib/signing/testing.d.ts +10 -10
- package/dist/lib/signing/testing.d.ts.map +1 -1
- package/dist/lib/signing/testing.js +6 -13
- package/dist/lib/signing/testing.js.map +1 -1
- package/dist/lib/signing/types.d.ts +0 -36
- package/dist/lib/signing/types.d.ts.map +1 -1
- package/dist/lib/signing/types.js +1 -37
- package/dist/lib/signing/types.js.map +1 -1
- package/dist/lib/testing/agent-tester.d.ts +1 -0
- package/dist/lib/testing/agent-tester.d.ts.map +1 -1
- package/dist/lib/testing/agent-tester.js.map +1 -1
- package/dist/lib/testing/client.d.ts +1 -1
- package/dist/lib/testing/client.d.ts.map +1 -1
- package/dist/lib/testing/client.js +4 -2
- package/dist/lib/testing/client.js.map +1 -1
- package/dist/lib/testing/compliance/comply.d.ts +8 -0
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
- package/dist/lib/testing/compliance/comply.js +98 -7
- package/dist/lib/testing/compliance/comply.js.map +1 -1
- package/dist/lib/testing/compliance/spec-conformance.d.ts +6 -6
- package/dist/lib/testing/compliance/spec-conformance.d.ts.map +1 -1
- package/dist/lib/testing/compliance/spec-conformance.js +6 -6
- package/dist/lib/testing/compliance/spec-conformance.js.map +1 -1
- package/dist/lib/testing/compliance/summary.d.ts +5 -0
- package/dist/lib/testing/compliance/summary.d.ts.map +1 -1
- package/dist/lib/testing/compliance/summary.js +17 -0
- package/dist/lib/testing/compliance/summary.js.map +1 -1
- package/dist/lib/testing/comply-controller.d.ts +19 -0
- package/dist/lib/testing/comply-controller.d.ts.map +1 -1
- package/dist/lib/testing/comply-controller.js +11 -8
- package/dist/lib/testing/comply-controller.js.map +1 -1
- package/dist/lib/testing/index.d.ts +4 -3
- package/dist/lib/testing/index.d.ts.map +1 -1
- package/dist/lib/testing/index.js +13 -1
- package/dist/lib/testing/index.js.map +1 -1
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.d.ts +4 -0
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.js +881 -0
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.js.map +1 -0
- package/dist/lib/testing/storyboard/compliance.d.ts +6 -0
- package/dist/lib/testing/storyboard/compliance.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/compliance.js +8 -4
- package/dist/lib/testing/storyboard/compliance.js.map +1 -1
- package/dist/lib/testing/storyboard/index.d.ts +2 -1
- package/dist/lib/testing/storyboard/index.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/index.js +9 -1
- package/dist/lib/testing/storyboard/index.js.map +1 -1
- package/dist/lib/testing/storyboard/loader.d.ts +3 -2
- package/dist/lib/testing/storyboard/loader.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/loader.js +73 -2
- package/dist/lib/testing/storyboard/loader.js.map +1 -1
- package/dist/lib/testing/storyboard/path.d.ts +21 -0
- package/dist/lib/testing/storyboard/path.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/path.js +86 -0
- package/dist/lib/testing/storyboard/path.js.map +1 -1
- package/dist/lib/testing/storyboard/rate-limit-trip.d.ts +92 -0
- package/dist/lib/testing/storyboard/rate-limit-trip.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/rate-limit-trip.js +276 -0
- package/dist/lib/testing/storyboard/rate-limit-trip.js.map +1 -0
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +361 -28
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/seeding.d.ts +5 -4
- package/dist/lib/testing/storyboard/seeding.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/seeding.js +23 -3
- package/dist/lib/testing/storyboard/seeding.js.map +1 -1
- package/dist/lib/testing/storyboard/types.d.ts +108 -20
- package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/types.js +1 -0
- package/dist/lib/testing/storyboard/types.js.map +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +18 -0
- package/dist/lib/testing/storyboard/validations.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/validations.js +238 -33
- package/dist/lib/testing/storyboard/validations.js.map +1 -1
- package/dist/lib/testing/test-controller.d.ts +17 -25
- package/dist/lib/testing/test-controller.d.ts.map +1 -1
- package/dist/lib/testing/test-controller.js.map +1 -1
- package/dist/lib/testing/types.d.ts +13 -1
- package/dist/lib/testing/types.d.ts.map +1 -1
- package/dist/lib/types/check-governance.d.ts +1 -1
- package/dist/lib/types/comply-test-controller.d.ts +243 -3
- package/dist/lib/types/core.generated.d.ts +261 -21
- package/dist/lib/types/core.generated.d.ts.map +1 -1
- package/dist/lib/types/core.generated.js +1 -1
- package/dist/lib/types/create-media-buy.d.ts +107 -3
- package/dist/lib/types/error-codes.d.ts +2 -2
- package/dist/lib/types/get-adcp-capabilities.d.ts +1 -1
- package/dist/lib/types/get-media-buys.d.ts +107 -3
- package/dist/lib/types/get-plan-audit-logs.d.ts +1 -1
- package/dist/lib/types/get-products.d.ts +104 -3
- package/dist/lib/types/inline-enums.generated.d.ts +27 -17
- package/dist/lib/types/inline-enums.generated.d.ts.map +1 -1
- package/dist/lib/types/inline-enums.generated.js +39 -28
- package/dist/lib/types/inline-enums.generated.js.map +1 -1
- package/dist/lib/types/manifest.generated.d.ts +7 -4
- package/dist/lib/types/manifest.generated.d.ts.map +1 -1
- package/dist/lib/types/manifest.generated.js +2 -2
- package/dist/lib/types/manifest.generated.js.map +1 -1
- package/dist/lib/types/report-plan-outcome.d.ts +1 -1
- package/dist/lib/types/schemas.generated.d.ts +714 -193
- package/dist/lib/types/schemas.generated.d.ts.map +1 -1
- package/dist/lib/types/schemas.generated.js +194 -79
- package/dist/lib/types/schemas.generated.js.map +1 -1
- package/dist/lib/types/sync-plans.d.ts +1 -1
- package/dist/lib/types/tools.generated.d.ts +331 -28
- package/dist/lib/types/tools.generated.d.ts.map +1 -1
- package/dist/lib/types/update-media-buy.d.ts +107 -3
- package/dist/lib/types/v3-1-beta/tools.generated.d.ts +20 -0
- package/dist/lib/types/v3-1-beta/tools.generated.d.ts.map +1 -1
- package/dist/lib/upstream-recorder/constants.d.ts +2 -0
- package/dist/lib/upstream-recorder/constants.d.ts.map +1 -0
- package/dist/lib/upstream-recorder/constants.js +5 -0
- package/dist/lib/upstream-recorder/constants.js.map +1 -0
- package/dist/lib/upstream-recorder/index.d.ts +20 -10
- package/dist/lib/upstream-recorder/index.d.ts.map +1 -1
- package/dist/lib/upstream-recorder/index.js +21 -10
- package/dist/lib/upstream-recorder/index.js.map +1 -1
- package/dist/lib/upstream-recorder/recorder.d.ts +65 -0
- package/dist/lib/upstream-recorder/recorder.d.ts.map +1 -1
- package/dist/lib/upstream-recorder/recorder.js +500 -47
- package/dist/lib/upstream-recorder/recorder.js.map +1 -1
- package/dist/lib/upstream-recorder/types.d.ts +109 -13
- package/dist/lib/upstream-recorder/types.d.ts.map +1 -1
- package/dist/lib/upstream-recorder/types.js.map +1 -1
- package/dist/lib/utils/adcp-version-config.d.ts +1 -0
- package/dist/lib/utils/adcp-version-config.d.ts.map +1 -1
- package/dist/lib/utils/adcp-version-config.js +21 -0
- package/dist/lib/utils/adcp-version-config.js.map +1 -1
- package/dist/lib/utils/capability-rollups.d.ts +5 -5
- package/dist/lib/utils/capability-rollups.d.ts.map +1 -1
- package/dist/lib/utils/capability-rollups.js +1 -1
- package/dist/lib/utils/capability-rollups.js.map +1 -1
- package/dist/lib/utils/json-depth.d.ts +2 -0
- package/dist/lib/utils/json-depth.d.ts.map +1 -0
- package/dist/lib/utils/json-depth.js +5 -0
- package/dist/lib/utils/json-depth.js.map +1 -0
- package/dist/lib/utils/media-buy-delivery-notification-builders.d.ts +1 -1
- package/dist/lib/utils/media-buy-delivery-notification-builders.d.ts.map +1 -1
- package/dist/lib/utils/preview-creative-builders.d.ts +1 -1
- package/dist/lib/utils/preview-creative-builders.d.ts.map +1 -1
- package/dist/lib/utils/redact-secrets.d.ts +13 -2
- package/dist/lib/utils/redact-secrets.d.ts.map +1 -1
- package/dist/lib/utils/redact-secrets.js +40 -13
- package/dist/lib/utils/redact-secrets.js.map +1 -1
- package/dist/lib/utils/response-schemas.d.ts +1 -0
- package/dist/lib/utils/response-schemas.d.ts.map +1 -1
- package/dist/lib/utils/response-schemas.js +15 -0
- package/dist/lib/utils/response-schemas.js.map +1 -1
- package/dist/lib/utils/response-unwrapper.d.ts +2 -1
- package/dist/lib/utils/response-unwrapper.d.ts.map +1 -1
- package/dist/lib/utils/response-unwrapper.js +11 -3
- package/dist/lib/utils/response-unwrapper.js.map +1 -1
- package/dist/lib/utils/tool-request-schemas.d.ts +31 -1
- package/dist/lib/utils/tool-request-schemas.d.ts.map +1 -1
- package/dist/lib/v2/format-schema/fetch.d.ts +13 -5
- package/dist/lib/v2/format-schema/fetch.d.ts.map +1 -1
- package/dist/lib/v2/format-schema/fetch.js +27 -16
- package/dist/lib/v2/format-schema/fetch.js.map +1 -1
- package/dist/lib/v2/format-schema/index.d.ts +13 -11
- package/dist/lib/v2/format-schema/index.d.ts.map +1 -1
- package/dist/lib/v2/format-schema/index.js +19 -12
- package/dist/lib/v2/format-schema/index.js.map +1 -1
- package/dist/lib/v2/format-schema/resolver.d.ts +71 -0
- package/dist/lib/v2/format-schema/resolver.d.ts.map +1 -0
- package/dist/lib/v2/format-schema/resolver.js +284 -0
- package/dist/lib/v2/format-schema/resolver.js.map +1 -0
- package/dist/lib/v2/format-schema/sandbox-refs.d.ts +6 -0
- package/dist/lib/v2/format-schema/sandbox-refs.d.ts.map +1 -1
- package/dist/lib/v2/format-schema/sandbox-refs.js +36 -15
- package/dist/lib/v2/format-schema/sandbox-refs.js.map +1 -1
- package/dist/lib/validation/schema-loader.d.ts.map +1 -1
- package/dist/lib/validation/schema-loader.js +48 -3
- package/dist/lib/validation/schema-loader.js.map +1 -1
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/docs/guides/BUILD-AN-AGENT.md +7 -7
- package/docs/guides/CANONICAL-REFERENCE-RESOLVER.md +75 -0
- package/docs/llms.txt +37 -8
- package/examples/README.md +29 -16
- package/examples/hello_creative_adapter_ad_server.ts +8 -2
- package/examples/hello_seller_adapter_guaranteed.ts +26 -18
- package/examples/hello_seller_adapter_multi_tenant.ts +6 -6
- package/examples/hello_seller_adapter_social.ts +80 -4
- package/examples/hello_si_adapter_brand.ts +10 -21
- package/examples/hello_signals_adapter_marketplace.ts +184 -9
- package/examples/proxy-seller-snap/README.md +47 -0
- package/examples/proxy-seller-snap/index.ts +321 -0
- package/package.json +19 -4
- package/skills/build-creative-agent/SKILL.md +1 -15
- package/skills/build-decisioning-platform/SKILL.md +6 -1
- package/skills/build-seller-agent/SKILL.md +5 -2
- package/skills/build-si-agent/SKILL.md +2 -2
- package/skills/call-adcp-agent/SKILL.md +4 -1
- package/dist/lib/signing/response-verifier.d.ts +0 -105
- package/dist/lib/signing/response-verifier.d.ts.map +0 -1
- package/dist/lib/signing/response-verifier.js +0 -271
- package/dist/lib/signing/response-verifier.js.map +0 -1
|
@@ -16,12 +16,16 @@ const response_schemas_1 = require("../../utils/response-schemas");
|
|
|
16
16
|
const envelope_status_compat_1 = require("../../utils/envelope-status-compat");
|
|
17
17
|
const a2a_discovery_1 = require("../../utils/a2a-discovery");
|
|
18
18
|
const schema_validator_1 = require("../../validation/schema-validator");
|
|
19
|
+
const schema_loader_1 = require("../../validation/schema-loader");
|
|
19
20
|
const version_1 = require("../../version");
|
|
21
|
+
const adcp_version_config_1 = require("../../utils/adcp-version-config");
|
|
20
22
|
const test_controller_1 = require("../test-controller");
|
|
21
23
|
const glob_1 = require("../../utils/glob");
|
|
22
24
|
const path_1 = require("./path");
|
|
23
25
|
const shape_drift_hints_1 = require("./shape-drift-hints");
|
|
24
26
|
const test_kit_1 = require("./test-kit");
|
|
27
|
+
const canonical_format_satisfaction_1 = require("./canonical-format-satisfaction");
|
|
28
|
+
const rate_limit_trip_1 = require("./rate-limit-trip");
|
|
25
29
|
/**
|
|
26
30
|
* Run all validations for a storyboard step.
|
|
27
31
|
*/
|
|
@@ -108,10 +112,25 @@ function runValidation(validation, ctx) {
|
|
|
108
112
|
return validateFieldEqualsContext(validation, ctx);
|
|
109
113
|
case 'upstream_traffic':
|
|
110
114
|
return validateUpstreamTraffic(validation, ctx);
|
|
115
|
+
case 'replay_not_cached_rate_limit':
|
|
116
|
+
return validateReplayNotCachedRateLimit(validation, ctx);
|
|
111
117
|
case 'cross_response_field_equal':
|
|
112
118
|
return validateCrossResponseFieldEqual(validation, ctx);
|
|
113
119
|
case 'cross_response_count_distinct':
|
|
114
120
|
return validateCrossResponseCountDistinct(validation, ctx);
|
|
121
|
+
case 'canonical_format_satisfaction':
|
|
122
|
+
if (ctx.taskName !== 'create_media_buy') {
|
|
123
|
+
return {
|
|
124
|
+
check: validation.check,
|
|
125
|
+
passed: false,
|
|
126
|
+
description: validation.description,
|
|
127
|
+
error: 'canonical_format_satisfaction applies only to create_media_buy storyboard steps',
|
|
128
|
+
json_pointer: null,
|
|
129
|
+
expected: 'create_media_buy',
|
|
130
|
+
actual: ctx.taskName,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return requireTaskResult(ctx, validation, tr => (0, canonical_format_satisfaction_1.validateCanonicalFormatSatisfaction)(validation, ctx.request, ctx.storyboardContext, tr));
|
|
115
134
|
case 'array_length':
|
|
116
135
|
return validateArrayLength(validation, resolveTarget(ctx));
|
|
117
136
|
default:
|
|
@@ -291,13 +310,14 @@ function validateResponseSchema(validation, ctx, taskResult) {
|
|
|
291
310
|
const dataForValidation = Array.isArray(dataWithoutMessage)
|
|
292
311
|
? dataWithoutMessage
|
|
293
312
|
: (0, envelope_status_compat_1.injectLegacyEnvelopeStatus)(dataWithoutMessage, { toolName: taskName });
|
|
294
|
-
const
|
|
313
|
+
const responseAdcpVersion = ctx.responseAdcpVersion ?? ctx.adcpVersion;
|
|
314
|
+
const parseResult = schema.safeParse((0, response_schemas_1.prepareResponseForSchemaValidation)(taskName, dataForValidation, responseAdcpVersion));
|
|
295
315
|
// Strict (AJV) verdict runs alongside the lenient Zod check so the run
|
|
296
316
|
// report surfaces strictness deltas (issue #820 follow-up). The AJV path
|
|
297
317
|
// enforces `format` keywords and `additionalProperties: false` that Zod's
|
|
298
318
|
// `passthrough()` omits — a response can pass Zod and fail AJV. The step's
|
|
299
319
|
// overall pass/fail stays Zod-driven to preserve backwards compatibility.
|
|
300
|
-
const strict = computeStrictVerdict(taskName, dataWithoutMessage, ctx.adcpVersion);
|
|
320
|
+
const strict = computeStrictVerdict(taskName, dataWithoutMessage, ctx.adcpVersion, ctx.responseAdcpVersion);
|
|
301
321
|
// Shape-drift no longer rides on `ValidationResult.warning` — issue #935
|
|
302
322
|
// moved that diagnostic to `StoryboardStepResult.hints[]` as a structured
|
|
303
323
|
// `ShapeDriftHint`. The runner emits the structured hint via
|
|
@@ -348,8 +368,13 @@ function validateResponseSchema(validation, ctx, taskResult) {
|
|
|
348
368
|
* the SDK — notably the brand-rights and governance schemas that live
|
|
349
369
|
* outside the `bundled/` tree the loader walks today).
|
|
350
370
|
*/
|
|
351
|
-
function computeStrictVerdict(taskName, payload, adcpVersion) {
|
|
352
|
-
const
|
|
371
|
+
function computeStrictVerdict(taskName, payload, adcpVersion, responseAdcpVersion) {
|
|
372
|
+
const validationVersion = responseAdcpVersion && (0, schema_loader_1.hasSchemaBundle)(responseAdcpVersion) ? responseAdcpVersion : adcpVersion;
|
|
373
|
+
if (responseAdcpVersion && (0, adcp_version_config_1.isPre31AdcpVersion)(responseAdcpVersion) && !(0, schema_loader_1.hasSchemaBundle)(responseAdcpVersion)) {
|
|
374
|
+
return undefined;
|
|
375
|
+
}
|
|
376
|
+
const payloadForValidation = (0, response_schemas_1.prepareResponseForSchemaValidation)(taskName, payload, responseAdcpVersion);
|
|
377
|
+
const outcome = (0, schema_validator_1.validateResponse)(taskName, payloadForValidation, validationVersion);
|
|
353
378
|
// `variant: 'skipped'` means no AJV validator compiled for this task (no
|
|
354
379
|
// strictness signal to emit); treat the same as "no AJV schema available".
|
|
355
380
|
if (outcome.variant === 'skipped')
|
|
@@ -2242,6 +2267,27 @@ function validateFieldEqualsContext(validation, ctx) {
|
|
|
2242
2267
|
*/
|
|
2243
2268
|
function validateUpstreamTraffic(validation, ctx) {
|
|
2244
2269
|
const expected = buildUpstreamTrafficExpected(validation);
|
|
2270
|
+
const invalidIdentifierPaths = collectInvalidIdentifierPaths(validation.identifier_paths);
|
|
2271
|
+
if (invalidIdentifierPaths.length > 0) {
|
|
2272
|
+
return {
|
|
2273
|
+
check: 'upstream_traffic',
|
|
2274
|
+
passed: false,
|
|
2275
|
+
description: validation.description,
|
|
2276
|
+
error: 'storyboard authoring error: invalid upstream_traffic.identifier_paths: ' +
|
|
2277
|
+
invalidIdentifierPaths.map(issue => `${issue.path} (${issue.reason})`).join('; '),
|
|
2278
|
+
json_pointer: null,
|
|
2279
|
+
expected,
|
|
2280
|
+
actual: {
|
|
2281
|
+
matched_count: 0,
|
|
2282
|
+
total_calls: 0,
|
|
2283
|
+
missing_payload_paths: [],
|
|
2284
|
+
missing_identifier_values: [],
|
|
2285
|
+
invalid_identifier_paths: invalidIdentifierPaths,
|
|
2286
|
+
},
|
|
2287
|
+
schema_id: null,
|
|
2288
|
+
schema_url: null,
|
|
2289
|
+
};
|
|
2290
|
+
}
|
|
2245
2291
|
const upstream = ctx.upstreamTraffic;
|
|
2246
2292
|
// Adopter opted out (or controller wasn't detected): grade not_applicable.
|
|
2247
2293
|
// missing_test_controller controller-side, not failed — opt-in by adopter
|
|
@@ -2298,6 +2344,22 @@ function validateUpstreamTraffic(validation, ctx) {
|
|
|
2298
2344
|
// `MAX_ERROR_LENGTH` posture on every other validation_result.error.
|
|
2299
2345
|
if (!('success' in query.payload) || query.payload.success !== true) {
|
|
2300
2346
|
const errMsg = 'error' in query.payload ? query.payload.error : 'controller returned a non-success response';
|
|
2347
|
+
if ('error_kind' in query.payload && query.payload.error_kind === 'jcs_non_finite') {
|
|
2348
|
+
return {
|
|
2349
|
+
check: 'upstream_traffic',
|
|
2350
|
+
passed: true,
|
|
2351
|
+
not_applicable: true,
|
|
2352
|
+
description: validation.description,
|
|
2353
|
+
note: 'digest attestation could not canonicalize a non-finite JSON number - graded not_applicable',
|
|
2354
|
+
json_pointer: null,
|
|
2355
|
+
expected,
|
|
2356
|
+
actual: { matched_count: 0, total_calls: 0, missing_payload_paths: [], missing_identifier_values: [] },
|
|
2357
|
+
schema_id: null,
|
|
2358
|
+
schema_url: null,
|
|
2359
|
+
request: query.request,
|
|
2360
|
+
response: query.response,
|
|
2361
|
+
};
|
|
2362
|
+
}
|
|
2301
2363
|
return {
|
|
2302
2364
|
check: 'upstream_traffic',
|
|
2303
2365
|
passed: false,
|
|
@@ -2318,11 +2380,10 @@ function validateUpstreamTraffic(validation, ctx) {
|
|
|
2318
2380
|
const matchedCount = matched.length;
|
|
2319
2381
|
const minCount = validation.min_count ?? 1;
|
|
2320
2382
|
// payload_must_contain results bucket two ways: paths that no matched
|
|
2321
|
-
// call satisfied (failure), and
|
|
2322
|
-
//
|
|
2323
|
-
//
|
|
2324
|
-
// path
|
|
2325
|
-
// results still fail the validation if any required path is missing.
|
|
2383
|
+
// call satisfied despite inspectable raw JSON evidence (failure), and
|
|
2384
|
+
// paths with no portable payload evidence to inspect (`not_applicable`).
|
|
2385
|
+
// Any actionable raw JSON miss keeps the validation failed; otherwise any
|
|
2386
|
+
// not_applicable path downgrades the validation from pass to not_applicable.
|
|
2326
2387
|
const missingPayloadPaths = [];
|
|
2327
2388
|
const notApplicablePaths = [];
|
|
2328
2389
|
if (validation.payload_must_contain && validation.payload_must_contain.length > 0) {
|
|
@@ -2345,46 +2406,77 @@ function validateUpstreamTraffic(validation, ctx) {
|
|
|
2345
2406
|
// fabrication is the threat. Replaces the earlier `buyer_identifier_echo`
|
|
2346
2407
|
// boolean shorthand per spec PR adcp#3816.
|
|
2347
2408
|
const missingIdentifierValues = [];
|
|
2409
|
+
const notApplicableIdentifierValues = [];
|
|
2348
2410
|
if (validation.identifier_paths && validation.identifier_paths.length > 0) {
|
|
2349
2411
|
const requestPayload = ctx.request?.payload;
|
|
2350
2412
|
const sample = requestPayload && typeof requestPayload === 'object' && !Array.isArray(requestPayload)
|
|
2351
2413
|
? requestPayload
|
|
2352
2414
|
: ctx.storyboardStep?.sample_request;
|
|
2353
2415
|
for (const path of validation.identifier_paths) {
|
|
2354
|
-
const vectors = sample !== undefined ?
|
|
2416
|
+
const vectors = sample !== undefined ? (0, path_1.resolvePortableIdentifierPathAll)(sample, path) : [];
|
|
2355
2417
|
for (const vector of vectors) {
|
|
2356
2418
|
if (vector === undefined || vector === null)
|
|
2357
2419
|
continue;
|
|
2358
|
-
|
|
2420
|
+
const digest = typeof vector === 'string' ? upstream.identifierDigestByValue?.get(vector) : undefined;
|
|
2421
|
+
const result = anyMatchedCallEchoesValue(matched, vector, digest);
|
|
2422
|
+
if (result.satisfied)
|
|
2423
|
+
continue;
|
|
2424
|
+
if (result.not_applicable) {
|
|
2425
|
+
notApplicableIdentifierValues.push(vector);
|
|
2426
|
+
}
|
|
2427
|
+
else {
|
|
2359
2428
|
missingIdentifierValues.push(vector);
|
|
2360
2429
|
}
|
|
2361
2430
|
}
|
|
2362
2431
|
}
|
|
2363
2432
|
}
|
|
2364
|
-
const
|
|
2433
|
+
const hasRawIntrospectionAssertions = (validation.payload_must_contain?.length ?? 0) > 0 || (validation.identifier_paths?.length ?? 0) > 0;
|
|
2434
|
+
const rawRequiredDigestDowngrade = validation.attestation_mode_required === 'raw' &&
|
|
2435
|
+
hasRawIntrospectionAssertions &&
|
|
2436
|
+
matched.length > 0 &&
|
|
2437
|
+
matched.every(call => call.attestation_mode === 'digest');
|
|
2438
|
+
if (rawRequiredDigestDowngrade) {
|
|
2439
|
+
missingPayloadPaths.length = 0;
|
|
2440
|
+
missingIdentifierValues.length = 0;
|
|
2441
|
+
}
|
|
2442
|
+
const countOk = minCount === 0 ? matchedCount === 0 : matchedCount >= minCount;
|
|
2365
2443
|
const payloadOk = missingPayloadPaths.length === 0;
|
|
2366
2444
|
const echoOk = missingIdentifierValues.length === 0;
|
|
2367
|
-
const passed = countOk && payloadOk && echoOk;
|
|
2368
|
-
// Per spec: a payload_must_contain assertion whose
|
|
2369
|
-
//
|
|
2370
|
-
//
|
|
2371
|
-
//
|
|
2372
|
-
const
|
|
2373
|
-
notApplicablePaths.length
|
|
2445
|
+
const passed = countOk && (rawRequiredDigestDowngrade || (payloadOk && echoOk));
|
|
2446
|
+
// Per spec: a payload_must_contain assertion whose only available evidence
|
|
2447
|
+
// is not portable to inspect grades not_applicable. When any required path
|
|
2448
|
+
// lands in that bucket (and count + echo passed with no actionable payload
|
|
2449
|
+
// misses), the whole validation grades not_applicable rather than passed.
|
|
2450
|
+
const anyPayloadNotApplicable = (validation.payload_must_contain?.length ?? 0) > 0 &&
|
|
2451
|
+
notApplicablePaths.length > 0 &&
|
|
2374
2452
|
missingPayloadPaths.length === 0;
|
|
2375
|
-
const
|
|
2453
|
+
const hasMeaningfulPayloadPass = (validation.payload_must_contain?.length ?? 0) > 0 && payloadOk && !anyPayloadNotApplicable;
|
|
2454
|
+
const allIdentifiersNotApplicable = (validation.identifier_paths?.length ?? 0) > 0 &&
|
|
2455
|
+
missingIdentifierValues.length === 0 &&
|
|
2456
|
+
notApplicableIdentifierValues.length > 0;
|
|
2457
|
+
const not_applicable = passed &&
|
|
2458
|
+
countOk &&
|
|
2459
|
+
(rawRequiredDigestDowngrade ||
|
|
2460
|
+
anyPayloadNotApplicable ||
|
|
2461
|
+
(allIdentifiersNotApplicable && !hasMeaningfulPayloadPass));
|
|
2376
2462
|
const actual = {
|
|
2377
2463
|
matched_count: matchedCount,
|
|
2378
2464
|
total_calls: totalCalls,
|
|
2379
2465
|
missing_payload_paths: missingPayloadPaths,
|
|
2380
2466
|
missing_identifier_values: missingIdentifierValues,
|
|
2467
|
+
not_applicable_payload_paths: notApplicablePaths,
|
|
2468
|
+
not_applicable_identifier_values: notApplicableIdentifierValues,
|
|
2469
|
+
...(upstream.identifierDigestLimitExceeded && {
|
|
2470
|
+
identifier_digest_limit_exceeded: upstream.identifierDigestLimitExceeded,
|
|
2471
|
+
}),
|
|
2381
2472
|
};
|
|
2382
2473
|
// RFC 6901 pointer: when one specific call's payload failed
|
|
2383
2474
|
// payload_must_contain, point at that call's payload; null when the
|
|
2384
2475
|
// failure is a count mismatch or no specific call is implicated.
|
|
2385
2476
|
let jsonPointer = null;
|
|
2386
2477
|
if (!payloadOk && matched.length > 0) {
|
|
2387
|
-
const
|
|
2478
|
+
const actionableMiss = matched.find(call => call.attestation_mode === 'raw' && (0, test_controller_1.isJsonContentType)(call.content_type));
|
|
2479
|
+
const idx = all.indexOf(actionableMiss ?? matched[0]);
|
|
2388
2480
|
if (idx >= 0)
|
|
2389
2481
|
jsonPointer = `/recorded_calls/${idx}/payload`;
|
|
2390
2482
|
}
|
|
@@ -2394,7 +2486,13 @@ function validateUpstreamTraffic(validation, ctx) {
|
|
|
2394
2486
|
passed: true,
|
|
2395
2487
|
...(not_applicable && { not_applicable: true }),
|
|
2396
2488
|
...(not_applicable && {
|
|
2397
|
-
note:
|
|
2489
|
+
note: rawRequiredDigestDowngrade
|
|
2490
|
+
? `attestation_mode_required: raw but controller returned digest attestations — graded not_applicable`
|
|
2491
|
+
: allIdentifiersNotApplicable
|
|
2492
|
+
? upstream.identifierDigestLimitExceeded
|
|
2493
|
+
? `identifier_paths exceeded the runner digest buffer; recorder buffer capped at ${upstream.identifierDigestLimitExceeded.limit} unique digests with ${upstream.identifierDigestLimitExceeded.clipped} overflow value(s) clipped — graded not_applicable`
|
|
2494
|
+
: `identifier_paths only matched digest attestations without portable proofs — graded not_applicable`
|
|
2495
|
+
: `payload_must_contain paths could not be fully inspected in raw JSON attestations — graded not_applicable`,
|
|
2398
2496
|
}),
|
|
2399
2497
|
description: validation.description,
|
|
2400
2498
|
json_pointer: null,
|
|
@@ -2405,8 +2503,11 @@ function validateUpstreamTraffic(validation, ctx) {
|
|
|
2405
2503
|
};
|
|
2406
2504
|
}
|
|
2407
2505
|
const errParts = [];
|
|
2408
|
-
if (!countOk)
|
|
2409
|
-
errParts.push(
|
|
2506
|
+
if (!countOk) {
|
|
2507
|
+
errParts.push(minCount === 0
|
|
2508
|
+
? `expected zero matching call(s); observed ${matchedCount}`
|
|
2509
|
+
: `expected at least ${minCount} matching call(s); observed ${matchedCount}`);
|
|
2510
|
+
}
|
|
2410
2511
|
if (!payloadOk)
|
|
2411
2512
|
errParts.push(`missing payload paths: ${missingPayloadPaths.join(', ')}`);
|
|
2412
2513
|
if (!echoOk)
|
|
@@ -2425,6 +2526,15 @@ function validateUpstreamTraffic(validation, ctx) {
|
|
|
2425
2526
|
response: query.response,
|
|
2426
2527
|
};
|
|
2427
2528
|
}
|
|
2529
|
+
function collectInvalidIdentifierPaths(paths) {
|
|
2530
|
+
const invalid = [];
|
|
2531
|
+
for (const path of paths ?? []) {
|
|
2532
|
+
const reason = (0, path_1.validatePortableIdentifierPath)(path);
|
|
2533
|
+
if (reason)
|
|
2534
|
+
invalid.push({ path, reason });
|
|
2535
|
+
}
|
|
2536
|
+
return invalid;
|
|
2537
|
+
}
|
|
2428
2538
|
/**
|
|
2429
2539
|
* Cap on agent / controller-controlled error strings inlined into a
|
|
2430
2540
|
* `validation_result.error` field. Mirrors the runner's `MAX_ERROR_LENGTH`
|
|
@@ -2445,6 +2555,9 @@ function buildUpstreamTrafficExpected(validation) {
|
|
|
2445
2555
|
expected.endpoint_pattern = validation.endpoint_pattern;
|
|
2446
2556
|
if (validation.payload_must_contain !== undefined)
|
|
2447
2557
|
expected.payload_must_contain = validation.payload_must_contain;
|
|
2558
|
+
if (validation.attestation_mode_required !== undefined) {
|
|
2559
|
+
expected.attestation_mode_required = validation.attestation_mode_required;
|
|
2560
|
+
}
|
|
2448
2561
|
if (validation.identifier_paths !== undefined)
|
|
2449
2562
|
expected.identifier_paths = validation.identifier_paths;
|
|
2450
2563
|
return expected;
|
|
@@ -2464,8 +2577,7 @@ function filterByEndpointPattern(calls, pattern) {
|
|
|
2464
2577
|
/**
|
|
2465
2578
|
* Returns whether at least one matched call's payload satisfies the
|
|
2466
2579
|
* `payload_must_contain` predicate, plus a flag indicating the assertion
|
|
2467
|
-
* graded `not_applicable` (
|
|
2468
|
-
* matching has no portable semantics on non-JSON wire formats).
|
|
2580
|
+
* graded `not_applicable` (no matched call had a JSON payload to inspect).
|
|
2469
2581
|
*
|
|
2470
2582
|
* Per spec PRs adcp#3816 (initial JSONPath restriction) and adcp#3987
|
|
2471
2583
|
* (closes the substring-fallback ambiguity #3845):
|
|
@@ -2491,11 +2603,15 @@ function filterByEndpointPattern(calls, pattern) {
|
|
|
2491
2603
|
function anyMatchedCallSatisfies(calls, spec) {
|
|
2492
2604
|
let sawApplicableCall = false;
|
|
2493
2605
|
for (const call of calls) {
|
|
2606
|
+
if (call.attestation_mode !== 'raw') {
|
|
2607
|
+
continue;
|
|
2608
|
+
}
|
|
2494
2609
|
const isJson = (0, test_controller_1.isJsonContentType)(call.content_type);
|
|
2495
2610
|
// All match modes require a structured-JSON payload — non-JSON calls
|
|
2496
2611
|
// don't contribute regardless of mode (adcp#3987).
|
|
2497
|
-
if (!isJson)
|
|
2612
|
+
if (!isJson) {
|
|
2498
2613
|
continue;
|
|
2614
|
+
}
|
|
2499
2615
|
sawApplicableCall = true;
|
|
2500
2616
|
const candidates = resolveJsonPathLite(call.payload, spec.path);
|
|
2501
2617
|
if (candidates.length === 0)
|
|
@@ -2525,7 +2641,7 @@ function anyMatchedCallSatisfies(calls, spec) {
|
|
|
2525
2641
|
function resolveJsonPathLite(root, path) {
|
|
2526
2642
|
if (!path)
|
|
2527
2643
|
return [];
|
|
2528
|
-
let p = path;
|
|
2644
|
+
let p = path.trim();
|
|
2529
2645
|
if (p.startsWith('$.'))
|
|
2530
2646
|
p = p.slice(2);
|
|
2531
2647
|
else if (p.startsWith('$'))
|
|
@@ -2589,20 +2705,34 @@ function walkLitePath(root, path) {
|
|
|
2589
2705
|
* nested object that would blow the recursion stack.
|
|
2590
2706
|
*/
|
|
2591
2707
|
const CONTAINS_VALUE_MAX_DEPTH = 256;
|
|
2592
|
-
function anyMatchedCallEchoesValue(calls, value) {
|
|
2708
|
+
function anyMatchedCallEchoesValue(calls, value, valueDigest) {
|
|
2709
|
+
let sawApplicableCall = false;
|
|
2593
2710
|
for (const call of calls) {
|
|
2711
|
+
if (call.attestation_mode === 'digest') {
|
|
2712
|
+
if (!(0, test_controller_1.isJsonContentType)(call.content_type))
|
|
2713
|
+
continue;
|
|
2714
|
+
if (!valueDigest)
|
|
2715
|
+
continue;
|
|
2716
|
+
sawApplicableCall = true;
|
|
2717
|
+
if (call.identifier_match_proofs?.some(proof => proof.identifier_value_sha256 === valueDigest && proof.found)) {
|
|
2718
|
+
return { satisfied: true, not_applicable: false };
|
|
2719
|
+
}
|
|
2720
|
+
continue;
|
|
2721
|
+
}
|
|
2722
|
+
sawApplicableCall = true;
|
|
2594
2723
|
// Non-JSON payloads land as raw strings — substring-match the
|
|
2595
2724
|
// stringified vector. Defensible best-effort downgrade per the spec's
|
|
2596
2725
|
// non-JSON fallback note.
|
|
2597
2726
|
if (typeof call.payload === 'string') {
|
|
2598
|
-
if (typeof value === 'string' && call.payload.includes(value))
|
|
2599
|
-
return true;
|
|
2727
|
+
if (typeof value === 'string' && call.payload.includes(value)) {
|
|
2728
|
+
return { satisfied: true, not_applicable: false };
|
|
2729
|
+
}
|
|
2600
2730
|
continue;
|
|
2601
2731
|
}
|
|
2602
2732
|
if (containsValueAnyDepth(call.payload, value, 0))
|
|
2603
|
-
return true;
|
|
2733
|
+
return { satisfied: true, not_applicable: false };
|
|
2604
2734
|
}
|
|
2605
|
-
return false;
|
|
2735
|
+
return { satisfied: false, not_applicable: !sawApplicableCall };
|
|
2606
2736
|
}
|
|
2607
2737
|
function containsValueAnyDepth(root, target, depth) {
|
|
2608
2738
|
if (depth > CONTAINS_VALUE_MAX_DEPTH)
|
|
@@ -2716,6 +2846,81 @@ function validateCrossResponseFieldEqual(validation, ctx) {
|
|
|
2716
2846
|
schema_url: null,
|
|
2717
2847
|
};
|
|
2718
2848
|
}
|
|
2849
|
+
function validateReplayNotCachedRateLimit(validation, ctx) {
|
|
2850
|
+
const payload = resolveTarget(ctx).data;
|
|
2851
|
+
const tripResponse = payload?.trip_response;
|
|
2852
|
+
const replayResponse = payload?.replay_response;
|
|
2853
|
+
const targetTask = typeof payload?.target_task === 'string' ? payload.target_task : undefined;
|
|
2854
|
+
if (!tripResponse || typeof tripResponse !== 'object' || !replayResponse || typeof replayResponse !== 'object') {
|
|
2855
|
+
const missing = [
|
|
2856
|
+
!tripResponse || typeof tripResponse !== 'object' ? 'trip_response' : undefined,
|
|
2857
|
+
!replayResponse || typeof replayResponse !== 'object' ? 'replay_response' : undefined,
|
|
2858
|
+
].filter((field) => typeof field === 'string');
|
|
2859
|
+
return {
|
|
2860
|
+
check: validation.check,
|
|
2861
|
+
passed: true,
|
|
2862
|
+
not_applicable: true,
|
|
2863
|
+
description: validation.description,
|
|
2864
|
+
note: `step did not produce rate_limit_trip_runner ${missing.join(' and ')}; replay_not_cached_rate_limit grades not_applicable`,
|
|
2865
|
+
json_pointer: null,
|
|
2866
|
+
};
|
|
2867
|
+
}
|
|
2868
|
+
const tripCode = extractSnapshotErrorCode(tripResponse, targetTask);
|
|
2869
|
+
const replayCode = extractSnapshotErrorCode(replayResponse, targetTask);
|
|
2870
|
+
if (tripCode !== 'RATE_LIMITED') {
|
|
2871
|
+
return {
|
|
2872
|
+
check: validation.check,
|
|
2873
|
+
passed: false,
|
|
2874
|
+
description: validation.description,
|
|
2875
|
+
json_pointer: '/trip_response/error/code',
|
|
2876
|
+
expected: 'RATE_LIMITED trip_response error code',
|
|
2877
|
+
actual: tripCode ?? null,
|
|
2878
|
+
schema_id: null,
|
|
2879
|
+
schema_url: null,
|
|
2880
|
+
};
|
|
2881
|
+
}
|
|
2882
|
+
if (replayCode === 'RATE_LIMITED') {
|
|
2883
|
+
return {
|
|
2884
|
+
check: validation.check,
|
|
2885
|
+
passed: false,
|
|
2886
|
+
description: validation.description,
|
|
2887
|
+
error: 'rate_limit_response_cached_as_replay',
|
|
2888
|
+
json_pointer: '/replay_response/error/code',
|
|
2889
|
+
expected: 'replay_response must not return RATE_LIMITED from the idempotency cache',
|
|
2890
|
+
actual: replayCode,
|
|
2891
|
+
schema_id: null,
|
|
2892
|
+
schema_url: null,
|
|
2893
|
+
};
|
|
2894
|
+
}
|
|
2895
|
+
return {
|
|
2896
|
+
check: validation.check,
|
|
2897
|
+
passed: true,
|
|
2898
|
+
description: validation.description,
|
|
2899
|
+
json_pointer: '/replay_response/error/code',
|
|
2900
|
+
actual: replayCode ?? null,
|
|
2901
|
+
};
|
|
2902
|
+
}
|
|
2903
|
+
function extractSnapshotErrorCode(snapshot, taskName) {
|
|
2904
|
+
const structuredError = snapshot.error;
|
|
2905
|
+
if (structuredError && typeof structuredError === 'object') {
|
|
2906
|
+
const code = structuredError.code;
|
|
2907
|
+
if (typeof code === 'string')
|
|
2908
|
+
return code;
|
|
2909
|
+
}
|
|
2910
|
+
const adcpError = snapshot.adcp_error;
|
|
2911
|
+
if (adcpError && typeof adcpError === 'object') {
|
|
2912
|
+
const code = adcpError.code;
|
|
2913
|
+
if (typeof code === 'string')
|
|
2914
|
+
return code;
|
|
2915
|
+
}
|
|
2916
|
+
const data = snapshot.data;
|
|
2917
|
+
if (data && typeof data === 'object') {
|
|
2918
|
+
const extracted = (0, rate_limit_trip_1.extractTaskAdcpError)({ success: snapshot.success === true, data }, taskName);
|
|
2919
|
+
if (extracted)
|
|
2920
|
+
return extracted.code;
|
|
2921
|
+
}
|
|
2922
|
+
return undefined;
|
|
2923
|
+
}
|
|
2719
2924
|
/**
|
|
2720
2925
|
* Cross-response: the cardinality of distinct values at `path` across all
|
|
2721
2926
|
* resolved dispatches is in `allowed_values`. Spec:
|