@adcp/sdk 17.0.0-beta.1 → 17.0.0-beta.3

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.
Files changed (282) hide show
  1. package/dist/lib/adapters/keyed-account-store.js +1 -1
  2. package/dist/lib/adapters/keyed-account-store.mjs +1 -1
  3. package/dist/lib/adapters/version/3.0/brand-fields.d.mts +7 -1
  4. package/dist/lib/adapters/version/3.0/brand-fields.d.ts +7 -1
  5. package/dist/lib/adapters/version/3.0/brand-fields.js +139 -3
  6. package/dist/lib/adapters/version/3.0/brand-fields.mjs +136 -2
  7. package/dist/lib/adapters/version/3.0/index.js +6 -0
  8. package/dist/lib/adapters/version/3.0/index.mjs +7 -1
  9. package/dist/lib/adapters/version/index.d.mts +9 -0
  10. package/dist/lib/adapters/version/index.d.ts +9 -0
  11. package/dist/lib/adapters/version/index.js +20 -6
  12. package/dist/lib/adapters/version/index.mjs +15 -2
  13. package/dist/lib/adapters/version/types.d.mts +5 -0
  14. package/dist/lib/adapters/version/types.d.ts +5 -0
  15. package/dist/lib/canonical-references/index.js +2 -0
  16. package/dist/lib/canonical-references/index.mjs +2 -0
  17. package/dist/lib/client/account-changes.d.mts +3 -1
  18. package/dist/lib/client/account-changes.d.ts +3 -1
  19. package/dist/lib/client/account-changes.js +22 -2
  20. package/dist/lib/client/account-changes.mjs +22 -2
  21. package/dist/lib/conformance/oracle.js +3 -2
  22. package/dist/lib/conformance/oracle.mjs +3 -2
  23. package/dist/lib/core/AgentClient.d.mts +165 -1
  24. package/dist/lib/core/AgentClient.d.ts +165 -1
  25. package/dist/lib/core/AgentClient.js +446 -8
  26. package/dist/lib/core/AgentClient.mjs +446 -8
  27. package/dist/lib/core/ConversationTypes.d.mts +8 -0
  28. package/dist/lib/core/ConversationTypes.d.ts +8 -0
  29. package/dist/lib/core/ProtocolResponseParser.d.mts +1 -1
  30. package/dist/lib/core/ProtocolResponseParser.d.ts +1 -1
  31. package/dist/lib/core/ProtocolResponseParser.js +28 -18
  32. package/dist/lib/core/ProtocolResponseParser.mjs +11 -1
  33. package/dist/lib/core/SingleAgentClient.d.mts +115 -2
  34. package/dist/lib/core/SingleAgentClient.d.ts +115 -2
  35. package/dist/lib/core/SingleAgentClient.js +547 -67
  36. package/dist/lib/core/SingleAgentClient.mjs +534 -54
  37. package/dist/lib/core/TaskExecutor.d.mts +7 -0
  38. package/dist/lib/core/TaskExecutor.d.ts +7 -0
  39. package/dist/lib/core/TaskExecutor.js +18 -5
  40. package/dist/lib/core/TaskExecutor.mjs +18 -5
  41. package/dist/lib/core/task-status.d.mts +2 -0
  42. package/dist/lib/core/task-status.d.ts +2 -0
  43. package/dist/lib/core/task-status.js +11 -2
  44. package/dist/lib/core/task-status.mjs +9 -1
  45. package/dist/lib/identity-3.3/trust.d.mts +1 -4
  46. package/dist/lib/identity-3.3/trust.d.ts +1 -4
  47. package/dist/lib/identity-3.3/trust.js +43 -23
  48. package/dist/lib/identity-3.3/trust.mjs +43 -23
  49. package/dist/lib/identity-3.3/validation.js +5 -3
  50. package/dist/lib/identity-3.3/validation.mjs +6 -4
  51. package/dist/lib/index.d.mts +6 -52
  52. package/dist/lib/index.d.ts +6 -52
  53. package/dist/lib/index.js +11 -0
  54. package/dist/lib/index.mjs +7 -0
  55. package/dist/lib/media-buy/compatibility.js +6 -1
  56. package/dist/lib/media-buy/compatibility.mjs +6 -1
  57. package/dist/lib/protocols/mcp-scope.d.mts +3 -0
  58. package/dist/lib/protocols/mcp-scope.d.ts +3 -0
  59. package/dist/lib/protocols/mcp-scope.js +8 -3
  60. package/dist/lib/protocols/mcp-scope.mjs +8 -3
  61. package/dist/lib/reporting/inspection.js +1 -0
  62. package/dist/lib/reporting/inspection.mjs +1 -0
  63. package/dist/lib/reporting/ledger/coverage.d.mts +5 -0
  64. package/dist/lib/reporting/ledger/coverage.d.ts +5 -0
  65. package/dist/lib/reporting/ledger/coverage.js +37 -3
  66. package/dist/lib/reporting/ledger/coverage.mjs +36 -3
  67. package/dist/lib/reporting/ledger/handler.js +7 -4
  68. package/dist/lib/reporting/ledger/handler.mjs +7 -4
  69. package/dist/lib/reporting/ledger/producer.js +215 -69
  70. package/dist/lib/reporting/ledger/producer.mjs +217 -70
  71. package/dist/lib/reporting/ledger/schedule.d.mts +2 -2
  72. package/dist/lib/reporting/ledger/schedule.d.ts +2 -2
  73. package/dist/lib/reporting/ledger/schedule.js +8 -5
  74. package/dist/lib/reporting/ledger/schedule.mjs +8 -5
  75. package/dist/lib/reporting/ledger/status-ingest.d.mts +1 -1
  76. package/dist/lib/reporting/ledger/status-ingest.d.ts +1 -1
  77. package/dist/lib/reporting/ledger/status-ingest.js +4 -3
  78. package/dist/lib/reporting/ledger/status-ingest.mjs +4 -3
  79. package/dist/lib/reporting/ledger/types.d.mts +36 -1
  80. package/dist/lib/reporting/ledger/types.d.ts +36 -1
  81. package/dist/lib/reporting/service/index.d.mts +14 -1
  82. package/dist/lib/reporting/service/index.d.ts +14 -1
  83. package/dist/lib/reporting/service/index.js +24 -12
  84. package/dist/lib/reporting/service/index.mjs +24 -12
  85. package/dist/lib/schemas/browser.d.mts +2 -0
  86. package/dist/lib/schemas/browser.d.ts +2 -0
  87. package/dist/lib/schemas/browser.js +3 -0
  88. package/dist/lib/schemas/browser.mjs +2 -0
  89. package/dist/lib/schemas/index.d.mts +5 -3
  90. package/dist/lib/schemas/index.d.ts +5 -3
  91. package/dist/lib/schemas/index.js +5 -0
  92. package/dist/lib/schemas/index.mjs +4 -0
  93. package/dist/lib/server/a2a-adapter.js +2 -1
  94. package/dist/lib/server/a2a-adapter.mjs +2 -1
  95. package/dist/lib/server/account-response-identity.d.mts +17 -0
  96. package/dist/lib/server/account-response-identity.d.ts +17 -0
  97. package/dist/lib/server/account-response-identity.js +52 -0
  98. package/dist/lib/server/account-response-identity.mjs +28 -0
  99. package/dist/lib/server/account-sync-contract.js +2 -2
  100. package/dist/lib/server/account-sync-contract.mjs +2 -2
  101. package/dist/lib/server/auth-signature.d.mts +2 -2
  102. package/dist/lib/server/auth-signature.d.ts +2 -2
  103. package/dist/lib/server/auth-signature.js +3 -0
  104. package/dist/lib/server/auth-signature.mjs +3 -0
  105. package/dist/lib/server/create-adcp-server.d.mts +2 -2
  106. package/dist/lib/server/create-adcp-server.d.ts +2 -2
  107. package/dist/lib/server/create-adcp-server.js +58 -23
  108. package/dist/lib/server/create-adcp-server.mjs +61 -15
  109. package/dist/lib/server/decisioning/account.d.mts +36 -10
  110. package/dist/lib/server/decisioning/account.d.ts +36 -10
  111. package/dist/lib/server/decisioning/account.js +33 -14
  112. package/dist/lib/server/decisioning/account.mjs +33 -14
  113. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +5 -5
  114. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +5 -5
  115. package/dist/lib/server/decisioning/runtime/from-platform.js +4 -4
  116. package/dist/lib/server/decisioning/runtime/from-platform.mjs +4 -4
  117. package/dist/lib/server/media-buy-store.d.mts +26 -12
  118. package/dist/lib/server/media-buy-store.d.ts +26 -12
  119. package/dist/lib/server/media-buy-store.js +69 -21
  120. package/dist/lib/server/media-buy-store.mjs +69 -21
  121. package/dist/lib/server/notification-subscriptions/runtime.d.mts +1 -1
  122. package/dist/lib/server/notification-subscriptions/runtime.d.ts +1 -1
  123. package/dist/lib/server/notification-subscriptions/runtime.js +4 -0
  124. package/dist/lib/server/notification-subscriptions/runtime.mjs +4 -0
  125. package/dist/lib/server/responses.js +9 -1
  126. package/dist/lib/server/responses.mjs +9 -1
  127. package/dist/lib/server/serve.js +3 -1
  128. package/dist/lib/server/serve.mjs +3 -1
  129. package/dist/lib/server/signed-request-transport.d.mts +1 -0
  130. package/dist/lib/server/signed-request-transport.d.ts +1 -0
  131. package/dist/lib/server/signed-request-transport.js +46 -0
  132. package/dist/lib/server/signed-request-transport.mjs +20 -0
  133. package/dist/lib/server/test-controller.d.mts +1 -0
  134. package/dist/lib/server/test-controller.d.ts +1 -0
  135. package/dist/lib/server/test-controller.js +5 -1
  136. package/dist/lib/server/test-controller.mjs +5 -1
  137. package/dist/lib/signing/agent-fetch.d.mts +1 -1
  138. package/dist/lib/signing/agent-fetch.d.ts +1 -1
  139. package/dist/lib/signing/agent-fetch.js +3 -3
  140. package/dist/lib/signing/agent-fetch.mjs +3 -3
  141. package/dist/lib/testing/index.d.mts +1 -0
  142. package/dist/lib/testing/index.d.ts +1 -0
  143. package/dist/lib/testing/index.js +3 -0
  144. package/dist/lib/testing/index.mjs +2 -0
  145. package/dist/lib/testing/storyboard/canonical-format-satisfaction.js +61 -29
  146. package/dist/lib/testing/storyboard/canonical-format-satisfaction.mjs +61 -29
  147. package/dist/lib/testing/storyboard/compliance.d.mts +2 -5
  148. package/dist/lib/testing/storyboard/compliance.d.ts +2 -5
  149. package/dist/lib/testing/storyboard/compliance.js +62 -13
  150. package/dist/lib/testing/storyboard/compliance.mjs +63 -14
  151. package/dist/lib/testing/storyboard/index.d.mts +1 -0
  152. package/dist/lib/testing/storyboard/index.d.ts +1 -0
  153. package/dist/lib/testing/storyboard/index.js +3 -0
  154. package/dist/lib/testing/storyboard/index.mjs +2 -0
  155. package/dist/lib/testing/storyboard/loader.js +7 -0
  156. package/dist/lib/testing/storyboard/loader.mjs +7 -0
  157. package/dist/lib/testing/storyboard/request-builder.js +9 -6
  158. package/dist/lib/testing/storyboard/request-builder.mjs +9 -6
  159. package/dist/lib/testing/storyboard/request-signing/vector-loader.d.mts +2 -0
  160. package/dist/lib/testing/storyboard/request-signing/vector-loader.d.ts +2 -0
  161. package/dist/lib/testing/storyboard/request-signing/vector-loader.js +11 -0
  162. package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +10 -0
  163. package/dist/lib/testing/storyboard/runner.js +59 -6
  164. package/dist/lib/testing/storyboard/runner.mjs +59 -6
  165. package/dist/lib/testing/storyboard/types.d.mts +18 -0
  166. package/dist/lib/testing/storyboard/types.d.ts +18 -0
  167. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  168. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  169. package/dist/lib/testing/storyboard/web-bot-auth.d.mts +10 -0
  170. package/dist/lib/testing/storyboard/web-bot-auth.d.ts +10 -0
  171. package/dist/lib/testing/storyboard/web-bot-auth.js +80 -0
  172. package/dist/lib/testing/storyboard/web-bot-auth.mjs +56 -0
  173. package/dist/lib/types/accept-proposal.d.ts +20 -28
  174. package/dist/lib/types/asset-instances.d.mts +1 -1
  175. package/dist/lib/types/asset-instances.d.ts +1 -1
  176. package/dist/lib/types/buy-products.d.ts +20 -28
  177. package/dist/lib/types/check-governance.d.ts +20 -28
  178. package/dist/lib/types/comply-test-controller.d.ts +20 -28
  179. package/dist/lib/types/control-media-buy.d.ts +20 -28
  180. package/dist/lib/types/core.generated.d.mts +273 -184
  181. package/dist/lib/types/core.generated.d.ts +273 -184
  182. package/dist/lib/types/create-media-buy.d.ts +20 -28
  183. package/dist/lib/types/get-media-buys.d.ts +20 -28
  184. package/dist/lib/types/get-products.d.ts +20 -28
  185. package/dist/lib/types/index.d.mts +6 -1
  186. package/dist/lib/types/index.d.ts +6 -1
  187. package/dist/lib/types/index.js +6 -1
  188. package/dist/lib/types/index.mjs +4 -1
  189. package/dist/lib/types/inline-enums.generated.d.mts +30 -4
  190. package/dist/lib/types/inline-enums.generated.d.ts +30 -4
  191. package/dist/lib/types/inline-enums.generated.js +41 -2
  192. package/dist/lib/types/inline-enums.generated.mjs +28 -2
  193. package/dist/lib/types/list-products.d.ts +20 -28
  194. package/dist/lib/types/list-proposals.d.ts +20 -28
  195. package/dist/lib/types/media-buy-delivery-report.d.mts +6 -0
  196. package/dist/lib/types/media-buy-delivery-report.d.ts +6 -0
  197. package/dist/lib/types/media-buy-delivery-report.js +16 -0
  198. package/dist/lib/types/media-buy-delivery-report.mjs +0 -0
  199. package/dist/lib/types/refine-proposals.d.ts +20 -28
  200. package/dist/lib/types/request-proposals.d.ts +20 -28
  201. package/dist/lib/types/schemas.generated.d.ts +63113 -127273
  202. package/dist/lib/types/schemas.generated.js +759 -770
  203. package/dist/lib/types/schemas.generated.mjs +759 -770
  204. package/dist/lib/types/targeting-keys.generated.d.mts +4 -0
  205. package/dist/lib/types/targeting-keys.generated.d.ts +4 -0
  206. package/dist/lib/types/targeting-keys.generated.js +109 -0
  207. package/dist/lib/types/targeting-keys.generated.mjs +84 -0
  208. package/dist/lib/types/tools.generated.d.mts +2 -68
  209. package/dist/lib/types/tools.generated.d.ts +2 -68
  210. package/dist/lib/types/update-media-buy.d.ts +20 -28
  211. package/dist/lib/utils/adcp-version-config.js +5 -2
  212. package/dist/lib/utils/adcp-version-config.mjs +5 -2
  213. package/dist/lib/utils/response-unwrapper.js +6 -1
  214. package/dist/lib/utils/response-unwrapper.mjs +6 -1
  215. package/dist/lib/v2/format-schema/resolver.js +1 -1
  216. package/dist/lib/v2/format-schema/resolver.mjs +1 -1
  217. package/dist/lib/v2/projection/creative-delivery.js +104 -29
  218. package/dist/lib/v2/projection/creative-delivery.mjs +108 -29
  219. package/dist/lib/v2/projection/index.d.mts +1 -0
  220. package/dist/lib/v2/projection/index.d.ts +1 -0
  221. package/dist/lib/v2/projection/index.js +3 -0
  222. package/dist/lib/v2/projection/index.mjs +2 -0
  223. package/dist/lib/v2/projection/legacy-metadata.d.mts +19 -0
  224. package/dist/lib/v2/projection/legacy-metadata.d.ts +19 -0
  225. package/dist/lib/v2/projection/legacy-metadata.js +91 -0
  226. package/dist/lib/v2/projection/legacy-metadata.mjs +86 -0
  227. package/dist/lib/v2/projection/v1-to-v2.d.mts +1 -1
  228. package/dist/lib/v2/projection/v1-to-v2.d.ts +1 -1
  229. package/dist/lib/v2/projection/v1-to-v2.js +12 -9
  230. package/dist/lib/v2/projection/v1-to-v2.mjs +12 -9
  231. package/dist/lib/validation/budget-allocation.d.mts +3 -3
  232. package/dist/lib/validation/budget-allocation.d.ts +3 -3
  233. package/dist/lib/validation/compact-schema.d.mts +27 -0
  234. package/dist/lib/validation/compact-schema.d.ts +27 -0
  235. package/dist/lib/validation/compact-schema.js +276 -0
  236. package/dist/lib/validation/compact-schema.mjs +250 -0
  237. package/dist/lib/validation/media-buy-delivery-report.d.mts +8 -0
  238. package/dist/lib/validation/media-buy-delivery-report.d.ts +8 -0
  239. package/dist/lib/validation/media-buy-delivery-report.js +31 -0
  240. package/dist/lib/validation/media-buy-delivery-report.mjs +7 -0
  241. package/dist/lib/validation/nonempty-array.d.mts +15 -0
  242. package/dist/lib/validation/nonempty-array.d.ts +15 -0
  243. package/dist/lib/validation/nonempty-array.js +41 -0
  244. package/dist/lib/validation/nonempty-array.mjs +7 -0
  245. package/dist/lib/validation/schema-diagnostic-origins.d.mts +21 -0
  246. package/dist/lib/validation/schema-diagnostic-origins.d.ts +21 -0
  247. package/dist/lib/validation/schema-diagnostic-origins.js +193 -0
  248. package/dist/lib/validation/schema-diagnostic-origins.mjs +169 -0
  249. package/dist/lib/validation/schema-loader.js +86 -16
  250. package/dist/lib/validation/schema-loader.mjs +82 -16
  251. package/dist/lib/validation/schema-validator.d.mts +10 -19
  252. package/dist/lib/validation/schema-validator.d.ts +10 -19
  253. package/dist/lib/validation/schema-validator.js +135 -42
  254. package/dist/lib/validation/schema-validator.mjs +139 -43
  255. package/dist/lib/validation/sync-creatives.d.mts +22 -22
  256. package/dist/lib/validation/sync-creatives.d.ts +22 -22
  257. package/dist/lib/version.d.mts +3 -3
  258. package/dist/lib/version.d.ts +3 -3
  259. package/dist/lib/version.js +3 -3
  260. package/dist/lib/version.mjs +3 -3
  261. package/dist/lib/webhooks/index.d.mts +3 -0
  262. package/dist/lib/webhooks/index.d.ts +3 -0
  263. package/dist/lib/webhooks/index.js +3 -0
  264. package/dist/lib/webhooks/index.mjs +2 -0
  265. package/dist/lib/webhooks/media-buy-delivery.d.mts +43 -0
  266. package/dist/lib/webhooks/media-buy-delivery.d.ts +43 -0
  267. package/dist/lib/webhooks/media-buy-delivery.js +119 -0
  268. package/dist/lib/webhooks/media-buy-delivery.mjs +94 -0
  269. package/docs/TYPE-SUMMARY.md +2 -2
  270. package/docs/guides/DELIVERY-WEBHOOK-PARSING.md +142 -0
  271. package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +15 -0
  272. package/docs/guides/REPORTING-LEDGER.md +93 -0
  273. package/docs/guides/REPORTING-STABILITY.md +1 -1
  274. package/docs/guides/TYPED-CLIENT-TOOLS.md +49 -0
  275. package/docs/llms.txt +2 -2
  276. package/docs/migration-14.x-rc-worksheet.md +4 -4
  277. package/docs/migration-16-to-17.md +218 -14
  278. package/docs/migration-6.6-to-6.7.md +14 -0
  279. package/docs/migration-account-change-feed.md +15 -0
  280. package/docs/migration-agent-identity-3.3.md +106 -4
  281. package/docs/recipes/verifying-inbound-webhooks.md +18 -2
  282. package/package.json +16 -3
