@adcp/sdk 14.0.0-rc.32 → 14.0.0-rc.33

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 (190) hide show
  1. package/bin/adcp-storyboard-summary.js +1 -0
  2. package/dist/lib/conformance/oracle.js +26 -6
  3. package/dist/lib/conformance/oracle.mjs +26 -6
  4. package/dist/lib/core/SingleAgentClient.js +7 -2
  5. package/dist/lib/core/SingleAgentClient.mjs +8 -3
  6. package/dist/lib/core/TaskExecutor.js +3 -0
  7. package/dist/lib/core/TaskExecutor.mjs +3 -0
  8. package/dist/lib/index.d.mts +1 -1
  9. package/dist/lib/index.d.ts +1 -1
  10. package/dist/lib/protocols/mcp-modern.d.mts +2 -0
  11. package/dist/lib/protocols/mcp-modern.d.ts +2 -0
  12. package/dist/lib/protocols/mcp-modern.js +7 -4
  13. package/dist/lib/protocols/mcp-modern.mjs +7 -4
  14. package/dist/lib/protocols/mcp.js +2 -1
  15. package/dist/lib/protocols/mcp.mjs +3 -2
  16. package/dist/lib/registry/types.generated.d.mts +1 -1
  17. package/dist/lib/registry/types.generated.d.ts +1 -1
  18. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  19. package/dist/lib/server/a2a-adapter.js +2 -3
  20. package/dist/lib/server/a2a-adapter.mjs +4 -4
  21. package/dist/lib/server/adcp-server.d.mts +11 -2
  22. package/dist/lib/server/adcp-server.d.ts +11 -2
  23. package/dist/lib/server/adcp-server.js +3 -2
  24. package/dist/lib/server/adcp-server.mjs +3 -2
  25. package/dist/lib/server/create-adcp-server.d.mts +43 -17
  26. package/dist/lib/server/create-adcp-server.d.ts +43 -17
  27. package/dist/lib/server/create-adcp-server.js +278 -161
  28. package/dist/lib/server/create-adcp-server.mjs +191 -74
  29. package/dist/lib/server/decisioning/account.d.mts +2 -0
  30. package/dist/lib/server/decisioning/account.d.ts +2 -0
  31. package/dist/lib/server/decisioning/async-outcome.d.mts +4 -0
  32. package/dist/lib/server/decisioning/async-outcome.d.ts +4 -0
  33. package/dist/lib/server/decisioning/context.d.mts +2 -0
  34. package/dist/lib/server/decisioning/context.d.ts +2 -0
  35. package/dist/lib/server/decisioning/runtime/from-platform.js +77 -41
  36. package/dist/lib/server/decisioning/runtime/from-platform.mjs +77 -41
  37. package/dist/lib/server/decisioning/runtime/to-context.d.mts +1 -1
  38. package/dist/lib/server/decisioning/runtime/to-context.d.ts +1 -1
  39. package/dist/lib/server/decisioning/runtime/to-context.js +24 -7
  40. package/dist/lib/server/decisioning/runtime/to-context.mjs +24 -7
  41. package/dist/lib/server/index.d.mts +4 -2
  42. package/dist/lib/server/index.d.ts +4 -2
  43. package/dist/lib/server/index.js +25 -0
  44. package/dist/lib/server/index.mjs +26 -0
  45. package/dist/lib/server/legacy/v5/index.d.mts +1 -1
  46. package/dist/lib/server/legacy/v5/index.d.ts +1 -1
  47. package/dist/lib/server/notification-subscriptions/index.d.mts +9 -0
  48. package/dist/lib/server/notification-subscriptions/index.d.ts +9 -0
  49. package/dist/lib/server/notification-subscriptions/index.js +55 -0
  50. package/dist/lib/server/notification-subscriptions/index.mjs +30 -0
  51. package/dist/lib/server/notification-subscriptions/memory-store.d.mts +3 -0
  52. package/dist/lib/server/notification-subscriptions/memory-store.d.ts +3 -0
  53. package/dist/lib/server/notification-subscriptions/memory-store.js +95 -0
  54. package/dist/lib/server/notification-subscriptions/memory-store.mjs +71 -0
  55. package/dist/lib/server/notification-subscriptions/postgres-runtime.d.mts +42 -0
  56. package/dist/lib/server/notification-subscriptions/postgres-runtime.d.ts +42 -0
  57. package/dist/lib/server/notification-subscriptions/postgres-runtime.js +84 -0
  58. package/dist/lib/server/notification-subscriptions/postgres-runtime.mjs +65 -0
  59. package/dist/lib/server/notification-subscriptions/postgres-store.d.mts +10 -0
  60. package/dist/lib/server/notification-subscriptions/postgres-store.d.ts +10 -0
  61. package/dist/lib/server/notification-subscriptions/postgres-store.js +232 -0
  62. package/dist/lib/server/notification-subscriptions/postgres-store.mjs +206 -0
  63. package/dist/lib/server/notification-subscriptions/protocol-handlers.d.mts +14 -0
  64. package/dist/lib/server/notification-subscriptions/protocol-handlers.d.ts +14 -0
  65. package/dist/lib/server/notification-subscriptions/protocol-handlers.js +102 -0
  66. package/dist/lib/server/notification-subscriptions/protocol-handlers.mjs +78 -0
  67. package/dist/lib/server/notification-subscriptions/runtime.d.mts +20 -0
  68. package/dist/lib/server/notification-subscriptions/runtime.d.ts +20 -0
  69. package/dist/lib/server/notification-subscriptions/runtime.js +849 -0
  70. package/dist/lib/server/notification-subscriptions/runtime.mjs +821 -0
  71. package/dist/lib/server/notification-subscriptions/types.d.mts +330 -0
  72. package/dist/lib/server/notification-subscriptions/types.d.ts +330 -0
  73. package/dist/lib/server/notification-subscriptions/types.js +35 -0
  74. package/dist/lib/server/notification-subscriptions/types.mjs +11 -0
  75. package/dist/lib/server/redact.d.mts +1 -51
  76. package/dist/lib/server/redact.d.ts +1 -51
  77. package/dist/lib/server/redact.js +2 -9
  78. package/dist/lib/server/redact.mjs +1 -8
  79. package/dist/lib/server/webhook-delivery/recovery.d.mts +2 -0
  80. package/dist/lib/server/webhook-delivery/recovery.d.ts +2 -0
  81. package/dist/lib/server/webhook-delivery/recovery.js +9 -4
  82. package/dist/lib/server/webhook-delivery/recovery.mjs +9 -4
  83. package/dist/lib/server/webhook-emitter.d.mts +41 -0
  84. package/dist/lib/server/webhook-emitter.d.ts +41 -0
  85. package/dist/lib/server/webhook-emitter.js +76 -4
  86. package/dist/lib/server/webhook-emitter.mjs +76 -4
  87. package/dist/lib/testing/compliance/summary.js +34 -6
  88. package/dist/lib/testing/compliance/summary.mjs +34 -6
  89. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  90. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  91. package/dist/lib/types/accept-proposal.d.ts +6 -3
  92. package/dist/lib/types/acquire-rights.d.ts +6 -3
  93. package/dist/lib/types/activate-signal.d.ts +6 -3
  94. package/dist/lib/types/build-creative.d.ts +11 -8
  95. package/dist/lib/types/buy-products.d.ts +6 -3
  96. package/dist/lib/types/calibrate-content.d.ts +6 -3
  97. package/dist/lib/types/comply-test-controller.d.ts +8 -5
  98. package/dist/lib/types/control-media-buy.d.ts +6 -3
  99. package/dist/lib/types/create-collection-list.d.ts +5 -2
  100. package/dist/lib/types/create-content-standards.d.ts +6 -3
  101. package/dist/lib/types/create-media-buy.d.ts +7 -4
  102. package/dist/lib/types/create-property-list.d.ts +5 -2
  103. package/dist/lib/types/decline-proposals.d.ts +6 -3
  104. package/dist/lib/types/delete-collection-list.d.ts +5 -2
  105. package/dist/lib/types/delete-property-list.d.ts +5 -2
  106. package/dist/lib/types/get-account-financials.d.ts +6 -3
  107. package/dist/lib/types/get-adcp-capabilities.d.ts +6 -3
  108. package/dist/lib/types/get-brand-identity.d.ts +6 -3
  109. package/dist/lib/types/get-collection-list.d.ts +5 -2
  110. package/dist/lib/types/get-content-standards.d.ts +6 -3
  111. package/dist/lib/types/get-creative-delivery.d.ts +6 -3
  112. package/dist/lib/types/get-creative-features.d.ts +6 -3
  113. package/dist/lib/types/get-media-buy-artifacts.d.ts +6 -3
  114. package/dist/lib/types/get-media-buy-delivery.d.ts +6 -3
  115. package/dist/lib/types/get-media-buys.d.ts +6 -3
  116. package/dist/lib/types/get-plan-audit-logs.d.ts +5 -2
  117. package/dist/lib/types/get-principal.d.ts +7 -4
  118. package/dist/lib/types/get-products.d.ts +7 -4
  119. package/dist/lib/types/get-property-list.d.ts +5 -2
  120. package/dist/lib/types/get-reporting-status.d.ts +8 -5
  121. package/dist/lib/types/get-rights.d.ts +6 -3
  122. package/dist/lib/types/get-signals.d.ts +7 -4
  123. package/dist/lib/types/get-task-status.d.ts +5 -2
  124. package/dist/lib/types/list-account-changes.d.ts +8 -5
  125. package/dist/lib/types/list-accounts.d.ts +6 -3
  126. package/dist/lib/types/list-collection-lists.d.ts +5 -2
  127. package/dist/lib/types/list-content-standards.d.ts +6 -3
  128. package/dist/lib/types/list-creative-formats.d.ts +6 -3
  129. package/dist/lib/types/list-creatives.d.ts +8 -5
  130. package/dist/lib/types/list-property-lists.d.ts +5 -2
  131. package/dist/lib/types/list-tasks.d.ts +5 -2
  132. package/dist/lib/types/list-transformers.d.ts +6 -3
  133. package/dist/lib/types/log-event.d.ts +6 -3
  134. package/dist/lib/types/preview-creative.d.ts +5 -2
  135. package/dist/lib/types/provide-performance-feedback.d.ts +6 -3
  136. package/dist/lib/types/refine-proposals.d.ts +8 -5
  137. package/dist/lib/types/report-usage.d.ts +6 -3
  138. package/dist/lib/types/request-proposals.d.ts +8 -5
  139. package/dist/lib/types/schemas.generated.d.ts +4 -4
  140. package/dist/lib/types/schemas.generated.js +3 -3
  141. package/dist/lib/types/schemas.generated.mjs +3 -3
  142. package/dist/lib/types/search-brands.d.ts +6 -3
  143. package/dist/lib/types/si-get-offering.d.ts +6 -3
  144. package/dist/lib/types/si-initiate-session.d.ts +6 -3
  145. package/dist/lib/types/si-send-message.d.ts +6 -3
  146. package/dist/lib/types/si-terminate-session.d.ts +6 -3
  147. package/dist/lib/types/sync-accounts.d.ts +7 -4
  148. package/dist/lib/types/sync-agent-notification-configs.d.ts +6 -3
  149. package/dist/lib/types/sync-audiences.d.ts +8 -5
  150. package/dist/lib/types/sync-catalogs.d.ts +9 -6
  151. package/dist/lib/types/sync-creatives.d.ts +8 -5
  152. package/dist/lib/types/sync-event-sources.d.ts +7 -4
  153. package/dist/lib/types/sync-governance.d.ts +7 -4
  154. package/dist/lib/types/sync-plans.d.ts +5 -2
  155. package/dist/lib/types/sync-principal.d.ts +9 -6
  156. package/dist/lib/types/sync-reporting-receipts.d.ts +6 -3
  157. package/dist/lib/types/update-collection-list.d.ts +5 -2
  158. package/dist/lib/types/update-content-standards.d.ts +6 -3
  159. package/dist/lib/types/update-media-buy.d.ts +7 -4
  160. package/dist/lib/types/update-property-list.d.ts +5 -2
  161. package/dist/lib/types/update-rights.d.ts +6 -3
  162. package/dist/lib/types/validate-content-delivery.d.ts +6 -3
  163. package/dist/lib/types/validate-input.d.ts +5 -2
  164. package/dist/lib/types/validate-property-delivery.d.ts +5 -2
  165. package/dist/lib/types/verify-brand-claim.d.ts +6 -3
  166. package/dist/lib/types/verify-brand-claims.d.ts +6 -3
  167. package/dist/lib/utils/adcp-version-config.d.mts +1 -1
  168. package/dist/lib/utils/adcp-version-config.d.ts +1 -1
  169. package/dist/lib/utils/adcp-version-config.js +7 -7
  170. package/dist/lib/utils/adcp-version-config.mjs +7 -7
  171. package/dist/lib/utils/logger.d.mts +10 -1
  172. package/dist/lib/utils/logger.d.ts +10 -1
  173. package/dist/lib/utils/logger.js +193 -8
  174. package/dist/lib/utils/logger.mjs +193 -8
  175. package/dist/lib/utils/redact-credential-patterns.d.mts +2 -0
  176. package/dist/lib/utils/redact-credential-patterns.d.ts +2 -0
  177. package/dist/lib/utils/redact-credential-patterns.js +66 -0
  178. package/dist/lib/utils/redact-credential-patterns.mjs +42 -0
  179. package/dist/lib/version.d.mts +3 -3
  180. package/dist/lib/version.d.ts +3 -3
  181. package/dist/lib/version.js +3 -3
  182. package/dist/lib/version.mjs +3 -3
  183. package/docs/TYPE-SUMMARY.md +25 -2
  184. package/docs/guides/BUILD-AN-AGENT.md +7 -0
  185. package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +17 -1
  186. package/docs/guides/PERSISTENT-NOTIFICATION-RUNTIME.md +214 -0
  187. package/docs/guides/PRODUCTION-DURABILITY.md +5 -0
  188. package/docs/llms.txt +5 -2
  189. package/docs/migration-13-to-14.md +22 -0
  190. package/package.json +1 -1
