@adcp/sdk 17.0.0-beta.15 → 17.0.0-beta.16

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.
@@ -39,8 +39,8 @@ function applyBrandInvariant(request, options, taskName, stepFlags) {
39
39
  if (!options.brand && !options.brand_manifest) return request;
40
40
  if (taskName !== void 0 && BRAND_SUBJECT_TASKS.has(taskName)) return request;
41
41
  const brand = (0, import_client.resolveBrand)(options);
42
- const topBrandOk = !taskName || (0, import_schema_loader.schemaAllowsTopLevelField)(taskName, "brand");
43
- const topAccountOk = !taskName || (0, import_schema_loader.schemaAllowsTopLevelField)(taskName, "account");
42
+ const topBrandOk = !taskName || (0, import_schema_loader.schemaAllowsTopLevelField)(taskName, "brand", options.adcpVersion);
43
+ const topAccountOk = !taskName || (0, import_schema_loader.schemaAllowsTopLevelField)(taskName, "account", options.adcpVersion);
44
44
  const result = { ...request };
45
45
  if (topBrandOk) result.brand = brand;
46
46
  if (stepFlags?.omit_account) return result;
@@ -14,8 +14,8 @@ function applyBrandInvariant(request, options, taskName, stepFlags) {
14
14
  if (!options.brand && !options.brand_manifest) return request;
15
15
  if (taskName !== void 0 && BRAND_SUBJECT_TASKS.has(taskName)) return request;
16
16
  const brand = resolveBrand(options);
17
- const topBrandOk = !taskName || schemaAllowsTopLevelField(taskName, "brand");
18
- const topAccountOk = !taskName || schemaAllowsTopLevelField(taskName, "account");
17
+ const topBrandOk = !taskName || schemaAllowsTopLevelField(taskName, "brand", options.adcpVersion);
18
+ const topAccountOk = !taskName || schemaAllowsTopLevelField(taskName, "account", options.adcpVersion);
19
19
  const result = { ...request };
20
20
  if (topBrandOk) result.brand = brand;
21
21
  if (stepFlags?.omit_account) return result;
@@ -0,0 +1,3 @@
1
+ export declare const REPLAY_WEBHOOK_VECTOR_TASK = "replay_webhook_vector";
2
+ /** Runner operations are not seller request-schema names. */
3
+ export declare function isRunnerOwnedTask(task: string): boolean;
@@ -0,0 +1,3 @@
1
+ export declare const REPLAY_WEBHOOK_VECTOR_TASK = "replay_webhook_vector";
2
+ /** Runner operations are not seller request-schema names. */
3
+ export declare function isRunnerOwnedTask(task: string): boolean;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var runner_owned_task_exports = {};
20
+ __export(runner_owned_task_exports, {
21
+ REPLAY_WEBHOOK_VECTOR_TASK: () => REPLAY_WEBHOOK_VECTOR_TASK,
22
+ isRunnerOwnedTask: () => isRunnerOwnedTask
23
+ });
24
+ module.exports = __toCommonJS(runner_owned_task_exports);
25
+ var import_loader = require('./loader.js');
26
+ var import_probes = require('./probes.js');
27
+ var import_trusted_match_publisher_auth = require('./trusted-match-publisher-auth.js');
28
+ var import_types = require('./types.js');
29
+ var import_webhook_assertions = require('./webhook-assertions.js');
30
+ const REPLAY_WEBHOOK_VECTOR_TASK = "replay_webhook_vector";
31
+ function isRunnerOwnedTask(task) {
32
+ return task === import_loader.VALIDATION_ONLY_TASK || task === import_types.MCP_SESSION_PROBE_TASK || task === "assert_contribution" || task === REPLAY_WEBHOOK_VECTOR_TASK || import_trusted_match_publisher_auth.TRUSTED_MATCH_PUBLISHER_AUTH_TASKS.has(task) || import_probes.PROBE_TASKS.has(task) || import_webhook_assertions.WEBHOOK_ASSERTION_TASKS.has(task);
33
+ }
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ REPLAY_WEBHOOK_VECTOR_TASK,
37
+ isRunnerOwnedTask
38
+ });
@@ -0,0 +1,13 @@
1
+ import { VALIDATION_ONLY_TASK } from "./loader.mjs";
2
+ import { PROBE_TASKS } from "./probes.mjs";
3
+ import { TRUSTED_MATCH_PUBLISHER_AUTH_TASKS } from "./trusted-match-publisher-auth.mjs";
4
+ import { MCP_SESSION_PROBE_TASK } from "./types.mjs";
5
+ import { WEBHOOK_ASSERTION_TASKS } from "./webhook-assertions.mjs";
6
+ const REPLAY_WEBHOOK_VECTOR_TASK = "replay_webhook_vector";
7
+ function isRunnerOwnedTask(task) {
8
+ return task === VALIDATION_ONLY_TASK || task === MCP_SESSION_PROBE_TASK || task === "assert_contribution" || task === REPLAY_WEBHOOK_VECTOR_TASK || TRUSTED_MATCH_PUBLISHER_AUTH_TASKS.has(task) || PROBE_TASKS.has(task) || WEBHOOK_ASSERTION_TASKS.has(task);
9
+ }
10
+ export {
11
+ REPLAY_WEBHOOK_VECTOR_TASK,
12
+ isRunnerOwnedTask
13
+ };
@@ -71,6 +71,7 @@ var import_node_fs = require("node:fs");
71
71
  var import_node_path = require("node:path");