@@ -6,6 +6,7 @@
6
6
  * The canonical storyboard set lives in the AdCP compliance tarball
7
7
  * and is pulled into `compliance/cache/{version}/` via `npm run sync-schemas`.
8
8
  */
9
+ export { createStoryboardWebBotAuthFetch } from './web-bot-auth';
9
10
  export type { A2ATaskEnvelope, AgentEntry, Storyboard, StoryboardFixtureResolution, FixtureResolutionStrategy, FixtureMatchOperator, FixtureMatchClause, FixtureResolutionDeclaration, ProductFixtureResolutionDeclaration, PricingOptionFixtureResolutionDeclaration, FixtureResolutionStatus, FixtureResolutionRecord, FixtureResolutionAttempt, FixtureResolutionEvidence, FixtureResolutionCoverageGap, StoryboardInvariants, StoryboardInvariantsObject, StepInvariantsObject, StoryboardPhase, StoryboardStep, RateLimitTripSpec, StoryboardValidation, StoryboardValidationCheck, WebhookFilterSpec, WebhookRetryTriggerSpec, WebhookAssertionErrorCode, ContextOutput, ContextInput, ContextProvenanceEntry, ContextValueRejectedHint, ShapeDriftHint, MissingRequiredFieldHint, FormatMismatchHint, MonotonicViolationHint, ImpairmentCoherenceHint, ImpairmentCoherenceNotApplicableHint, StoryboardContext, StoryboardRunOptions, PrepareStoryboardFixturesOptions, TrustedMatchContextProviderEndpoint, TrustedMatchContextRegistrationContext, TrustedMatchContextRouterRunnerOptions, TrustedMatchPublisherAuthOperation, TrustedMatchPublisherCredentialState, TrustedMatchPublisherAuthTls, TrustedMatchPublisherAuthProbeConfiguration, TrustedMatchPublisherAuthRunner, ValidationResult, StoryboardStepPreview, StoryboardStepResult, StoryboardStepHint, StoryboardStepHintBase, StoryboardPhaseResult, StoryboardResult, AssertionResult, StrictValidationSummary, StrictValidationVerdict, UpstreamTrafficPayloadMatch, RunnerNotice, NoticeCode, NoticeSeverity, } from './types';
