@adcp/sdk 13.0.0 → 13.0.1
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/bin/adcp.js +102 -38
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/testing/compliance/comply.d.mts +3 -0
- package/dist/lib/testing/compliance/comply.d.ts +3 -0
- package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
- package/dist/lib/testing/compliance/comply.js +5 -2
- package/dist/lib/testing/compliance/comply.js.map +1 -1
- package/dist/lib/testing/compliance/comply.mjs +5 -2
- package/dist/lib/testing/compliance/comply.mjs.map +1 -1
- package/dist/lib/testing/storyboard/compliance.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/compliance.js +13 -4
- package/dist/lib/testing/storyboard/compliance.js.map +1 -1
- package/dist/lib/testing/storyboard/compliance.mjs +13 -4
- package/dist/lib/testing/storyboard/compliance.mjs.map +1 -1
- package/dist/lib/testing/storyboard/loader.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/loader.js +5 -0
- package/dist/lib/testing/storyboard/loader.js.map +1 -1
- package/dist/lib/testing/storyboard/loader.mjs +5 -0
- package/dist/lib/testing/storyboard/loader.mjs.map +1 -1
- package/dist/lib/testing/storyboard/provenance.d.mts +3 -0
- package/dist/lib/testing/storyboard/provenance.d.ts +4 -0
- package/dist/lib/testing/storyboard/provenance.d.ts.map +1 -0
- package/dist/lib/testing/storyboard/provenance.js +38 -0
- package/dist/lib/testing/storyboard/provenance.js.map +1 -0
- package/dist/lib/testing/storyboard/provenance.mjs +13 -0
- package/dist/lib/testing/storyboard/provenance.mjs.map +1 -0
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +42 -5
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.mjs +43 -6
- package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
- package/dist/lib/testing/storyboard/test-kit.d.mts +35 -0
- package/dist/lib/testing/storyboard/test-kit.d.ts +35 -0
- package/dist/lib/testing/storyboard/test-kit.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/test-kit.js +101 -6
- package/dist/lib/testing/storyboard/test-kit.js.map +1 -1
- package/dist/lib/testing/storyboard/test-kit.mjs +100 -6
- package/dist/lib/testing/storyboard/test-kit.mjs.map +1 -1
- package/dist/lib/testing/storyboard/types.d.mts +2 -0
- package/dist/lib/testing/storyboard/types.d.ts +2 -0
- package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/types.js.map +1 -1
- package/dist/lib/testing/storyboard/types.mjs.map +1 -1
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- 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.js.map +1 -1
- package/dist/lib/version.mjs +3 -3
- package/dist/lib/version.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -64,8 +64,9 @@ import {
|
|
|
64
64
|
generateRandomInvalidJwt
|
|
65
65
|
} from "./probes.mjs";
|
|
66
66
|
import { readBrandJsonUrl } from "../../signing/agent-resolver/capabilities-types.mjs";
|
|
67
|
-
import { validateTestKit } from "./test-kit.mjs";
|
|
67
|
+
import { resolveDeclaredTestKit, validateTestKit } from "./test-kit.mjs";
|
|
68
68
|
import { validateStoryboardShape } from "./loader.mjs";
|
|
69
|
+
import { trustedStoryboardComplianceRoot } from "./provenance.mjs";
|
|
69
70
|
import { probeRequestSigningVector } from "./request-signing/probe-dispatch.mjs";
|
|
70
71
|
import { createWebhookReceiver } from "./webhook-receiver.mjs";
|
|
71
72
|
import { WEBHOOK_ASSERTION_TASKS, armWebhookAssertions, executeWebhookAssertionStep } from "./webhook-assertions.mjs";
|
|
@@ -119,7 +120,10 @@ const CONTROLLER_SEEDING_FAILED_DETAIL = "Skipped: pre-flight comply_test_contro
|
|
|
119
120
|
const FIXTURE_SEED_UNSUPPORTED_DETAIL = "Skipped: pre-flight comply_test_controller seeding requires a seed_* scenario this agent does not implement (`fixture_seed_unsupported`).";
|
|
120
121
|
const OAUTH_NOT_ADVERTISED_DETAIL = "Skipped: agent does not advertise OAuth \u2014 /.well-known/oauth-protected-resource returned 404 (RFC 9728 \xA73). API-key path must carry auth_mechanism_verified for this storyboard to pass.";
|
|
121
122
|
function applyStoryboardVersionOptions(storyboard, options) {
|
|
122
|
-
|
|
123
|
+
const versioned = applyAdcpVersionRunOptions(storyboard.adcp_version, options);
|
|
124
|
+
const mayInheritStoryboardDir = options.adcpVersion === void 0 || options.adcpVersion === storyboard.adcp_version;
|
|
125
|
+
const complianceDir = versioned.complianceDir ?? (mayInheritStoryboardDir ? trustedStoryboardComplianceRoot(storyboard) : void 0);
|
|
126
|
+
return complianceDir && versioned.complianceDir !== complianceDir ? { ...versioned, complianceDir } : versioned;
|
|
123
127
|
}
|
|
124
128
|
function applyAdcpVersionRunOptions(defaultAdcpVersion, options) {
|
|
125
129
|
const adcpVersion = options.adcpVersion ?? defaultAdcpVersion;
|
|
@@ -608,6 +612,7 @@ async function runStoryboard(agentUrlOrUrls, storyboard, options = {}) {
|
|
|
608
612
|
return withMCPConnectionScope(
|
|
609
613
|
async () => {
|
|
610
614
|
options = applyStoryboardVersionOptions(storyboard, options);
|
|
615
|
+
options = resolveDeclaredTestKit(storyboard, options);
|
|
611
616
|
options = { ...options, transport: normalizeTransportOptions(options.transport) };
|
|
612
617
|
const schemaRoot = getRunSchemaRoot(options);
|
|
613
618
|
if (schemaRoot) {
|
|
@@ -2427,6 +2432,7 @@ async function runStoryboardStep(agentUrl, storyboard, stepId, options = {}) {
|
|
|
2427
2432
|
async () => {
|
|
2428
2433
|
validateStoryboardShape(storyboard);
|
|
2429
2434
|
options = applyStoryboardVersionOptions(storyboard, options);
|
|
2435
|
+
options = resolveDeclaredTestKit(storyboard, options);
|
|
2430
2436
|
const schemaRoot = getRunSchemaRoot(options);
|
|
2431
2437
|
if (schemaRoot) {
|
|
2432
2438
|
return await withExternalSchemaRoot(
|
|
@@ -2787,7 +2793,23 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
2787
2793
|
}
|
|
2788
2794
|
const testsMissingIdempotencyKey = step.omit_idempotency_key === true && isMutatingTask(effectiveStep.task);
|
|
2789
2795
|
const testsMissingAccount = step.omit_account === true && effectiveStep.task === "create_media_buy";
|
|
2790
|
-
|
|
2796
|
+
let rawProbeHeaders;
|
|
2797
|
+
try {
|
|
2798
|
+
rawProbeHeaders = step.auth !== void 0 ? authHeadersForStep(step.auth, options) : void 0;
|
|
2799
|
+
} catch (err) {
|
|
2800
|
+
return {
|
|
2801
|
+
step_id: step.id,
|
|
2802
|
+
phase_id: phaseId,
|
|
2803
|
+
title: step.title,
|
|
2804
|
+
task: step.task,
|
|
2805
|
+
passed: false,
|
|
2806
|
+
duration_ms: 0,
|
|
2807
|
+
validations: [],
|
|
2808
|
+
context,
|
|
2809
|
+
error: `Step auth configuration error: ${err instanceof Error ? err.message : String(err)}`,
|
|
2810
|
+
extraction: { path: "none" }
|
|
2811
|
+
};
|
|
2812
|
+
}
|
|
2791
2813
|
const useRawProbe = rawProbeHeaders !== void 0;
|
|
2792
2814
|
let taskResult;
|
|
2793
2815
|
let stepResult;
|
|
@@ -3095,7 +3117,9 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
|
|
|
3095
3117
|
}
|
|
3096
3118
|
let passed;
|
|
3097
3119
|
if (step.expect_error) {
|
|
3098
|
-
|
|
3120
|
+
const responsePayload = taskResult?.data;
|
|
3121
|
+
const payloadReportsFailure = responsePayload?.success === false;
|
|
3122
|
+
passed = !taskResult?.success || !!stepResult.error || payloadReportsFailure;
|
|
3099
3123
|
} else if (crossResponses) {
|
|
3100
3124
|
passed = stepResult.passed;
|
|
3101
3125
|
} else {
|
|
@@ -4522,6 +4546,11 @@ function authHeadersForStep(directive, options) {
|
|
|
4522
4546
|
value = directive.value;
|
|
4523
4547
|
} else if ("from_test_kit" in directive && directive.from_test_kit) {
|
|
4524
4548
|
value = options.test_kit?.auth?.api_key;
|
|
4549
|
+
if (!value) {
|
|
4550
|
+
throw new Error(
|
|
4551
|
+
"step declares auth.from_test_kit but no test kit with auth.api_key is configured \u2014 declare prerequisites.test_kit and authorize its cache with options.complianceDir (CLI: --compliance-dir), or pass options.test_kit (CLI: --test-kit)."
|
|
4552
|
+
);
|
|
4553
|
+
}
|
|
4525
4554
|
} else if ("value_strategy" in directive && directive.value_strategy) {
|
|
4526
4555
|
if (directive.value_strategy === "random_invalid") value = generateRandomInvalidApiKey();
|
|
4527
4556
|
else if (directive.value_strategy === "random_invalid_jwt") value = generateRandomInvalidJwt();
|
|
@@ -4545,8 +4574,16 @@ function basicAuthHeadersForStep(directive, options) {
|
|
|
4545
4574
|
)
|
|
4546
4575
|
};
|
|
4547
4576
|
}
|
|
4548
|
-
const
|
|
4549
|
-
|
|
4577
|
+
const usesTestKit = directive.from_test_kit === true || typeof directive.from_test_kit === "string" && directive.from_test_kit.length > 0;
|
|
4578
|
+
const source = usesTestKit ? resolveStepBasicFromTestKit(directive.from_test_kit, options) : directive.basic !== void 0 ? directive.basic : directive;
|
|
4579
|
+
if (source === void 0) {
|
|
4580
|
+
if (usesTestKit) {
|
|
4581
|
+
throw new Error(
|
|
4582
|
+
"step declares auth.from_test_kit (basic) but no test kit with matching credentials is configured \u2014 declare prerequisites.test_kit and authorize its cache with options.complianceDir (CLI: --compliance-dir), or pass options.test_kit (CLI: --test-kit)."
|
|
4583
|
+
);
|
|
4584
|
+
}
|
|
4585
|
+
return {};
|
|
4586
|
+
}
|
|
4550
4587
|
return { authorization: encodeBasicAuthHeader(source, "step.auth.basic") };
|
|
4551
4588
|
}
|
|
4552
4589
|
function resolveStepBasicFromTestKit(fromTestKit, options) {
|