72
72
  var import_node_util = require("node:util");
73
73
  var import_account_policy = require('./account-policy.js');
74
+ var import_runner_owned_task = require('./runner-owned-task.js');
74
75
  var import_creative_build_probe = require('./creative-build-probe.js');
75
76
  var import_client = require('../client.js');
76
77
  var import_protocols = require('../../protocols/index.js');
@@ -250,10 +251,6 @@ const CANONICAL_SKIP_DETAILS = {
250
251
  signing_transport_unavailable: "signing_transport_unavailable"
251
252
  };
252
253
  const MCP_SESSION_PROBE_REQUEST_TIMEOUT_MS = 5e3;
253
- const REPLAY_WEBHOOK_VECTOR_TASK = "replay_webhook_vector";
254
- function isRunnerOwnedTask(task) {
255
- return task === import_loader.VALIDATION_ONLY_TASK || task === import_types.MCP_SESSION_PROBE_TASK || task === "assert_contribution" || task === REPLAY_WEBHOOK_VECTOR_TASK || import_trusted_match_publisher_auth.TRUSTED_MATCH_PUBLISHER_AUTH_TASKS.has(task) || import_probes.PROBE_TASKS.has(task) || import_webhook_assertions.WEBHOOK_ASSERTION_TASKS.has(task);
256
- }
257
254
  const REPLAY_TRUSTED_MATCH_CONTEXT_VECTOR_TASK = "replay_trusted_match_context_vector";
258
255
  const WEBHOOK_REPLAY_DEFAULT_TIMEOUT_MS = 1e4;