10
11
  export { WEBHOOK_IDEMPOTENCY_KEY_PATTERN } from './types';
11
12
  export { MCP_SESSION_PROBE_TASK } from './types';
@@ -60,6 +60,7 @@ __export(storyboard_exports, {
60
60
  clearSandboxCache: () => import_sandbox_entities.clearSandboxCache,
61
61
  compareCollectionPairs: () => import_collection_selection.compareCollectionPairs,
62
62
  createRunnerVariables: () => import_context.createRunnerVariables,
63
+ createStoryboardWebBotAuthFetch: () => import_web_bot_auth.createStoryboardWebBotAuthFetch,
63
64
  createWebhookReceiver: () => import_webhook_receiver.createWebhookReceiver,
64
65
  describeStoryboardCapabilityGates: () => import_runner.describeStoryboardCapabilityGates,
65
66
  detectContextRejectionHints: () => import_rejection_hints.detectContextRejectionHints,
@@ -136,6 +137,7 @@ __export(storyboard_exports, {
136
137
  });
137
138
  module.exports = __toCommonJS(storyboard_exports);
138
139
  var import_default_invariants = require('./default-invariants.js');
140
+ var import_web_bot_auth = require('./web-bot-auth.js');
139
141
  var import_types = require('./types.js');
140
142
  var import_types2 = require('./types.js');
141
143
  var import_assertions = require('./assertions.js');
@@ -207,6 +209,7 @@ var import_creative_build_probe = require('./creative-build-probe.js');
207
209
  clearSandboxCache,
208
210
  compareCollectionPairs,
209
211
  createRunnerVariables,
212
+ createStoryboardWebBotAuthFetch,
210
213
  createWebhookReceiver,
211
214
  describeStoryboardCapabilityGates,
212
215
  detectContextRejectionHints,
@@ -1,5 +1,6 @@
1
1
  import { registerDefaultInvariants } from "./default-invariants.mjs";
2
2
  registerDefaultInvariants();
3
+ import { createStoryboardWebBotAuthFetch } from "./web-bot-auth.mjs";
3
4
  import { WEBHOOK_IDEMPOTENCY_KEY_PATTERN } from "./types.mjs";
4
5
  import { MCP_SESSION_PROBE_TASK } from "./types.mjs";
5
6
  import {
@@ -164,6 +165,7 @@ export {
164
165
  clearSandboxCache,
165
166
  compareCollectionPairs,
166
167
  createRunnerVariables,
168
+ createStoryboardWebBotAuthFetch,
167
169
  createWebhookReceiver,
168
170
  describeStoryboardCapabilityGates,
169
171
  detectContextRejectionHints,
@@ -96,6 +96,13 @@ function validateStoryboardShape(storyboard) {
96
96
  validateBranchSet(storyboard.id, phase);
97
97
  if (!phase.steps) continue;
98
98
  for (const step of phase.steps) {
99
+ if (step.enrich_request !== void 0 && (step.enrich_request !== true || !step.expect_error || step.negative_path !== "payload_well_formed")) {
100
+ throw new Error(
101
+ `[${storyboard.id}] ${step.id}: enrich_request requires expect_error: true and negative_path: payload_well_formed`
102
+ );
103
+ }
104
+ if (typeof step.auth === "object" && step.auth.type === "web_bot_auth" && (typeof step.auth.identity !== "string" || step.auth.identity.trim().length === 0))
105
+ throw new Error(`[${storyboard.id}] ${step.id}: web_bot_auth requires an identity name`);
99
106
  const rawStep = step;
100
107
  if (rawStep.task === void 0) {
101
108
  if (!Array.isArray(rawStep.validations) || rawStep.validations.length === 0) {
@@ -68,6 +68,13 @@ function validateStoryboardShape(storyboard) {
68
68
  validateBranchSet(storyboard.id, phase);
69
69
  if (!phase.steps) continue;
70
70
  for (const step of phase.steps) {
71
+ if (step.enrich_request !== void 0 && (step.enrich_request !== true || !step.expect_error || step.negative_path !== "payload_well_formed")) {
72
+ throw new Error(
73
+ `[${storyboard.id}] ${step.id}: enrich_request requires expect_error: true and negative_path: payload_well_formed`
74
+ );
75
+ }
76
+ if (typeof step.auth === "object" && step.auth.type === "web_bot_auth" && (typeof step.auth.identity !== "string" || step.auth.identity.trim().length === 0))
77
+ throw new Error(`[${storyboard.id}] ${step.id}: web_bot_auth requires an identity name`);
71
78
  const rawStep = step;
72
79
  if (rawStep.task === void 0) {
73
80
  if (!Array.isArray(rawStep.validations) || rawStep.validations.length === 0) {
@@ -248,12 +248,15 @@ const REQUEST_ENRICHERS = {
248
248
  budget: (typeof baseSample.budget === "number" ? baseSample.budget : void 0) ?? options.budget ?? Math.max(1e3, pricingOption?.min_spend_per_package ?? 1e3),
249
249
  pricing_option_id: fixturePricingOptionId ?? pricingOption?.pricing_option_id ?? context.pricing_option_id ?? "test-pricing"
250
250
  };
251
- const sentPricingOption = fixtureProductId === void 0 && fixturePricingOptionId === void 0 ? pricingOption : findPricingOption(context, firstPkg.product_id, firstPkg.pricing_option_id);
252
- if (baseSample.bid_price === void 0 && baseSample.bidding === void 0 && step.sample_request?.bidding === void 0 && sentPricingOption?.pricing_model === "cpm" && !(0, import_pricing_adapter.isFixedPricing)(sentPricingOption)) {
253
- const floor = Number(sentPricingOption.floor_price) || 5;
254
- firstPkg.bid_price = Math.round(floor * 1.5 * 100) / 100;
255
- }
256
251
  const additionalPkgs = samplePackages.slice(1).map((p) => (0, import_context.injectContext)({ ...p }, context));
252
+ const packages = [firstPkg, ...additionalPkgs];
253
+ for (const pkg of packages) {
254
+ const sentPricingOption = pkg === firstPkg && fixtureProductId === void 0 && fixturePricingOptionId === void 0 ? pricingOption : findPricingOption(context, pkg.product_id, pkg.pricing_option_id);
255
+ if (pkg.bid_price === void 0 && pkg.bidding === void 0 && step.sample_request?.bidding === void 0 && sentPricingOption?.pricing_model === "cpm" && !(0, import_pricing_adapter.isFixedPricing)(sentPricingOption)) {
256
+ const floor = Number(sentPricingOption.floor_price) || 5;
257
+ pkg.bid_price = Math.round(floor * 1.5 * 100) / 100;
258
+ }
259
+ }
257
260
  const fixture = step.sample_request !== void 0 ? (0, import_context.injectContext)({ ...step.sample_request }, context) : {};
258
261
  const fixtureBody = omitEnvelopeFields(fixture);
259
262
  const fixtureHasPackages = Array.isArray(fixture.packages) && fixture.packages.length > 0;
@@ -275,7 +278,7 @@ const REQUEST_ENRICHERS = {
275
278
  brand: (0, import_client.resolveBrand)(options),
276
279
  start_time: startTime,
277
280
  end_time: endTime,
278
- packages: [firstPkg, ...additionalPkgs]
281
+ packages
279
282
  };
280
283
  },
281
284
  update_media_buy(step, context, options) {
@@ -222,12 +222,15 @@ const REQUEST_ENRICHERS = {
222
222
  budget: (typeof baseSample.budget === "number" ? baseSample.budget : void 0) ?? options.budget ?? Math.max(1e3, pricingOption?.min_spend_per_package ?? 1e3),
223
223
  pricing_option_id: fixturePricingOptionId ?? pricingOption?.pricing_option_id ?? context.pricing_option_id ?? "test-pricing"
224
224
  };
225
- const sentPricingOption = fixtureProductId === void 0 && fixturePricingOptionId === void 0 ? pricingOption : findPricingOption(context, firstPkg.product_id, firstPkg.pricing_option_id);
226
- if (baseSample.bid_price === void 0 && baseSample.bidding === void 0 && step.sample_request?.bidding === void 0 && sentPricingOption?.pricing_model === "cpm" && !isFixedPricing(sentPricingOption)) {
227
- const floor = Number(sentPricingOption.floor_price) || 5;
228
- firstPkg.bid_price = Math.round(floor * 1.5 * 100) / 100;
229
- }
230
225
  const additionalPkgs = samplePackages.slice(1).map((p) => injectContext({ ...p }, context));
226
+ const packages = [firstPkg, ...additionalPkgs];
227
+ for (const pkg of packages) {
228
+ const sentPricingOption = pkg === firstPkg && fixtureProductId === void 0 && fixturePricingOptionId === void 0 ? pricingOption : findPricingOption(context, pkg.product_id, pkg.pricing_option_id);
229
+ if (pkg.bid_price === void 0 && pkg.bidding === void 0 && step.sample_request?.bidding === void 0 && sentPricingOption?.pricing_model === "cpm" && !isFixedPricing(sentPricingOption)) {
230
+ const floor = Number(sentPricingOption.floor_price) || 5;
231
+ pkg.bid_price = Math.round(floor * 1.5 * 100) / 100;
232
+ }
233
+ }
231
234
  const fixture = step.sample_request !== void 0 ? injectContext({ ...step.sample_request }, context) : {};
232
235
  const fixtureBody = omitEnvelopeFields(fixture);
233
236
  const fixtureHasPackages = Array.isArray(fixture.packages) && fixture.packages.length > 0;
@@ -249,7 +252,7 @@ const REQUEST_ENRICHERS = {
249
252
  brand: resolveBrand(options),
250
253
  start_time: startTime,
251
254
  end_time: endTime,
252
- packages: [firstPkg, ...additionalPkgs]
255
+ packages
253
256
  };
254
257
  },
255
258
  update_media_buy(step, context, options) {
@@ -34,6 +34,8 @@ export declare function signingProfileForAdcpVersion(version?: string): '3.2' |
34
34
  export declare function loadRequestSigningVectors(options?: LoadVectorsOptions): LoadedVectors;
35
35
  /** Load only the shared signing keyset, without requiring the grader vectors. */
36
36
  export declare function loadRequestSigningKeys(options?: LoadVectorsOptions): TestKeyset;
37
+ /** Refresh only the signing fixtures belonging to a changed custom compliance root. */
38
+ export declare function invalidateRequestSigningVectorCache(complianceDir: string): void;
37
39
  /** Test-only: clear the memoization cache so a fresh cache path is reread. */
38
40
  export declare function __resetVectorCache(): void;
39
41
  /** Where the A2A operation-resolution vectors came from. */
@@ -34,6 +34,8 @@ export declare function signingProfileForAdcpVersion(version?: string): '3.2' |
34
34
  export declare function loadRequestSigningVectors(options?: LoadVectorsOptions): LoadedVectors;
35
35
  /** Load only the shared signing keyset, without requiring the grader vectors. */
36
36
  export declare function loadRequestSigningKeys(options?: LoadVectorsOptions): TestKeyset;
37
+ /** Refresh only the signing fixtures belonging to a changed custom compliance root. */
38
+ export declare function invalidateRequestSigningVectorCache(complianceDir: string): void;
37
39
  /** Test-only: clear the memoization cache so a fresh cache path is reread. */
38
40
  export declare function __resetVectorCache(): void;
39
41
  /** Where the A2A operation-resolution vectors came from. */
@@ -22,6 +22,7 @@ __export(vector_loader_exports, {
22
22
  A2A_VECTORS_UNAVAILABLE_MESSAGE: () => A2A_VECTORS_UNAVAILABLE_MESSAGE,
23
23
  __resetVectorCache: () => __resetVectorCache,
24
24
  findKey: () => findKey,
25
+ invalidateRequestSigningVectorCache: () => invalidateRequestSigningVectorCache,
25
26
  loadA2aOperationResolutionVectors: () => loadA2aOperationResolutionVectors,
26
27
  loadRequestSigningKeys: () => loadRequestSigningKeys,
27
28
  loadRequestSigningVectors: () => loadRequestSigningVectors,
@@ -95,6 +96,15 @@ function loadRequestSigningKeys(options = {}) {
95
96
  const cacheDir = (0, import_compliance.getComplianceCacheDir)(options);
96
97
  return loadKeys((0, import_path.join)(cacheDir, "test-vectors", "request-signing", "keys.json"));
97
98
  }
99
+ function invalidateRequestSigningVectorCache(complianceDir) {
100
+ const sourceDir = (0, import_path.resolve)(complianceDir, "test-vectors", "request-signing");
101
+ for (const key of VECTOR_CACHE.keys()) {
102
+ if ((0, import_path.resolve)(key) === sourceDir) VECTOR_CACHE.delete(key);
103
+ }
104
+ for (const key of A2A_VECTOR_CACHE.keys()) {
105
+ if ((0, import_path.resolve)(key) === (0, import_path.join)(sourceDir, "a2a")) A2A_VECTOR_CACHE.delete(key);
106
+ }
107
+ }
98
108
  function __resetVectorCache() {
99
109
  VECTOR_CACHE.clear();
100
110
  A2A_VECTOR_CACHE.clear();
@@ -384,6 +394,7 @@ function strArray(v, where) {
384
394
  A2A_VECTORS_UNAVAILABLE_MESSAGE,
385
395
  __resetVectorCache,
386
396
  findKey,
397
+ invalidateRequestSigningVectorCache,
387
398
  loadA2aOperationResolutionVectors,
388
399
  loadRequestSigningKeys,
389
400
  loadRequestSigningVectors,
@@ -69,6 +69,15 @@ function loadRequestSigningKeys(options = {}) {
69
69
  const cacheDir = getComplianceCacheDir(options);
70
70
  return loadKeys(join(cacheDir, "test-vectors", "request-signing", "keys.json"));
71
71
  }
72
+ function invalidateRequestSigningVectorCache(complianceDir) {
73
+ const sourceDir = resolve(complianceDir, "test-vectors", "request-signing");
74
+ for (const key of VECTOR_CACHE.keys()) {
75
+ if (resolve(key) === sourceDir) VECTOR_CACHE.delete(key);
76
+ }
77
+ for (const key of A2A_VECTOR_CACHE.keys()) {
78
+ if (resolve(key) === join(sourceDir, "a2a")) A2A_VECTOR_CACHE.delete(key);
79
+ }
80
+ }
72
81
  function __resetVectorCache() {
73
82
  VECTOR_CACHE.clear();
74
83
  A2A_VECTOR_CACHE.clear();
@@ -357,6 +366,7 @@ export {
357
366
  A2A_VECTORS_UNAVAILABLE_MESSAGE,
358
367
  __resetVectorCache,
359
368
  findKey,
369
+ invalidateRequestSigningVectorCache,
360
370
  loadA2aOperationResolutionVectors,
361
371
  loadRequestSigningKeys,
362
372
  loadRequestSigningVectors,
@@ -61,6 +61,9 @@ __export(runner_exports, {
61
61
  summarizeStrictValidation: () => summarizeStrictValidation
62
62
  });
63
63
  module.exports = __toCommonJS(runner_exports);
64
+ var import_web_bot_auth = require('./web-bot-auth.js');
65
+ var import_web_bot_auth2 = require('../../signing/web-bot-auth.js');
66
+ var import_agent_transport_fetch = require('../../net/agent-transport-fetch.js');
64
67
  var import_node_crypto = require("node:crypto");
65
68
  var import_node_fs = require("node:fs");
66
69
  var import_node_path = require("node:path");
@@ -2206,6 +2209,19 @@ function resolveBindingAccountScope(storyboard, options) {
2206
2209
  }
2207
2210
  function resolveBindingCredential(options, step) {
2208
2211
  const parts = [];
2212
+ if (options.web_bot_auth) {
2213
+ parts.push(`wba_target:${JSON.stringify(options.web_bot_auth.publicUrl ?? null)}`);
2214
+ for (const [name, identity] of Object.entries(options.web_bot_auth.identities).sort(
2215
+ ([a], [b]) => a < b ? -1 : a > b ? 1 : 0
2216
+ )) {
2217
+ try {
2218
+ const jwk = "privateKey" in identity.key ? identity.key.privateKey : identity.key.publicKey;
2219
+ parts.push(`wba_identity:${JSON.stringify([name, identity.origin, (0, import_web_bot_auth2.jwkThumbprint)(jwk)])}`);
2220
+ } catch {
2221
+ parts.push(`wba_identity:${JSON.stringify([name, "invalid"])}`);
2222
+ }
2223
+ }
2224
+ }
2209
2225
  if (step?.auth !== void 0) {
2210
2226
  parts.push(`step_auth:${JSON.stringify(describeStepAuthDirective(step.auth))}`);
2211
2227
  }
@@ -4867,7 +4883,7 @@ function buildStepRequest(step, effectiveStep, context, options, runnerVars) {
4867
4883
  const governedFixture = payloadBoundGovernance && effectiveStep.task !== "check_governance" && effectiveStep.task !== "report_plan_outcome" && (governedSource !== void 0 && Object.prototype.hasOwnProperty.call(governedSource, "governance_context") || contextGovernance);
4868
4884
  if (options.request) {
4869
4885
  request = (0, import_context.injectContext)({ ...options.request }, context, runnerVars);
4870
- } else if (step.expect_error && step.sample_request) {
4886
+ } else if (step.expect_error && step.sample_request && step.enrich_request !== true) {
4871
4887
  request = (0, import_context.injectContext)({ ...step.sample_request }, context, runnerVars);
4872
4888
  } else if (governedFixture) {
4873
4889
  request = (0, import_context.injectContext)({ ...step.sample_request ?? {} }, context, runnerVars);
@@ -5242,18 +5258,49 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
5242
5258
  const testsIdempotencyKeyOmission = (step.omit_idempotency_key === true || governedRequest && (typeof request.idempotency_key !== "string" || request.idempotency_key.length === 0)) && (0, import_idempotency.requestUsesIdempotency)(effectiveStep.task, request);
5243
5259
  const testsMissingAccount = effectiveStep.task === "create_media_buy" && (step.omit_account === true || governedRequest && !Object.prototype.hasOwnProperty.call(request, "account"));
5244
5260
  const testsSchemaInvalidRequest = step.expect_error === true && step.negative_path !== "payload_well_formed";
5245
- const useSdkAuthOverride = typeof step.auth === "object" && step.auth.type === "api_key" && step.auth.from_test_kit === true && step.auth.value_strategy === void 0 && step.expect_error !== true && !(step.validations ?? []).some((validation) => HTTP_PROBE_ONLY_CHECKS.has(validation.check));
5261
+ const useWebBotAuth = typeof step.auth === "object" && step.auth.type === "web_bot_auth";
5262
+ const useSdkAuthOverride = useWebBotAuth || typeof step.auth === "object" && step.auth.type === "api_key" && step.auth.from_test_kit === true && step.auth.value_strategy === void 0 && step.expect_error !== true && !(step.validations ?? []).some((validation) => HTTP_PROBE_ONLY_CHECKS.has(validation.check));
5246
5263
  let rawProbeHeaders;
5247
5264
  let authOverrideClient;
5248
5265
  try {
5249
5266
  rawProbeHeaders = step.auth !== void 0 ? authHeadersForStep(step.auth, options) : void 0;
5267
+ let signedFetch;
5268
+ if (typeof step.auth === "object" && step.auth.type === "web_bot_auth") {
5269
+ if ((step.validations ?? []).some((validation) => HTTP_PROBE_ONLY_CHECKS.has(validation.check)))
5270
+ throw new Error(
5271
+ "web_bot_auth steps require tool-response validations; HTTP probe assertions are not supported"
5272
+ );
5273
+ if (options.web_bot_auth?.publicUrl && options.protocol === "a2a")
5274
+ throw new Error("web_bot_auth.publicUrl loopback delivery supports MCP only; use HTTPS directly for A2A");
5275
+ if (!options.web_bot_auth?.publicUrl && new URL(runState.agentUrl).protocol !== "https:")
5276
+ throw new Error("web_bot_auth.publicUrl is required to sign for a non-HTTPS agent");
5277
+ const name = step.auth.identity;
5278
+ const identities = options.web_bot_auth?.identities;
5279
+ const identity = identities && Object.hasOwn(identities, name) ? identities[name] : void 0;
5280
+ if (!identity) throw new Error("web_bot_auth identity is not configured in options.web_bot_auth.identities");
5281
+ signedFetch = (0, import_web_bot_auth.createStoryboardWebBotAuthFetch)(
5282
+ (0, import_agent_transport_fetch.createAgentTransportFetch)(runState.agentUrl, {
5283
+ trustedFetchFn: options.transport?.trustedFetchFn,
5284
+ allowPrivateIp: options.transport?.allowPrivateIp
5285
+ }),
5286
+ identity.key,
5287
+ {
5288
+ agentUrl: runState.agentUrl,
5289
+ origin: identity.origin,
5290
+ ...options.web_bot_auth?.publicUrl && {
5291
+ target: { publicUrl: options.web_bot_auth.publicUrl, loopbackUrl: runState.agentUrl }
5292
+ }
5293
+ }
5294
+ );
5295
+ }
5250
5296
  if (useSdkAuthOverride) {
5251
5297
  if (rawProbeHeaders === void 0) throw new Error("Step auth override credentials were not resolved");
5252
5298
  authOverrideClient = createAuthOverrideClient(
5253
5299
  runState.agentUrl,
5254
5300
  options.protocol ?? "mcp",
5255
5301
  options,
5256
- rawProbeHeaders
5302
+ rawProbeHeaders,
5303
+ signedFetch
5257
5304
  );
5258
5305
  }
5259
5306
  } catch (err) {
@@ -5547,7 +5594,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
5547
5594
  runState.agentProfile?.raw_capabilities,
5548
5595
  "request_signing.required_for"
5549
5596
  );
5550
- if (taskResult?.adcp_error?.code === "request_signature_required" && Array.isArray(requiredForSigning) && requiredForSigning.includes(effectiveStep.task) && options.functional_request_signing === void 0 && runState.storyboardRequiresRequestSigner !== true) {
5597
+ if (taskResult?.adcp_error?.code === "request_signature_required" && Array.isArray(requiredForSigning) && requiredForSigning.includes(effectiveStep.task) && options.functional_request_signing === void 0 && !useWebBotAuth && runState.storyboardRequiresRequestSigner !== true) {
5551
5598
  const next2 = getNextStepPreview(step.id, allSteps, context, runState.runnerVars);
5552
5599
  const detail = `Agent declared request_signing.required_for includes "${effectiveStep.task}" and rejected the unsigned request with request_signature_required; storyboard "${storyboardId}" does not require request_signer.`;
5553
5600
  return {
@@ -7679,6 +7726,8 @@ function selectProtectedToolTarget(tools) {
7679
7726
  function sessionControlMechanismFor(auth) {
7680
7727
  if (auth === "none") return "any";
7681
7728
  switch (auth.type) {
7729
+ case "web_bot_auth":
7730
+ throw new Error("web_bot_auth is not supported by session probes");
7682
7731
  case "oauth_bearer":
7683
7732
  return "oauth_bearer";
7684
7733
  case "basic":
@@ -7704,6 +7753,9 @@ function planMcpSessionSentinel(step, options, client, agentUrl) {
7704
7753
  )
7705
7754
  };
7706
7755
  }
7756
+ if (typeof step.auth === "object" && step.auth.type === "web_bot_auth") {
7757
+ return { kind: "error", error: "web_bot_auth is not supported by MCP session probes; select an AdCP tool step" };
7758
+ }
7707
7759
  const signatureBound = signatureBoundTools(options);
7708
7760
  const candidates = protectedToolCandidates(options.agentTools);
7709
7761
  if (signatureBound === "unparseable") {
@@ -7763,7 +7815,7 @@ function planMcpSessionSentinel(step, options, client, agentUrl) {
7763
7815
  };
7764
7816
  }
7765
7817
  function authHeadersForStep(directive, options) {
7766
- if (directive === "none") return {};
7818
+ if (directive === "none" || directive.type === "web_bot_auth") return {};
7767
7819
  if (directive.type === "basic") return basicAuthHeadersForStep(directive, options);
7768
7820
  let value;
7769
7821
  if ("value" in directive && directive.value) {
@@ -7811,7 +7863,7 @@ function isCredentialHeaderName(name) {
7811
7863
  if (SESSION_PROBE_ROUTING_HEADERS.has(normalized)) return false;
7812
7864
  return AUTH_OVERRIDE_HEADER_NAMES.has(normalized) || AUTH_OVERRIDE_CREDENTIAL_HEADER_RE.test(normalized) || AUTH_OVERRIDE_COMPACT_CREDENTIAL_RE.test(normalized.replace(/[-_]/g, ""));
7813
7865
  }
7814
- function createAuthOverrideClient(agentUrl, protocol, options, authHeaders) {
7866
+ function createAuthOverrideClient(agentUrl, protocol, options, authHeaders, signedFetch) {
7815
7867
  const runSecrets = runCredentialValues(options);
7816
7868
  const headers = {};
7817
7869
  for (const [name, value] of Object.entries(options.headers ?? {})) {
@@ -7842,6 +7894,7 @@ function createAuthOverrideClient(agentUrl, protocol, options, authHeaders) {
7842
7894
  test_kit: void 0,
7843
7895
  _client: void 0,
7844
7896
  functional_request_signing: void 0,
7897
+ ...signedFetch && { transport: { ...options.transport, trustedFetchFn: signedFetch } },
7845
7898
  headers: Object.keys(headers).length > 0 ? headers : void 0
7846
7899
  });
7847
7900
  }
@@ -1,3 +1,6 @@
1
+ import { createStoryboardWebBotAuthFetch } from "./web-bot-auth.mjs";
2
+ import { jwkThumbprint } from "../../signing/web-bot-auth.mjs";
3
+ import { createAgentTransportFetch } from "../../net/agent-transport-fetch.mjs";
1
4
  import { createHash, createHmac } from "node:crypto";
2
5
  import { existsSync, readFileSync } from "node:fs";
3
6
  import { basename, join } from "node:path";
@@ -2248,6 +2251,19 @@ function resolveBindingAccountScope(storyboard, options) {
2248
2251
  }
2249
2252
  function resolveBindingCredential(options, step) {
2250
2253
  const parts = [];
2254
+ if (options.web_bot_auth) {
2255
+ parts.push(`wba_target:${JSON.stringify(options.web_bot_auth.publicUrl ?? null)}`);
2256
+ for (const [name, identity] of Object.entries(options.web_bot_auth.identities).sort(
2257
+ ([a], [b]) => a < b ? -1 : a > b ? 1 : 0
2258
+ )) {
2259
+ try {
2260
+ const jwk = "privateKey" in identity.key ? identity.key.privateKey : identity.key.publicKey;
2261
+ parts.push(`wba_identity:${JSON.stringify([name, identity.origin, jwkThumbprint(jwk)])}`);
2262
+ } catch {
2263
+ parts.push(`wba_identity:${JSON.stringify([name, "invalid"])}`);
2264
+ }
2265
+ }
2266
+ }
2251
2267
  if (step?.auth !== void 0) {
2252
2268
  parts.push(`step_auth:${JSON.stringify(describeStepAuthDirective(step.auth))}`);
2253
2269
  }
@@ -4909,7 +4925,7 @@ function buildStepRequest(step, effectiveStep, context, options, runnerVars) {
4909
4925
  const governedFixture = payloadBoundGovernance && effectiveStep.task !== "check_governance" && effectiveStep.task !== "report_plan_outcome" && (governedSource !== void 0 && Object.prototype.hasOwnProperty.call(governedSource, "governance_context") || contextGovernance);
4910
4926
  if (options.request) {
4911
4927
  request = injectContext({ ...options.request }, context, runnerVars);
4912
- } else if (step.expect_error && step.sample_request) {
4928
+ } else if (step.expect_error && step.sample_request && step.enrich_request !== true) {
4913
4929
  request = injectContext({ ...step.sample_request }, context, runnerVars);
4914
4930
  } else if (governedFixture) {
4915
4931
  request = injectContext({ ...step.sample_request ?? {} }, context, runnerVars);
@@ -5284,18 +5300,49 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
5284
5300
  const testsIdempotencyKeyOmission = (step.omit_idempotency_key === true || governedRequest && (typeof request.idempotency_key !== "string" || request.idempotency_key.length === 0)) && requestUsesIdempotency(effectiveStep.task, request);
5285
5301
  const testsMissingAccount = effectiveStep.task === "create_media_buy" && (step.omit_account === true || governedRequest && !Object.prototype.hasOwnProperty.call(request, "account"));
5286
5302
  const testsSchemaInvalidRequest = step.expect_error === true && step.negative_path !== "payload_well_formed";
5287
- const useSdkAuthOverride = typeof step.auth === "object" && step.auth.type === "api_key" && step.auth.from_test_kit === true && step.auth.value_strategy === void 0 && step.expect_error !== true && !(step.validations ?? []).some((validation) => HTTP_PROBE_ONLY_CHECKS.has(validation.check));
5303
+ const useWebBotAuth = typeof step.auth === "object" && step.auth.type === "web_bot_auth";
5304
+ const useSdkAuthOverride = useWebBotAuth || typeof step.auth === "object" && step.auth.type === "api_key" && step.auth.from_test_kit === true && step.auth.value_strategy === void 0 && step.expect_error !== true && !(step.validations ?? []).some((validation) => HTTP_PROBE_ONLY_CHECKS.has(validation.check));
5288
5305
  let rawProbeHeaders;
5289
5306
  let authOverrideClient;
5290
5307
  try {
5291
5308
  rawProbeHeaders = step.auth !== void 0 ? authHeadersForStep(step.auth, options) : void 0;
5309
+ let signedFetch;
5310
+ if (typeof step.auth === "object" && step.auth.type === "web_bot_auth") {
5311
+ if ((step.validations ?? []).some((validation) => HTTP_PROBE_ONLY_CHECKS.has(validation.check)))
5312
+ throw new Error(
5313
+ "web_bot_auth steps require tool-response validations; HTTP probe assertions are not supported"
5314
+ );
5315
+ if (options.web_bot_auth?.publicUrl && options.protocol === "a2a")
5316
+ throw new Error("web_bot_auth.publicUrl loopback delivery supports MCP only; use HTTPS directly for A2A");
5317
+ if (!options.web_bot_auth?.publicUrl && new URL(runState.agentUrl).protocol !== "https:")
5318
+ throw new Error("web_bot_auth.publicUrl is required to sign for a non-HTTPS agent");
5319
+ const name = step.auth.identity;
5320
+ const identities = options.web_bot_auth?.identities;
5321
+ const identity = identities && Object.hasOwn(identities, name) ? identities[name] : void 0;
5322
+ if (!identity) throw new Error("web_bot_auth identity is not configured in options.web_bot_auth.identities");
5323
+ signedFetch = createStoryboardWebBotAuthFetch(
5324
+ createAgentTransportFetch(runState.agentUrl, {
5325
+ trustedFetchFn: options.transport?.trustedFetchFn,
5326
+ allowPrivateIp: options.transport?.allowPrivateIp
5327
+ }),
5328
+ identity.key,
5329
+ {
5330
+ agentUrl: runState.agentUrl,
5331
+ origin: identity.origin,
5332
+ ...options.web_bot_auth?.publicUrl && {
5333
+ target: { publicUrl: options.web_bot_auth.publicUrl, loopbackUrl: runState.agentUrl }
5334
+ }
5335
+ }
5336
+ );
5337
+ }
5292
5338
  if (useSdkAuthOverride) {
5293
5339
  if (rawProbeHeaders === void 0) throw new Error("Step auth override credentials were not resolved");
5294
5340
  authOverrideClient = createAuthOverrideClient(
5295
5341
  runState.agentUrl,
5296
5342
  options.protocol ?? "mcp",
5297
5343
  options,
5298
- rawProbeHeaders
5344
+ rawProbeHeaders,
5345
+ signedFetch
5299
5346
  );
5300
5347
  }
5301
5348
  } catch (err) {
@@ -5589,7 +5636,7 @@ async function executeStep(client, step, storyboardId, phaseId, context, allStep
5589
5636
  runState.agentProfile?.raw_capabilities,
5590
5637
  "request_signing.required_for"
5591
5638
  );
5592
- if (taskResult?.adcp_error?.code === "request_signature_required" && Array.isArray(requiredForSigning) && requiredForSigning.includes(effectiveStep.task) && options.functional_request_signing === void 0 && runState.storyboardRequiresRequestSigner !== true) {
5639
+ if (taskResult?.adcp_error?.code === "request_signature_required" && Array.isArray(requiredForSigning) && requiredForSigning.includes(effectiveStep.task) && options.functional_request_signing === void 0 && !useWebBotAuth && runState.storyboardRequiresRequestSigner !== true) {
5593
5640
  const next2 = getNextStepPreview(step.id, allSteps, context, runState.runnerVars);
5594
5641
  const detail = `Agent declared request_signing.required_for includes "${effectiveStep.task}" and rejected the unsigned request with request_signature_required; storyboard "${storyboardId}" does not require request_signer.`;
5595
5642
  return {
@@ -7721,6 +7768,8 @@ function selectProtectedToolTarget(tools) {
7721
7768
  function sessionControlMechanismFor(auth) {
7722
7769
  if (auth === "none") return "any";
7723
7770
  switch (auth.type) {
7771
+ case "web_bot_auth":
7772
+ throw new Error("web_bot_auth is not supported by session probes");
7724
7773
  case "oauth_bearer":
7725
7774
  return "oauth_bearer";
7726
7775
  case "basic":
@@ -7746,6 +7795,9 @@ function planMcpSessionSentinel(step, options, client, agentUrl) {
7746
7795
  )
7747
7796
  };
7748
7797
  }
7798
+ if (typeof step.auth === "object" && step.auth.type === "web_bot_auth") {
7799
+ return { kind: "error", error: "web_bot_auth is not supported by MCP session probes; select an AdCP tool step" };
7800
+ }
7749
7801
  const signatureBound = signatureBoundTools(options);
7750
7802
  const candidates = protectedToolCandidates(options.agentTools);
7751
7803
  if (signatureBound === "unparseable") {
@@ -7805,7 +7857,7 @@ function planMcpSessionSentinel(step, options, client, agentUrl) {
7805
7857
  };
7806
7858
  }
7807
7859
  function authHeadersForStep(directive, options) {
7808
- if (directive === "none") return {};
7860
+ if (directive === "none" || directive.type === "web_bot_auth") return {};
7809
7861
  if (directive.type === "basic") return basicAuthHeadersForStep(directive, options);
7810
7862
  let value;
7811
7863
  if ("value" in directive && directive.value) {
@@ -7853,7 +7905,7 @@ function isCredentialHeaderName(name) {
7853
7905
  if (SESSION_PROBE_ROUTING_HEADERS.has(normalized)) return false;
7854
7906
  return AUTH_OVERRIDE_HEADER_NAMES.has(normalized) || AUTH_OVERRIDE_CREDENTIAL_HEADER_RE.test(normalized) || AUTH_OVERRIDE_COMPACT_CREDENTIAL_RE.test(normalized.replace(/[-_]/g, ""));
7855
7907
  }
7856
- function createAuthOverrideClient(agentUrl, protocol, options, authHeaders) {
7908
+ function createAuthOverrideClient(agentUrl, protocol, options, authHeaders, signedFetch) {
7857
7909
  const runSecrets = runCredentialValues(options);
7858
7910
  const headers = {};
7859
7911
  for (const [name, value] of Object.entries(options.headers ?? {})) {
@@ -7884,6 +7936,7 @@ function createAuthOverrideClient(agentUrl, protocol, options, authHeaders) {
7884
7936
  test_kit: void 0,
7885
7937
  _client: void 0,
7886
7938
  functional_request_signing: void 0,
7939
+ ...signedFetch && { transport: { ...options.transport, trustedFetchFn: signedFetch } },
7887
7940
  headers: Object.keys(headers).length > 0 ? headers : void 0
7888
7941
  });
7889
7942
  }
@@ -704,6 +704,10 @@ export interface ContextInput {
704
704
  export type StepAuthDirective =
705
705
  /** Strip transport credentials entirely. The step MUST hit the agent unauthenticated. */
706
706
  'none' | {
707
+ type: 'web_bot_auth';
708
+ /** Name in the runner's runtime-only `web_bot_auth.identities` map. */
709
+ identity: string;
710
+ } | {
707
711
  type: 'api_key';
708
712
  /** Literal Bearer value sent as `Authorization: Bearer <value>`. */
709
713
  value?: string;
@@ -838,6 +842,11 @@ export interface StoryboardStep {
838
842
  * seller; schema validation remains enabled for `payload_well_formed`.
839
843
  */
840
844
  negative_path?: 'schema_invalid' | 'payload_well_formed';
845
+ /** Opt a schema-valid semantic rejection probe into normal request enrichment.
846
+ * Explicit fixture values remain authoritative. Invalid-input probes must
847
+ * retain the default, which sends the authored request without enrichment.
848
+ */
849
+ enrich_request?: true;
841
850
  /**
842
851
  * Per-step invariant opt-out. See `StepInvariantsObject`. Use when a
843
852
  * specific step deliberately trips a default invariant (e.g. a
@@ -1694,6 +1703,15 @@ export interface PrepareStoryboardFixturesOptions extends StoryboardRunOptions {
1694
1703
  prepared_fixtures_preparation_authorizer?: PreparedFixturesPreparationAuthorizer;
1695
1704
  }
1696
1705
  export interface StoryboardRunOptions extends TestOptions {
1706
+ /** Runtime signing keys; storyboard YAML contains only identity names. */
1707
+ web_bot_auth?: {
1708
+ identities: Record<string, {
1709
+ origin: string;
1710
+ key: import('../../signing/web-bot-auth.mjs').WebBotSigningKey;
1711
+ }>;
1712
+ /** Sign this public HTTPS endpoint, delivering to the loopback agent URL. */
1713
+ publicUrl?: string;
1714
+ };
1697
1715
  /** Compliance cache root for bundle-scoped fixtures and test vectors. */
1698
1716
  complianceDir?: string;
1699
1717
  /**
@@ -704,6 +704,10 @@ export interface ContextInput {
704
704
  export type StepAuthDirective =
705
705
  /** Strip transport credentials entirely. The step MUST hit the agent unauthenticated. */
706
706
  'none' | {
707
+ type: 'web_bot_auth';
708
+ /** Name in the runner's runtime-only `web_bot_auth.identities` map. */
709
+ identity: string;
710
+ } | {
707
711
  type: 'api_key';
708
712
  /** Literal Bearer value sent as `Authorization: Bearer <value>`. */
709
713
  value?: string;
@@ -838,6 +842,11 @@ export interface StoryboardStep {
838
842
  * seller; schema validation remains enabled for `payload_well_formed`.
839
843
  */
840
844
  negative_path?: 'schema_invalid' | 'payload_well_formed';
845
+ /** Opt a schema-valid semantic rejection probe into normal request enrichment.
846
+ * Explicit fixture values remain authoritative. Invalid-input probes must
847
+ * retain the default, which sends the authored request without enrichment.
848
+ */
849
+ enrich_request?: true;
841
850
  /**
842
851
  * Per-step invariant opt-out. See `StepInvariantsObject`. Use when a
843
852
  * specific step deliberately trips a default invariant (e.g. a
@@ -1694,6 +1703,15 @@ export interface PrepareStoryboardFixturesOptions extends StoryboardRunOptions {
1694
1703
  prepared_fixtures_preparation_authorizer?: PreparedFixturesPreparationAuthorizer;
1695
1704
  }
1696
1705
  export interface StoryboardRunOptions extends TestOptions {
1706
+ /** Runtime signing keys; storyboard YAML contains only identity names. */
1707
+ web_bot_auth?: {
1708
+ identities: Record<string, {
1709
+ origin: string;
1710
+ key: import('../../signing/web-bot-auth').WebBotSigningKey;
1711
+ }>;
1712
+ /** Sign this public HTTPS endpoint, delivering to the loopback agent URL. */
1713
+ publicUrl?: string;
1714
+ };
1697
1715
  /** Compliance cache root for bundle-scoped fixtures and test vectors. */
1698
1716
  complianceDir?: string;
1699
1717
  /**
@@ -197,7 +197,7 @@ export interface UpstreamTrafficQueryResult {
197
197
  */
198
198
  export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
199
199
  /** Capability semver emitted in run summaries and used for advisory expiry. */
200
- export declare const RUNNER_CAPABILITY_VERSION = "17.0.0-beta.1";
200
+ export declare const RUNNER_CAPABILITY_VERSION = "17.0.0-beta.3";
201
201
  /** True when a failed validation contributes to the owning step's grade. */
202
202
  export declare function validationFailsStep(result: ValidationResult): boolean;
203
203
  /**
@@ -197,7 +197,7 @@ export interface UpstreamTrafficQueryResult {
197
197
  */
198
198
  export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
199
199
  /** Capability semver emitted in run summaries and used for advisory expiry. */
200
- export declare const RUNNER_CAPABILITY_VERSION = "17.0.0-beta.1";
200
+ export declare const RUNNER_CAPABILITY_VERSION = "17.0.0-beta.3";
201
201
  /** True when a failed validation contributes to the owning step's grade. */
202
202
  export declare function validationFailsStep(result: ValidationResult): boolean;
203
203
  /**
@@ -0,0 +1,10 @@
1
+ import { type WebBotSigningKey, type WebBotSigningOptions } from '../../signing/web-bot-auth.mjs';
2
+ /** Sign the public HTTPS target while the official transport delivers to loopback. */
3
+ export declare function createStoryboardWebBotAuthFetch(upstream: typeof fetch, key: WebBotSigningKey, options: WebBotSigningOptions & {
4
+ /** Pin the destination origin for direct HTTPS delivery. */
5
+ agentUrl?: string;
6
+ target?: {
7
+ publicUrl: string;
8
+ loopbackUrl: string;
9
+ };
10
+ }): typeof fetch;
@@ -0,0 +1,10 @@
1
+ import { type WebBotSigningKey, type WebBotSigningOptions } from '../../signing/web-bot-auth';
2
+ /** Sign the public HTTPS target while the official transport delivers to loopback. */
3
+ export declare function createStoryboardWebBotAuthFetch(upstream: typeof fetch, key: WebBotSigningKey, options: WebBotSigningOptions & {
4
+ /** Pin the destination origin for direct HTTPS delivery. */
5
+ agentUrl?: string;
6
+ target?: {
7
+ publicUrl: string;
8
+ loopbackUrl: string;
9
+ };
10
+ }): typeof fetch;