@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
|
@@ -23,6 +23,7 @@ exports.applyBrandInvariant = applyBrandInvariant;
|
|
|
23
23
|
exports.applyDisableSandboxHint = applyDisableSandboxHint;
|
|
24
24
|
exports.applyIdempotencyInvariant = applyIdempotencyInvariant;
|
|
25
25
|
exports.getFirstStepPreview = getFirstStepPreview;
|
|
26
|
+
const node_crypto_1 = require("node:crypto");
|
|
26
27
|
const client_1 = require("../client");
|
|
27
28
|
const protocols_1 = require("../../protocols");
|
|
28
29
|
const rawResponseCapture_1 = require("../../protocols/rawResponseCapture");
|
|
@@ -34,10 +35,12 @@ const strict_validation_hints_1 = require("./strict-validation-hints");
|
|
|
34
35
|
const validations_1 = require("./validations");
|
|
35
36
|
const parallel_dispatch_1 = require("./parallel-dispatch");
|
|
36
37
|
const path_1 = require("./path");
|
|
38
|
+
const rate_limit_trip_1 = require("./rate-limit-trip");
|
|
37
39
|
const redact_secrets_1 = require("../../utils/redact-secrets");
|
|
38
40
|
const response_unwrapper_1 = require("../../utils/response-unwrapper");
|
|
39
41
|
const envelope_status_compat_1 = require("../../utils/envelope-status-compat");
|
|
40
42
|
const test_controller_1 = require("../test-controller");
|
|
43
|
+
const constants_1 = require("../../upstream-recorder/constants");
|
|
41
44
|
const request_builder_1 = require("./request-builder");
|
|
42
45
|
const client_2 = require("../client");
|
|
43
46
|
const idempotency_1 = require("../../utils/idempotency");
|
|
@@ -83,6 +86,15 @@ function applyAdcpVersionRunOptions(defaultAdcpVersion, options) {
|
|
|
83
86
|
}
|
|
84
87
|
return { ...options, adcpVersion, versionEnvelope };
|
|
85
88
|
}
|
|
89
|
+
function registerRunSchemaRoot(options) {
|
|
90
|
+
if (!options.schemaRoot)
|
|
91
|
+
return;
|
|
92
|
+
const adcpVersion = options.adcpVersion ?? options._serverAdcpVersion;
|
|
93
|
+
if (!adcpVersion) {
|
|
94
|
+
throw new Error('schemaRoot requires an AdCP version. Pass adcpVersion, or run a storyboard/compliance bundle with adcp_version set.');
|
|
95
|
+
}
|
|
96
|
+
(0, schema_loader_1.registerExternalSchemaRoot)(adcpVersion, options.schemaRoot);
|
|
97
|
+
}
|
|
86
98
|
function storyboardVersionEnvelopeMode(adcpVersion) {
|
|
87
99
|
const bundleKey = (0, schema_loader_1.resolveBundleKey)(adcpVersion);
|
|
88
100
|
const major = (0, version_1.parseAdcpMajorVersion)(bundleKey);
|
|
@@ -116,6 +128,7 @@ const DETAILED_SKIP_DETAILS = {
|
|
|
116
128
|
rate_abuse_opt_out: 'Rate-abuse vector was excluded by request_signing.skipRateAbuse.',
|
|
117
129
|
capability_profile_mismatch: 'Vector is outside the agent capability profile selected for this run.',
|
|
118
130
|
transport_ungradable: 'Vector cannot be graded faithfully by the selected transport.',
|
|
131
|
+
rate_limit_not_triggered: 'No RATE_LIMITED response was observed within the configured max_attempts.',
|
|
119
132
|
};
|
|
120
133
|
function selectionForProbeSkip(reason, detail) {
|
|
121
134
|
switch (reason) {
|
|
@@ -735,6 +748,7 @@ function filterResponseHeaders(headers) {
|
|
|
735
748
|
*/
|
|
736
749
|
async function runStoryboard(agentUrlOrUrls, storyboard, options = {}) {
|
|
737
750
|
options = applyStoryboardVersionOptions(storyboard, options);
|
|
751
|
+
registerRunSchemaRoot(options);
|
|
738
752
|
(0, test_kit_1.validateTestKit)(options.test_kit);
|
|
739
753
|
// Enforce authoring-time branch_set invariants regardless of how the
|
|
740
754
|
// storyboard reached us. YAML callers already ran these rules in
|
|
@@ -901,6 +915,10 @@ function buildCapabilityUnsupportedResult(agentUrls, storyboard, detail) {
|
|
|
901
915
|
],
|
|
902
916
|
context: {},
|
|
903
917
|
total_duration_ms: 0,
|
|
918
|
+
// This synthetic phase is an applicability gate, not a real passed
|
|
919
|
+
// scenario. `overall_passed: true` preserves non-failing CI semantics,
|
|
920
|
+
// while passed_count stays 0 so rollups do not report unexecuted
|
|
921
|
+
// storyboards as successful coverage.
|
|
904
922
|
passed_count: 0,
|
|
905
923
|
failed_count: 0,
|
|
906
924
|
skipped_count: 1,
|
|
@@ -978,6 +996,56 @@ function buildRequirementUnmetResult(agentUrls, storyboard, requirement, detail)
|
|
|
978
996
|
],
|
|
979
997
|
context: {},
|
|
980
998
|
total_duration_ms: 0,
|
|
999
|
+
// `required_any_of_tools` unmet is an applicability skip. Keep
|
|
1000
|
+
// `overall_passed: true` for CI/non-failing semantics, but do not
|
|
1001
|
+
// increment passed_count because no scenario behavior was exercised.
|
|
1002
|
+
passed_count: 0,
|
|
1003
|
+
failed_count: 0,
|
|
1004
|
+
skipped_count: 1,
|
|
1005
|
+
tested_at: new Date().toISOString(),
|
|
1006
|
+
strict_validation_summary: {
|
|
1007
|
+
observable: false,
|
|
1008
|
+
checked: 0,
|
|
1009
|
+
passed: 0,
|
|
1010
|
+
failed: 0,
|
|
1011
|
+
strict_only_failures: 0,
|
|
1012
|
+
lenient_also_failed: 0,
|
|
1013
|
+
},
|
|
1014
|
+
notices: [],
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
function buildRequiredAnyOfToolsMissingResult(agentUrls, storyboard, detail) {
|
|
1018
|
+
const syntheticStep = {
|
|
1019
|
+
storyboard_id: storyboard.id,
|
|
1020
|
+
step_id: 'missing_required_tool_family',
|
|
1021
|
+
phase_id: 'requirement_unmet',
|
|
1022
|
+
title: 'Storyboard skipped: required tool family missing',
|
|
1023
|
+
task: '',
|
|
1024
|
+
passed: true,
|
|
1025
|
+
skipped: true,
|
|
1026
|
+
skip_reason: 'requirement_unmet',
|
|
1027
|
+
skip: { reason: 'requirement_unmet', detail },
|
|
1028
|
+
duration_ms: 0,
|
|
1029
|
+
validations: [],
|
|
1030
|
+
context: {},
|
|
1031
|
+
extraction: { path: 'none' },
|
|
1032
|
+
};
|
|
1033
|
+
return {
|
|
1034
|
+
storyboard_id: storyboard.id,
|
|
1035
|
+
storyboard_title: storyboard.title,
|
|
1036
|
+
agent_url: agentUrls[0],
|
|
1037
|
+
overall_passed: true,
|
|
1038
|
+
phases: [
|
|
1039
|
+
{
|
|
1040
|
+
phase_id: 'requirement_unmet',
|
|
1041
|
+
phase_title: 'Requirement unmet: required_any_of_tools',
|
|
1042
|
+
passed: true,
|
|
1043
|
+
steps: [syntheticStep],
|
|
1044
|
+
duration_ms: 0,
|
|
1045
|
+
},
|
|
1046
|
+
],
|
|
1047
|
+
context: {},
|
|
1048
|
+
total_duration_ms: 0,
|
|
981
1049
|
passed_count: 0,
|
|
982
1050
|
failed_count: 0,
|
|
983
1051
|
skipped_count: 1,
|
|
@@ -993,6 +1061,22 @@ function buildRequirementUnmetResult(agentUrls, storyboard, requirement, detail)
|
|
|
993
1061
|
notices: [],
|
|
994
1062
|
};
|
|
995
1063
|
}
|
|
1064
|
+
function normalizeAgentToolNames(tools) {
|
|
1065
|
+
if (!Array.isArray(tools))
|
|
1066
|
+
return undefined;
|
|
1067
|
+
const names = [];
|
|
1068
|
+
for (const tool of tools) {
|
|
1069
|
+
if (typeof tool === 'string') {
|
|
1070
|
+
names.push(tool);
|
|
1071
|
+
}
|
|
1072
|
+
else if (tool && typeof tool === 'object') {
|
|
1073
|
+
const name = tool.name;
|
|
1074
|
+
if (typeof name === 'string')
|
|
1075
|
+
names.push(name);
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
return names.length > 0 ? names : undefined;
|
|
1079
|
+
}
|
|
996
1080
|
/**
|
|
997
1081
|
* Resolve a storyboard's `requires:` tags against the runtime environment.
|
|
998
1082
|
* Returns the first unmet requirement (with a human-readable detail) or
|
|
@@ -1409,7 +1493,7 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1409
1493
|
// passes the gate when any tenant in the map serves either one.
|
|
1410
1494
|
const unionedTools = new Set();
|
|
1411
1495
|
for (const p of routingContext.profiles.values()) {
|
|
1412
|
-
for (const t of p.tools ?? [])
|
|
1496
|
+
for (const t of normalizeAgentToolNames(p.tools) ?? [])
|
|
1413
1497
|
unionedTools.add(t);
|
|
1414
1498
|
}
|
|
1415
1499
|
if (!options.agentTools) {
|
|
@@ -1455,8 +1539,9 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1455
1539
|
// Populate agentTools and _profile from discovered profile if not already set.
|
|
1456
1540
|
// _profile is threaded into executeStep so capability-based skip gates
|
|
1457
1541
|
// (e.g. account-mode branching) can read raw_capabilities at step time.
|
|
1458
|
-
|
|
1459
|
-
|
|
1542
|
+
const profileTools = normalizeAgentToolNames(profile?.tools);
|
|
1543
|
+
if (!options.agentTools && profileTools) {
|
|
1544
|
+
options = { ...options, agentTools: profileTools, _profile: profile };
|
|
1460
1545
|
}
|
|
1461
1546
|
else if (profile && !options._profile) {
|
|
1462
1547
|
options = { ...options, _profile: profile };
|
|
@@ -1464,6 +1549,25 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1464
1549
|
}
|
|
1465
1550
|
else {
|
|
1466
1551
|
profile = options._profile;
|
|
1552
|
+
const profileTools = normalizeAgentToolNames(profile?.tools);
|
|
1553
|
+
if (!options.agentTools && profileTools) {
|
|
1554
|
+
options = { ...options, agentTools: profileTools, _profile: profile };
|
|
1555
|
+
}
|
|
1556
|
+
else if (!options.agentTools &&
|
|
1557
|
+
typeof clients[0]?.getAgentInfo === 'function') {
|
|
1558
|
+
const discovered = await (0, client_1.getOrDiscoverProfile)(clients[0], options);
|
|
1559
|
+
if (discovered.step.passed === false) {
|
|
1560
|
+
return buildDiscoveryFailedResult(agentUrls, storyboard, discovered.step);
|
|
1561
|
+
}
|
|
1562
|
+
profile = discovered.profile;
|
|
1563
|
+
const discoveredTools = normalizeAgentToolNames(profile?.tools);
|
|
1564
|
+
if (discoveredTools) {
|
|
1565
|
+
options = { ...options, agentTools: discoveredTools, _profile: profile };
|
|
1566
|
+
}
|
|
1567
|
+
else if (profile && !options._profile) {
|
|
1568
|
+
options = { ...options, _profile: profile };
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1467
1571
|
}
|
|
1468
1572
|
}
|
|
1469
1573
|
// Evaluate `requires` tags before any phase setup. The runner detects
|
|
@@ -1502,6 +1606,20 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1502
1606
|
};
|
|
1503
1607
|
}
|
|
1504
1608
|
}
|
|
1609
|
+
if (storyboard.required_any_of_tools?.length && options.agentTools) {
|
|
1610
|
+
const agentTools = new Set(options.agentTools);
|
|
1611
|
+
const missing = storyboard.required_any_of_tools.find(family => !family.tools.some(tool => agentTools.has(tool)));
|
|
1612
|
+
if (missing) {
|
|
1613
|
+
const detail = `missing_required_tool_family: needs ${missing.tools.join(' or ')}` +
|
|
1614
|
+
(missing.rationale ? ` (${missing.rationale})` : '');
|
|
1615
|
+
if (!callerOwnsClients)
|
|
1616
|
+
await (0, protocols_1.closeConnections)(options.protocol);
|
|
1617
|
+
return {
|
|
1618
|
+
...buildRequiredAnyOfToolsMissingResult(agentUrls, storyboard, detail),
|
|
1619
|
+
notices: preflightNotices,
|
|
1620
|
+
};
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1505
1623
|
// Evaluate requires_capability predicate before any phase setup.
|
|
1506
1624
|
// When the agent explicitly declared it doesn't support what this storyboard
|
|
1507
1625
|
// tests (e.g. `adcp.idempotency.supported: false`), skip the whole storyboard
|
|
@@ -1527,12 +1645,11 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
1527
1645
|
// advertises none of them, skip the whole storyboard instead of producing
|
|
1528
1646
|
// misleading per-step failures.
|
|
1529
1647
|
//
|
|
1530
|
-
// Gate condition: `options.agentTools` is
|
|
1531
|
-
// `
|
|
1532
|
-
//
|
|
1533
|
-
//
|
|
1534
|
-
// `
|
|
1535
|
-
// in the standard runner flow.
|
|
1648
|
+
// Gate condition: `options.agentTools` is populated from discovery or
|
|
1649
|
+
// `_profile.tools` before this point, including reused-client callers when
|
|
1650
|
+
// discovery is available. If a direct `_client` caller supplies neither
|
|
1651
|
+
// `agentTools` nor a discoverable profile, this gate remains a no-op and
|
|
1652
|
+
// step-level `requires_tool` checks carry the compatibility signal.
|
|
1536
1653
|
if (storyboard.required_tools?.length && options.agentTools) {
|
|
1537
1654
|
const hasAnyRequired = storyboard.required_tools.some(t => options.agentTools.includes(t));
|
|
1538
1655
|
if (!hasAnyRequired) {
|
|
@@ -2725,7 +2842,9 @@ function summarizeStrictValidation(phases) {
|
|
|
2725
2842
|
* Context is passed in and returned, enabling step-by-step orchestration.
|
|
2726
2843
|
*/
|
|
2727
2844
|
async function runStoryboardStep(agentUrl, storyboard, stepId, options = {}) {
|
|
2845
|
+
(0, loader_1.validateStoryboardShape)(storyboard);
|
|
2728
2846
|
options = applyStoryboardVersionOptions(storyboard, options);
|
|
2847
|
+
registerRunSchemaRoot(options);
|
|
2729
2848
|
(0, test_kit_1.validateTestKit)(options.test_kit);
|
|
2730
2849
|
const clientResolution = (0, client_1.getOrCreateClientResolution)(agentUrl, options);
|
|
2731
2850
|
const client = clientResolution.client;
|
|
@@ -2817,7 +2936,7 @@ client, step, phaseId, context, allSteps, options, state) {
|
|
|
2817
2936
|
};
|
|
2818
2937
|
// HTTP probe tasks bypass the MCP client entirely.
|
|
2819
2938
|
if (probes_1.PROBE_TASKS.has(step.task)) {
|
|
2820
|
-
return executeProbeStep(step, phaseId, context, allSteps, options, runState);
|
|
2939
|
+
return executeProbeStep(client, step, phaseId, context, allSteps, options, runState);
|
|
2821
2940
|
}
|
|
2822
2941
|
// Webhook-assertion pseudo-tasks observe the shared receiver instead of
|
|
2823
2942
|
// driving the agent. They never reach the MCP/A2A transport.
|
|
@@ -3436,10 +3555,11 @@ client, step, phaseId, context, allSteps, options, state) {
|
|
|
3436
3555
|
// synchronously. Adopters who don't advertise the scenario short-
|
|
3437
3556
|
// circuit to a single `advertised: false` marker and every
|
|
3438
3557
|
// upstream_traffic check on the step grades not_applicable.
|
|
3439
|
-
const upstreamTraffic = await prefetchUpstreamTraffic(step.id, resolvedValidations, client, options, runState, requestStartIso);
|
|
3558
|
+
const upstreamTraffic = await prefetchUpstreamTraffic(step.id, resolvedValidations, client, options, runState, requestStartIso, requestRecord.payload, step.sample_request);
|
|
3440
3559
|
const vctx = {
|
|
3441
3560
|
taskName: effectiveStep.task,
|
|
3442
3561
|
...(options.adcpVersion && { adcpVersion: options.adcpVersion }),
|
|
3562
|
+
...(options._serverAdcpVersion && { responseAdcpVersion: options._serverAdcpVersion }),
|
|
3443
3563
|
...(taskResult && { taskResult }),
|
|
3444
3564
|
...(httpResult && { httpResult }),
|
|
3445
3565
|
agentUrl: runState.agentUrl,
|
|
@@ -3761,10 +3881,13 @@ client, step, phaseId, context, allSteps, options, state) {
|
|
|
3761
3881
|
// ────────────────────────────────────────────────────────────
|
|
3762
3882
|
// Probe dispatch (raw HTTP tasks)
|
|
3763
3883
|
// ────────────────────────────────────────────────────────────
|
|
3764
|
-
async function executeProbeStep(
|
|
3884
|
+
async function executeProbeStep(
|
|
3885
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- client type varies (TestClient)
|
|
3886
|
+
client, step, phaseId, context, allSteps, options, runState) {
|
|
3765
3887
|
const start = Date.now();
|
|
3766
3888
|
let httpResult;
|
|
3767
3889
|
const probeOpts = { allowPrivateIp: options.allow_http === true };
|
|
3890
|
+
let requestRecordOverride;
|
|
3768
3891
|
if (step.requires_contract) {
|
|
3769
3892
|
const contracts = new Set(options.contracts ?? []);
|
|
3770
3893
|
if (!contracts.has(step.requires_contract)) {
|
|
@@ -3815,33 +3938,116 @@ async function executeProbeStep(step, phaseId, context, allSteps, options, runSt
|
|
|
3815
3938
|
httpResult = assertJwksPurpose(runState.priorProbes.get('fetch_brand_jwks'), 'webhook-signing');
|
|
3816
3939
|
}
|
|
3817
3940
|
else if (step.task === 'expect_rate_limit_not_replayed') {
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3941
|
+
const specError = (0, rate_limit_trip_1.validateRateLimitTripSpec)(step.rate_limit_trip);
|
|
3942
|
+
if (specError) {
|
|
3943
|
+
httpResult = {
|
|
3944
|
+
url: runState.agentUrl,
|
|
3945
|
+
status: 0,
|
|
3946
|
+
headers: {},
|
|
3947
|
+
body: { attempts: 0, error: 'rate_limit_trip_misconfigured' },
|
|
3948
|
+
error: specError,
|
|
3949
|
+
};
|
|
3950
|
+
}
|
|
3951
|
+
else {
|
|
3952
|
+
const rateLimitTrip = step.rate_limit_trip;
|
|
3953
|
+
const targetStep = {
|
|
3954
|
+
...step,
|
|
3955
|
+
task: rateLimitTrip.trip_target_task,
|
|
3956
|
+
sample_request: rateLimitTrip.trip_target_sample_request,
|
|
3957
|
+
omit_idempotency_key: true,
|
|
3958
|
+
};
|
|
3959
|
+
const resolvedTargetRequest = buildEffectiveStepRequest(targetStep, context, options, runState);
|
|
3960
|
+
const unresolvedVars = findUnresolvedContextVars(resolvedTargetRequest);
|
|
3961
|
+
if (unresolvedVars.length > 0 && !targetStep.expect_error) {
|
|
3962
|
+
const next = getNextStepPreview(step.id, allSteps, context, runState.runnerVars);
|
|
3963
|
+
const detail = `Skipped: unresolved context variables from rate_limit_trip.trip_target_sample_request: ${unresolvedVars
|
|
3964
|
+
.map(v => v.key)
|
|
3965
|
+
.join(', ')}.`;
|
|
3966
|
+
return {
|
|
3967
|
+
step_id: step.id,
|
|
3968
|
+
phase_id: phaseId,
|
|
3969
|
+
title: step.title,
|
|
3970
|
+
task: step.task,
|
|
3971
|
+
passed: false,
|
|
3972
|
+
skipped: true,
|
|
3973
|
+
skip_reason: 'prerequisite_failed',
|
|
3974
|
+
skip: buildSkip('prerequisite_failed', detail),
|
|
3975
|
+
duration_ms: Date.now() - start,
|
|
3976
|
+
validations: [],
|
|
3977
|
+
context,
|
|
3978
|
+
next,
|
|
3979
|
+
extraction: { path: 'none' },
|
|
3980
|
+
error: detail,
|
|
3981
|
+
};
|
|
3982
|
+
}
|
|
3983
|
+
const advertisedTools = resolveAdvertisedTools(options);
|
|
3984
|
+
if (advertisedTools && !advertisedTools.includes(rateLimitTrip.trip_target_task)) {
|
|
3985
|
+
const next = getNextStepPreview(step.id, allSteps, context, runState.runnerVars);
|
|
3986
|
+
const detail = `Agent did not advertise tool "${rateLimitTrip.trip_target_task}"; agent tools: [${advertisedTools.join(', ')}].`;
|
|
3987
|
+
return {
|
|
3988
|
+
step_id: step.id,
|
|
3989
|
+
phase_id: phaseId,
|
|
3990
|
+
title: step.title,
|
|
3991
|
+
task: step.task,
|
|
3992
|
+
passed: true,
|
|
3993
|
+
skipped: true,
|
|
3994
|
+
skip_reason: 'missing_tool',
|
|
3995
|
+
skip: buildSkip('missing_tool', detail),
|
|
3996
|
+
duration_ms: Date.now() - start,
|
|
3997
|
+
validations: [],
|
|
3998
|
+
context,
|
|
3999
|
+
next,
|
|
4000
|
+
extraction: { path: 'none' },
|
|
4001
|
+
};
|
|
4002
|
+
}
|
|
4003
|
+
const resolvedSpec = {
|
|
4004
|
+
...rateLimitTrip,
|
|
4005
|
+
trip_target_sample_request: resolvedTargetRequest,
|
|
4006
|
+
};
|
|
4007
|
+
const targetTransport = options.protocol === 'a2a' ? 'a2a' : 'mcp';
|
|
4008
|
+
const observer = new rate_limit_trip_1.RateLimitTripObserver(client, {
|
|
4009
|
+
keyMinter: idempotency_1.generateIdempotencyKey,
|
|
4010
|
+
correlationPrefix: step.id,
|
|
4011
|
+
transport: targetTransport,
|
|
4012
|
+
});
|
|
4013
|
+
const observation = await observer.run(resolvedSpec);
|
|
4014
|
+
httpResult = rateLimitTripObservationToProbeResult(runState.agentUrl, observation);
|
|
4015
|
+
const observedRequest = observation.body.replay_request ?? observation.body.trip_request ?? resolvedTargetRequest;
|
|
4016
|
+
requestRecordOverride = {
|
|
4017
|
+
transport: targetTransport,
|
|
4018
|
+
operation: rateLimitTrip.trip_target_task,
|
|
4019
|
+
payload: (0, redact_secrets_1.redactSecrets)(observedRequest),
|
|
4020
|
+
...(runState.agentUrl ? { url: runState.agentUrl } : {}),
|
|
4021
|
+
};
|
|
4022
|
+
}
|
|
3825
4023
|
}
|
|
3826
4024
|
if (httpResult)
|
|
3827
4025
|
runState.priorProbes.set(step.task, httpResult);
|
|
3828
4026
|
const duration = Date.now() - start;
|
|
3829
|
-
const requestRecord = {
|
|
4027
|
+
const requestRecord = requestRecordOverride ?? {
|
|
3830
4028
|
transport: 'http',
|
|
3831
4029
|
operation: step.task,
|
|
3832
4030
|
payload: null,
|
|
3833
4031
|
...(httpResult?.url ? { url: httpResult.url } : runState.agentUrl ? { url: runState.agentUrl } : {}),
|
|
3834
4032
|
};
|
|
3835
4033
|
const filteredProbeHeaders = filterResponseHeaders(httpResult?.headers);
|
|
4034
|
+
const responseTransport = requestRecordOverride?.transport ?? 'http';
|
|
3836
4035
|
const responseRecord = httpResult
|
|
3837
4036
|
? {
|
|
3838
|
-
transport:
|
|
4037
|
+
transport: responseTransport,
|
|
3839
4038
|
payload: (0, redact_secrets_1.redactSecrets)(httpResult.body),
|
|
3840
|
-
status: httpResult.status,
|
|
4039
|
+
...(responseTransport === 'http' && { status: httpResult.status }),
|
|
3841
4040
|
...(filteredProbeHeaders && { headers: filteredProbeHeaders }),
|
|
3842
4041
|
duration_ms: duration,
|
|
3843
4042
|
}
|
|
3844
4043
|
: undefined;
|
|
4044
|
+
const redactedHttpResult = httpResult
|
|
4045
|
+
? {
|
|
4046
|
+
...httpResult,
|
|
4047
|
+
body: (0, redact_secrets_1.redactSecrets)(httpResult.body),
|
|
4048
|
+
...(responseTransport !== 'http' && { status: undefined }),
|
|
4049
|
+
}
|
|
4050
|
+
: undefined;
|
|
3845
4051
|
// Probe may self-skip (request_signing_probe uses this for operator opt-outs
|
|
3846
4052
|
// and capability-profile mismatches). Surface as a skipped step without
|
|
3847
4053
|
// running validations — skip ≠ fail. The detailed reason goes on
|
|
@@ -3863,7 +4069,7 @@ async function executeProbeStep(step, phaseId, context, allSteps, options, runSt
|
|
|
3863
4069
|
skip: { reason: canonicalReason, detail },
|
|
3864
4070
|
...(selectionResult && { selection_result: selectionResult }),
|
|
3865
4071
|
duration_ms: duration,
|
|
3866
|
-
response:
|
|
4072
|
+
response: redactedHttpResult,
|
|
3867
4073
|
validations: [],
|
|
3868
4074
|
context,
|
|
3869
4075
|
next: getNextStepPreview(step.id, allSteps, context, runState.runnerVars),
|
|
@@ -3875,7 +4081,8 @@ async function executeProbeStep(step, phaseId, context, allSteps, options, runSt
|
|
|
3875
4081
|
const vctx = {
|
|
3876
4082
|
taskName: step.task,
|
|
3877
4083
|
...(options.adcpVersion && { adcpVersion: options.adcpVersion }),
|
|
3878
|
-
|
|
4084
|
+
...(options._serverAdcpVersion && { responseAdcpVersion: options._serverAdcpVersion }),
|
|
4085
|
+
httpResult: redactedHttpResult,
|
|
3879
4086
|
agentUrl: runState.agentUrl,
|
|
3880
4087
|
contributions: runState.contributions,
|
|
3881
4088
|
request: requestRecord,
|
|
@@ -3901,7 +4108,7 @@ async function executeProbeStep(step, phaseId, context, allSteps, options, runSt
|
|
|
3901
4108
|
task: step.task,
|
|
3902
4109
|
passed,
|
|
3903
4110
|
duration_ms: duration,
|
|
3904
|
-
response:
|
|
4111
|
+
response: redactedHttpResult ?? undefined,
|
|
3905
4112
|
validations,
|
|
3906
4113
|
context,
|
|
3907
4114
|
error: httpResult?.error ?? (passed ? undefined : 'Probe validations failed.'),
|
|
@@ -3911,6 +4118,63 @@ async function executeProbeStep(step, phaseId, context, allSteps, options, runSt
|
|
|
3911
4118
|
extraction,
|
|
3912
4119
|
};
|
|
3913
4120
|
}
|
|
4121
|
+
function buildEffectiveStepRequest(step, context, options, runState) {
|
|
4122
|
+
let request;
|
|
4123
|
+
if (options.request) {
|
|
4124
|
+
request = { ...options.request };
|
|
4125
|
+
}
|
|
4126
|
+
else if (step.expect_error && step.sample_request) {
|
|
4127
|
+
request = (0, context_1.injectContext)({ ...step.sample_request }, context, runState.runnerVars);
|
|
4128
|
+
}
|
|
4129
|
+
else if ((0, request_builder_1.hasRequestEnricher)(step.task)) {
|
|
4130
|
+
request = (0, request_builder_1.enrichRequest)(step, context, options, runState.runnerVars);
|
|
4131
|
+
}
|
|
4132
|
+
else if (step.sample_request) {
|
|
4133
|
+
request = (0, context_1.injectContext)({ ...step.sample_request }, context, runState.runnerVars);
|
|
4134
|
+
}
|
|
4135
|
+
else {
|
|
4136
|
+
request = {};
|
|
4137
|
+
}
|
|
4138
|
+
if (step.context_inputs?.length) {
|
|
4139
|
+
request = (0, context_1.applyContextInputs)(request, step.context_inputs, context);
|
|
4140
|
+
}
|
|
4141
|
+
request = applyBrandInvariant(request, options, step.task, { omit_account: step.omit_account });
|
|
4142
|
+
if (options.disable_sandbox === true) {
|
|
4143
|
+
request = applyDisableSandboxHint(request, step.task);
|
|
4144
|
+
}
|
|
4145
|
+
return applyIdempotencyInvariant(request, step.task, step);
|
|
4146
|
+
}
|
|
4147
|
+
function resolveAdvertisedTools(options) {
|
|
4148
|
+
return options.agentTools ?? normalizeAgentToolNames(options._profile?.tools);
|
|
4149
|
+
}
|
|
4150
|
+
function rateLimitTripObservationToProbeResult(agentUrl, observation) {
|
|
4151
|
+
if (observation.status === 'not_applicable') {
|
|
4152
|
+
return {
|
|
4153
|
+
url: agentUrl,
|
|
4154
|
+
status: 0,
|
|
4155
|
+
headers: {},
|
|
4156
|
+
body: observation.body,
|
|
4157
|
+
skipped: true,
|
|
4158
|
+
skip_reason: observation.skip_reason,
|
|
4159
|
+
error: observation.message,
|
|
4160
|
+
};
|
|
4161
|
+
}
|
|
4162
|
+
if (observation.status === 'failed') {
|
|
4163
|
+
return {
|
|
4164
|
+
url: agentUrl,
|
|
4165
|
+
status: 0,
|
|
4166
|
+
headers: {},
|
|
4167
|
+
body: { ...observation.body, error: observation.error },
|
|
4168
|
+
error: observation.message,
|
|
4169
|
+
};
|
|
4170
|
+
}
|
|
4171
|
+
return {
|
|
4172
|
+
url: agentUrl,
|
|
4173
|
+
status: 200,
|
|
4174
|
+
headers: {},
|
|
4175
|
+
body: observation.body,
|
|
4176
|
+
};
|
|
4177
|
+
}
|
|
3914
4178
|
async function probeBrandJwks(rawCapabilities, options) {
|
|
3915
4179
|
const brandJsonUrl = (0, capabilities_types_1.readBrandJsonUrl)(rawCapabilities);
|
|
3916
4180
|
if (!brandJsonUrl) {
|
|
@@ -4455,10 +4719,13 @@ function truncateError(error) {
|
|
|
4455
4719
|
* controller does not advertise `query_upstream_traffic` (every check
|
|
4456
4720
|
* grades not_applicable per the spec's adopter-opt-in rule).
|
|
4457
4721
|
*/
|
|
4458
|
-
async function prefetchUpstreamTraffic(stepId, resolvedValidations, client, options, runState, requestStartIso) {
|
|
4722
|
+
async function prefetchUpstreamTraffic(stepId, resolvedValidations, client, options, runState, requestStartIso, requestPayload, sampleRequest) {
|
|
4459
4723
|
const upstreamChecks = resolvedValidations.filter(v => v.check === 'upstream_traffic');
|
|
4460
4724
|
if (upstreamChecks.length === 0)
|
|
4461
4725
|
return undefined;
|
|
4726
|
+
if (upstreamChecks.some(check => (check.identifier_paths ?? []).some(path => (0, path_1.validatePortableIdentifierPath)(path)))) {
|
|
4727
|
+
return undefined;
|
|
4728
|
+
}
|
|
4462
4729
|
const advertised = options._controllerCapabilities?.detected === true &&
|
|
4463
4730
|
options._controllerCapabilities.scenarios.includes('query_upstream_traffic');
|
|
4464
4731
|
if (!advertised) {
|
|
@@ -4492,6 +4759,11 @@ async function prefetchUpstreamTraffic(stepId, resolvedValidations, client, opti
|
|
|
4492
4759
|
}
|
|
4493
4760
|
}
|
|
4494
4761
|
const queries = new Map();
|
|
4762
|
+
const identifierDigestCollection = collectUpstreamIdentifierDigests(upstreamChecks, requestPayload, sampleRequest);
|
|
4763
|
+
const identifierDigestByValue = identifierDigestCollection.digests;
|
|
4764
|
+
const identifier_value_digests = [...identifierDigestByValue.values()];
|
|
4765
|
+
const requiresRawAttestation = upstreamChecks.some(check => check.attestation_mode_required === 'raw' || (check.payload_must_contain?.length ?? 0) > 0);
|
|
4766
|
+
const requestedAttestationMode = !requiresRawAttestation && identifier_value_digests.length > 0 ? 'digest' : 'raw';
|
|
4495
4767
|
for (const sinceTs of sinceTimestamps) {
|
|
4496
4768
|
// Per spec PR adcp#3816: runners SHOULD subtract a clock-skew tolerance
|
|
4497
4769
|
// (50ms minimum, 250ms recommended) before sending the bound to the
|
|
@@ -4499,7 +4771,12 @@ async function prefetchUpstreamTraffic(stepId, resolvedValidations, client, opti
|
|
|
4499
4771
|
// runner's clock measurement isn't silently excluded. We use 250ms (the
|
|
4500
4772
|
// spec's recommended value).
|
|
4501
4773
|
const adjustedSince = new Date(new Date(sinceTs).getTime() - 250).toISOString();
|
|
4502
|
-
const params = {
|
|
4774
|
+
const params = {
|
|
4775
|
+
since_timestamp: adjustedSince,
|
|
4776
|
+
limit: 100,
|
|
4777
|
+
attestation_mode: requestedAttestationMode,
|
|
4778
|
+
...(identifier_value_digests.length > 0 ? { identifier_value_digests } : {}),
|
|
4779
|
+
};
|
|
4503
4780
|
const requestRecord = {
|
|
4504
4781
|
transport: options.protocol === 'a2a' ? 'a2a' : 'mcp',
|
|
4505
4782
|
operation: 'comply_test_controller',
|
|
@@ -4518,7 +4795,8 @@ async function prefetchUpstreamTraffic(stepId, resolvedValidations, client, opti
|
|
|
4518
4795
|
const message = errResult.error_detail
|
|
4519
4796
|
? `${errResult.error ?? 'controller_error'}: ${errResult.error_detail}`
|
|
4520
4797
|
: (errResult.error ?? 'controller returned a non-success response');
|
|
4521
|
-
|
|
4798
|
+
const errorKind = extractControllerErrorKind(errResult);
|
|
4799
|
+
payload = { error: message, ...(errorKind ? { error_kind: errorKind } : {}) };
|
|
4522
4800
|
}
|
|
4523
4801
|
}
|
|
4524
4802
|
catch (err) {
|
|
@@ -4535,10 +4813,65 @@ async function prefetchUpstreamTraffic(stepId, resolvedValidations, client, opti
|
|
|
4535
4813
|
advertised: true,
|
|
4536
4814
|
queries,
|
|
4537
4815
|
thisStepSince: requestStartIso,
|
|
4816
|
+
...(identifierDigestByValue.size > 0 ? { identifierDigestByValue } : {}),
|
|
4817
|
+
...(identifierDigestCollection.clipped > 0
|
|
4818
|
+
? {
|
|
4819
|
+
identifierDigestLimitExceeded: {
|
|
4820
|
+
limit: identifierDigestCollection.limit,
|
|
4821
|
+
clipped: identifierDigestCollection.clipped,
|
|
4822
|
+
},
|
|
4823
|
+
}
|
|
4824
|
+
: {}),
|
|
4538
4825
|
...(priorStepSinceMap.size > 0 ? { priorStepSinceMap } : {}),
|
|
4539
4826
|
...(unresolvedSinceRefs.size > 0 ? { unresolvedSinceRefs } : {}),
|
|
4540
4827
|
};
|
|
4541
4828
|
}
|
|
4829
|
+
function extractControllerErrorKind(result) {
|
|
4830
|
+
return readErrorKind(result.context) ?? readErrorKind(result.ext);
|
|
4831
|
+
}
|
|
4832
|
+
function readErrorKind(value) {
|
|
4833
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
4834
|
+
return undefined;
|
|
4835
|
+
const record = value;
|
|
4836
|
+
if (typeof record.error_kind === 'string' && record.error_kind.length > 0)
|
|
4837
|
+
return record.error_kind;
|
|
4838
|
+
if (typeof record.kind === 'string' && record.kind.length > 0)
|
|
4839
|
+
return record.kind;
|
|
4840
|
+
return undefined;
|
|
4841
|
+
}
|
|
4842
|
+
function collectUpstreamIdentifierDigests(validations, requestPayload, sampleRequest) {
|
|
4843
|
+
const digests = new Map();
|
|
4844
|
+
let clipped = 0;
|
|
4845
|
+
const sample = requestPayload && typeof requestPayload === 'object' && !Array.isArray(requestPayload)
|
|
4846
|
+
? requestPayload
|
|
4847
|
+
: sampleRequest;
|
|
4848
|
+
if (!sample)
|
|
4849
|
+
return { digests, limit: constants_1.IDENTIFIER_DIGEST_LIMIT, clipped };
|
|
4850
|
+
const clippedVectors = new Set();
|
|
4851
|
+
for (const validation of validations) {
|
|
4852
|
+
for (const path of validation.identifier_paths ?? []) {
|
|
4853
|
+
const vectors = (0, path_1.resolvePortableIdentifierPathAll)(sample, path);
|
|
4854
|
+
for (const vector of vectors) {
|
|
4855
|
+
if (typeof vector !== 'string')
|
|
4856
|
+
continue;
|
|
4857
|
+
if (digests.has(vector))
|
|
4858
|
+
continue;
|
|
4859
|
+
if (digests.size >= constants_1.IDENTIFIER_DIGEST_LIMIT) {
|
|
4860
|
+
if (!clippedVectors.has(vector)) {
|
|
4861
|
+
clippedVectors.add(vector);
|
|
4862
|
+
clipped++;
|
|
4863
|
+
}
|
|
4864
|
+
continue;
|
|
4865
|
+
}
|
|
4866
|
+
digests.set(vector, sha256Hex(vector));
|
|
4867
|
+
}
|
|
4868
|
+
}
|
|
4869
|
+
}
|
|
4870
|
+
return { digests, limit: constants_1.IDENTIFIER_DIGEST_LIMIT, clipped };
|
|
4871
|
+
}
|
|
4872
|
+
function sha256Hex(value) {
|
|
4873
|
+
return (0, node_crypto_1.createHash)('sha256').update(value, 'utf8').digest('hex');
|
|
4874
|
+
}
|
|
4542
4875
|
/**
|
|
4543
4876
|
* Find any "$context.xxx" strings that weren't resolved during injection.
|
|
4544
4877
|
* Returns one entry per occurrence with both the bare key (for legacy
|