259
256
  function selectionForProbeSkip(reason, detail) {
@@ -1439,7 +1436,7 @@ function detectImplicitRequires(storyboard, options = {}) {
1439
1436
  if (!needsSigner && step.task === "request_signing_probe") {
1440
1437
  needsSigner = true;
1441
1438
  }
1442
- if (!needsWebhookReplayReceiver && stepContractInScope && step.task === REPLAY_WEBHOOK_VECTOR_TASK) {
1439
+ if (!needsWebhookReplayReceiver && stepContractInScope && step.task === import_runner_owned_task.REPLAY_WEBHOOK_VECTOR_TASK) {
1443
1440
  needsWebhookReplayReceiver = true;
1444
1441
  }
1445
1442
  if (!needsTrustedMatchContextRouterRunner && stepContractInScope && step.task === REPLAY_TRUSTED_MATCH_CONTEXT_VECTOR_TASK) {
@@ -3433,7 +3430,7 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
3433
3430
  const cascade = step.stateful ? cascadeForPhase(phase, priorPhaseIds) : { tripped: false };
3434
3431
  if (cascade.tripped && step.stateful && routedCapabilityDetail === void 0) {
3435
3432
  const resolvedTask = (0, import_agent_routing.resolveTaskName)(step, selectedOptions);
3436
- const missingTool = selectedOptions.agentTools && (routingContext && step.requires_tool && !selectedOptions.agentTools.includes(step.requires_tool) ? step.requires_tool : resolvedTask && !isRunnerOwnedTask(resolvedTask) && !selectedOptions.agentTools.includes(resolvedTask) ? resolvedTask : void 0);
3433
+ const missingTool = selectedOptions.agentTools && (routingContext && 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);
3437
3434
  if (missingTool) {
3438
3435
  const missingReason = routingContext && missingTool === "comply_test_controller" ? "missing_test_controller" : "missing_tool";
3439
3436
  const toolDetail = `Agent did not advertise tool "${missingTool}"; agent tools: [${selectedOptions.agentTools.join(", ")}].`;
@@ -3464,7 +3461,7 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
3464
3461
  const trigger = cascade.trigger;
3465
3462
  let detail = trigger ? trigger.substitution_chain ? `Skipped: prior stateful step "${trigger.stepId}" skipped (${trigger.reason}); ${trigger.substitution_chain}; state never materialized.` : `Skipped: prior stateful step "${trigger.stepId}" skipped (${trigger.reason}); state never materialized.` : "Skipped: prior stateful step failed.";
3466
3463
  let capabilityUnavailable = trigger?.capabilityUnavailable === true;
3467
- if (capabilityUnavailable && routingContext && !import_trusted_match_publisher_auth.TRUSTED_MATCH_PUBLISHER_AUTH_TASKS.has(step.task) && !import_probes.PROBE_TASKS.has(step.task) && !import_webhook_assertions.WEBHOOK_ASSERTION_TASKS.has(step.task) && step.task !== REPLAY_WEBHOOK_VECTOR_TASK && (!step.requires_contract || (selectedOptions.contracts ?? []).includes(step.requires_contract))) {
3464
+ if (capabilityUnavailable && routingContext && !import_trusted_match_publisher_auth.TRUSTED_MATCH_PUBLISHER_AUTH_TASKS.has(step.task) && !import_probes.PROBE_TASKS.has(step.task) && !import_webhook_assertions.WEBHOOK_ASSERTION_TASKS.has(step.task) && step.task !== import_runner_owned_task.REPLAY_WEBHOOK_VECTOR_TASK && (!step.requires_contract || (selectedOptions.contracts ?? []).includes(step.requires_contract))) {
3468
3465
  const hardKeys = unavailableContextKeysForPhase(phase, priorPhaseIds, missingPrerequisiteContextKeysByPhase);
3469
3466
  if (hardKeys.size > 0) {
3470
3467
  const effectiveRequest = buildEffectiveStepRequest(
@@ -4791,7 +4788,7 @@ async function runStoryboardStepBody(agentUrl, storyboard, stepId, options) {
4791
4788
  if (storyboard.prerequisites?.controller_seeding === true && storyboard.fixture_resolution === void 0 && options.skip_controller_seeding !== true && runState.preparedFixtures === void 0 && options.agentTools !== void 0 && !options.agentTools.includes("comply_test_controller")) {
4792
4789
  const seeds = (0, import_seeding.buildSeedCalls)(storyboard.fixtures);
4793
4790
  const resolvedTask = (0, import_agent_routing.resolveTaskName)(found.step, options);
4794
- const intrinsicSkip = found.step.requires_tool !== void 0 && !options.agentTools.includes(found.step.requires_tool) || found.step.requires_contract !== void 0 && !(options.contracts ?? []).includes(found.step.requires_contract) || resolvedTask !== void 0 && !isRunnerOwnedTask(resolvedTask) && !options.agentTools.includes(resolvedTask);
4791
+ const intrinsicSkip = found.step.requires_tool !== void 0 && !options.agentTools.includes(found.step.requires_tool) || found.step.requires_contract !== void 0 && !(options.contracts ?? []).includes(found.step.requires_contract) || resolvedTask !== void 0 && !(0, import_runner_owned_task.isRunnerOwnedTask)(resolvedTask) && !options.agentTools.includes(resolvedTask);
4795
4792
  if (seeds.length > 0 && !seeds.some((seed) => seed.authoring_error !== void 0) && resolvedTask !== void 0 && resolvedTask !== "get_adcp_capabilities" && !intrinsicSkip) {
4796
4793
  const capabilityDetail = collectPhaseCapabilitySkipDetails(
4797
4794
  storyboard,
@@ -5075,7 +5072,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
5075
5072
  if (import_webhook_assertions.WEBHOOK_ASSERTION_TASKS.has(step.task)) {
5076
5073
  return (0, import_webhook_assertions.executeWebhookAssertionStep)(step, phaseId, context, allSteps, options, runState);
5077
5074
  }
5078
- if (step.task === REPLAY_WEBHOOK_VECTOR_TASK) {
5075
+ if (step.task === import_runner_owned_task.REPLAY_WEBHOOK_VECTOR_TASK) {
5079
5076
  return executeReplayWebhookVectorStep(step, phaseId, context, allSteps, options, runState);
5080
5077
  }
5081
5078
  if (step.requires_contract && !new Set(options.contracts ?? []).has(step.requires_contract)) {
@@ -7,6 +7,7 @@ import { existsSync, readFileSync } from "node:fs";
7
7
  import { basename, join } from "node:path";
8
8
  import { isDeepStrictEqual } from "node:util";
9
9
  import { applyBrandInvariant } from "./account-policy.mjs";
10
+ import { isRunnerOwnedTask, REPLAY_WEBHOOK_VECTOR_TASK } from "./runner-owned-task.mjs";
10
11
  import { prepareCreativeBuildProbe } from "./creative-build-probe.mjs";
11
12
  import {
12
13
  createTestClient,
@@ -292,10 +293,6 @@ const CANONICAL_SKIP_DETAILS = {
292
293
  signing_transport_unavailable: "signing_transport_unavailable"
293
294
  };
294
295
  const MCP_SESSION_PROBE_REQUEST_TIMEOUT_MS = 5e3;
295
- const REPLAY_WEBHOOK_VECTOR_TASK = "replay_webhook_vector";
296
- function isRunnerOwnedTask(task) {
297
- return task === VALIDATION_ONLY_TASK || task === MCP_SESSION_PROBE_TASK || task === "assert_contribution" || task === REPLAY_WEBHOOK_VECTOR_TASK || TRUSTED_MATCH_PUBLISHER_AUTH_TASKS.has(task) || PROBE_TASKS.has(task) || WEBHOOK_ASSERTION_TASKS.has(task);
298
- }
299
296
  const REPLAY_TRUSTED_MATCH_CONTEXT_VECTOR_TASK = "replay_trusted_match_context_vector";
300
297
  const WEBHOOK_REPLAY_DEFAULT_TIMEOUT_MS = 1e4;
301
298
  function selectionForProbeSkip(reason, detail) {
@@ -38,6 +38,7 @@ var import_collection_selection = require('./collection-selection.js');
38
38
  var import_path = require('./path.js');
39
39
  var import_context = require('./context.js');
40
40
  var import_account_policy = require('./account-policy.js');
41
+ var import_runner_owned_task = require('./runner-owned-task.js');
41
42
  var import_redact_secrets = require('../../utils/redact-secrets.js');
42
43
  var import_jcs = require('../../utils/jcs.js');
43
44
  var import_discovery_evidence = require('../discovery-evidence.js');
@@ -93,7 +94,13 @@ function storyboardSeedScope(storyboard, context, options, call) {
93
94
  sample_request: { account }
94
95
  }))
95
96
  ];
96
- for (const step of seedScopeSteps) {
97
+ for (const authoredStep of seedScopeSteps) {
98
+ const step = authoredStep.task === "expect_rate_limit_not_replayed" && authoredStep.rate_limit_trip ? {
99
+ ...authoredStep,
100
+ task: authoredStep.rate_limit_trip.trip_target_task,
101
+ sample_request: authoredStep.rate_limit_trip.trip_target_sample_request
102
+ } : authoredStep;
103
+ if ((0, import_runner_owned_task.isRunnerOwnedTask)(step.task)) continue;
97
104
  if (step.expect_error || step.omit_account) continue;
98
105
  const source = options.request ?? step.sample_request ?? {};
99
106
  if (JSON.stringify(source.account ?? {}).includes("$generate:")) {
@@ -103,11 +110,21 @@ function storyboardSeedScope(storyboard, context, options, call) {
103
110
  {
104
111
  ...source.account !== void 0 && { account: source.account },
105
112
  buying_mode: source.buying_mode,
106
- discovery_mode: source.discovery_mode
113
+ discovery_mode: source.discovery_mode,
114
+ ...step.task === "validate_input" && { targets: source.targets },
115
+ ...step.task === "comply_test_controller" && { scenario: source.scenario }
107
116
  },
108
117
  context
109
118
  );
110
119
  if (step.context_inputs?.length) request = (0, import_context.applyContextInputs)(request, step.context_inputs, context);
120
+ const formatOnlyValidation = step.task === "validate_input" && Array.isArray(request.targets) && request.targets.length > 0 && request.targets.every(
121
+ (target) => isPlainRecord(target) && ["canonical", "third_party_format", "capability"].includes(String(target.kind))
122
+ );
123
+ const controllerMetadata = step.task === "comply_test_controller" && request.scenario === "list_scenarios";
124
+ if (request.account === void 0 && (controllerMetadata || formatOnlyValidation)) continue;
125
+ if (request.account === void 0 && step.task === "comply_test_controller") {
126
+ request.account = { ...(0, import_client.resolveAccount)(options), sandbox: true };
127
+ }
111
128
  request = (0, import_account_policy.applyBrandInvariant)(request, options, step.task, { omit_account: step.omit_account });
112
129
  if (request.account === void 0) continue;
113
130
  if (JSON.stringify(request.account).includes("$generate:")) {
@@ -18,6 +18,7 @@ import { readCollectionWitness } from "./collection-selection.mjs";
18
18
  import { resolvePath } from "./path.mjs";
19
19
  import { injectContext, applyContextInputs } from "./context.mjs";
20
20
  import { applyBrandInvariant } from "./account-policy.mjs";
21
+ import { isRunnerOwnedTask } from "./runner-owned-task.mjs";
21
22
  import { redactSecrets } from "../../utils/redact-secrets.mjs";
22
23
  import { canonicalize } from "../../utils/jcs.mjs";
23
24
  import { redactDiscoveryEvidence as redactDiscoveryResponse } from "../discovery-evidence.mjs";
@@ -73,7 +74,13 @@ function storyboardSeedScope(storyboard, context, options, call) {
73
74
  sample_request: { account }
74
75
  }))
75
76
  ];
76
- for (const step of seedScopeSteps) {
77
+ for (const authoredStep of seedScopeSteps) {
78
+ const step = authoredStep.task === "expect_rate_limit_not_replayed" && authoredStep.rate_limit_trip ? {
79
+ ...authoredStep,
80
+ task: authoredStep.rate_limit_trip.trip_target_task,
81
+ sample_request: authoredStep.rate_limit_trip.trip_target_sample_request
82
+ } : authoredStep;
83
+ if (isRunnerOwnedTask(step.task)) continue;
77
84
  if (step.expect_error || step.omit_account) continue;
78
85
  const source = options.request ?? step.sample_request ?? {};
79
86
  if (JSON.stringify(source.account ?? {}).includes("$generate:")) {
@@ -83,11 +90,21 @@ function storyboardSeedScope(storyboard, context, options, call) {
83
90
  {
84
91
  ...source.account !== void 0 && { account: source.account },
85
92
  buying_mode: source.buying_mode,
86
- discovery_mode: source.discovery_mode
93
+ discovery_mode: source.discovery_mode,
94
+ ...step.task === "validate_input" && { targets: source.targets },
95
+ ...step.task === "comply_test_controller" && { scenario: source.scenario }
87
96
  },
88
97
  context
89
98
  );
90
99
  if (step.context_inputs?.length) request = applyContextInputs(request, step.context_inputs, context);
100
+ const formatOnlyValidation = step.task === "validate_input" && Array.isArray(request.targets) && request.targets.length > 0 && request.targets.every(
101
+ (target) => isPlainRecord(target) && ["canonical", "third_party_format", "capability"].includes(String(target.kind))
102
+ );
103
+ const controllerMetadata = step.task === "comply_test_controller" && request.scenario === "list_scenarios";
104
+ if (request.account === void 0 && (controllerMetadata || formatOnlyValidation)) continue;
105
+ if (request.account === void 0 && step.task === "comply_test_controller") {
106
+ request.account = { ...resolveAccount(options), sandbox: true };
107
+ }
91
108
  request = applyBrandInvariant(request, options, step.task, { omit_account: step.omit_account });
92
109
  if (request.account === void 0) continue;
93
110
  if (JSON.stringify(request.account).includes("$generate:")) {
@@ -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.15";
203
+ export declare const RUNNER_CAPABILITY_VERSION = "17.0.0-beta.16";
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.15";
203
+ export declare const RUNNER_CAPABILITY_VERSION = "17.0.0-beta.16";
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
  /**
@@ -362,7 +362,7 @@ async function executeWebhookAssertionStep(step, phaseId, context, allSteps, opt
362
362
  } else
363
363
  switch (step.task) {
364
364
  case "expect_webhook": {
365
- const outcome = await runExpectWebhook(step, filter, receiver);
365
+ const outcome = await runExpectWebhook(step, filter, receiver, options.adcpVersion ?? import_version.ADCP_VERSION);
366
366
  validations = outcome.validations;
367
367
  passed = outcome.passed;
368
368
  let changeKey;
@@ -523,7 +523,7 @@ async function runExpectNoWebhook(step, filter, receiver) {
523
523
  passed: true
524
524
  };
525
525
  }
526
- async function runExpectWebhook(step, filter, receiver) {
526
+ async function runExpectWebhook(step, filter, receiver, adcpVersion) {
527
527
  const timeoutMs = clampTimeoutSeconds(step.timeout_seconds, DEFAULT_TIMEOUT_SECONDS) * 1e3;
528
528
  const checkIdempotency = step.expect_idempotency_key !== false;
529
529
  const capCount = step.expect_max_deliveries_per_logical_event;
@@ -553,7 +553,7 @@ async function runExpectWebhook(step, filter, receiver) {
553
553
  first.raw_body.slice(0, 256)
554
554
  );
555
555
  }
556
- const schemaCheck = validateWebhookPayloadSchema(step, first);
556
+ const schemaCheck = validateWebhookPayloadSchema(step, first, adcpVersion);
557
557
  if (schemaCheck && !schemaCheck.passed) return { validations: [schemaCheck], passed: false };
558
558
  if (checkIdempotency) {
559
559
  const idempotencyCheck = assertIdempotencyKey(first);
@@ -759,11 +759,11 @@ function mapSignatureErrorCode(code) {
759
759
  }
760
760
  }
761
761
  }
762
- function validateWebhookPayloadSchema(step, webhook) {
762
+ function validateWebhookPayloadSchema(step, webhook, adcpVersion) {
763
763
  const schemaRef = step.webhook_payload_schema_ref ?? step.response_schema_webhook_ref;
764
764
  if (!schemaRef) return void 0;
765
- const { schema_id, schema_url } = resolveWebhookSchemaIdentity(schemaRef);
766
- const validator = (0, import_schema_loader.getSchemaValidatorByRef)(schemaRef);
765
+ const { schema_id, schema_url } = resolveWebhookSchemaIdentity(schemaRef, adcpVersion);
766
+ const validator = (0, import_schema_loader.getSchemaValidatorByRef)(schemaRef, adcpVersion);
767
767
  if (!validator) {
768
768
  return {
769
769
  check: "expect_webhook",
@@ -818,9 +818,10 @@ function validateWebhookPayloadSchema(step, webhook) {
818
818
  schema_url
819
819
  };
820
820
  }
821
- function resolveWebhookSchemaIdentity(schemaRef) {
822
- const trimmed = schemaRef.replace(/^\/+/, "");
823
- const schemaId = `/schemas/${import_version.ADCP_VERSION}/${trimmed}`;
821
+ function resolveWebhookSchemaIdentity(schemaRef, adcpVersion) {
822
+ const document = (0, import_schema_loader.getSchemaDocumentByRef)(schemaRef, adcpVersion);
823
+ const ref = document?.schemaRef ?? schemaRef.replace(/^\/+/, "");
824
+ const schemaId = `/schemas/${document?.resolvedVersion ?? adcpVersion}/${ref}`;
824
825
  return { schema_id: schemaId, schema_url: `${SCHEMA_URL_BASE}${schemaId}` };
825
826
  }
826
827
  function ajvErrorToSchemaError(error) {
@@ -7,7 +7,7 @@ import { verifyWebhookSignature } from "../../signing/webhook-verifier.mjs";
7
7
  import { WebhookSignatureError } from "../../signing/errors.mjs";
8
8
  import { InMemoryReplayStore } from "../../signing/replay.mjs";
9
9
  import { InMemoryRevocationStore } from "../../signing/revocation.mjs";
10
- import { getSchemaValidatorByRef } from "../../validation/schema-loader.mjs";
10
+ import { getSchemaDocumentByRef, getSchemaValidatorByRef } from "../../validation/schema-loader.mjs";
11
11
  import { ADCP_VERSION } from "../../version.mjs";
12
12
  import { ConfigurationError } from "../../errors/index.mjs";
13
13
  const RUN_STATE_REPLAY_KEY = "__webhook_signing_replay_store";
@@ -337,7 +337,7 @@ async function executeWebhookAssertionStep(step, phaseId, context, allSteps, opt
337
337
  } else
338
338
  switch (step.task) {
339
339
  case "expect_webhook": {
340
- const outcome = await runExpectWebhook(step, filter, receiver);
340
+ const outcome = await runExpectWebhook(step, filter, receiver, options.adcpVersion ?? ADCP_VERSION);
341
341
  validations = outcome.validations;
342
342
  passed = outcome.passed;
343
343
  let changeKey;
@@ -498,7 +498,7 @@ async function runExpectNoWebhook(step, filter, receiver) {
498
498
  passed: true
499
499
  };
500
500
  }
501
- async function runExpectWebhook(step, filter, receiver) {
501
+ async function runExpectWebhook(step, filter, receiver, adcpVersion) {
502
502
  const timeoutMs = clampTimeoutSeconds(step.timeout_seconds, DEFAULT_TIMEOUT_SECONDS) * 1e3;
503
503
  const checkIdempotency = step.expect_idempotency_key !== false;
504
504
  const capCount = step.expect_max_deliveries_per_logical_event;
@@ -528,7 +528,7 @@ async function runExpectWebhook(step, filter, receiver) {
528
528
  first.raw_body.slice(0, 256)
529
529
  );
530
530
  }
531
- const schemaCheck = validateWebhookPayloadSchema(step, first);
531
+ const schemaCheck = validateWebhookPayloadSchema(step, first, adcpVersion);
532
532
  if (schemaCheck && !schemaCheck.passed) return { validations: [schemaCheck], passed: false };
533
533
  if (checkIdempotency) {
534
534
  const idempotencyCheck = assertIdempotencyKey(first);
@@ -734,11 +734,11 @@ function mapSignatureErrorCode(code) {
734
734
  }
735
735
  }
736
736
  }
737
- function validateWebhookPayloadSchema(step, webhook) {
737
+ function validateWebhookPayloadSchema(step, webhook, adcpVersion) {
738
738
  const schemaRef = step.webhook_payload_schema_ref ?? step.response_schema_webhook_ref;
739
739
  if (!schemaRef) return void 0;
740
- const { schema_id, schema_url } = resolveWebhookSchemaIdentity(schemaRef);
741
- const validator = getSchemaValidatorByRef(schemaRef);
740
+ const { schema_id, schema_url } = resolveWebhookSchemaIdentity(schemaRef, adcpVersion);
741
+ const validator = getSchemaValidatorByRef(schemaRef, adcpVersion);
742
742
  if (!validator) {
743
743
  return {
744
744
  check: "expect_webhook",
@@ -793,9 +793,10 @@ function validateWebhookPayloadSchema(step, webhook) {
793
793
  schema_url
794
794
  };
795
795
  }
796
- function resolveWebhookSchemaIdentity(schemaRef) {
797
- const trimmed = schemaRef.replace(/^\/+/, "");
798
- const schemaId = `/schemas/${ADCP_VERSION}/${trimmed}`;
796
+ function resolveWebhookSchemaIdentity(schemaRef, adcpVersion) {
797
+ const document = getSchemaDocumentByRef(schemaRef, adcpVersion);
798
+ const ref = document?.schemaRef ?? schemaRef.replace(/^\/+/, "");
799
+ const schemaId = `/schemas/${document?.resolvedVersion ?? adcpVersion}/${ref}`;
799
800
  return { schema_id: schemaId, schema_url: `${SCHEMA_URL_BASE}${schemaId}` };
800
801
  }
801
802
  function ajvErrorToSchemaError(error) {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AdCP SDK library version
3
3
  */
4
- export declare const LIBRARY_VERSION = "17.0.0-beta.15";
4
+ export declare const LIBRARY_VERSION = "17.0.0-beta.16";
5
5
  /**
6
6
  * AdCP specification version this library is built for
7
7
  */
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
33
33
  * Full version information
34
34
  */
35
35
  export declare const VERSION_INFO: {
36
- readonly library: "17.0.0-beta.15";
36
+ readonly library: "17.0.0-beta.16";
37
37
  readonly adcp: "3.3.0-beta.3";
38
38
  readonly compatibleVersions: readonly ["v3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.1.19", "3.1.20", "3.1.21", "3.1.22", "3.1.23", "3.1.24", "3.1.25", "3.1.26", "3.1.27", "3.1.28", "3.1.29", "3.1.30", "3.1.31", "3.2.1", "3.2", "3.2.2", "3.2.3", "3.2.4", "3.2.5", "3.2.6", "3.2.7", "3.2.8", "3.3.0-beta.3", "3.3-beta.3"];
39
- readonly generatedAt: "2026-11-03T12:43:16.598Z";
39
+ readonly generatedAt: "2026-11-03T17:30:06.582Z";
40
40
  };
41
41
  /**
42
42
  * Get the AdCP specification version this library is built for
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AdCP SDK library version
3
3
  */
4
- export declare const LIBRARY_VERSION = "17.0.0-beta.15";
4
+ export declare const LIBRARY_VERSION = "17.0.0-beta.16";
5
5
  /**
6
6
  * AdCP specification version this library is built for
7
7
  */
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
33
33
  * Full version information
34
34
  */
35
35
  export declare const VERSION_INFO: {
36
- readonly library: "17.0.0-beta.15";
36
+ readonly library: "17.0.0-beta.16";
37
37
  readonly adcp: "3.3.0-beta.3";
38
38
  readonly compatibleVersions: readonly ["v3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.1.19", "3.1.20", "3.1.21", "3.1.22", "3.1.23", "3.1.24", "3.1.25", "3.1.26", "3.1.27", "3.1.28", "3.1.29", "3.1.30", "3.1.31", "3.2.1", "3.2", "3.2.2", "3.2.3", "3.2.4", "3.2.5", "3.2.6", "3.2.7", "3.2.8", "3.3.0-beta.3", "3.3-beta.3"];
39
- readonly generatedAt: "2026-11-03T12:43:16.598Z";
39
+ readonly generatedAt: "2026-11-03T17:30:06.582Z";
40
40
  };
41
41
  /**
42
42
  * Get the AdCP specification version this library is built for
@@ -31,7 +31,7 @@ __export(version_exports, {
31
31
  toReleasePrecisionVersion: () => toReleasePrecisionVersion
32
32
  });
33
33
  module.exports = __toCommonJS(version_exports);
34
- const LIBRARY_VERSION = "17.0.0-beta.15";
34
+ const LIBRARY_VERSION = "17.0.0-beta.16";
35
35
  const ADCP_VERSION = "3.3.0-beta.3";
36
36
  const ADCP_MAJOR_VERSION = 3;
37
37
  const COMPATIBLE_ADCP_VERSIONS = [
@@ -109,10 +109,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
109
109
  "3.3-beta.3"
110
110
  ];
111
111
  const VERSION_INFO = {
112
- library: "17.0.0-beta.15",
112
+ library: "17.0.0-beta.16",
113
113
  adcp: "3.3.0-beta.3",
114
114
  compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
115
- generatedAt: "2026-11-03T12:43:16.598Z"
115
+ generatedAt: "2026-11-03T17:30:06.582Z"
116
116
  };
117
117
  function getAdcpVersion() {
118
118
  return ADCP_VERSION;
@@ -1,4 +1,4 @@
1
- const LIBRARY_VERSION = "17.0.0-beta.15";
1
+ const LIBRARY_VERSION = "17.0.0-beta.16";
2
2
  const ADCP_VERSION = "3.3.0-beta.3";
3
3
  const ADCP_MAJOR_VERSION = 3;
4
4
  const COMPATIBLE_ADCP_VERSIONS = [
@@ -76,10 +76,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
76
76
  "3.3-beta.3"
77
77
  ];
78
78
  const VERSION_INFO = {
79
- library: "17.0.0-beta.15",
79
+ library: "17.0.0-beta.16",
80
80
  adcp: "3.3.0-beta.3",
81
81
  compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
82
- generatedAt: "2026-11-03T12:43:16.598Z"
82
+ generatedAt: "2026-11-03T17:30:06.582Z"
83
83
  };
84
84
  function getAdcpVersion() {
85
85
  return ADCP_VERSION;
@@ -1,7 +1,7 @@
1
1
  # AdCP Type Summary
2
2
 
3
3
  > Generated at: 2026-11-03
4
- > @adcp/sdk v17.0.0-beta.15
4
+ > @adcp/sdk v17.0.0-beta.16
5
5
 
6
6
  Curated reference of the types that matter for using the AdCP client. For full generated types see `src/lib/types/tools.generated.ts` and `src/lib/types/core.generated.ts`.
7
7
 
package/docs/llms.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  # Ad Context Protocol (AdCP)
2
2
 
3
3
  > Generated at: 2026-11-03
4
- > Library: @adcp/sdk v17.0.0-beta.15
4
+ > Library: @adcp/sdk v17.0.0-beta.16
5
5
  > AdCP major version: 3
6
6
  > Canonical URL: https://adcontextprotocol.github.io/adcp-client/llms.txt
7
7
  > Note: the `Library` stamp reflects the package.json version at doc-generation time. The narrative below describes the surface that lands on the next-published minor — including any 6.7 helpers documented here ahead of the release tag.
@@ -16,8 +16,8 @@ pin using `ADCP_VERSION` inside that tarball.
16
16
 
17
17
  | Fact | Value |
18
18
  | --- | --- |
19
- | Checkout `package.json` version | `@adcp/sdk@17.0.0-beta.15` |
20
- | npm integrity | registry-derived after publication; run `npm view @adcp/sdk@17.0.0-beta.15 dist.integrity` |
19
+ | Checkout `package.json` version | `@adcp/sdk@17.0.0-beta.16` |
20
+ | npm integrity | registry-derived after publication; run `npm view @adcp/sdk@17.0.0-beta.16 dist.integrity` |
21
21
  | Node.js runtime | `^20.19.0 || >=22.12.0` |
22
22
  | Default AdCP wire release | `3.3.0-beta.3` |
23
23
  | Maintained wire releases | `v3`, `3.0.0`, `3.0`, `3.0.1`, `3.0.2`, `3.0.3`, `3.0.4`, `3.0.5`, `3.0.6`, `3.0.7`, `3.0.8`, `3.0.9`, `3.0.10`, `3.0.11`, `3.0.12`, `3.0.13`, `3.0.14`, `3.0.15`, `3.0.16`, `3.0.17`, `3.0.18`, `3.0.19`, `3.0.20`, `3.0.21`, `3.0.22`, `3.0.23`, `3.0.24`, `3.0.25`, `3.1.0`, `3.1`, `3.1.1`, `3.1.2`, `3.1.3`, `3.1.4`, `3.1.5`, `3.1.6`, `3.1.7`, `3.1.8`, `3.1.9`, `3.1.10`, `3.1.11`, `3.1.12`, `3.1.13`, `3.1.14`, `3.1.15`, `3.1.16`, `3.1.17`, `3.1.18`, `3.1.19`, `3.1.20`, `3.1.21`, `3.1.22`, `3.1.23`, `3.1.24`, `3.1.25`, `3.1.26`, `3.1.27`, `3.1.28`, `3.1.29`, `3.1.30`, `3.1.31`, `3.2.1`, `3.2`, `3.2.2`, `3.2.3`, `3.2.4`, `3.2.5`, `3.2.6`, `3.2.7`, `3.2.8`, `3.3.0-beta.3`, `3.3-beta.3` |
@@ -26,8 +26,8 @@ pin using `ADCP_VERSION` inside that tarball.
26
26
  For a checkout at the published release commit, install the exact package version:
27
27
 
28
28
  ```bash
29
- npm install --save-exact '@adcp/sdk@17.0.0-beta.15'
30
- npm view '@adcp/sdk@17.0.0-beta.15' dist.integrity
29
+ npm install --save-exact '@adcp/sdk@17.0.0-beta.16'
30
+ npm view '@adcp/sdk@17.0.0-beta.16' dist.integrity
31
31
  ```
32
32
 
33
33
  ### Required and optional peers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adcp/sdk",
3
- "version": "17.0.0-beta.15",
3
+ "version": "17.0.0-beta.16",
4
4
  "description": "AdCP SDK — client, server, and compliance harnesses for the AdContext Protocol (MCP + A2A)",
5
5
  "workspaces": [
6
6
  ".",