@adcp/sdk 17.0.0-beta.21 → 17.0.0-beta.23
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 +26 -2
- package/dist/lib/adapters/version/index.d.mts +1 -1
- package/dist/lib/adapters/version/index.d.ts +1 -1
- package/dist/lib/adapters/version/index.js +2 -0
- package/dist/lib/adapters/version/index.mjs +2 -0
- package/dist/lib/adapters/version/negotiate.d.mts +13 -0
- package/dist/lib/adapters/version/negotiate.d.ts +13 -0
- package/dist/lib/adapters/version/negotiate.js +6 -0
- package/dist/lib/adapters/version/negotiate.mjs +5 -0
- package/dist/lib/client/core.d.mts +4 -0
- package/dist/lib/client/core.d.ts +4 -0
- package/dist/lib/client/core.js +13 -0
- package/dist/lib/client/core.mjs +12 -0
- package/dist/lib/conformance/property-lists.d.mts +1 -1
- package/dist/lib/conformance/property-lists.d.ts +1 -1
- package/dist/lib/conformance/property-lists.js +1 -1
- package/dist/lib/conformance/property-lists.mjs +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +23 -1
- package/dist/lib/core/SingleAgentClient.d.ts +23 -1
- package/dist/lib/core/SingleAgentClient.js +102 -18
- package/dist/lib/core/SingleAgentClient.mjs +108 -18
- package/dist/lib/core/targeting-helpers.d.mts +123 -0
- package/dist/lib/core/targeting-helpers.d.ts +123 -0
- package/dist/lib/core/targeting-helpers.js +412 -0
- package/dist/lib/core/targeting-helpers.mjs +370 -0
- package/dist/lib/entrypoints/client-account-changes.d.mts +5 -0
- package/dist/lib/entrypoints/client-account-changes.d.ts +5 -0
- package/dist/lib/entrypoints/client-account-changes.js +28 -0
- package/dist/lib/entrypoints/client-account-changes.mjs +4 -0
- package/dist/lib/entrypoints/client-webhook-stores.d.mts +2 -0
- package/dist/lib/entrypoints/client-webhook-stores.d.ts +2 -0
- package/dist/lib/entrypoints/client-webhook-stores.js +37 -0
- package/dist/lib/entrypoints/client-webhook-stores.mjs +16 -0
- package/dist/lib/entrypoints/discovery.d.mts +9 -0
- package/dist/lib/entrypoints/discovery.d.ts +9 -0
- package/dist/lib/entrypoints/discovery.js +72 -0
- package/dist/lib/entrypoints/discovery.mjs +56 -0
- package/dist/lib/entrypoints/errors.d.mts +11 -0
- package/dist/lib/entrypoints/errors.d.ts +11 -0
- package/dist/lib/entrypoints/errors.js +159 -0
- package/dist/lib/entrypoints/errors.mjs +132 -0
- package/dist/lib/entrypoints/media-buy.d.mts +5 -0
- package/dist/lib/entrypoints/media-buy.d.ts +5 -0
- package/dist/lib/entrypoints/media-buy.js +119 -0
- package/dist/lib/entrypoints/media-buy.mjs +100 -0
- package/dist/lib/entrypoints/registry.d.mts +5 -0
- package/dist/lib/entrypoints/registry.d.ts +5 -0
- package/dist/lib/entrypoints/registry.js +61 -0
- package/dist/lib/entrypoints/registry.mjs +40 -0
- package/dist/lib/entrypoints/utils.d.mts +7 -0
- package/dist/lib/entrypoints/utils.d.ts +7 -0
- package/dist/lib/entrypoints/utils.js +100 -0
- package/dist/lib/entrypoints/utils.mjs +72 -0
- package/dist/lib/entrypoints/version.d.mts +3 -0
- package/dist/lib/entrypoints/version.d.ts +3 -0
- package/dist/lib/entrypoints/version.js +57 -0
- package/dist/lib/entrypoints/version.mjs +36 -0
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/media-buy/action-contracts.js +3 -3
- package/dist/lib/media-buy/action-contracts.mjs +1 -1
- package/dist/lib/media-buy/creative-start-policy.d.mts +19 -0
- package/dist/lib/media-buy/creative-start-policy.d.ts +19 -0
- package/dist/lib/media-buy/creative-start-policy.js +59 -0
- package/dist/lib/media-buy/creative-start-policy.mjs +31 -0
- package/dist/lib/media-buy/valid-actions.d.mts +47 -0
- package/dist/lib/media-buy/valid-actions.d.ts +47 -0
- package/dist/lib/media-buy/valid-actions.js +42 -0
- package/dist/lib/media-buy/valid-actions.mjs +18 -0
- package/dist/lib/net/pin-and-bind-fetch.d.mts +121 -0
- package/dist/lib/net/pin-and-bind-fetch.d.ts +121 -0
- package/dist/lib/net/pin-and-bind-fetch.js +209 -0
- package/dist/lib/net/pin-and-bind-fetch.mjs +183 -0
- package/dist/lib/protocols/mcp-modern.js +20 -4
- package/dist/lib/protocols/mcp-modern.mjs +20 -4
- package/dist/lib/registry/types.generated.d.ts +224 -3
- package/dist/lib/reporting/ledger/index.d.mts +1 -0
- package/dist/lib/reporting/ledger/index.d.ts +1 -0
- package/dist/lib/reporting/ledger/index.js +3 -1
- package/dist/lib/reporting/ledger/index.mjs +1 -0
- package/dist/lib/reporting/ledger/instant.d.mts +5 -0
- package/dist/lib/reporting/ledger/instant.d.ts +5 -0
- package/dist/lib/reporting/ledger/instant.js +10 -0
- package/dist/lib/reporting/ledger/instant.mjs +9 -0
- package/dist/lib/reporting/ledger/issue-events.d.mts +333 -0
- package/dist/lib/reporting/ledger/issue-events.d.ts +333 -0
- package/dist/lib/reporting/ledger/issue-events.js +310 -0
- package/dist/lib/reporting/ledger/issue-events.mjs +282 -0
- package/dist/lib/reporting/service/index.d.mts +36 -1
- package/dist/lib/reporting/service/index.d.ts +36 -1
- package/dist/lib/reporting/service/index.js +51 -1
- package/dist/lib/reporting/service/index.mjs +52 -2
- package/dist/lib/reporting/service/scheduler-support.d.mts +1 -1
- package/dist/lib/reporting/service/scheduler-support.d.ts +1 -1
- package/dist/lib/reporting/service/scheduler-support.js +1 -1
- package/dist/lib/reporting/service/scheduler-support.mjs +1 -1
- package/dist/lib/server/capabilities-release-projection.d.mts +43 -0
- package/dist/lib/server/capabilities-release-projection.d.ts +43 -0
- package/dist/lib/server/capabilities-release-projection.js +128 -0
- package/dist/lib/server/capabilities-release-projection.mjs +112 -0
- package/dist/lib/server/create-adcp-server.d.mts +29 -5
- package/dist/lib/server/create-adcp-server.d.ts +29 -5
- package/dist/lib/server/create-adcp-server.js +97 -24
- package/dist/lib/server/create-adcp-server.mjs +108 -23
- package/dist/lib/server/decisioning/capabilities.d.mts +27 -0
- package/dist/lib/server/decisioning/capabilities.d.ts +27 -0
- package/dist/lib/server/decisioning/runtime/from-platform.js +99 -27
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +103 -27
- package/dist/lib/server/declared-input-schema.d.mts +108 -0
- package/dist/lib/server/declared-input-schema.d.ts +108 -0
- package/dist/lib/server/declared-input-schema.js +167 -0
- package/dist/lib/server/declared-input-schema.mjs +137 -0
- package/dist/lib/server/envelope-allowlist.d.mts +1 -105
- package/dist/lib/server/envelope-allowlist.d.ts +1 -105
- package/dist/lib/server/envelope-allowlist.js +3 -79
- package/dist/lib/server/envelope-allowlist.mjs +1 -71
- package/dist/lib/server/errors.d.mts +1 -186
- package/dist/lib/server/errors.d.ts +1 -186
- package/dist/lib/server/errors.js +3 -98
- package/dist/lib/server/errors.mjs +1 -94
- package/dist/lib/server/index.d.mts +1 -1
- package/dist/lib/server/index.d.ts +1 -1
- package/dist/lib/server/mcp-modern-server.js +21 -4
- package/dist/lib/server/mcp-modern-server.mjs +21 -4
- package/dist/lib/server/media-buy-action-resolver.d.mts +7 -0
- package/dist/lib/server/media-buy-action-resolver.d.ts +7 -0
- package/dist/lib/server/media-buy-action-resolver.js +10 -1
- package/dist/lib/server/media-buy-action-resolver.mjs +10 -1
- package/dist/lib/server/media-buy-helpers.d.mts +1 -47
- package/dist/lib/server/media-buy-helpers.d.ts +1 -47
- package/dist/lib/server/media-buy-helpers.js +3 -23
- package/dist/lib/server/media-buy-helpers.mjs +1 -18
- package/dist/lib/server/pick-safe-details.d.mts +1 -89
- package/dist/lib/server/pick-safe-details.d.ts +1 -89
- package/dist/lib/server/pick-safe-details.js +3 -61
- package/dist/lib/server/pick-safe-details.mjs +1 -56
- package/dist/lib/server/pin-and-bind-fetch.d.mts +1 -121
- package/dist/lib/server/pin-and-bind-fetch.d.ts +1 -121
- package/dist/lib/server/pin-and-bind-fetch.js +3 -190
- package/dist/lib/server/pin-and-bind-fetch.mjs +1 -183
- package/dist/lib/server/targeting-helpers.d.mts +1 -123
- package/dist/lib/server/targeting-helpers.d.ts +1 -123
- package/dist/lib/server/targeting-helpers.js +3 -393
- package/dist/lib/server/targeting-helpers.mjs +1 -370
- package/dist/lib/server/test-controller.js +7 -3
- package/dist/lib/server/test-controller.mjs +7 -3
- package/dist/lib/storage/memory-ledger.js +219 -1
- package/dist/lib/storage/memory-ledger.mjs +223 -1
- package/dist/lib/testing/client.js +26 -5
- package/dist/lib/testing/client.mjs +24 -5
- package/dist/lib/testing/compliance/storyboard-tracks.js +0 -4
- package/dist/lib/testing/compliance/storyboard-tracks.mjs +0 -4
- package/dist/lib/testing/comply-controller.js +7 -2
- package/dist/lib/testing/comply-controller.mjs +7 -2
- package/dist/lib/testing/storyboard/request-signing/grader.d.mts +21 -0
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts +21 -0
- package/dist/lib/testing/storyboard/request-signing/grader.js +31 -0
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +30 -0
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js +1 -1
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs +2 -1
- package/dist/lib/testing/storyboard/request-signing/types.d.mts +12 -0
- package/dist/lib/testing/storyboard/request-signing/types.d.ts +12 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +7 -2
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +7 -2
- package/dist/lib/testing/storyboard/runner.js +4 -4
- package/dist/lib/testing/storyboard/runner.mjs +4 -4
- package/dist/lib/testing/storyboard/task-map.js +4 -1
- package/dist/lib/testing/storyboard/task-map.mjs +4 -1
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/utils/adcp-error-response.d.mts +196 -0
- package/dist/lib/utils/adcp-error-response.d.ts +196 -0
- package/dist/lib/utils/adcp-error-response.js +118 -0
- package/dist/lib/utils/adcp-error-response.mjs +95 -0
- package/dist/lib/utils/buyer-retry-policy.js +2 -2
- package/dist/lib/utils/buyer-retry-policy.mjs +1 -1
- package/dist/lib/utils/capabilities.d.mts +6 -0
- package/dist/lib/utils/capabilities.d.ts +6 -0
- package/dist/lib/utils/capabilities.js +6 -2
- package/dist/lib/utils/capabilities.mjs +6 -2
- package/dist/lib/utils/envelope-allowlist.d.mts +105 -0
- package/dist/lib/utils/envelope-allowlist.d.ts +105 -0
- package/dist/lib/utils/envelope-allowlist.js +98 -0
- package/dist/lib/utils/envelope-allowlist.mjs +71 -0
- package/dist/lib/utils/pick-safe-details.d.mts +89 -0
- package/dist/lib/utils/pick-safe-details.d.ts +89 -0
- package/dist/lib/utils/pick-safe-details.js +80 -0
- package/dist/lib/utils/pick-safe-details.mjs +56 -0
- package/dist/lib/v2/projection/augment-response.d.mts +4 -0
- package/dist/lib/v2/projection/augment-response.d.ts +4 -0
- package/dist/lib/v2/projection/creative-delivery.d.mts +20 -3
- package/dist/lib/v2/projection/creative-delivery.d.ts +20 -3
- package/dist/lib/v2/projection/creative-delivery.js +20 -4
- package/dist/lib/v2/projection/creative-delivery.mjs +19 -4
- package/dist/lib/v2/projection/index.d.mts +2 -2
- package/dist/lib/v2/projection/index.d.ts +2 -2
- package/dist/lib/v2/projection/index.js +4 -0
- package/dist/lib/v2/projection/index.mjs +5 -1
- package/dist/lib/v2/projection/legacy-metadata.d.mts +7 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts +7 -0
- package/dist/lib/v2/projection/legacy-metadata.js +14 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs +12 -0
- package/dist/lib/v2/projection/legacy-routes.d.mts +11 -0
- package/dist/lib/v2/projection/legacy-routes.d.ts +11 -0
- package/dist/lib/v2/projection/legacy-routes.js +2 -1
- package/dist/lib/v2/projection/legacy-routes.mjs +7 -2
- package/dist/lib/v2/projection/v1-to-v2.d.mts +21 -1
- package/dist/lib/v2/projection/v1-to-v2.d.ts +21 -1
- package/dist/lib/v2/projection/v1-to-v2.js +18 -11
- package/dist/lib/v2/projection/v1-to-v2.mjs +19 -11
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/CREATIVE-DELIVERY.md +12 -0
- package/docs/guides/REPORTING-LEDGER.md +121 -0
- package/docs/guides/VALIDATE-YOUR-AGENT.md +1 -0
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-16-to-17.md +149 -0
- package/docs/migration-reporting-storage-package.md +10 -0
- package/package.json +106 -1
|
@@ -9,6 +9,7 @@ import { parseCapabilitiesResponse, looksLikeV3Capabilities } from "../utils/cap
|
|
|
9
9
|
import { classifyProbeUrl } from "../utils/probe-policy.mjs";
|
|
10
10
|
import { SsrfRefusedError } from "../net/ssrf-fetch.mjs";
|
|
11
11
|
import { ADCP_VERSION, toReleasePrecisionVersion } from "../version.mjs";
|
|
12
|
+
import { capabilityDiscoveryEnvelope } from "../adapters/version/negotiate.mjs";
|
|
12
13
|
import { normalizeTransportOptions } from "../protocols/index.mjs";
|
|
13
14
|
import { createHmac, hkdfSync, randomBytes } from "node:crypto";
|
|
14
15
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -163,7 +164,7 @@ function createTestClient(agentUrl, protocol = "mcp", options = {}) {
|
|
|
163
164
|
protocol,
|
|
164
165
|
adcpVersion: multiClient.getAdcpVersion(),
|
|
165
166
|
...options.wireAdcpVersion !== void 0 && { wireAdcpVersion: options.wireAdcpVersion },
|
|
166
|
-
versionEnvelope: options.versionEnvelope
|
|
167
|
+
...options.versionEnvelope !== void 0 && { versionEnvelope: options.versionEnvelope },
|
|
167
168
|
strictResponseSchemaValidation: options.strictResponseSchemaValidation !== false,
|
|
168
169
|
...authMode !== void 0 && { authMode },
|
|
169
170
|
...requestScopeMode !== void 0 && { requestScopeMode },
|
|
@@ -219,8 +220,10 @@ function testClientMatchesVersionOptions(client, agentUrl, options) {
|
|
|
219
220
|
}
|
|
220
221
|
const expectedAdcpVersion = effectiveOptions.adcpVersion ?? ADCP_VERSION;
|
|
221
222
|
const expectedWireAdcpVersion = effectiveOptions.wireAdcpVersion;
|
|
222
|
-
|
|
223
|
-
|
|
223
|
+
return meta.agentUrl === agentUrl && meta.protocol === (effectiveOptions.protocol ?? "mcp") && meta.adcpVersion === expectedAdcpVersion && meta.wireAdcpVersion === expectedWireAdcpVersion && // Unset and `auto` put the same envelope on ordinary calls and authored
|
|
224
|
+
// storyboard steps; they differ only in the reused client's own preview
|
|
225
|
+
// discovery probe, which follows that client's config.
|
|
226
|
+
(meta.versionEnvelope ?? "auto") === (effectiveOptions.versionEnvelope ?? "auto") && meta.strictResponseSchemaValidation === (effectiveOptions.strictResponseSchemaValidation !== false) && meta.authMode === expectedAuthMode && meta.requestScopeMode === expectedRequestScopeMode && meta.requestSigningMode === expectedRequestSigningMode && meta.oauthStorage === expectedOAuthStorage && meta.connectionPartition === expectedTransport?.connectionPartition && meta.connectionReuse === expectedTransport?.connectionReuse && meta.fetchFn === expectedTransport?.trustedFetchFn && meta.allowPrivateIp === expectedTransport?.allowPrivateIp && meta.maxResponseBytes === expectedTransport?.maxResponseBytes && meta.requestTimeoutMs === expectedTransport?.requestTimeoutMs && meta.legacyCompatEnabled === expectedTransport?.legacyCompat?.enabled;
|
|
224
227
|
}
|
|
225
228
|
function withTestKitAuthDefaults(options) {
|
|
226
229
|
if (options.auth) return options;
|
|
@@ -443,11 +446,22 @@ async function runStep(stepName, taskName, fn) {
|
|
|
443
446
|
}
|
|
444
447
|
function testClientWireAdcpVersion(client, fallbackVersion) {
|
|
445
448
|
const meta = client?.[TEST_CLIENT_VERSION_OPTIONS];
|
|
446
|
-
if (meta && meta.versionEnvelope !== "auto") return void 0;
|
|
449
|
+
if (meta && (meta.versionEnvelope ?? "auto") !== "auto") return void 0;
|
|
447
450
|
const getAdcpVersion = client?.getAdcpVersion;
|
|
448
451
|
const pinned = meta?.wireAdcpVersion ?? meta?.adcpVersion ?? (typeof getAdcpVersion === "function" ? getAdcpVersion.call(client) : void 0) ?? fallbackVersion;
|
|
449
452
|
return pinned === void 0 ? void 0 : toReleasePrecisionVersion(pinned);
|
|
450
453
|
}
|
|
454
|
+
function storyboardCapabilityStepEnvelope(client) {
|
|
455
|
+
const meta = client?.[TEST_CLIENT_VERSION_OPTIONS];
|
|
456
|
+
return meta && meta.versionEnvelope === void 0 ? "auto" : void 0;
|
|
457
|
+
}
|
|
458
|
+
function testClientDiscoveryWireAdcpVersion(client, fallbackVersion) {
|
|
459
|
+
const meta = client?.[TEST_CLIENT_VERSION_OPTIONS];
|
|
460
|
+
if (meta && capabilityDiscoveryEnvelope(meta.versionEnvelope, meta.wireAdcpVersion ?? meta.adcpVersion) === "none") {
|
|
461
|
+
return void 0;
|
|
462
|
+
}
|
|
463
|
+
return testClientWireAdcpVersion(client, fallbackVersion);
|
|
464
|
+
}
|
|
451
465
|
function describeVersionUnsupported(result, requestedVersion) {
|
|
452
466
|
if (!result || typeof result !== "object") return void 0;
|
|
453
467
|
const record = result;
|
|
@@ -544,7 +558,10 @@ async function discoverAgentProfile(client, signal, schemaAdcpVersion) {
|
|
|
544
558
|
};
|
|
545
559
|
const adcpError = caps.adcpError ?? caps.adcp_error;
|
|
546
560
|
if (adcpError) step.adcp_error = redactDiscoveryEvidence(adcpError);
|
|
547
|
-
const versionUnsupported = describeVersionUnsupported(
|
|
561
|
+
const versionUnsupported = describeVersionUnsupported(
|
|
562
|
+
caps,
|
|
563
|
+
testClientDiscoveryWireAdcpVersion(client, schemaAdcpVersion)
|
|
564
|
+
);
|
|
548
565
|
if (versionUnsupported) {
|
|
549
566
|
profile.capabilities_probe_error = versionUnsupported;
|
|
550
567
|
step.passed = false;
|
|
@@ -935,6 +952,8 @@ export {
|
|
|
935
952
|
seedAuthRejectedTestClientProfile,
|
|
936
953
|
seedTestClientSigningCapability,
|
|
937
954
|
setAgentTesterLogger,
|
|
955
|
+
storyboardCapabilityStepEnvelope,
|
|
956
|
+
testClientDiscoveryWireAdcpVersion,
|
|
938
957
|
testClientWireAdcpVersion,
|
|
939
958
|
validateResponseSchema,
|
|
940
959
|
withTestClientScope
|
|
@@ -199,9 +199,6 @@ function computeTrackStatus(results) {
|
|
|
199
199
|
const totalSteps = totalPassed + totalFailed + totalSkipped;
|
|
200
200
|
const hasAssertionFailure = results.some((result) => collectDetachedAssertionFailures(result).length > 0);
|
|
201
201
|
const stepsOf = (result) => (result.passes?.flatMap((pass) => pass.phases) ?? result.phases).flatMap((phase) => phase.steps);
|
|
202
|
-
const hasFixtureUnavailable = results.some(
|
|
203
|
-
(result) => stepsOf(result).some((step) => step.skip?.reason === "fixture_unavailable")
|
|
204
|
-
);
|
|
205
202
|
const hasUnverifiedSigningCoverage = results.some((result) => (0, import_runner.signingCoverageUnverified)(stepsOf(result)));
|
|
206
203
|
if (totalSteps === 0) return "skip";
|
|
207
204
|
if (totalFailed > 0) return totalPassed === 0 ? "fail" : "partial";
|
|
@@ -209,7 +206,6 @@ function computeTrackStatus(results) {
|
|
|
209
206
|
if (hasUnverifiedSigningCoverage) return "partial";
|
|
210
207
|
if (totalSteps === totalSkipped) return "skip";
|
|
211
208
|
if (results.some((result) => !result.overall_passed)) return "partial";
|
|
212
|
-
if (hasFixtureUnavailable) return "partial";
|
|
213
209
|
const observationRecords = results.flatMap((r) => r.assertions ?? []).filter((a) => typeof a.observation_count === "number");
|
|
214
210
|
if (observationRecords.length > 0 && observationRecords.every((a) => a.observation_count === 0)) {
|
|
215
211
|
return "silent";
|
|
@@ -174,9 +174,6 @@ function computeTrackStatus(results) {
|
|
|
174
174
|
const totalSteps = totalPassed + totalFailed + totalSkipped;
|
|
175
175
|
const hasAssertionFailure = results.some((result) => collectDetachedAssertionFailures(result).length > 0);
|
|
176
176
|
const stepsOf = (result) => (result.passes?.flatMap((pass) => pass.phases) ?? result.phases).flatMap((phase) => phase.steps);
|
|
177
|
-
const hasFixtureUnavailable = results.some(
|
|
178
|
-
(result) => stepsOf(result).some((step) => step.skip?.reason === "fixture_unavailable")
|
|
179
|
-
);
|
|
180
177
|
const hasUnverifiedSigningCoverage = results.some((result) => signingCoverageUnverified(stepsOf(result)));
|
|
181
178
|
if (totalSteps === 0) return "skip";
|
|
182
179
|
if (totalFailed > 0) return totalPassed === 0 ? "fail" : "partial";
|
|
@@ -184,7 +181,6 @@ function computeTrackStatus(results) {
|
|
|
184
181
|
if (hasUnverifiedSigningCoverage) return "partial";
|
|
185
182
|
if (totalSteps === totalSkipped) return "skip";
|
|
186
183
|
if (results.some((result) => !result.overall_passed)) return "partial";
|
|
187
|
-
if (hasFixtureUnavailable) return "partial";
|
|
188
184
|
const observationRecords = results.flatMap((r) => r.assertions ?? []).filter((a) => typeof a.observation_count === "number");
|
|
189
185
|
if (observationRecords.length > 0 && observationRecords.every((a) => a.observation_count === 0)) {
|
|
190
186
|
return "silent";
|
|
@@ -24,6 +24,7 @@ __export(comply_controller_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(comply_controller_exports);
|
|
25
25
|
var import_test_controller = require('../server/test-controller.js');
|
|
26
26
|
var import_adcp_server = require('../server/adcp-server.js');
|
|
27
|
+
var import_declared_input_schema = require('../server/declared-input-schema.js');
|
|
27
28
|
function controllerError(code, detail) {
|
|
28
29
|
return { status: "failed", success: false, error: code, error_detail: detail };
|
|
29
30
|
}
|
|
@@ -254,14 +255,18 @@ function createComplyController(config) {
|
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
257
|
const mcp = (0, import_adcp_server.getSdkServer)(server) ?? server;
|
|
257
|
-
mcp.registerTool(
|
|
258
|
+
const registered = mcp.registerTool(
|
|
258
259
|
toolDefinition.name,
|
|
259
260
|
{
|
|
260
261
|
description: toolDefinition.description,
|
|
261
262
|
inputSchema: toolDefinition.inputSchema
|
|
262
263
|
},
|
|
263
|
-
(async (
|
|
264
|
+
(async (rawInput) => {
|
|
265
|
+
const parsed = await (0, import_declared_input_schema.parseDeclaredToolInput)(mcp, toolDefinition.name, rawInput);
|
|
266
|
+
return parsed.success ? handle(parsed.data) : parsed.response;
|
|
267
|
+
})
|
|
264
268
|
);
|
|
269
|
+
(0, import_declared_input_schema.validateToolInputAtAdcpLayer)(mcp, toolDefinition.name, registered);
|
|
265
270
|
}
|
|
266
271
|
const controller = { toolDefinition, handleRaw, handle, register };
|
|
267
272
|
resolvedContextHandlers.set(controller, handleRawWithResolvedAuthority);
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
RESET_STATE_SCENARIO
|
|
10
10
|
} from "../server/test-controller.mjs";
|
|
11
11
|
import { getSdkServer } from "../server/adcp-server.mjs";
|
|
12
|
+
import { parseDeclaredToolInput, validateToolInputAtAdcpLayer } from "../server/declared-input-schema.mjs";
|
|
12
13
|
function controllerError(code, detail) {
|
|
13
14
|
return { status: "failed", success: false, error: code, error_detail: detail };
|
|
14
15
|
}
|
|
@@ -239,14 +240,18 @@ function createComplyController(config) {
|
|
|
239
240
|
}
|
|
240
241
|
}
|
|
241
242
|
const mcp = getSdkServer(server) ?? server;
|
|
242
|
-
mcp.registerTool(
|
|
243
|
+
const registered = mcp.registerTool(
|
|
243
244
|
toolDefinition.name,
|
|
244
245
|
{
|
|
245
246
|
description: toolDefinition.description,
|
|
246
247
|
inputSchema: toolDefinition.inputSchema
|
|
247
248
|
},
|
|
248
|
-
(async (
|
|
249
|
+
(async (rawInput) => {
|
|
250
|
+
const parsed = await parseDeclaredToolInput(mcp, toolDefinition.name, rawInput);
|
|
251
|
+
return parsed.success ? handle(parsed.data) : parsed.response;
|
|
252
|
+
})
|
|
249
253
|
);
|
|
254
|
+
validateToolInputAtAdcpLayer(mcp, toolDefinition.name, registered);
|
|
250
255
|
}
|
|
251
256
|
const controller = { toolDefinition, handleRaw, handle, register };
|
|
252
257
|
resolvedContextHandlers.set(controller, handleRawWithResolvedAuthority);
|
|
@@ -105,6 +105,13 @@ export interface GradeOptions extends LoadVectorsOptions {
|
|
|
105
105
|
* provided (its own `protocol_methods_required_for` governs).
|
|
106
106
|
*/
|
|
107
107
|
agentProtocolMethodsRequiredFor?: readonly string[];
|
|
108
|
+
/**
|
|
109
|
+
* The agent's `get_adcp_capabilities` response, used to evaluate a vector's
|
|
110
|
+
* `applies_when` condition (adcp#8064). A vector whose condition does not
|
|
111
|
+
* hold skips as `capability_profile_mismatch`. Without this option,
|
|
112
|
+
* conditional vectors are graded.
|
|
113
|
+
*/
|
|
114
|
+
agentCapabilities?: Record<string, unknown>;
|
|
108
115
|
/**
|
|
109
116
|
* Transport shape the agent speaks. `'mcp'` (default) wraps each
|
|
110
117
|
* vector body in a JSON-RPC `tools/call` envelope and POSTs to the MCP
|
|
@@ -316,6 +323,20 @@ export declare function advertisedContentDigestPolicyExclusion(vector: PositiveV
|
|
|
316
323
|
* 001 unchanged.
|
|
317
324
|
*/
|
|
318
325
|
export declare function advertisedRequiredForExclusion(vector: PositiveVector | NegativeVector, kind: 'positive' | 'negative', agentRequiredFor: readonly string[]): SemanticVectorExclusion | undefined;
|
|
326
|
+
/**
|
|
327
|
+
* Evaluate a vector's `applies_when` condition (adcp#8064) against the agent's
|
|
328
|
+
* advertised `get_adcp_capabilities` response. A vector whose condition does
|
|
329
|
+
* not hold tests a path the agent does not offer, so it skips as
|
|
330
|
+
* `capability_profile_mismatch` instead of failing. Vector 027 uses this:
|
|
331
|
+
* condition (b) of `request_signature_required` applies only while
|
|
332
|
+
* `webhook_signing.legacy_hmac_fallback` is `true`, and an absent
|
|
333
|
+
* `webhook_signing` block does not satisfy it.
|
|
334
|
+
*
|
|
335
|
+
* Supported form: a dotted capability path compared with `==` or `!=` to a
|
|
336
|
+
* JSON scalar. Without capabilities, or with any other expression, the vector
|
|
337
|
+
* stays graded, so a condition the grader cannot read never hides a failure.
|
|
338
|
+
*/
|
|
339
|
+
export declare function appliesWhenExclusion(vector: PositiveVector | NegativeVector, agentCapabilities: unknown): SemanticVectorExclusion | undefined;
|
|
319
340
|
/**
|
|
320
341
|
* The `protocol_methods_required_for` slice of `capabilityMismatch`
|
|
321
342
|
* (adcp#4326 namespace): negative vectors that grade a JSON-RPC protocol
|
|
@@ -105,6 +105,13 @@ export interface GradeOptions extends LoadVectorsOptions {
|
|
|
105
105
|
* provided (its own `protocol_methods_required_for` governs).
|
|
106
106
|
*/
|
|
107
107
|
agentProtocolMethodsRequiredFor?: readonly string[];
|
|
108
|
+
/**
|
|
109
|
+
* The agent's `get_adcp_capabilities` response, used to evaluate a vector's
|
|
110
|
+
* `applies_when` condition (adcp#8064). A vector whose condition does not
|
|
111
|
+
* hold skips as `capability_profile_mismatch`. Without this option,
|
|
112
|
+
* conditional vectors are graded.
|
|
113
|
+
*/
|
|
114
|
+
agentCapabilities?: Record<string, unknown>;
|
|
108
115
|
/**
|
|
109
116
|
* Transport shape the agent speaks. `'mcp'` (default) wraps each
|
|
110
117
|
* vector body in a JSON-RPC `tools/call` envelope and POSTs to the MCP
|
|
@@ -316,6 +323,20 @@ export declare function advertisedContentDigestPolicyExclusion(vector: PositiveV
|
|
|
316
323
|
* 001 unchanged.
|
|
317
324
|
*/
|
|
318
325
|
export declare function advertisedRequiredForExclusion(vector: PositiveVector | NegativeVector, kind: 'positive' | 'negative', agentRequiredFor: readonly string[]): SemanticVectorExclusion | undefined;
|
|
326
|
+
/**
|
|
327
|
+
* Evaluate a vector's `applies_when` condition (adcp#8064) against the agent's
|
|
328
|
+
* advertised `get_adcp_capabilities` response. A vector whose condition does
|
|
329
|
+
* not hold tests a path the agent does not offer, so it skips as
|
|
330
|
+
* `capability_profile_mismatch` instead of failing. Vector 027 uses this:
|
|
331
|
+
* condition (b) of `request_signature_required` applies only while
|
|
332
|
+
* `webhook_signing.legacy_hmac_fallback` is `true`, and an absent
|
|
333
|
+
* `webhook_signing` block does not satisfy it.
|
|
334
|
+
*
|
|
335
|
+
* Supported form: a dotted capability path compared with `==` or `!=` to a
|
|
336
|
+
* JSON scalar. Without capabilities, or with any other expression, the vector
|
|
337
|
+
* stays graded, so a condition the grader cannot read never hides a failure.
|
|
338
|
+
*/
|
|
339
|
+
export declare function appliesWhenExclusion(vector: PositiveVector | NegativeVector, agentCapabilities: unknown): SemanticVectorExclusion | undefined;
|
|
319
340
|
/**
|
|
320
341
|
* The `protocol_methods_required_for` slice of `capabilityMismatch`
|
|
321
342
|
* (adcp#4326 namespace): negative vectors that grade a JSON-RPC protocol
|
|
@@ -20,6 +20,7 @@ var grader_exports = {};
|
|
|
20
20
|
__export(grader_exports, {
|
|
21
21
|
advertisedContentDigestPolicyExclusion: () => advertisedContentDigestPolicyExclusion,
|
|
22
22
|
advertisedRequiredForExclusion: () => advertisedRequiredForExclusion,
|
|
23
|
+
appliesWhenExclusion: () => appliesWhenExclusion,
|
|
23
24
|
gradeOneVector: () => gradeOneVector,
|
|
24
25
|
gradeRequestSigning: () => gradeRequestSigning,
|
|
25
26
|
protocolMethodCoverageMismatch: () => protocolMethodCoverageMismatch,
|
|
@@ -224,6 +225,10 @@ function preflightSkip(vector, kind, contract, options, agentUrl) {
|
|
|
224
225
|
};
|
|
225
226
|
}
|
|
226
227
|
}
|
|
228
|
+
const appliesWhen = appliesWhenExclusion(vector, options.agentCapabilities);
|
|
229
|
+
if (appliesWhen) {
|
|
230
|
+
return { ...base, skipped: true, skip_reason: appliesWhen.skip_reason, diagnostic: appliesWhen.diagnostic };
|
|
231
|
+
}
|
|
227
232
|
const semantic = semanticVectorExclusion(vector);
|
|
228
233
|
if (semantic) {
|
|
229
234
|
return { ...base, skipped: true, skip_reason: semantic.skip_reason, diagnostic: semantic.diagnostic };
|
|
@@ -660,6 +665,31 @@ function advertisedRequiredForExclusion(vector, kind, agentRequiredFor) {
|
|
|
660
665
|
diagnostic: `Vector asserts required_for includes [${missing.join(", ")}] but the agent declares required_for [${agentRequiredFor.join(", ")}]. The vector tests a rejection path the agent has not opted into; add the operation to request_signing.required_for to grade it.`
|
|
661
666
|
};
|
|
662
667
|
}
|
|
668
|
+
const APPLIES_WHEN_GRAMMAR = /^\s*([A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*)\s*(==|!=)\s*(.+?)\s*$/;
|
|
669
|
+
const capabilityRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
670
|
+
function appliesWhenExclusion(vector, agentCapabilities) {
|
|
671
|
+
const expression = vector.applies_when;
|
|
672
|
+
if (expression === void 0 || !capabilityRecord(agentCapabilities)) return void 0;
|
|
673
|
+
const [, path, operator, literal] = APPLIES_WHEN_GRAMMAR.exec(expression) ?? [];
|
|
674
|
+
if (!path || !operator || !literal) return void 0;
|
|
675
|
+
let expected;
|
|
676
|
+
try {
|
|
677
|
+
expected = JSON.parse(literal);
|
|
678
|
+
} catch {
|
|
679
|
+
return void 0;
|
|
680
|
+
}
|
|
681
|
+
if (typeof expected === "object" && expected !== null) return void 0;
|
|
682
|
+
let actual = agentCapabilities;
|
|
683
|
+
for (const segment of path.split(".")) {
|
|
684
|
+
const descriptor = capabilityRecord(actual) ? Object.getOwnPropertyDescriptor(actual, segment) : void 0;
|
|
685
|
+
actual = descriptor && "value" in descriptor ? descriptor.value : void 0;
|
|
686
|
+
}
|
|
687
|
+
if (actual === expected === (operator === "==")) return void 0;
|
|
688
|
+
return {
|
|
689
|
+
skip_reason: "capability_profile_mismatch",
|
|
690
|
+
diagnostic: `Vector applies only when \`${expression}\`, which the agent's advertised capabilities do not satisfy.`
|
|
691
|
+
};
|
|
692
|
+
}
|
|
663
693
|
function capabilityMismatch(vector, kind, agentCap) {
|
|
664
694
|
const vectorCap = vector.verifier_capability;
|
|
665
695
|
if (vectorCap.supported !== agentCap.supported) {
|
|
@@ -699,6 +729,7 @@ function buildNegativeDiagnostic(vector, probe) {
|
|
|
699
729
|
0 && (module.exports = {
|
|
700
730
|
advertisedContentDigestPolicyExclusion,
|
|
701
731
|
advertisedRequiredForExclusion,
|
|
732
|
+
appliesWhenExclusion,
|
|
702
733
|
gradeOneVector,
|
|
703
734
|
gradeRequestSigning,
|
|
704
735
|
protocolMethodCoverageMismatch,
|
|
@@ -203,6 +203,10 @@ function preflightSkip(vector, kind, contract, options, agentUrl) {
|
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
+
const appliesWhen = appliesWhenExclusion(vector, options.agentCapabilities);
|
|
207
|
+
if (appliesWhen) {
|
|
208
|
+
return { ...base, skipped: true, skip_reason: appliesWhen.skip_reason, diagnostic: appliesWhen.diagnostic };
|
|
209
|
+
}
|
|
206
210
|
const semantic = semanticVectorExclusion(vector);
|
|
207
211
|
if (semantic) {
|
|
208
212
|
return { ...base, skipped: true, skip_reason: semantic.skip_reason, diagnostic: semantic.diagnostic };
|
|
@@ -639,6 +643,31 @@ function advertisedRequiredForExclusion(vector, kind, agentRequiredFor) {
|
|
|
639
643
|
diagnostic: `Vector asserts required_for includes [${missing.join(", ")}] but the agent declares required_for [${agentRequiredFor.join(", ")}]. The vector tests a rejection path the agent has not opted into; add the operation to request_signing.required_for to grade it.`
|
|
640
644
|
};
|
|
641
645
|
}
|
|
646
|
+
const APPLIES_WHEN_GRAMMAR = /^\s*([A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*)\s*(==|!=)\s*(.+?)\s*$/;
|
|
647
|
+
const capabilityRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
648
|
+
function appliesWhenExclusion(vector, agentCapabilities) {
|
|
649
|
+
const expression = vector.applies_when;
|
|
650
|
+
if (expression === void 0 || !capabilityRecord(agentCapabilities)) return void 0;
|
|
651
|
+
const [, path, operator, literal] = APPLIES_WHEN_GRAMMAR.exec(expression) ?? [];
|
|
652
|
+
if (!path || !operator || !literal) return void 0;
|
|
653
|
+
let expected;
|
|
654
|
+
try {
|
|
655
|
+
expected = JSON.parse(literal);
|
|
656
|
+
} catch {
|
|
657
|
+
return void 0;
|
|
658
|
+
}
|
|
659
|
+
if (typeof expected === "object" && expected !== null) return void 0;
|
|
660
|
+
let actual = agentCapabilities;
|
|
661
|
+
for (const segment of path.split(".")) {
|
|
662
|
+
const descriptor = capabilityRecord(actual) ? Object.getOwnPropertyDescriptor(actual, segment) : void 0;
|
|
663
|
+
actual = descriptor && "value" in descriptor ? descriptor.value : void 0;
|
|
664
|
+
}
|
|
665
|
+
if (actual === expected === (operator === "==")) return void 0;
|
|
666
|
+
return {
|
|
667
|
+
skip_reason: "capability_profile_mismatch",
|
|
668
|
+
diagnostic: `Vector applies only when \`${expression}\`, which the agent's advertised capabilities do not satisfy.`
|
|
669
|
+
};
|
|
670
|
+
}
|
|
642
671
|
function capabilityMismatch(vector, kind, agentCap) {
|
|
643
672
|
const vectorCap = vector.verifier_capability;
|
|
644
673
|
if (vectorCap.supported !== agentCap.supported) {
|
|
@@ -677,6 +706,7 @@ function buildNegativeDiagnostic(vector, probe) {
|
|
|
677
706
|
export {
|
|
678
707
|
advertisedContentDigestPolicyExclusion,
|
|
679
708
|
advertisedRequiredForExclusion,
|
|
709
|
+
appliesWhenExclusion,
|
|
680
710
|
gradeOneVector,
|
|
681
711
|
gradeRequestSigning,
|
|
682
712
|
protocolMethodCoverageMismatch,
|
|
@@ -116,7 +116,7 @@ async function probeRequestSigningVector(stepId, agentUrl, options) {
|
|
|
116
116
|
}
|
|
117
117
|
const agentContentDigestPolicy = declaredContentDigestPolicy(options, loaded.sourceDir);
|
|
118
118
|
const agentRequiredFor = declaredRequiredFor(options);
|
|
119
|
-
const semantic = (agentContentDigestPolicy ? (0, import_grader.advertisedContentDigestPolicyExclusion)(vector, parsed.kind, agentContentDigestPolicy) : void 0) ?? (agentRequiredFor ? (0, import_grader.advertisedRequiredForExclusion)(vector, parsed.kind, agentRequiredFor) : void 0) ?? (0, import_grader.semanticVectorExclusion)(vector, declaredProtocolMethodCoverage(options, loaded.sourceDir));
|
|
119
|
+
const semantic = (agentContentDigestPolicy ? (0, import_grader.advertisedContentDigestPolicyExclusion)(vector, parsed.kind, agentContentDigestPolicy) : void 0) ?? (agentRequiredFor ? (0, import_grader.advertisedRequiredForExclusion)(vector, parsed.kind, agentRequiredFor) : void 0) ?? (0, import_grader.appliesWhenExclusion)(vector, options._profile?.raw_capabilities) ?? (0, import_grader.semanticVectorExclusion)(vector, declaredProtocolMethodCoverage(options, loaded.sourceDir));
|
|
120
120
|
if (semantic) {
|
|
121
121
|
return skipProbe(agentUrl, semantic.skip_reason, semantic.diagnostic);
|
|
122
122
|
}
|
|
@@ -2,6 +2,7 @@ import { basename, dirname } from "path";
|
|
|
2
2
|
import {
|
|
3
3
|
advertisedContentDigestPolicyExclusion,
|
|
4
4
|
advertisedRequiredForExclusion,
|
|
5
|
+
appliesWhenExclusion,
|
|
5
6
|
gradeOneVector,
|
|
6
7
|
semanticVectorExclusion
|
|
7
8
|
} from "./grader.mjs";
|
|
@@ -84,7 +85,7 @@ async function probeRequestSigningVector(stepId, agentUrl, options) {
|
|
|
84
85
|
}
|
|
85
86
|
const agentContentDigestPolicy = declaredContentDigestPolicy(options, loaded.sourceDir);
|
|
86
87
|
const agentRequiredFor = declaredRequiredFor(options);
|
|
87
|
-
const semantic = (agentContentDigestPolicy ? advertisedContentDigestPolicyExclusion(vector, parsed.kind, agentContentDigestPolicy) : void 0) ?? (agentRequiredFor ? advertisedRequiredForExclusion(vector, parsed.kind, agentRequiredFor) : void 0) ?? semanticVectorExclusion(vector, declaredProtocolMethodCoverage(options, loaded.sourceDir));
|
|
88
|
+
const semantic = (agentContentDigestPolicy ? advertisedContentDigestPolicyExclusion(vector, parsed.kind, agentContentDigestPolicy) : void 0) ?? (agentRequiredFor ? advertisedRequiredForExclusion(vector, parsed.kind, agentRequiredFor) : void 0) ?? appliesWhenExclusion(vector, options._profile?.raw_capabilities) ?? semanticVectorExclusion(vector, declaredProtocolMethodCoverage(options, loaded.sourceDir));
|
|
88
89
|
if (semantic) {
|
|
89
90
|
return skipProbe(agentUrl, semantic.skip_reason, semantic.diagnostic);
|
|
90
91
|
}
|
|
@@ -48,6 +48,12 @@ export interface PositiveVector {
|
|
|
48
48
|
jwks_override?: JwksOverride;
|
|
49
49
|
expected_signature_base?: string;
|
|
50
50
|
spec_reference?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Capability condition from the authored fixture (adcp#8064), e.g.
|
|
53
|
+
* `webhook_signing.legacy_hmac_fallback == true`. The vector grades only for
|
|
54
|
+
* agents whose `get_adcp_capabilities` response satisfies it.
|
|
55
|
+
*/
|
|
56
|
+
applies_when?: string;
|
|
51
57
|
}
|
|
52
58
|
export interface NegativeVector {
|
|
53
59
|
kind: 'negative';
|
|
@@ -64,6 +70,12 @@ export interface NegativeVector {
|
|
|
64
70
|
expected_failed_step: number | string;
|
|
65
71
|
requires_contract?: ContractId;
|
|
66
72
|
spec_reference?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Capability condition from the authored fixture (adcp#8064), e.g.
|
|
75
|
+
* `webhook_signing.legacy_hmac_fallback == true`. The vector grades only for
|
|
76
|
+
* agents whose `get_adcp_capabilities` response satisfies it.
|
|
77
|
+
*/
|
|
78
|
+
applies_when?: string;
|
|
67
79
|
}
|
|
68
80
|
export type Vector = PositiveVector | NegativeVector;
|
|
69
81
|
/**
|
|
@@ -48,6 +48,12 @@ export interface PositiveVector {
|
|
|
48
48
|
jwks_override?: JwksOverride;
|
|
49
49
|
expected_signature_base?: string;
|
|
50
50
|
spec_reference?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Capability condition from the authored fixture (adcp#8064), e.g.
|
|
53
|
+
* `webhook_signing.legacy_hmac_fallback == true`. The vector grades only for
|
|
54
|
+
* agents whose `get_adcp_capabilities` response satisfies it.
|
|
55
|
+
*/
|
|
56
|
+
applies_when?: string;
|
|
51
57
|
}
|
|
52
58
|
export interface NegativeVector {
|
|
53
59
|
kind: 'negative';
|
|
@@ -64,6 +70,12 @@ export interface NegativeVector {
|
|
|
64
70
|
expected_failed_step: number | string;
|
|
65
71
|
requires_contract?: ContractId;
|
|
66
72
|
spec_reference?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Capability condition from the authored fixture (adcp#8064), e.g.
|
|
75
|
+
* `webhook_signing.legacy_hmac_fallback == true`. The vector grades only for
|
|
76
|
+
* agents whose `get_adcp_capabilities` response satisfies it.
|
|
77
|
+
*/
|
|
78
|
+
applies_when?: string;
|
|
67
79
|
}
|
|
68
80
|
export type Vector = PositiveVector | NegativeVector;
|
|
69
81
|
/**
|
|
@@ -228,7 +228,8 @@ function parsePositive(id, raw) {
|
|
|
228
228
|
jwks_ref,
|
|
229
229
|
jwks_override,
|
|
230
230
|
expected_signature_base: typeof r.expected_signature_base === "string" ? r.expected_signature_base : void 0,
|
|
231
|
-
spec_reference: typeof r.spec_reference === "string" ? r.spec_reference : void 0
|
|
231
|
+
spec_reference: typeof r.spec_reference === "string" ? r.spec_reference : void 0,
|
|
232
|
+
applies_when: optionalAppliesWhen(id, r)
|
|
232
233
|
};
|
|
233
234
|
}
|
|
234
235
|
function parseNegative(id, raw) {
|
|
@@ -265,12 +266,16 @@ function parseNegative(id, raw) {
|
|
|
265
266
|
expected_error_code: errorCode,
|
|
266
267
|
expected_failed_step: failedStep,
|
|
267
268
|
requires_contract: contract,
|
|
268
|
-
spec_reference: typeof r.spec_reference === "string" ? r.spec_reference : void 0
|
|
269
|
+
spec_reference: typeof r.spec_reference === "string" ? r.spec_reference : void 0,
|
|
270
|
+
applies_when: optionalAppliesWhen(id, r)
|
|
269
271
|
};
|
|
270
272
|
}
|
|
271
273
|
function optionalSigningProfileVersion(vector) {
|
|
272
274
|
return typeof vector.signing_profile_version === "string" ? vector.signing_profile_version : "3.1";
|
|
273
275
|
}
|
|
276
|
+
function optionalAppliesWhen(id, vector) {
|
|
277
|
+
return vector.applies_when === void 0 ? void 0 : str(vector.applies_when, `${id}.applies_when`);
|
|
278
|
+
}
|
|
274
279
|
function parseJwksSelector(id, r) {
|
|
275
280
|
const hasRef = r.jwks_ref !== void 0;
|
|
276
281
|
const hasOverride = r.jwks_override !== void 0;
|
|
@@ -201,7 +201,8 @@ function parsePositive(id, raw) {
|
|
|
201
201
|
jwks_ref,
|
|
202
202
|
jwks_override,
|
|
203
203
|
expected_signature_base: typeof r.expected_signature_base === "string" ? r.expected_signature_base : void 0,
|
|
204
|
-
spec_reference: typeof r.spec_reference === "string" ? r.spec_reference : void 0
|
|
204
|
+
spec_reference: typeof r.spec_reference === "string" ? r.spec_reference : void 0,
|
|
205
|
+
applies_when: optionalAppliesWhen(id, r)
|
|
205
206
|
};
|
|
206
207
|
}
|
|
207
208
|
function parseNegative(id, raw) {
|
|
@@ -238,12 +239,16 @@ function parseNegative(id, raw) {
|
|
|
238
239
|
expected_error_code: errorCode,
|
|
239
240
|
expected_failed_step: failedStep,
|
|
240
241
|
requires_contract: contract,
|
|
241
|
-
spec_reference: typeof r.spec_reference === "string" ? r.spec_reference : void 0
|
|
242
|
+
spec_reference: typeof r.spec_reference === "string" ? r.spec_reference : void 0,
|
|
243
|
+
applies_when: optionalAppliesWhen(id, r)
|
|
242
244
|
};
|
|
243
245
|
}
|
|
244
246
|
function optionalSigningProfileVersion(vector) {
|
|
245
247
|
return typeof vector.signing_profile_version === "string" ? vector.signing_profile_version : "3.1";
|
|
246
248
|
}
|
|
249
|
+
function optionalAppliesWhen(id, vector) {
|
|
250
|
+
return vector.applies_when === void 0 ? void 0 : str(vector.applies_when, `${id}.applies_when`);
|
|
251
|
+
}
|
|
247
252
|
function parseJwksSelector(id, r) {
|
|
248
253
|
const hasRef = r.jwks_ref !== void 0;
|
|
249
254
|
const hasOverride = r.jwks_override !== void 0;
|
|
@@ -203,7 +203,7 @@ function applyAdcpVersionRunOptions(defaultAdcpVersion, options) {
|
|
|
203
203
|
if (options.adcpVersion === adcpVersion && options.versionEnvelope === versionEnvelope) {
|
|
204
204
|
return options;
|
|
205
205
|
}
|
|
206
|
-
return { ...options, adcpVersion, versionEnvelope };
|
|
206
|
+
return { ...options, adcpVersion, ...versionEnvelope !== void 0 && { versionEnvelope } };
|
|
207
207
|
}
|
|
208
208
|
function getRunSchemaRoot(options) {
|
|
209
209
|
if (!options.schemaRoot) return void 0;
|
|
@@ -219,7 +219,7 @@ function storyboardVersionEnvelopeMode(adcpVersion) {
|
|
|
219
219
|
const bundleKey = (0, import_schema_loader.resolveBundleKey)(adcpVersion);
|
|
220
220
|
const major = (0, import_version.parseAdcpMajorVersion)(bundleKey);
|
|
221
221
|
if (Number.isFinite(major) && major < 3) return "none";
|
|
222
|
-
return
|
|
222
|
+
return void 0;
|
|
223
223
|
}
|
|
224
224
|
function soleStatefulExemptionDetail(phaseId) {
|
|
225
225
|
return ` Sole stateful step exemption applied for phase '${phaseId}': no peer could have established substitute state, so downstream phases run without cascade (adcp#4053, adcp-client#1146/#1545).`;
|
|
@@ -3432,9 +3432,9 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
3432
3432
|
const cascade = step.stateful ? cascadeForPhase(phase, priorPhaseIds) : { tripped: false };
|
|
3433
3433
|
if (cascade.tripped && step.stateful && routedCapabilityDetail === void 0) {
|
|
3434
3434
|
const resolvedTask = (0, import_agent_routing.resolveTaskName)(step, selectedOptions);
|
|
3435
|
-
const missingTool = selectedOptions.agentTools && (
|
|
3435
|
+
const missingTool = selectedOptions.agentTools && (step.requires_tool && !selectedOptions.agentTools.includes(step.requires_tool) ? step.requires_tool : resolvedTask && !(0, import_runner_owned_task.isRunnerOwnedTask)(resolvedTask) && !selectedOptions.agentTools.includes(resolvedTask) ? resolvedTask : void 0);
|
|
3436
3436
|
if (missingTool) {
|
|
3437
|
-
const missingReason =
|
|
3437
|
+
const missingReason = missingTool === "comply_test_controller" && (routingContext || step.requires_tool === missingTool) ? "missing_test_controller" : "missing_tool";
|
|
3438
3438
|
const toolDetail = `Agent did not advertise tool "${missingTool}"; agent tools: [${selectedOptions.agentTools.join(", ")}].`;
|
|
3439
3439
|
const missingToolResult = {
|
|
3440
3440
|
storyboard_id: storyboard.id,
|
|
@@ -245,7 +245,7 @@ function applyAdcpVersionRunOptions(defaultAdcpVersion, options) {
|
|
|
245
245
|
if (options.adcpVersion === adcpVersion && options.versionEnvelope === versionEnvelope) {
|
|
246
246
|
return options;
|
|
247
247
|
}
|
|
248
|
-
return { ...options, adcpVersion, versionEnvelope };
|
|
248
|
+
return { ...options, adcpVersion, ...versionEnvelope !== void 0 && { versionEnvelope } };
|
|
249
249
|
}
|
|
250
250
|
function getRunSchemaRoot(options) {
|
|
251
251
|
if (!options.schemaRoot) return void 0;
|
|
@@ -261,7 +261,7 @@ function storyboardVersionEnvelopeMode(adcpVersion) {
|
|
|
261
261
|
const bundleKey = resolveBundleKey(adcpVersion);
|
|
262
262
|
const major = parseAdcpMajorVersion(bundleKey);
|
|
263
263
|
if (Number.isFinite(major) && major < 3) return "none";
|
|
264
|
-
return
|
|
264
|
+
return void 0;
|
|
265
265
|
}
|
|
266
266
|
function soleStatefulExemptionDetail(phaseId) {
|
|
267
267
|
return ` Sole stateful step exemption applied for phase '${phaseId}': no peer could have established substitute state, so downstream phases run without cascade (adcp#4053, adcp-client#1146/#1545).`;
|
|
@@ -3474,9 +3474,9 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
|
|
|
3474
3474
|
const cascade = step.stateful ? cascadeForPhase(phase, priorPhaseIds) : { tripped: false };
|
|
3475
3475
|
if (cascade.tripped && step.stateful && routedCapabilityDetail === void 0) {
|
|
3476
3476
|
const resolvedTask = resolveTaskName(step, selectedOptions);
|
|
3477
|
-
const missingTool = selectedOptions.agentTools && (
|
|
3477
|
+
const missingTool = selectedOptions.agentTools && (step.requires_tool && !selectedOptions.agentTools.includes(step.requires_tool) ? step.requires_tool : resolvedTask && !isRunnerOwnedTask(resolvedTask) && !selectedOptions.agentTools.includes(resolvedTask) ? resolvedTask : void 0);
|
|
3478
3478
|
if (missingTool) {
|
|
3479
|
-
const missingReason =
|
|
3479
|
+
const missingReason = missingTool === "comply_test_controller" && (routingContext || step.requires_tool === missingTool) ? "missing_test_controller" : "missing_tool";
|
|
3480
3480
|
const toolDetail = `Agent did not advertise tool "${missingTool}"; agent tools: [${selectedOptions.agentTools.join(", ")}].`;
|
|
3481
3481
|
const missingToolResult = {
|
|
3482
3482
|
storyboard_id: storyboard.id,
|
|
@@ -27,6 +27,7 @@ var import_response_unwrapper = require('../../utils/response-unwrapper.js');
|
|
|
27
27
|
var import_idempotency = require('../../utils/idempotency.js');
|
|
28
28
|
var import_creative_assets = require('./creative-assets.js');
|
|
29
29
|
var import_errors = require('../../errors/index.js');
|
|
30
|
+
var import_client = require('../client.js');
|
|
30
31
|
const TASK_TO_METHOD = {
|
|
31
32
|
// Account & audience
|
|
32
33
|
sync_accounts: "syncAccounts",
|
|
@@ -281,8 +282,10 @@ async function executeStoryboardTask(client, taskName, params, opts = {}) {
|
|
|
281
282
|
])).has(taskName);
|
|
282
283
|
const stableCallParams = compatibilityMethod && compatibilityMutation && !opts.skipIdempotencyAutoInject && typeof callParams.idempotency_key !== "string" ? { ...callParams, idempotency_key: (0, import_idempotency.generateIdempotencyKey)() } : callParams;
|
|
283
284
|
const unguardedPrincipalWrite = taskName === "sync_principal";
|
|
284
|
-
const
|
|
285
|
+
const capabilityStepEnvelope = taskName === "get_adcp_capabilities" ? (0, import_client.storyboardCapabilityStepEnvelope)(client) : void 0;
|
|
286
|
+
const taskOptions = opts.skipIdempotencyAutoInject || opts.skipAccountValidation || opts.skipRequestValidation || opts.preserveGovernedPayload || opts.signal || unguardedPrincipalWrite || capabilityStepEnvelope ? {
|
|
285
287
|
...unguardedPrincipalWrite && { allowDeactivation: true, allowRevocation: true },
|
|
288
|
+
...capabilityStepEnvelope && { versionEnvelope: capabilityStepEnvelope },
|
|
286
289
|
...opts.skipIdempotencyAutoInject && { skipIdempotencyAutoInject: true },
|
|
287
290
|
...opts.skipAccountValidation && { skipAccountValidation: true },
|
|
288
291
|
...opts.skipRequestValidation && { skipRequestValidation: true },
|
|
@@ -2,6 +2,7 @@ import { isTerminalAdcpError, readExtractionPath } from "../../utils/response-un
|
|
|
2
2
|
import { generateIdempotencyKey } from "../../utils/idempotency.mjs";
|
|
3
3
|
import { BUILD_ASSETS_FROM_FORMAT_DIRECTIVE, findUnresolvedCreativeAssetDirectives } from "./creative-assets.mjs";
|
|
4
4
|
import { ConfigurationError } from "../../errors/index.mjs";
|
|
5
|
+
import { storyboardCapabilityStepEnvelope } from "../client.mjs";
|
|
5
6
|
const TASK_TO_METHOD = {
|
|
6
7
|
// Account & audience
|
|
7
8
|
sync_accounts: "syncAccounts",
|
|
@@ -256,8 +257,10 @@ async function executeStoryboardTask(client, taskName, params, opts = {}) {
|
|
|
256
257
|
])).has(taskName);
|
|
257
258
|
const stableCallParams = compatibilityMethod && compatibilityMutation && !opts.skipIdempotencyAutoInject && typeof callParams.idempotency_key !== "string" ? { ...callParams, idempotency_key: generateIdempotencyKey() } : callParams;
|
|
258
259
|
const unguardedPrincipalWrite = taskName === "sync_principal";
|
|
259
|
-
const
|
|
260
|
+
const capabilityStepEnvelope = taskName === "get_adcp_capabilities" ? storyboardCapabilityStepEnvelope(client) : void 0;
|
|
261
|
+
const taskOptions = opts.skipIdempotencyAutoInject || opts.skipAccountValidation || opts.skipRequestValidation || opts.preserveGovernedPayload || opts.signal || unguardedPrincipalWrite || capabilityStepEnvelope ? {
|
|
260
262
|
...unguardedPrincipalWrite && { allowDeactivation: true, allowRevocation: true },
|
|
263
|
+
...capabilityStepEnvelope && { versionEnvelope: capabilityStepEnvelope },
|
|
261
264
|
...opts.skipIdempotencyAutoInject && { skipIdempotencyAutoInject: true },
|
|
262
265
|
...opts.skipAccountValidation && { skipAccountValidation: true },
|
|
263
266
|
...opts.skipRequestValidation && { skipRequestValidation: true },
|
|
@@ -200,7 +200,7 @@ export interface UpstreamTrafficQueryResult {
|
|
|
200
200
|
*/
|
|
201
201
|
export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
|
|
202
202
|
/** Capability semver emitted in run summaries and used for advisory expiry. */
|
|
203
|
-
export declare const RUNNER_CAPABILITY_VERSION = "17.0.0-beta.
|
|
203
|
+
export declare const RUNNER_CAPABILITY_VERSION = "17.0.0-beta.23";
|
|
204
204
|
/** True when a failed validation contributes to the owning step's grade. */
|
|
205
205
|
export declare function validationFailsStep(result: ValidationResult): boolean;
|
|
206
206
|
/**
|
|
@@ -200,7 +200,7 @@ export interface UpstreamTrafficQueryResult {
|
|
|
200
200
|
*/
|
|
201
201
|
export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
|
|
202
202
|
/** Capability semver emitted in run summaries and used for advisory expiry. */
|
|
203
|
-
export declare const RUNNER_CAPABILITY_VERSION = "17.0.0-beta.
|
|
203
|
+
export declare const RUNNER_CAPABILITY_VERSION = "17.0.0-beta.23";
|
|
204
204
|
/** True when a failed validation contributes to the owning step's grade. */
|
|
205
205
|
export declare function validationFailsStep(result: ValidationResult): boolean;
|
|
206
206
|
/**
|