@@ -19,6 +19,7 @@ const { writeFileSync } = require('node:fs');
19
19
 
20
20
  function escapeMarkdownCell(s) {
21
21
  return String(s ?? '')
22
+ .replace(/\\/g, '\\\\')
22
23
  .replace(/\|/g, '\\|')
23
24
  .replace(/\n/g, ' ');
24
25
  }
@@ -56,17 +56,33 @@ const STACK_TRACE_REGEXES = [
56
56
  /\.go:\d+ \+0x[0-9a-f]+/,
57
57
  // PHP: `#7 /var/www/foo.php(42): Bar->baz()` — numbered frame with file:line
58
58
  /#\d+ [^\s]+\.php\(\d+\):/,
59
- // JVM: `\n\tat com.foo.Bar.method(Bar.java:42)` — fully-qualified
60
- // method with source:line. Anchored to whitespace/newline so an
61
- // echoed Javadoc reference in prose (`"at com.foo.Bar(Bar.java:42)"`)
62
- // doesn't trigger the detector — real stack frames sit on their own
63
- // indented line.
64
- /(?:\\n\s*|^\s+|\n\s+)at [\w$.]+\.[\w$]+\([\w$]+\.(?:java|kt|kts|scala|groovy):\d+\)/,
65
59
  // .NET: `at Foo.Bar.Baz() in /path/to/X.cs:line 42` — method invocation
66
60
  // followed by ` in ` and a file:line marker. The method-name charset
67
61
  // includes parens/brackets for generic and overloaded signatures.
68
62
  /at [\w.<>`,()[\]]+ in [^:\s]+\.(?:cs|vb|fs):line \d+/
69
63
  ];
64
+ const JVM_STACK_FRAME = /^at [\w$.]+\.[\w$]+\([\w$]+\.(?:java|kt|kts|scala|groovy):\d+\)\s*/;
65
+ function isJsonFramingSuffix(value) {
66
+ if (!value.startsWith('"')) return false;
67
+ for (let index = 1; index < value.length; index++) {
68
+ const char = value[index];
69
+ if (char !== "}" && char !== "]" && char !== "," && char !== " " && char !== " ") return false;
70
+ }
71
+ return true;
72
+ }
73
+ function hasJvmStackFrame(haystack) {
74
+ const lines = haystack.replaceAll("\\n", "\n").split("\n");
75
+ for (const [index, line] of lines.entries()) {
76
+ const candidate = line.trimStart();
77
+ if (index > 0 || candidate !== line) {
78
+ const match = JVM_STACK_FRAME.exec(candidate);
79
+ if (match && (match[0].length === candidate.length || isJsonFramingSuffix(candidate.slice(match[0].length)))) {
80
+ return true;
81
+ }
82
+ }
83
+ }
84
+ return false;
85
+ }
70
86
  const FS_PATH_SIGNATURES = [/\/Users\/[^ "']+/, /\/home\/[^ "']+/, /[A-Z]:\\\\Users\\\\/];
71
87
  let cachedAjv = null;
72
88
  function getAjv() {
@@ -160,6 +176,10 @@ function checkNoStackLeak(result, failures) {
160
176
  return;
161
177
  }
162
178
  }
179
+ if (hasJvmStackFrame(haystack)) {
180
+ failures.push(`stack trace leak (matched ${JVM_STACK_FRAME.source})`);
181
+ return;
182
+ }
163
183
  for (const rx of STACK_TRACE_REGEXES) {
164
184
  if (rx.test(haystack)) {
165
185
  failures.push(`stack trace leak (matched ${rx.source})`);
@@ -22,17 +22,33 @@ const STACK_TRACE_REGEXES = [
22
22
  /\.go:\d+ \+0x[0-9a-f]+/,
23
23
  // PHP: `#7 /var/www/foo.php(42): Bar->baz()` — numbered frame with file:line
24
24
  /#\d+ [^\s]+\.php\(\d+\):/,
25
- // JVM: `\n\tat com.foo.Bar.method(Bar.java:42)` — fully-qualified
26
- // method with source:line. Anchored to whitespace/newline so an
27
- // echoed Javadoc reference in prose (`"at com.foo.Bar(Bar.java:42)"`)
28
- // doesn't trigger the detector — real stack frames sit on their own
29
- // indented line.
30
- /(?:\\n\s*|^\s+|\n\s+)at [\w$.]+\.[\w$]+\([\w$]+\.(?:java|kt|kts|scala|groovy):\d+\)/,
31
25
  // .NET: `at Foo.Bar.Baz() in /path/to/X.cs:line 42` — method invocation
32
26
  // followed by ` in ` and a file:line marker. The method-name charset
33
27
  // includes parens/brackets for generic and overloaded signatures.
34
28
  /at [\w.<>`,()[\]]+ in [^:\s]+\.(?:cs|vb|fs):line \d+/
35
29
  ];
30
+ const JVM_STACK_FRAME = /^at [\w$.]+\.[\w$]+\([\w$]+\.(?:java|kt|kts|scala|groovy):\d+\)\s*/;
31
+ function isJsonFramingSuffix(value) {
32
+ if (!value.startsWith('"')) return false;
33
+ for (let index = 1; index < value.length; index++) {
34
+ const char = value[index];
35
+ if (char !== "}" && char !== "]" && char !== "," && char !== " " && char !== " ") return false;
36
+ }
37
+ return true;
38
+ }
39
+ function hasJvmStackFrame(haystack) {
40
+ const lines = haystack.replaceAll("\\n", "\n").split("\n");
41
+ for (const [index, line] of lines.entries()) {
42
+ const candidate = line.trimStart();
43
+ if (index > 0 || candidate !== line) {
44
+ const match = JVM_STACK_FRAME.exec(candidate);
45
+ if (match && (match[0].length === candidate.length || isJsonFramingSuffix(candidate.slice(match[0].length)))) {
46
+ return true;
47
+ }
48
+ }
49
+ }
50
+ return false;
51
+ }
36
52
  const FS_PATH_SIGNATURES = [/\/Users\/[^ "']+/, /\/home\/[^ "']+/, /[A-Z]:\\\\Users\\\\/];
37
53
  let cachedAjv = null;
38
54
  function getAjv() {
@@ -126,6 +142,10 @@ function checkNoStackLeak(result, failures) {
126
142
  return;
127
143
  }
128
144
  }
145
+ if (hasJvmStackFrame(haystack)) {
146
+ failures.push(`stack trace leak (matched ${JVM_STACK_FRAME.source})`);
147
+ return;
148
+ }
129
149
  for (const rx of STACK_TRACE_REGEXES) {
130
150
  if (rx.test(haystack)) {
131
151
  failures.push(`stack trace leak (matched ${rx.source})`);
@@ -5488,6 +5488,8 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5488
5488
  ...options?.signal && { signal: options.signal },
5489
5489
  ...clientRequestTimeoutMs !== void 0 && { timeout: clientRequestTimeoutMs }
5490
5490
  };
5491
+ const discoveryAdcpVersion = this.getWireAdcpVersion();
5492
+ const mcpListParams = (0, import_version.parseAdcpMajorVersion)(discoveryAdcpVersion) >= 3 ? { _meta: { adcp_version: (0, import_version.toReleasePrecisionVersion)(discoveryAdcpVersion) } } : void 0;
5491
5493
  const ensureReadAuthToken = async () => {
5492
5494
  if (!this.normalizedAgent.oauth_client_credentials) return this.normalizedAgent.auth_token;
5493
5495
  const { ensureClientCredentialsTokens, getAgentStorage } = await import("../auth/oauth/index.js");
@@ -5504,7 +5506,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5504
5506
  const mcpClient2 = this.normalizedAgent._inProcessMcpClient;
5505
5507
  const toolsList = await withResponseSizeLimit(
5506
5508
  maxResponseBytes,
5507
- () => mcpClient2.listTools(void 0, mcpRequestOptions)
5509
+ () => mcpClient2.listTools(mcpListParams, mcpRequestOptions)
5508
5510
  );
5509
5511
  const tools = toolsList.tools.map((tool) => ({
5510
5512
  name: tool.name,
@@ -5557,6 +5559,9 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5557
5559
  maxResponseBytes,
5558
5560
  () => tryListModernMCPTools(agent.agent_uri, readAuthToken, this.normalizedAgent.headers, {
5559
5561
  authProvider,
5562
+ ...mcpListParams?._meta.adcp_version !== void 0 && {
5563
+ adcpVersion: mcpListParams._meta.adcp_version
5564
+ },
5560
5565
  signal: options?.signal,
5561
5566
  requestTimeoutMs: transport?.requestTimeoutMs,
5562
5567
  fetchFn: transport?.trustedFetchFn,
@@ -5582,7 +5587,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5582
5587
  try {
5583
5588
  const toolsList = await withResponseSizeLimit(
5584
5589
  maxResponseBytes,
5585
- () => mcpClient.listTools(void 0, mcpRequestOptions)
5590
+ () => mcpClient.listTools(mcpListParams, mcpRequestOptions)
5586
5591
  );
5587
5592
  const tools = toolsList.tools.map((tool) => ({
5588
5593
  name: tool.name,
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import * as schemas from "../types/schemas.generated.mjs";
3
3
  import { ADCP_ENVELOPE_FIELDS } from "../types/adcp.mjs";
4
- import { parseAdcpMajorVersion } from "../version.mjs";
4
+ import { parseAdcpMajorVersion, toReleasePrecisionVersion } from "../version.mjs";
5
5
  import {
6
6
  isAdcpVersionSupported,
7
7
  isAdcpVersionAtLeast,
@@ -5542,6 +5542,8 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5542
5542
  ...options?.signal && { signal: options.signal },
5543
5543
  ...clientRequestTimeoutMs !== void 0 && { timeout: clientRequestTimeoutMs }
5544
5544
  };
5545
+ const discoveryAdcpVersion = this.getWireAdcpVersion();
5546
+ const mcpListParams = parseAdcpMajorVersion(discoveryAdcpVersion) >= 3 ? { _meta: { adcp_version: toReleasePrecisionVersion(discoveryAdcpVersion) } } : void 0;
5545
5547
  const ensureReadAuthToken = async () => {
5546
5548
  if (!this.normalizedAgent.oauth_client_credentials) return this.normalizedAgent.auth_token;
5547
5549
  const { ensureClientCredentialsTokens, getAgentStorage } = await import("../auth/oauth/index.mjs");
@@ -5558,7 +5560,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5558
5560
  const mcpClient2 = this.normalizedAgent._inProcessMcpClient;
5559
5561
  const toolsList = await withResponseSizeLimit(
5560
5562
  maxResponseBytes,
5561
- () => mcpClient2.listTools(void 0, mcpRequestOptions)
5563
+ () => mcpClient2.listTools(mcpListParams, mcpRequestOptions)
5562
5564
  );
5563
5565
  const tools = toolsList.tools.map((tool) => ({
5564
5566
  name: tool.name,
@@ -5611,6 +5613,9 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5611
5613
  maxResponseBytes,
5612
5614
  () => tryListModernMCPTools(agent.agent_uri, readAuthToken, this.normalizedAgent.headers, {
5613
5615
  authProvider,
5616
+ ...mcpListParams?._meta.adcp_version !== void 0 && {
5617
+ adcpVersion: mcpListParams._meta.adcp_version
5618
+ },
5614
5619
  signal: options?.signal,
5615
5620
  requestTimeoutMs: transport?.requestTimeoutMs,
5616
5621
  fetchFn: transport?.trustedFetchFn,
@@ -5636,7 +5641,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5636
5641
  try {
5637
5642
  const toolsList = await withResponseSizeLimit(
5638
5643
  maxResponseBytes,
5639
- () => mcpClient.listTools(void 0, mcpRequestOptions)
5644
+ () => mcpClient.listTools(mcpListParams, mcpRequestOptions)
5640
5645
  );
5641
5646
  const tools = toolsList.tools.map((tool) => ({
5642
5647
  name: tool.name,
@@ -1673,6 +1673,9 @@ class TaskExecutor {
1673
1673
  }
1674
1674
  externalTaskObservationKey(observation) {
1675
1675
  return (0, import_crypto.createHmac)("sha256", EXTERNAL_TASK_OBSERVATION_HMAC_KEY).update(
1676
+ // This keyed digest deduplicates canonical task observations; it does
1677
+ // not store or verify passwords. Agent responses are over-tainted.
1678
+ // codeql[js/insufficient-password-hash]
1676
1679
  (0, import_jcs.canonicalize)({
1677
1680
  status: observation.status,
1678
1681
  serverTaskId: observation.serverTaskId ?? null,
@@ -1647,6 +1647,9 @@ class TaskExecutor {
1647
1647
  }
1648
1648
  externalTaskObservationKey(observation) {
1649
1649
  return createHmac("sha256", EXTERNAL_TASK_OBSERVATION_HMAC_KEY).update(
1650
+ // This keyed digest deduplicates canonical task observations; it does
1651
+ // not store or verify passwords. Agent responses are over-tainted.
1652
+ // codeql[js/insufficient-password-hash]
1650
1653
  canonicalize({
1651
1654
  status: observation.status,
1652
1655
  serverTaskId: observation.serverTaskId ?? null,
@@ -163,7 +163,7 @@ export type { Error as TaskErrorDetail } from './types/core.generated.mjs';
163
163
  export { STANDARD_ERROR_CODES, isStandardErrorCode, getErrorRecovery } from './types/error-codes.mjs';
164
164
  export type { StandardErrorCode, ErrorRecovery } from './types/error-codes.mjs';
165
165
  export { adcpError, legacyCapabilitiesResponse, legacyProductsResponse, legacyMediaBuyResponse, legacyDeliveryResponse, legacyListAccountsResponse, legacyListCreativeFormatsResponse, legacyUpdateMediaBuyResponse, legacyGetMediaBuysResponse, legacyPerformanceFeedbackResponse, legacyBuildCreativeResponse, legacyBuildCreativeMultiResponse, legacyPreviewCreativeResponse, legacyCreativeDeliveryResponse, legacyListCreativesResponse, legacyListPropertyListsResponse, legacyListCollectionListsResponse, legacyListContentStandardsResponse, legacyGetPlanAuditLogsResponse, legacySyncCreativesResponse, legacyGetSignalsResponse, legacyActivateSignalResponse, legacyCancelMediaBuyResponse, legacyAcquireRightsResponse, legacyAcquireRightsAcquired, legacyAcquireRightsPendingApproval, legacyAcquireRightsRejected, legacySyncAccountsResponse, legacySyncGovernanceResponse, legacyReportUsageResponse, validActionsForStatus, MEDIA_BUY_TRANSITIONS, CREATIVE_ASSET_TRANSITIONS, isLegalMediaBuyTransition, isLegalCreativeTransition, assertMediaBuyTransition, assertCreativeTransition, getAccountMode, isSandboxOrMockAccount, assertSandboxAccount, taskToolResponse, registerAdcpTaskTool, createTaskCapableServer, InMemoryTaskStore, isTerminal, serve, taskScopeFromPrincipal, UnknownHostError, hostname, resolveHost, verifyIntrospection, registerTestController, handleTestControllerRequest, TestControllerError, toMcpResponse, TOOL_INPUT_SHAPE, CONTROLLER_SCENARIOS, DISCOVERY_ARM_SCENARIOS, SEED_SCENARIOS, SESSION_ENTRY_CAP, enforceMapCap, createSeedFixtureCache, PostgresTaskStore, cleanupExpiredTasks, getMcpTasksMigration, MCP_TASKS_MIGRATION, ADCP_PRE_TRANSPORT, checkGovernance, governanceDeniedError, DEFAULT_REPORTING_CAPABILITIES, InMemoryStateStore, PostgresStateStore, getAdcpStateMigration, ADCP_STATE_MIGRATION, StateError, PatchConflictError, SESSION_KEY_FIELD, createSessionedStore, scopedStore, patchWithRetry, isPutIfMatchConflict, requireSessionKey, structuredSerialize, structuredDeserialize, createIdempotencyStore, memoryBackend, pgBackend, getIdempotencyMigration, IDEMPOTENCY_MIGRATION, cleanupExpiredIdempotency, redisBackend, createLazyBackend, hashPayload, IdempotencyClaimOwnershipError, getServeRequestContext, ADCP_SERVE_REQUEST_CONTEXT, createA2AAdapter, A2AInvocationError, MCP_APP_RESOURCE_MIME_TYPE, ADCP_MIRRORED_STRUCTURED_CONTENT_META_KEY, } from './server/index.mjs';
166
- export type { AdcpErrorOptions, AdcpErrorResponse, McpToolResponse, ValidAction, CancelMediaBuyInput, AdcpTaskToolConfig, TaskStore, TaskMessageQueue, CreateTaskOptions, ToolTaskHandler, CreateTaskRequestHandlerExtra, TaskRequestHandlerExtra, CreateTaskResult, GetTaskResult, Task, ServeContext, ServeOptions, PgQueryable, PostgresTaskStoreOptions, TestControllerStore, TestControllerStoreFactory, TestControllerStoreOrFactory, ControllerScenario, SeedScenario, SeedFixtureCache, SessionContext, OnInstructionsError, MaybePromise, LegacyAdcpServerConfig, LegacyAdcpToolMap, AdcpServerToolName, AdcpCapabilitiesConfig, LegacyAdcpCustomToolConfig, McpAppUiMeta, McpAppMeta, AdcpMcpResourceDefinition, McpAppResourceCsp, McpAppResourcePermissions, McpAppResourceUiMeta, McpAppResourceMeta, McpAppResourceReadContext, AdcpLogger, LegacyHandlerContext, LegacyMediaBuyHandlers, LegacySignalsHandlers, LegacyCreativeHandlers, LegacyGovernanceHandlers, LegacyAccountHandlers, LegacyEventTrackingHandlers, LegacySponsoredIntelligenceHandlers, SignedRequestsConfig, AdcpPreTransport, AdcpServer, AdcpServerTransport, AdcpTestRequest, AdcpTestToolsCallRequest, AdcpTestResponse, AdcpInvokeOptions, StructuredContentFallbackTransport, StructuredContentTextFallback, StructuredContentTextFallbackContext, CheckGovernanceOptions, GovernanceCallResult, GovernanceApproved, GovernanceDenied, GovernanceConditions, AdcpStateStore, ListOptions as StateListOptions, ListResult as StateListResult, PostgresStateStoreOptions, InMemoryStateStoreOptions, VersionedDocument, PutIfMatchResult, PatchWithRetryOptions, StateErrorCode, SessionKeyContext, IdempotencyStore, IdempotencyStoreConfig, IdempotencyBackend, IdempotencyCacheEntry, IdempotencyCheckResult, MemoryBackendOptions, PgBackendOptions, RedisBackendOptions, RedisBackendClient, RedisLikeClient, LazyBackendFactory, LazyBackendOptions, A2AAdapter, A2AAdapterOptions, A2AAgentCardOverrides, A2AAgentCapabilitiesOverride, A2AAgentSkillOverride, A2AMountOptions, ExpressAppLike, LegacyHttpSecurityScheme, LegacySecurityScheme, AccountMode, RequireCacheScopeWhenProducts, ServerPayload, GetProductsPayload, CreateMediaBuyPayload, UpdateMediaBuyPayload, GetMediaBuysPayload, GetMediaBuyDeliveryPayload, ListCreativesPayload, GetCreativeDeliveryPayload, CanonicalPreviewCreativePayload, PreviewCreativePayload, LegacyGetProductsPayload, LegacyCreateMediaBuyPayload, LegacyUpdateMediaBuyPayload, LegacyGetMediaBuysPayload, LegacyGetMediaBuyDeliveryPayload, LegacyListCreativesPayload, LegacyGetCreativeDeliveryPayload, LegacyListCreativeFormatsPayload, LegacyListCreativeFormatsResponsePayload, LegacyListCreativeFormatsServerPayload, LegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload, LegacyBuildCreativeVariantPayload, LegacyPreviewCreativePayload, SyncCreativesPayload, SyncCreativesSuccessPayload, SyncCreativesErrorPayload, } from './server/index.mjs';
166
+ export type { AdcpErrorOptions, AdcpErrorResponse, McpToolResponse, ValidAction, CancelMediaBuyInput, AdcpTaskToolConfig, TaskStore, TaskMessageQueue, CreateTaskOptions, ToolTaskHandler, CreateTaskRequestHandlerExtra, TaskRequestHandlerExtra, CreateTaskResult, GetTaskResult, Task, ServeContext, ServeOptions, PgQueryable, PostgresTaskStoreOptions, TestControllerStore, TestControllerStoreFactory, TestControllerStoreOrFactory, ControllerScenario, SeedScenario, SeedFixtureCache, SessionContext, OnInstructionsError, MaybePromise, LegacyAdcpServerConfig, LegacyAdcpToolMap, AdcpServerToolName, AdcpCapabilitiesConfig, LegacyAdcpCustomToolConfig, LegacyAdcpCustomToolHandler, LegacyAdcpCustomToolHandlerExtra, McpAppUiMeta, McpAppMeta, AdcpMcpResourceDefinition, McpAppResourceCsp, McpAppResourcePermissions, McpAppResourceUiMeta, McpAppResourceMeta, McpAppResourceReadContext, AdcpLogger, LegacyHandlerContext, LegacyMediaBuyHandlers, LegacySignalsHandlers, LegacyCreativeHandlers, LegacyGovernanceHandlers, LegacyAccountHandlers, LegacyEventTrackingHandlers, LegacySponsoredIntelligenceHandlers, SignedRequestsConfig, AdcpPreTransport, AdcpServer, AdcpServerTransport, AdcpTestRequest, AdcpTestToolsCallRequest, AdcpTestResponse, AdcpInvokeOptions, StructuredContentFallbackTransport, StructuredContentTextFallback, StructuredContentTextFallbackContext, CheckGovernanceOptions, GovernanceCallResult, GovernanceApproved, GovernanceDenied, GovernanceConditions, AdcpStateStore, ListOptions as StateListOptions, ListResult as StateListResult, PostgresStateStoreOptions, InMemoryStateStoreOptions, VersionedDocument, PutIfMatchResult, PatchWithRetryOptions, StateErrorCode, SessionKeyContext, IdempotencyStore, IdempotencyStoreConfig, IdempotencyBackend, IdempotencyCacheEntry, IdempotencyCheckResult, MemoryBackendOptions, PgBackendOptions, RedisBackendOptions, RedisBackendClient, RedisLikeClient, LazyBackendFactory, LazyBackendOptions, A2AAdapter, A2AAdapterOptions, A2AAgentCardOverrides, A2AAgentCapabilitiesOverride, A2AAgentSkillOverride, A2AMountOptions, ExpressAppLike, LegacyHttpSecurityScheme, LegacySecurityScheme, AccountMode, RequireCacheScopeWhenProducts, ServerPayload, GetProductsPayload, CreateMediaBuyPayload, UpdateMediaBuyPayload, GetMediaBuysPayload, GetMediaBuyDeliveryPayload, ListCreativesPayload, GetCreativeDeliveryPayload, CanonicalPreviewCreativePayload, PreviewCreativePayload, LegacyGetProductsPayload, LegacyCreateMediaBuyPayload, LegacyUpdateMediaBuyPayload, LegacyGetMediaBuysPayload, LegacyGetMediaBuyDeliveryPayload, LegacyListCreativesPayload, LegacyGetCreativeDeliveryPayload, LegacyListCreativeFormatsPayload, LegacyListCreativeFormatsResponsePayload, LegacyListCreativeFormatsServerPayload, LegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload, LegacyBuildCreativeVariantPayload, LegacyPreviewCreativePayload, SyncCreativesPayload, SyncCreativesSuccessPayload, SyncCreativesErrorPayload, } from './server/index.mjs';
167
167
  export { isRetryable, getRetryDelay } from './utils/retry.mjs';
168
168
  export { decideRetry, BuyerRetryPolicy } from './utils/buyer-retry-policy.mjs';
169
169
  export type { RetryDecision, RetryContext, RetryDecisionOverride } from './utils/buyer-retry-policy.mjs';
@@ -163,7 +163,7 @@ export type { Error as TaskErrorDetail } from './types/core.generated';
163
163
  export { STANDARD_ERROR_CODES, isStandardErrorCode, getErrorRecovery } from './types/error-codes';
164
164
  export type { StandardErrorCode, ErrorRecovery } from './types/error-codes';
165
165
  export { adcpError, legacyCapabilitiesResponse, legacyProductsResponse, legacyMediaBuyResponse, legacyDeliveryResponse, legacyListAccountsResponse, legacyListCreativeFormatsResponse, legacyUpdateMediaBuyResponse, legacyGetMediaBuysResponse, legacyPerformanceFeedbackResponse, legacyBuildCreativeResponse, legacyBuildCreativeMultiResponse, legacyPreviewCreativeResponse, legacyCreativeDeliveryResponse, legacyListCreativesResponse, legacyListPropertyListsResponse, legacyListCollectionListsResponse, legacyListContentStandardsResponse, legacyGetPlanAuditLogsResponse, legacySyncCreativesResponse, legacyGetSignalsResponse, legacyActivateSignalResponse, legacyCancelMediaBuyResponse, legacyAcquireRightsResponse, legacyAcquireRightsAcquired, legacyAcquireRightsPendingApproval, legacyAcquireRightsRejected, legacySyncAccountsResponse, legacySyncGovernanceResponse, legacyReportUsageResponse, validActionsForStatus, MEDIA_BUY_TRANSITIONS, CREATIVE_ASSET_TRANSITIONS, isLegalMediaBuyTransition, isLegalCreativeTransition, assertMediaBuyTransition, assertCreativeTransition, getAccountMode, isSandboxOrMockAccount, assertSandboxAccount, taskToolResponse, registerAdcpTaskTool, createTaskCapableServer, InMemoryTaskStore, isTerminal, serve, taskScopeFromPrincipal, UnknownHostError, hostname, resolveHost, verifyIntrospection, registerTestController, handleTestControllerRequest, TestControllerError, toMcpResponse, TOOL_INPUT_SHAPE, CONTROLLER_SCENARIOS, DISCOVERY_ARM_SCENARIOS, SEED_SCENARIOS, SESSION_ENTRY_CAP, enforceMapCap, createSeedFixtureCache, PostgresTaskStore, cleanupExpiredTasks, getMcpTasksMigration, MCP_TASKS_MIGRATION, ADCP_PRE_TRANSPORT, checkGovernance, governanceDeniedError, DEFAULT_REPORTING_CAPABILITIES, InMemoryStateStore, PostgresStateStore, getAdcpStateMigration, ADCP_STATE_MIGRATION, StateError, PatchConflictError, SESSION_KEY_FIELD, createSessionedStore, scopedStore, patchWithRetry, isPutIfMatchConflict, requireSessionKey, structuredSerialize, structuredDeserialize, createIdempotencyStore, memoryBackend, pgBackend, getIdempotencyMigration, IDEMPOTENCY_MIGRATION, cleanupExpiredIdempotency, redisBackend, createLazyBackend, hashPayload, IdempotencyClaimOwnershipError, getServeRequestContext, ADCP_SERVE_REQUEST_CONTEXT, createA2AAdapter, A2AInvocationError, MCP_APP_RESOURCE_MIME_TYPE, ADCP_MIRRORED_STRUCTURED_CONTENT_META_KEY, } from './server';
166
- export type { AdcpErrorOptions, AdcpErrorResponse, McpToolResponse, ValidAction, CancelMediaBuyInput, AdcpTaskToolConfig, TaskStore, TaskMessageQueue, CreateTaskOptions, ToolTaskHandler, CreateTaskRequestHandlerExtra, TaskRequestHandlerExtra, CreateTaskResult, GetTaskResult, Task, ServeContext, ServeOptions, PgQueryable, PostgresTaskStoreOptions, TestControllerStore, TestControllerStoreFactory, TestControllerStoreOrFactory, ControllerScenario, SeedScenario, SeedFixtureCache, SessionContext, OnInstructionsError, MaybePromise, LegacyAdcpServerConfig, LegacyAdcpToolMap, AdcpServerToolName, AdcpCapabilitiesConfig, LegacyAdcpCustomToolConfig, McpAppUiMeta, McpAppMeta, AdcpMcpResourceDefinition, McpAppResourceCsp, McpAppResourcePermissions, McpAppResourceUiMeta, McpAppResourceMeta, McpAppResourceReadContext, AdcpLogger, LegacyHandlerContext, LegacyMediaBuyHandlers, LegacySignalsHandlers, LegacyCreativeHandlers, LegacyGovernanceHandlers, LegacyAccountHandlers, LegacyEventTrackingHandlers, LegacySponsoredIntelligenceHandlers, SignedRequestsConfig, AdcpPreTransport, AdcpServer, AdcpServerTransport, AdcpTestRequest, AdcpTestToolsCallRequest, AdcpTestResponse, AdcpInvokeOptions, StructuredContentFallbackTransport, StructuredContentTextFallback, StructuredContentTextFallbackContext, CheckGovernanceOptions, GovernanceCallResult, GovernanceApproved, GovernanceDenied, GovernanceConditions, AdcpStateStore, ListOptions as StateListOptions, ListResult as StateListResult, PostgresStateStoreOptions, InMemoryStateStoreOptions, VersionedDocument, PutIfMatchResult, PatchWithRetryOptions, StateErrorCode, SessionKeyContext, IdempotencyStore, IdempotencyStoreConfig, IdempotencyBackend, IdempotencyCacheEntry, IdempotencyCheckResult, MemoryBackendOptions, PgBackendOptions, RedisBackendOptions, RedisBackendClient, RedisLikeClient, LazyBackendFactory, LazyBackendOptions, A2AAdapter, A2AAdapterOptions, A2AAgentCardOverrides, A2AAgentCapabilitiesOverride, A2AAgentSkillOverride, A2AMountOptions, ExpressAppLike, LegacyHttpSecurityScheme, LegacySecurityScheme, AccountMode, RequireCacheScopeWhenProducts, ServerPayload, GetProductsPayload, CreateMediaBuyPayload, UpdateMediaBuyPayload, GetMediaBuysPayload, GetMediaBuyDeliveryPayload, ListCreativesPayload, GetCreativeDeliveryPayload, CanonicalPreviewCreativePayload, PreviewCreativePayload, LegacyGetProductsPayload, LegacyCreateMediaBuyPayload, LegacyUpdateMediaBuyPayload, LegacyGetMediaBuysPayload, LegacyGetMediaBuyDeliveryPayload, LegacyListCreativesPayload, LegacyGetCreativeDeliveryPayload, LegacyListCreativeFormatsPayload, LegacyListCreativeFormatsResponsePayload, LegacyListCreativeFormatsServerPayload, LegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload, LegacyBuildCreativeVariantPayload, LegacyPreviewCreativePayload, SyncCreativesPayload, SyncCreativesSuccessPayload, SyncCreativesErrorPayload, } from './server';
166
+ export type { AdcpErrorOptions, AdcpErrorResponse, McpToolResponse, ValidAction, CancelMediaBuyInput, AdcpTaskToolConfig, TaskStore, TaskMessageQueue, CreateTaskOptions, ToolTaskHandler, CreateTaskRequestHandlerExtra, TaskRequestHandlerExtra, CreateTaskResult, GetTaskResult, Task, ServeContext, ServeOptions, PgQueryable, PostgresTaskStoreOptions, TestControllerStore, TestControllerStoreFactory, TestControllerStoreOrFactory, ControllerScenario, SeedScenario, SeedFixtureCache, SessionContext, OnInstructionsError, MaybePromise, LegacyAdcpServerConfig, LegacyAdcpToolMap, AdcpServerToolName, AdcpCapabilitiesConfig, LegacyAdcpCustomToolConfig, LegacyAdcpCustomToolHandler, LegacyAdcpCustomToolHandlerExtra, McpAppUiMeta, McpAppMeta, AdcpMcpResourceDefinition, McpAppResourceCsp, McpAppResourcePermissions, McpAppResourceUiMeta, McpAppResourceMeta, McpAppResourceReadContext, AdcpLogger, LegacyHandlerContext, LegacyMediaBuyHandlers, LegacySignalsHandlers, LegacyCreativeHandlers, LegacyGovernanceHandlers, LegacyAccountHandlers, LegacyEventTrackingHandlers, LegacySponsoredIntelligenceHandlers, SignedRequestsConfig, AdcpPreTransport, AdcpServer, AdcpServerTransport, AdcpTestRequest, AdcpTestToolsCallRequest, AdcpTestResponse, AdcpInvokeOptions, StructuredContentFallbackTransport, StructuredContentTextFallback, StructuredContentTextFallbackContext, CheckGovernanceOptions, GovernanceCallResult, GovernanceApproved, GovernanceDenied, GovernanceConditions, AdcpStateStore, ListOptions as StateListOptions, ListResult as StateListResult, PostgresStateStoreOptions, InMemoryStateStoreOptions, VersionedDocument, PutIfMatchResult, PatchWithRetryOptions, StateErrorCode, SessionKeyContext, IdempotencyStore, IdempotencyStoreConfig, IdempotencyBackend, IdempotencyCacheEntry, IdempotencyCheckResult, MemoryBackendOptions, PgBackendOptions, RedisBackendOptions, RedisBackendClient, RedisLikeClient, LazyBackendFactory, LazyBackendOptions, A2AAdapter, A2AAdapterOptions, A2AAgentCardOverrides, A2AAgentCapabilitiesOverride, A2AAgentSkillOverride, A2AMountOptions, ExpressAppLike, LegacyHttpSecurityScheme, LegacySecurityScheme, AccountMode, RequireCacheScopeWhenProducts, ServerPayload, GetProductsPayload, CreateMediaBuyPayload, UpdateMediaBuyPayload, GetMediaBuysPayload, GetMediaBuyDeliveryPayload, ListCreativesPayload, GetCreativeDeliveryPayload, CanonicalPreviewCreativePayload, PreviewCreativePayload, LegacyGetProductsPayload, LegacyCreateMediaBuyPayload, LegacyUpdateMediaBuyPayload, LegacyGetMediaBuysPayload, LegacyGetMediaBuyDeliveryPayload, LegacyListCreativesPayload, LegacyGetCreativeDeliveryPayload, LegacyListCreativeFormatsPayload, LegacyListCreativeFormatsResponsePayload, LegacyListCreativeFormatsServerPayload, LegacyBuildCreativePayload, LegacyBuildCreativeMultiPayload, LegacyBuildCreativeVariantPayload, LegacyPreviewCreativePayload, SyncCreativesPayload, SyncCreativesSuccessPayload, SyncCreativesErrorPayload, } from './server';
167
167
  export { isRetryable, getRetryDelay } from './utils/retry';
168
168
  export { decideRetry, BuyerRetryPolicy } from './utils/buyer-retry-policy';
169
169
  export type { RetryDecision, RetryContext, RetryDecisionOverride } from './utils/buyer-retry-policy';
@@ -36,6 +36,8 @@ export interface ModernMCPConnectionOptions {
36
36
  requestTimeoutMs?: number;
37
37
  fetchFn?: typeof fetch;
38
38
  allowPrivateIp?: boolean;
39
+ /** SDK-selected AdCP release-precision version for tools/list discovery. */
40
+ adcpVersion?: string;
39
41
  /** Use the v2 SDK's negotiated legacy client instead of handing off to v1. */
40
42
  handleLegacy?: boolean;
41
43
  }
@@ -36,6 +36,8 @@ export interface ModernMCPConnectionOptions {
36
36
  requestTimeoutMs?: number;
37
37
  fetchFn?: typeof fetch;
38
38
  allowPrivateIp?: boolean;
39
+ /** SDK-selected AdCP release-precision version for tools/list discovery. */
40
+ adcpVersion?: string;
39
41
  /** Use the v2 SDK's negotiated legacy client instead of handing off to v1. */
40
42
  handleLegacy?: boolean;
41
43
  }
@@ -509,10 +509,13 @@ async function tryListModernMCPTools(agentUrl, authToken, customHeaders, options
509
509
  const listTools = async (connectedClient) => {
510
510
  if (connectedClient.getProtocolEra() !== "modern") return { handled: false };
511
511
  const resolvedRequestTimeoutMs = (0, import_abort.resolveClientRequestTimeoutMs)(options.requestTimeoutMs);
512
- const result = await connectedClient.listTools(void 0, {
513
- ...options.signal && { signal: options.signal },
514
- ...resolvedRequestTimeoutMs !== void 0 && { timeout: resolvedRequestTimeoutMs }
515
- });
512
+ const result = await connectedClient.listTools(
513
+ options.adcpVersion === void 0 ? void 0 : { _meta: { adcp_version: options.adcpVersion } },
514
+ {
515
+ ...options.signal && { signal: options.signal },
516
+ ...resolvedRequestTimeoutMs !== void 0 && { timeout: resolvedRequestTimeoutMs }
517
+ }
518
+ );
516
519
  return { handled: true, tools: result.tools };
517
520
  };
518
521
  try {
@@ -503,10 +503,13 @@ async function tryListModernMCPTools(agentUrl, authToken, customHeaders, options
503
503
  const listTools = async (connectedClient) => {
504
504
  if (connectedClient.getProtocolEra() !== "modern") return { handled: false };
505
505
  const resolvedRequestTimeoutMs = resolveClientRequestTimeoutMs(options.requestTimeoutMs);
506
- const result = await connectedClient.listTools(void 0, {
507
- ...options.signal && { signal: options.signal },
508
- ...resolvedRequestTimeoutMs !== void 0 && { timeout: resolvedRequestTimeoutMs }
509
- });
506
+ const result = await connectedClient.listTools(
507
+ options.adcpVersion === void 0 ? void 0 : { _meta: { adcp_version: options.adcpVersion } },
508
+ {
509
+ ...options.signal && { signal: options.signal },
510
+ ...resolvedRequestTimeoutMs !== void 0 && { timeout: resolvedRequestTimeoutMs }
511
+ }
512
+ );
510
513
  return { handled: true, tools: result.tools };
511
514
  };
512
515
  try {
@@ -93,8 +93,9 @@ function connectionCacheKey(agentUrl, authToken, signingCacheKey, authHeaders, t
93
93
  if (scopeKey) parts.push(scopeKey);
94
94
  return parts.join("::");
95
95
  }
96
+ const CACHE_DISAMBIGUATOR_SALT = (0, import_node_crypto.randomBytes)(32);
96
97
  function cacheDisambiguator(value) {
97
- return (0, import_node_crypto.createHmac)("sha256", "").update(value).digest("hex").slice(0, 16);
98
+ return Buffer.from((0, import_node_crypto.hkdfSync)("sha256", value, CACHE_DISAMBIGUATOR_SALT, "adcp-mcp-cache-key", 32)).toString("hex");
98
99
  }
99
100
  function extractAuthHeader(headers) {
100
101
  if (!headers) return void 0;
@@ -10,7 +10,7 @@ import {
10
10
  } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
11
11
  import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
12
12
  import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
13
- import { createHmac } from "node:crypto";
13
+ import { hkdfSync, randomBytes } from "node:crypto";
14
14
  import { createMCPRequestHeaders } from "../auth/index.mjs";
15
15
  import { is401Error } from "../errors/index.mjs";
16
16
  import { withSpan, injectTraceHeaders } from "../observability/tracing.mjs";
@@ -80,8 +80,9 @@ function connectionCacheKey(agentUrl, authToken, signingCacheKey, authHeaders, t
80
80
  if (scopeKey) parts.push(scopeKey);
81
81
  return parts.join("::");
82
82
  }
83
+ const CACHE_DISAMBIGUATOR_SALT = randomBytes(32);
83
84
  function cacheDisambiguator(value) {
84
- return createHmac("sha256", "").update(value).digest("hex").slice(0, 16);
85
+ return Buffer.from(hkdfSync("sha256", value, CACHE_DISAMBIGUATOR_SALT, "adcp-mcp-cache-key", 32)).toString("hex");
85
86
  }
86
87
  function extractAuthHeader(headers) {
87
88
  if (!headers) return void 0;
@@ -4214,7 +4214,7 @@ export interface components {
4214
4214
  adcp_version: string;
4215
4215
  verified_at: string;
4216
4216
  /** @description Specialisms demonstrably passed (enums/specialism.json). Preview specialisms are excluded from stable badges. */
4217
- verified_specialisms: ("audience-sync" | "brand-rights" | "collection-lists" | "content-standards" | "creative-ad-server" | "creative-generative" | "creative-template" | "creative-transformers" | "governance-aware-seller" | "governance-delivery-monitor" | "governance-spend-authority" | "property-lists" | "sales-broadcast-tv" | "sales-catalog-driven" | "sales-dooh" | "sales-guaranteed" | "sales-non-guaranteed" | "sales-proposal-mode" | "sales-social" | "signal-marketplace" | "signal-owned" | "signed-requests" | "sponsored-intelligence")[];
4217
+ verified_specialisms: ("audience-sync" | "brand-rights" | "buyer-activation" | "buyer-discovery" | "buyer-monitoring" | "buyer-negotiation" | "buyer-recovery" | "collection-lists" | "content-standards" | "creative-ad-server" | "creative-generative" | "creative-template" | "creative-transformers" | "governance-aware-seller" | "governance-delivery-monitor" | "governance-spend-authority" | "property-lists" | "sales-broadcast-tv" | "sales-catalog-driven" | "sales-dooh" | "sales-guaranteed" | "sales-non-guaranteed" | "sales-proposal-mode" | "sales-social" | "signal-marketplace" | "orchestrator-multi-agent" | "signal-owned" | "signed-requests" | "sponsored-intelligence")[];
4218
4218
  /** @description Verification axes earned. 'spec' = AdCP storyboards pass for the declared specialisms. 'live' = AAO has observed real production traffic via canonical campaigns. Always non-empty when a badge is present; an absent badge is conveyed by the parent record being omitted, not by an empty array. */
4219
4219
  verification_modes: ("spec" | "live")[];
4220
4220
  verified_protocol_version: string | null;
@@ -4214,7 +4214,7 @@ export interface components {
4214
4214
  adcp_version: string;
4215
4215
  verified_at: string;
4216
4216
  /** @description Specialisms demonstrably passed (enums/specialism.json). Preview specialisms are excluded from stable badges. */
4217
- verified_specialisms: ("audience-sync" | "brand-rights" | "collection-lists" | "content-standards" | "creative-ad-server" | "creative-generative" | "creative-template" | "creative-transformers" | "governance-aware-seller" | "governance-delivery-monitor" | "governance-spend-authority" | "property-lists" | "sales-broadcast-tv" | "sales-catalog-driven" | "sales-dooh" | "sales-guaranteed" | "sales-non-guaranteed" | "sales-proposal-mode" | "sales-social" | "signal-marketplace" | "signal-owned" | "signed-requests" | "sponsored-intelligence")[];
4217
+ verified_specialisms: ("audience-sync" | "brand-rights" | "buyer-activation" | "buyer-discovery" | "buyer-monitoring" | "buyer-negotiation" | "buyer-recovery" | "collection-lists" | "content-standards" | "creative-ad-server" | "creative-generative" | "creative-template" | "creative-transformers" | "governance-aware-seller" | "governance-delivery-monitor" | "governance-spend-authority" | "property-lists" | "sales-broadcast-tv" | "sales-catalog-driven" | "sales-dooh" | "sales-guaranteed" | "sales-non-guaranteed" | "sales-proposal-mode" | "sales-social" | "signal-marketplace" | "orchestrator-multi-agent" | "signal-owned" | "signed-requests" | "sponsored-intelligence")[];
4218
4218
  /** @description Verification axes earned. 'spec' = AdCP storyboards pass for the declared specialisms. 'live' = AAO has observed real production traffic via canonical campaigns. Always non-empty when a badge is present; an absent badge is conveyed by the parent record being omitted, not by an empty array. */
4219
4219
  verification_modes: ("spec" | "live")[];
4220
4220
  verified_protocol_version: string | null;
@@ -4,5 +4,5 @@
4
4
  "source_sha": "4e553ad955f83b49c7d221ab5c3ff78237ad02e3",
5
5
  "source_tarball_sha256": "580656d6466ef9f0d1119985e6726c2efea718dc671e2ad30957fcb2fd54af0f",
6
6
  "upstream_adcp_version": "2.5.3",
7
- "synced_at": "2026-09-05T12:48:14.056Z"
7
+ "synced_at": "2026-09-07T02:22:39.478Z"
8
8
  }
@@ -385,9 +385,8 @@ function buildAgentCard(server, overrides) {
385
385
  throw new Error("createA2AAdapter: only the JSONRPC A2A transport is supported");
386
386
  }
387
387
  const registeredTools = listRegisteredTools(server);
388
- const tools = registeredTools.filter(
389
- (toolName) => (0, import_adcp_server.isToolAvailableForVersion)(server, toolName, server.getAdcpVersion())
390
- );
388
+ const discoveryVersion = (0, import_adcp_server.resolveDiscoveryVersion)(server);
389
+ const tools = registeredTools.filter((toolName) => (0, import_adcp_server.isToolAvailableForVersion)(server, toolName, discoveryVersion));
391
390
  const availableTools = new Set(tools);
392
391
  const registeredToolSet = new Set(registeredTools);
393
392
  const skills = filterPublicAgentCardSkills(
@@ -12,7 +12,8 @@ import { redactSecrets } from "../utils/redact-secrets.mjs";
12
12
  import {
13
13
  getSdkServer,
14
14
  isToolAvailableForVersion,
15
- listRegisteredToolNames
15
+ listRegisteredToolNames,
16
+ resolveDiscoveryVersion
16
17
  } from "./adcp-server.mjs";
17
18
  class RedactingA2ATaskStore {
18
19
  constructor(delegate) {
@@ -370,9 +371,8 @@ function buildAgentCard(server, overrides) {
370
371
  throw new Error("createA2AAdapter: only the JSONRPC A2A transport is supported");
371
372
  }
372
373
  const registeredTools = listRegisteredTools(server);
373
- const tools = registeredTools.filter(
374
- (toolName) => isToolAvailableForVersion(server, toolName, server.getAdcpVersion())
375
- );
374
+ const discoveryVersion = resolveDiscoveryVersion(server);
375
+ const tools = registeredTools.filter((toolName) => isToolAvailableForVersion(server, toolName, discoveryVersion));
376
376
  const availableTools = new Set(tools);
377
377
  const registeredToolSet = new Set(registeredTools);
378
378
  const skills = filterPublicAgentCardSkills(
@@ -289,15 +289,24 @@ export interface AdcpServer {
289
289
  */
290
290
  invoke(options: AdcpInvokeOptions): Promise<McpToolResponse>;
291
291
  /**
292
- * Returns the AdCP protocol version this server is configured to speak.
292
+ * Returns the newest AdCP protocol version this server can serve.
293
293
  *
294
294
  * Defaults to {@link ADCP_VERSION} (the GA version the SDK ships against)
295
295
  * unless overridden via `createAdcpServer({ adcpVersion })`. This is the
296
296
  * protocol version, **not** the publisher's app version (`config.version`).
297
297
  *
298
298
  * Plumbing surface — Stage 2 of the multi-version refactor exposes the
299
- * configured value but does not yet vary validator/schema selection by
299
+ * configured ceiling but does not yet vary validator/schema selection by
300
300
  * version. Wire-shape adapters key off this getter in subsequent stages.
301
301
  */
302
302
  getAdcpVersion(): string;
303
+ /**
304
+ * Returns the AdCP protocol version selected when a caller supplies no
305
+ * `adcp_version` or `adcp_major_version` claim.
306
+ *
307
+ * Defaults to {@link getAdcpVersion} unless the server config declares a
308
+ * lower `defaultAdcpVersion`. This lets one endpoint retain a conservative
309
+ * wire default while making newer explicitly versioned routes reachable.
310
+ */
311
+ getDefaultAdcpVersion(): string;
303
312
  }
@@ -289,15 +289,24 @@ export interface AdcpServer {
289
289
  */
290
290
  invoke(options: AdcpInvokeOptions): Promise<McpToolResponse>;
291
291
  /**
292
- * Returns the AdCP protocol version this server is configured to speak.
292
+ * Returns the newest AdCP protocol version this server can serve.
293
293
  *
294
294
  * Defaults to {@link ADCP_VERSION} (the GA version the SDK ships against)
295
295
  * unless overridden via `createAdcpServer({ adcpVersion })`. This is the
296
296
  * protocol version, **not** the publisher's app version (`config.version`).
297
297
  *
298
298
  * Plumbing surface — Stage 2 of the multi-version refactor exposes the
299
- * configured value but does not yet vary validator/schema selection by
299
+ * configured ceiling but does not yet vary validator/schema selection by
300
300
  * version. Wire-shape adapters key off this getter in subsequent stages.
301
301
  */
302
302
  getAdcpVersion(): string;
303
+ /**
304
+ * Returns the AdCP protocol version selected when a caller supplies no
305
+ * `adcp_version` or `adcp_major_version` claim.
306
+ *
307
+ * Defaults to {@link getAdcpVersion} unless the server config declares a
308
+ * lower `defaultAdcpVersion`. This lets one endpoint retain a conservative
309
+ * wire default while making newer explicitly versioned routes reachable.
310
+ */
311
+ getDefaultAdcpVersion(): string;
303
312
  }
@@ -90,7 +90,7 @@ function setDiscoveryVersionResolver(server, resolver) {
90
90
  }
91
91
  function resolveDiscoveryVersion(server, requestedVersion) {
92
92
  const resolver = server[ADCP_DISCOVERY_VERSION_RESOLVER];
93
- return resolver ? resolver(requestedVersion) : server.getAdcpVersion();
93
+ return resolver ? resolver(requestedVersion) : server.getDefaultAdcpVersion?.() ?? server.getAdcpVersion();
94
94
  }
95
95
  function setMcpToolProfile(server, profile) {
96
96
  Object.defineProperty(server, ADCP_MCP_TOOL_PROFILE, {
@@ -254,7 +254,8 @@ function wrapMcpServer(inner, compliance, adcpVersion = import_version.ADCP_VERS
254
254
  // runtime dispatcher is a single function that narrows by method.
255
255
  dispatchTestRequest: dispatch,
256
256
  invoke,
257
- getAdcpVersion: () => adcpVersion
257
+ getAdcpVersion: () => adcpVersion,
258
+ getDefaultAdcpVersion: () => options.defaultAdcpVersion ?? adcpVersion
258
259
  };
259
260
  return wrapper;
260
261
  }
@@ -40,7 +40,7 @@ function setDiscoveryVersionResolver(server, resolver) {
40
40
  }
41
41
  function resolveDiscoveryVersion(server, requestedVersion) {
42
42
  const resolver = server[ADCP_DISCOVERY_VERSION_RESOLVER];
43
- return resolver ? resolver(requestedVersion) : server.getAdcpVersion();
43
+ return resolver ? resolver(requestedVersion) : server.getDefaultAdcpVersion?.() ?? server.getAdcpVersion();
44
44
  }
45
45
  function setMcpToolProfile(server, profile) {
46
46
  Object.defineProperty(server, ADCP_MCP_TOOL_PROFILE, {
@@ -204,7 +204,8 @@ function wrapMcpServer(inner, compliance, adcpVersion = ADCP_VERSION, options =
204
204
  // runtime dispatcher is a single function that narrows by method.
205
205
  dispatchTestRequest: dispatch,
206
206
  invoke,
207
- getAdcpVersion: () => adcpVersion
207
+ getAdcpVersion: () => adcpVersion,
208
+ getDefaultAdcpVersion: () => options.defaultAdcpVersion ?? adcpVersion
208
209
  };
209
210
  return wrapper;
210
211
  }