@adcp/sdk 16.0.0-beta.8 → 16.0.0

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 (371) hide show
  1. package/AGENTS.md +3 -3
  2. package/README.md +5 -2
  3. package/bin/adcp.js +10 -13
  4. package/dist/lib/core/AgentClient.d.mts +8 -5
  5. package/dist/lib/core/AgentClient.d.ts +8 -5
  6. package/dist/lib/core/AgentClient.js +9 -4
  7. package/dist/lib/core/AgentClient.mjs +9 -4
  8. package/dist/lib/core/SingleAgentClient.d.mts +19 -112
  9. package/dist/lib/core/SingleAgentClient.d.ts +19 -112
  10. package/dist/lib/core/SingleAgentClient.js +270 -252
  11. package/dist/lib/core/SingleAgentClient.mjs +275 -253
  12. package/dist/lib/core/TaskExecutor.d.mts +1 -16
  13. package/dist/lib/core/TaskExecutor.d.ts +1 -16
  14. package/dist/lib/core/TaskExecutor.js +34 -51
  15. package/dist/lib/core/TaskExecutor.mjs +12 -29
  16. package/dist/lib/core/product-cache.d.mts +3 -1
  17. package/dist/lib/core/product-cache.d.ts +3 -1
  18. package/dist/lib/core/product-cache.js +2 -1
  19. package/dist/lib/core/product-cache.mjs +2 -1
  20. package/dist/lib/errors/index.d.mts +2 -8
  21. package/dist/lib/errors/index.d.ts +2 -8
  22. package/dist/lib/errors/index.js +4 -4
  23. package/dist/lib/errors/index.mjs +4 -4
  24. package/dist/lib/identity-3.3/revocation.js +6 -7
  25. package/dist/lib/identity-3.3/revocation.mjs +6 -7
  26. package/dist/lib/index.d.mts +4 -4
  27. package/dist/lib/index.d.ts +4 -4
  28. package/dist/lib/index.js +0 -14
  29. package/dist/lib/index.mjs +0 -14
  30. package/dist/lib/media-buy/compatibility.d.mts +1 -1
  31. package/dist/lib/media-buy/compatibility.d.ts +1 -1
  32. package/dist/lib/media-buy/compatibility.js +26 -45
  33. package/dist/lib/media-buy/compatibility.mjs +26 -45
  34. package/dist/lib/media-buy/legacy-purchase-continuation.d.mts +2 -2
  35. package/dist/lib/media-buy/legacy-purchase-continuation.d.ts +2 -2
  36. package/dist/lib/protocols/index.js +14 -22
  37. package/dist/lib/protocols/index.mjs +5 -13
  38. package/dist/lib/registry/types.d.mts +3 -2
  39. package/dist/lib/registry/types.d.ts +3 -2
  40. package/dist/lib/registry/types.generated.d.mts +51 -11
  41. package/dist/lib/registry/types.generated.d.ts +51 -11
  42. package/dist/lib/reporting/source/conformance.d.mts +8 -8
  43. package/dist/lib/reporting/source/conformance.d.ts +8 -8
  44. package/dist/lib/reporting/source/manifest.d.mts +27 -27
  45. package/dist/lib/reporting/source/manifest.d.ts +27 -27
  46. package/dist/lib/server/create-adcp-server.js +7 -1
  47. package/dist/lib/server/create-adcp-server.mjs +7 -1
  48. package/dist/lib/signing/crypto.d.mts +1 -1
  49. package/dist/lib/signing/crypto.d.ts +1 -1
  50. package/dist/lib/signing/crypto.js +2 -45
  51. package/dist/lib/signing/crypto.mjs +2 -46
  52. package/dist/lib/signing/web-bot-auth.d.mts +18 -10
  53. package/dist/lib/signing/web-bot-auth.d.ts +18 -10
  54. package/dist/lib/signing/web-bot-auth.js +29 -24
  55. package/dist/lib/signing/web-bot-auth.mjs +29 -24
  56. package/dist/lib/testing/compliance/comply.js +0 -8
  57. package/dist/lib/testing/compliance/comply.mjs +0 -8
  58. package/dist/lib/testing/compliance/storyboard-tracks.js +11 -0
  59. package/dist/lib/testing/compliance/storyboard-tracks.mjs +11 -0
  60. package/dist/lib/testing/index.d.mts +2 -0
  61. package/dist/lib/testing/index.d.ts +2 -0
  62. package/dist/lib/testing/index.js +5 -0
  63. package/dist/lib/testing/index.mjs +3 -0
  64. package/dist/lib/testing/scenarios/capabilities.d.mts +2 -2
  65. package/dist/lib/testing/scenarios/capabilities.d.ts +2 -2
  66. package/dist/lib/testing/scenarios/capabilities.js +8 -41
  67. package/dist/lib/testing/scenarios/capabilities.mjs +9 -42
  68. package/dist/lib/testing/storyboard/creative-build-probe.d.mts +34 -0
  69. package/dist/lib/testing/storyboard/creative-build-probe.d.ts +34 -0
  70. package/dist/lib/testing/storyboard/creative-build-probe.js +395 -0
  71. package/dist/lib/testing/storyboard/creative-build-probe.mjs +373 -0
  72. package/dist/lib/testing/storyboard/index.d.mts +2 -0
  73. package/dist/lib/testing/storyboard/index.d.ts +2 -0
  74. package/dist/lib/testing/storyboard/index.js +5 -0
  75. package/dist/lib/testing/storyboard/index.mjs +3 -0
  76. package/dist/lib/testing/storyboard/loader.js +12 -0
  77. package/dist/lib/testing/storyboard/loader.mjs +12 -0
  78. package/dist/lib/testing/storyboard/property-list-reference.d.mts +15 -0
  79. package/dist/lib/testing/storyboard/property-list-reference.d.ts +15 -0
  80. package/dist/lib/testing/storyboard/property-list-reference.js +514 -0
  81. package/dist/lib/testing/storyboard/property-list-reference.mjs +487 -0
  82. package/dist/lib/testing/storyboard/runner.js +318 -58
  83. package/dist/lib/testing/storyboard/runner.mjs +322 -58
  84. package/dist/lib/testing/storyboard/types.d.mts +38 -16
  85. package/dist/lib/testing/storyboard/types.d.ts +38 -16
  86. package/dist/lib/testing/storyboard/types.js +1 -0
  87. package/dist/lib/testing/storyboard/types.mjs +1 -0
  88. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  89. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  90. package/dist/lib/testing/storyboard/validations.js +64 -0
  91. package/dist/lib/testing/storyboard/validations.mjs +67 -1
  92. package/dist/lib/testing/types.d.mts +15 -1
  93. package/dist/lib/testing/types.d.ts +15 -1
  94. package/dist/lib/types/schemas.generated.d.ts +65 -65
  95. package/dist/lib/types/wellknown-schemas.generated.d.mts +21 -21
  96. package/dist/lib/types/wellknown-schemas.generated.d.ts +21 -21
  97. package/dist/lib/utils/adcp-version-config.js +6 -0
  98. package/dist/lib/utils/adcp-version-config.mjs +6 -0
  99. package/dist/lib/utils/capabilities.d.mts +7 -9
  100. package/dist/lib/utils/capabilities.d.ts +7 -9
  101. package/dist/lib/utils/capabilities.js +14 -28
  102. package/dist/lib/utils/capabilities.mjs +14 -27
  103. package/dist/lib/utils/creative-adapter.d.mts +15 -113
  104. package/dist/lib/utils/creative-adapter.d.ts +15 -113
  105. package/dist/lib/utils/creative-adapter.js +7 -106
  106. package/dist/lib/utils/creative-adapter.mjs +7 -102
  107. package/dist/lib/utils/format-renders.d.mts +20 -80
  108. package/dist/lib/utils/format-renders.d.ts +20 -80
  109. package/dist/lib/utils/format-renders.js +7 -67
  110. package/dist/lib/utils/format-renders.mjs +7 -66
  111. package/dist/lib/utils/index.d.mts +1 -2
  112. package/dist/lib/utils/index.d.ts +1 -2
  113. package/dist/lib/utils/index.js +0 -7
  114. package/dist/lib/utils/index.mjs +0 -6
  115. package/dist/lib/utils/preview-normalizer.d.mts +31 -80
  116. package/dist/lib/utils/preview-normalizer.d.ts +31 -80
  117. package/dist/lib/utils/preview-normalizer.js +5 -50
  118. package/dist/lib/utils/preview-normalizer.mjs +5 -49
  119. package/dist/lib/utils/pricing-adapter.d.mts +2 -36
  120. package/dist/lib/utils/pricing-adapter.d.ts +2 -36
  121. package/dist/lib/utils/pricing-adapter.js +0 -105
  122. package/dist/lib/utils/pricing-adapter.mjs +0 -100
  123. package/dist/lib/utils/request-normalizer.d.mts +1 -2
  124. package/dist/lib/utils/request-normalizer.d.ts +1 -2
  125. package/dist/lib/v2/projection/catalog.d.mts +4 -0
  126. package/dist/lib/v2/projection/catalog.d.ts +4 -0
  127. package/dist/lib/v2/projection/creative-delivery.d.mts +17 -9
  128. package/dist/lib/v2/projection/creative-delivery.d.ts +17 -9
  129. package/dist/lib/v2/projection/creative-delivery.js +78 -10
  130. package/dist/lib/v2/projection/creative-delivery.mjs +77 -10
  131. package/dist/lib/v2/projection/legacy-metadata.d.mts +12 -0
  132. package/dist/lib/v2/projection/legacy-metadata.d.ts +12 -0
  133. package/dist/lib/v2/projection/legacy-metadata.js +41 -1
  134. package/dist/lib/v2/projection/legacy-metadata.mjs +37 -1
  135. package/dist/lib/v2/projection/legacy-normalization.d.mts +1 -1
  136. package/dist/lib/v2/projection/legacy-normalization.d.ts +1 -1
  137. package/dist/lib/v2/projection/v1-to-v2.js +13 -0
  138. package/dist/lib/v2/projection/v1-to-v2.mjs +14 -0
  139. package/dist/lib/validation/client-hooks.d.mts +1 -4
  140. package/dist/lib/validation/client-hooks.d.ts +1 -4
  141. package/dist/lib/validation/get-products-request.d.mts +1 -1
  142. package/dist/lib/validation/get-products-request.d.ts +1 -1
  143. package/dist/lib/validation/schema-loader.js +6 -0
  144. package/dist/lib/validation/schema-loader.mjs +6 -0
  145. package/dist/lib/validation/schema-validator.js +1 -26
  146. package/dist/lib/validation/schema-validator.mjs +1 -26
  147. package/dist/lib/version.d.mts +5 -5
  148. package/dist/lib/version.d.ts +5 -5
  149. package/dist/lib/version.js +3 -5
  150. package/dist/lib/version.mjs +3 -5
  151. package/docs/TYPE-SUMMARY.md +2 -2
  152. package/docs/development/PROTOCOL_DIFFERENCES.md +1 -1
  153. package/docs/guides/CONFORMANCE.md +25 -0
  154. package/docs/guides/CREATIVE-BUILD-PROBE.md +156 -0
  155. package/docs/guides/CREATIVE-DELIVERY.md +63 -7
  156. package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +15 -18
  157. package/docs/guides/REPORTING-STABILITY.md +7 -7
  158. package/docs/guides/VALIDATE-YOUR-AGENT.md +5 -0
  159. package/docs/llms.txt +3 -3
  160. package/docs/migration-13-to-14.md +20 -16
  161. package/docs/migration-14.x-rc-worksheet.md +5 -5
  162. package/docs/migration-4.x-to-5.x.md +12 -7
  163. package/docs/migration-agent-identity-3.3.md +44 -19
  164. package/docs/migration-drop-adcp-2.md +25 -0
  165. package/docs/migration-reporting-storage-package.md +3 -3
  166. package/docs/releases/16.0.0.md +20 -0
  167. package/package.json +3 -18
  168. package/skills/call-adcp-agent/SKILL.md +23 -25
  169. package/dist/lib/adapters/legacy/v2-5/create_media_buy.d.mts +0 -3
  170. package/dist/lib/adapters/legacy/v2-5/create_media_buy.d.ts +0 -3
  171. package/dist/lib/adapters/legacy/v2-5/create_media_buy.js +0 -33
  172. package/dist/lib/adapters/legacy/v2-5/create_media_buy.mjs +0 -9
  173. package/dist/lib/adapters/legacy/v2-5/get_products.d.mts +0 -8
  174. package/dist/lib/adapters/legacy/v2-5/get_products.d.ts +0 -8
  175. package/dist/lib/adapters/legacy/v2-5/get_products.js +0 -33
  176. package/dist/lib/adapters/legacy/v2-5/get_products.mjs +0 -9
  177. package/dist/lib/adapters/legacy/v2-5/index.d.mts +0 -34
  178. package/dist/lib/adapters/legacy/v2-5/index.d.ts +0 -34
  179. package/dist/lib/adapters/legacy/v2-5/index.js +0 -50
  180. package/dist/lib/adapters/legacy/v2-5/index.mjs +0 -25
  181. package/dist/lib/adapters/legacy/v2-5/list_creative_formats.d.mts +0 -8
  182. package/dist/lib/adapters/legacy/v2-5/list_creative_formats.d.ts +0 -8
  183. package/dist/lib/adapters/legacy/v2-5/list_creative_formats.js +0 -33
  184. package/dist/lib/adapters/legacy/v2-5/list_creative_formats.mjs +0 -9
  185. package/dist/lib/adapters/legacy/v2-5/preview_creative.d.mts +0 -3
  186. package/dist/lib/adapters/legacy/v2-5/preview_creative.d.ts +0 -3
  187. package/dist/lib/adapters/legacy/v2-5/preview_creative.js +0 -33
  188. package/dist/lib/adapters/legacy/v2-5/preview_creative.mjs +0 -9
  189. package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.mts +0 -11
  190. package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.ts +0 -11
  191. package/dist/lib/adapters/legacy/v2-5/sync_creatives.js +0 -32
  192. package/dist/lib/adapters/legacy/v2-5/sync_creatives.mjs +0 -8
  193. package/dist/lib/adapters/legacy/v2-5/types.d.mts +0 -39
  194. package/dist/lib/adapters/legacy/v2-5/types.d.ts +0 -39
  195. package/dist/lib/adapters/legacy/v2-5/types.js +0 -16
  196. package/dist/lib/adapters/legacy/v2-5/types.mjs +0 -0
  197. package/dist/lib/adapters/legacy/v2-5/update_media_buy.d.mts +0 -3
  198. package/dist/lib/adapters/legacy/v2-5/update_media_buy.d.ts +0 -3
  199. package/dist/lib/adapters/legacy/v2-5/update_media_buy.js +0 -35
  200. package/dist/lib/adapters/legacy/v2-5/update_media_buy.mjs +0 -11
  201. package/dist/lib/schemas-data/v2.5/_provenance.json +0 -8
  202. package/dist/lib/schemas-data/v2.5/adagents.json +0 -494
  203. package/dist/lib/schemas-data/v2.5/core/activation-key.json +0 -50
  204. package/dist/lib/schemas-data/v2.5/core/assets/audio-asset.json +0 -32
  205. package/dist/lib/schemas-data/v2.5/core/assets/css-asset.json +0 -21
  206. package/dist/lib/schemas-data/v2.5/core/assets/daast-asset.json +0 -87
  207. package/dist/lib/schemas-data/v2.5/core/assets/html-asset.json +0 -21
  208. package/dist/lib/schemas-data/v2.5/core/assets/image-asset.json +0 -38
  209. package/dist/lib/schemas-data/v2.5/core/assets/javascript-asset.json +0 -21
  210. package/dist/lib/schemas-data/v2.5/core/assets/markdown-asset.json +0 -31
  211. package/dist/lib/schemas-data/v2.5/core/assets/text-asset.json +0 -21
  212. package/dist/lib/schemas-data/v2.5/core/assets/url-asset.json +0 -26
  213. package/dist/lib/schemas-data/v2.5/core/assets/vast-asset.json +0 -87
  214. package/dist/lib/schemas-data/v2.5/core/assets/video-asset.json +0 -44
  215. package/dist/lib/schemas-data/v2.5/core/assets/webhook-asset.json +0 -71
  216. package/dist/lib/schemas-data/v2.5/core/async-response-data.json +0 -88
  217. package/dist/lib/schemas-data/v2.5/core/brand-manifest-ref.json +0 -33
  218. package/dist/lib/schemas-data/v2.5/core/brand-manifest.json +0 -409
  219. package/dist/lib/schemas-data/v2.5/core/context.json +0 -8
  220. package/dist/lib/schemas-data/v2.5/core/creative-asset.json +0 -125
  221. package/dist/lib/schemas-data/v2.5/core/creative-assignment.json +0 -31
  222. package/dist/lib/schemas-data/v2.5/core/creative-filters.json +0 -111
  223. package/dist/lib/schemas-data/v2.5/core/creative-manifest.json +0 -72
  224. package/dist/lib/schemas-data/v2.5/core/creative-policy.json +0 -27
  225. package/dist/lib/schemas-data/v2.5/core/delivery-metrics.json +0 -171
  226. package/dist/lib/schemas-data/v2.5/core/deployment.json +0 -93
  227. package/dist/lib/schemas-data/v2.5/core/destination.json +0 -53
  228. package/dist/lib/schemas-data/v2.5/core/error.json +0 -40
  229. package/dist/lib/schemas-data/v2.5/core/ext.json +0 -8
  230. package/dist/lib/schemas-data/v2.5/core/format-id.json +0 -47
  231. package/dist/lib/schemas-data/v2.5/core/format.json +0 -324
  232. package/dist/lib/schemas-data/v2.5/core/frequency-cap.json +0 -18
  233. package/dist/lib/schemas-data/v2.5/core/mcp-webhook-payload.json +0 -152
  234. package/dist/lib/schemas-data/v2.5/core/measurement.json +0 -48
  235. package/dist/lib/schemas-data/v2.5/core/media-buy.json +0 -62
  236. package/dist/lib/schemas-data/v2.5/core/package.json +0 -72
  237. package/dist/lib/schemas-data/v2.5/core/performance-feedback.json +0 -90
  238. package/dist/lib/schemas-data/v2.5/core/placement.json +0 -34
  239. package/dist/lib/schemas-data/v2.5/core/pricing-option.json +0 -35
  240. package/dist/lib/schemas-data/v2.5/core/product-filters.json +0 -102
  241. package/dist/lib/schemas-data/v2.5/core/product.json +0 -153
  242. package/dist/lib/schemas-data/v2.5/core/promoted-offerings.json +0 -115
  243. package/dist/lib/schemas-data/v2.5/core/promoted-products.json +0 -67
  244. package/dist/lib/schemas-data/v2.5/core/property-id.json +0 -14
  245. package/dist/lib/schemas-data/v2.5/core/property-tag.json +0 -16
  246. package/dist/lib/schemas-data/v2.5/core/property.json +0 -62
  247. package/dist/lib/schemas-data/v2.5/core/protocol-envelope.json +0 -146
  248. package/dist/lib/schemas-data/v2.5/core/publisher-property-selector.json +0 -92
  249. package/dist/lib/schemas-data/v2.5/core/push-notification-config.json +0 -48
  250. package/dist/lib/schemas-data/v2.5/core/reporting-capabilities.json +0 -71
  251. package/dist/lib/schemas-data/v2.5/core/response.json +0 -24
  252. package/dist/lib/schemas-data/v2.5/core/signal-filters.json +0 -35
  253. package/dist/lib/schemas-data/v2.5/core/start-timing.json +0 -18
  254. package/dist/lib/schemas-data/v2.5/core/sub-asset.json +0 -79
  255. package/dist/lib/schemas-data/v2.5/core/targeting.json +0 -50
  256. package/dist/lib/schemas-data/v2.5/core/tasks-get-request.json +0 -43
  257. package/dist/lib/schemas-data/v2.5/core/tasks-get-response.json +0 -166
  258. package/dist/lib/schemas-data/v2.5/core/tasks-list-request.json +0 -192
  259. package/dist/lib/schemas-data/v2.5/core/tasks-list-response.json +0 -183
  260. package/dist/lib/schemas-data/v2.5/creative/asset-types/index.json +0 -101
  261. package/dist/lib/schemas-data/v2.5/creative/list-creative-formats-request.json +0 -73
  262. package/dist/lib/schemas-data/v2.5/creative/list-creative-formats-response.json +0 -61
  263. package/dist/lib/schemas-data/v2.5/creative/preview-creative-request.json +0 -164
  264. package/dist/lib/schemas-data/v2.5/creative/preview-creative-response.json +0 -245
  265. package/dist/lib/schemas-data/v2.5/creative/preview-render.json +0 -225
  266. package/dist/lib/schemas-data/v2.5/enums/adcp-domain.json +0 -11
  267. package/dist/lib/schemas-data/v2.5/enums/asset-content-type.json +0 -22
  268. package/dist/lib/schemas-data/v2.5/enums/auth-scheme.json +0 -11
  269. package/dist/lib/schemas-data/v2.5/enums/available-metric.json +0 -18
  270. package/dist/lib/schemas-data/v2.5/enums/channels.json +0 -18
  271. package/dist/lib/schemas-data/v2.5/enums/co-branding-requirement.json +0 -12
  272. package/dist/lib/schemas-data/v2.5/enums/creative-action.json +0 -14
  273. package/dist/lib/schemas-data/v2.5/enums/creative-agent-capability.json +0 -13
  274. package/dist/lib/schemas-data/v2.5/enums/creative-sort-field.json +0 -15
  275. package/dist/lib/schemas-data/v2.5/enums/creative-status.json +0 -19
  276. package/dist/lib/schemas-data/v2.5/enums/daast-tracking-event.json +0 -20
  277. package/dist/lib/schemas-data/v2.5/enums/daast-version.json +0 -11
  278. package/dist/lib/schemas-data/v2.5/enums/delivery-type.json +0 -15
  279. package/dist/lib/schemas-data/v2.5/enums/dimension-unit.json +0 -13
  280. package/dist/lib/schemas-data/v2.5/enums/feed-format.json +0 -12
  281. package/dist/lib/schemas-data/v2.5/enums/feedback-source.json +0 -13
  282. package/dist/lib/schemas-data/v2.5/enums/format-category.json +0 -16
  283. package/dist/lib/schemas-data/v2.5/enums/format-id-parameter.json +0 -11
  284. package/dist/lib/schemas-data/v2.5/enums/frequency-cap-scope.json +0 -13
  285. package/dist/lib/schemas-data/v2.5/enums/history-entry-type.json +0 -11
  286. package/dist/lib/schemas-data/v2.5/enums/http-method.json +0 -11
  287. package/dist/lib/schemas-data/v2.5/enums/identifier-types.json +0 -34
  288. package/dist/lib/schemas-data/v2.5/enums/javascript-module-type.json +0 -12
  289. package/dist/lib/schemas-data/v2.5/enums/landing-page-requirement.json +0 -12
  290. package/dist/lib/schemas-data/v2.5/enums/markdown-flavor.json +0 -11
  291. package/dist/lib/schemas-data/v2.5/enums/media-buy-status.json +0 -19
  292. package/dist/lib/schemas-data/v2.5/enums/metric-type.json +0 -17
  293. package/dist/lib/schemas-data/v2.5/enums/notification-type.json +0 -13
  294. package/dist/lib/schemas-data/v2.5/enums/pacing.json +0 -17
  295. package/dist/lib/schemas-data/v2.5/enums/preview-output-format.json +0 -11
  296. package/dist/lib/schemas-data/v2.5/enums/pricing-model.json +0 -25
  297. package/dist/lib/schemas-data/v2.5/enums/property-type.json +0 -16
  298. package/dist/lib/schemas-data/v2.5/enums/publisher-identifier-types.json +0 -19
  299. package/dist/lib/schemas-data/v2.5/enums/reporting-frequency.json +0 -12
  300. package/dist/lib/schemas-data/v2.5/enums/signal-catalog-type.json +0 -12
  301. package/dist/lib/schemas-data/v2.5/enums/sort-direction.json +0 -11
  302. package/dist/lib/schemas-data/v2.5/enums/standard-format-ids.json +0 -103
  303. package/dist/lib/schemas-data/v2.5/enums/task-status.json +0 -29
  304. package/dist/lib/schemas-data/v2.5/enums/task-type.json +0 -27
  305. package/dist/lib/schemas-data/v2.5/enums/update-frequency.json +0 -13
  306. package/dist/lib/schemas-data/v2.5/enums/url-asset-type.json +0 -12
  307. package/dist/lib/schemas-data/v2.5/enums/validation-mode.json +0 -11
  308. package/dist/lib/schemas-data/v2.5/enums/vast-tracking-event.json +0 -25
  309. package/dist/lib/schemas-data/v2.5/enums/vast-version.json +0 -14
  310. package/dist/lib/schemas-data/v2.5/enums/webhook-response-type.json +0 -13
  311. package/dist/lib/schemas-data/v2.5/enums/webhook-security-method.json +0 -12
  312. package/dist/lib/schemas-data/v2.5/index.json +0 -604
  313. package/dist/lib/schemas-data/v2.5/media-buy/build-creative-request.json +0 -31
  314. package/dist/lib/schemas-data/v2.5/media-buy/build-creative-response.json +0 -65
  315. package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-async-response-input-required.json +0 -31
  316. package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-async-response-submitted.json +0 -16
  317. package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-async-response-working.json +0 -36
  318. package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-request.json +0 -126
  319. package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-response.json +0 -97
  320. package/dist/lib/schemas-data/v2.5/media-buy/get-media-buy-delivery-request.json +0 -54
  321. package/dist/lib/schemas-data/v2.5/media-buy/get-media-buy-delivery-response.json +0 -285
  322. package/dist/lib/schemas-data/v2.5/media-buy/get-products-async-response-input-required.json +0 -38
  323. package/dist/lib/schemas-data/v2.5/media-buy/get-products-async-response-submitted.json +0 -21
  324. package/dist/lib/schemas-data/v2.5/media-buy/get-products-async-response-working.json +0 -34
  325. package/dist/lib/schemas-data/v2.5/media-buy/get-products-request.json +0 -28
  326. package/dist/lib/schemas-data/v2.5/media-buy/get-products-response.json +0 -33
  327. package/dist/lib/schemas-data/v2.5/media-buy/list-authorized-properties-request.json +0 -26
  328. package/dist/lib/schemas-data/v2.5/media-buy/list-authorized-properties-response.json +0 -70
  329. package/dist/lib/schemas-data/v2.5/media-buy/list-creative-formats-request.json +0 -58
  330. package/dist/lib/schemas-data/v2.5/media-buy/list-creative-formats-response.json +0 -61
  331. package/dist/lib/schemas-data/v2.5/media-buy/list-creatives-request.json +0 -137
  332. package/dist/lib/schemas-data/v2.5/media-buy/list-creatives-response.json +0 -437
  333. package/dist/lib/schemas-data/v2.5/media-buy/package-request.json +0 -80
  334. package/dist/lib/schemas-data/v2.5/media-buy/provide-performance-feedback-request.json +0 -88
  335. package/dist/lib/schemas-data/v2.5/media-buy/provide-performance-feedback-response.json +0 -66
  336. package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-async-response-input-required.json +0 -25
  337. package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-async-response-submitted.json +0 -16
  338. package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-async-response-working.json +0 -46
  339. package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-request.json +0 -178
  340. package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-response.json +0 -149
  341. package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-async-response-input-required.json +0 -24
  342. package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-async-response-submitted.json +0 -16
  343. package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-async-response-working.json +0 -36
  344. package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-request.json +0 -129
  345. package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-response.json +0 -99
  346. package/dist/lib/schemas-data/v2.5/pricing-options/cpc-option.json +0 -52
  347. package/dist/lib/schemas-data/v2.5/pricing-options/cpcv-option.json +0 -52
  348. package/dist/lib/schemas-data/v2.5/pricing-options/cpm-auction-option.json +0 -81
  349. package/dist/lib/schemas-data/v2.5/pricing-options/cpm-fixed-option.json +0 -52
  350. package/dist/lib/schemas-data/v2.5/pricing-options/cpp-option.json +0 -73
  351. package/dist/lib/schemas-data/v2.5/pricing-options/cpv-option.json +0 -88
  352. package/dist/lib/schemas-data/v2.5/pricing-options/flat-rate-option.json +0 -93
  353. package/dist/lib/schemas-data/v2.5/pricing-options/vcpm-auction-option.json +0 -81
  354. package/dist/lib/schemas-data/v2.5/pricing-options/vcpm-fixed-option.json +0 -52
  355. package/dist/lib/schemas-data/v2.5/protocols/adcp-extension.json +0 -33
  356. package/dist/lib/schemas-data/v2.5/signals/activate-signal-request.json +0 -32
  357. package/dist/lib/schemas-data/v2.5/signals/activate-signal-response.json +0 -68
  358. package/dist/lib/schemas-data/v2.5/signals/get-signals-request.json +0 -59
  359. package/dist/lib/schemas-data/v2.5/signals/get-signals-response.json +0 -100
  360. package/dist/lib/types/v2-5/index.d.mts +0 -1
  361. package/dist/lib/types/v2-5/index.d.ts +0 -1
  362. package/dist/lib/types/v2-5/index.js +0 -22
  363. package/dist/lib/types/v2-5/index.mjs +0 -1
  364. package/dist/lib/types/v2-5/tools.generated.d.mts +0 -3568
  365. package/dist/lib/types/v2-5/tools.generated.d.ts +0 -3568
  366. package/dist/lib/types/v2-5/tools.generated.js +0 -16
  367. package/dist/lib/types/v2-5/tools.generated.mjs +0 -0
  368. package/dist/lib/utils/sync-creatives-adapter.d.mts +0 -33
  369. package/dist/lib/utils/sync-creatives-adapter.d.ts +0 -33
  370. package/dist/lib/utils/sync-creatives-adapter.js +0 -83
  371. package/dist/lib/utils/sync-creatives-adapter.mjs +0 -59
@@ -3,6 +3,9 @@ import { dirname as __adcpDirname } from "node:path";
3
3
  import { createRequire as __adcpCreateRequire } from "node:module";
4
4
  const __dirname = __adcpDirname(__adcpFileURLToPath(import.meta.url));
5
5
  const require2 = __adcpCreateRequire(import.meta.url);
6
+ import { normalizeGetProductsResponse } from "../utils/pricing-adapter.mjs";
7
+ import { normalizeMediaBuyResponse } from "../utils/creative-adapter.mjs";
8
+ import { normalizeFormatsResponse } from "../utils/format-renders.mjs";
6
9
  import {
7
10
  isIdentity33SchemaScope,
8
11
  withIdentity33SchemaScope,
@@ -131,7 +134,6 @@ import {
131
134
  validateAgentDiscoveryCacheConfig
132
135
  } from "./agent-discovery-cache.mjs";
133
136
  import {
134
- buildSyntheticCapabilities,
135
137
  buildSyntheticV3Capabilities,
136
138
  augmentCapabilitiesFromTools,
137
139
  looksLikeV3Capabilities,
@@ -160,7 +162,6 @@ import { normalizeRequestParams } from "../utils/request-normalizer.mjs";
160
162
  import { globalAsyncLocalStorage } from "../utils/global-async-local-storage.mjs";
161
163
  import { validateUserAgent } from "../utils/validate-user-agent.mjs";
162
164
  import { resolveWebhookUrl, selectWebhookTemplate } from "./webhook-url.mjs";
163
- import { getV25Adapter } from "../adapters/legacy/v2-5/index.mjs";
164
165
  import {
165
166
  ProductPropertyPolicyError,
166
167
  validateProductsAgainstPropertyPolicy,
@@ -171,6 +172,7 @@ import { resolvePropertyList } from "../server/targeting-helpers.mjs";
171
172
  import {
172
173
  CreativeFormatCapabilityError,
173
174
  CreativeFormatProjectionError,
175
+ canUseProductOptionsForCreativeWire,
174
176
  projectMediaBuyCreativesForDelivery,
175
177
  projectCreativeForDelivery,
176
178
  projectSyncCreativesForDelivery,
@@ -190,6 +192,10 @@ import {
190
192
  import { toCanonicalOnlyResponse } from "../v2/projection/augment-response.mjs";
191
193
  import {
192
194
  legacyFormatRefsForDeclaration,
195
+ isSynthesizedFormatOption,
196
+ selectedFormatOptions,
197
+ rememberSellerFormatEvidence,
198
+ sellerFormatEvidence,
193
199
  rememberSellerDeclaredFormatOption,
194
200
  sellerDeclaredFormatOption,
195
201
  structuredCloneWithLegacyCreativeMetadata
@@ -313,6 +319,56 @@ const RECORDLESS_HMAC_READ_ONLY_TASKS = /* @__PURE__ */ new Set([
313
319
  ]);
314
320
  const TASK_SCOPED_STATE_LIMIT = 1e4;
315
321
  const WEBHOOK_JWKS_RESOLVER_LIMIT = 1024;
322
+ function creativeMatchesProductOption(creative, declaration) {
323
+ const params = isPlainRecord(declaration.params) ? declaration.params : {};
324
+ const assets = isPlainRecord(creative.assets) ? creative.assets : {};
325
+ const slots = Array.isArray(params.slots) ? params.slots : [];
326
+ if (!slots.every((slot) => {
327
+ if (!isPlainRecord(slot) || typeof slot.asset_group_id !== "string") return false;
328
+ const value = assets[slot.asset_group_id];
329
+ const entries = value === void 0 ? [] : Array.isArray(value) ? value : [value];
330
+ const minimum = Math.max(typeof slot.min === "number" ? slot.min : 0, slot.required === true ? 1 : 0);
331
+ if (entries.length < minimum || typeof slot.max === "number" && entries.length > slot.max) return false;
332
+ return entries.every(
333
+ (asset) => isPlainRecord(asset) && (typeof slot.asset_type !== "string" || asset.asset_type === slot.asset_type)
334
+ );
335
+ }))
336
+ return false;
337
+ const formatParams = isPlainRecord(creative.format_parameters) ? creative.format_parameters : {};
338
+ const kind = String(creative.format_kind);
339
+ const mediaType = kind.startsWith("image") ? "image" : kind.startsWith("video") ? "video" : kind.startsWith("audio") ? "audio" : kind === "html5" ? "html" : void 0;
340
+ const assetTypes = mediaType === "video" ? ["video", "vast"] : mediaType === "audio" ? ["audio", "vast", "daast"] : mediaType === "html" ? ["html", "zip"] : mediaType ? [mediaType] : ["image", "video", "audio", "html", "zip", "vast", "daast"];
341
+ const requiredMediaSlots = slots.filter(
342
+ (slot) => isPlainRecord(slot) && (slot.required === true || typeof slot.min === "number" && slot.min > 0) && assetTypes.includes(String(slot.asset_type))
343
+ );
344
+ const preferredGroups = mediaType ? [`${mediaType}_main`, mediaType, kind, ...assetTypes] : [];
345
+ const primaryGroup = (requiredMediaSlots.length === 1 ? String(requiredMediaSlots[0].asset_group_id) : void 0) ?? preferredGroups.find((group) => assets[group] !== void 0);
346
+ const sourceAssets = primaryGroup ? [assets[primaryGroup]] : Object.values(assets);
347
+ const dimensionalAssets = sourceAssets.flatMap((value) => Array.isArray(value) ? value : [value]).filter(
348
+ (value) => isPlainRecord(value) && assetTypes.includes(String(value.asset_type))
349
+ );
350
+ return (dimensionalAssets.length > 0 ? dimensionalAssets : [{}]).every((asset) => {
351
+ const actual = { ...asset, ...formatParams };
352
+ for (const key of ["width", "height"]) {
353
+ if (typeof params[key] === "number" && actual[key] !== params[key]) return false;
354
+ const min = params[`min_${key}`];
355
+ const max = params[`max_${key}`];
356
+ if (typeof min === "number" && (typeof actual[key] !== "number" || actual[key] < min)) return false;
357
+ if (typeof max === "number" && (typeof actual[key] !== "number" || actual[key] > max)) return false;
358
+ }
359
+ if (Array.isArray(params.sizes) && !params.sizes.some((size) => isPlainRecord(size) && size.width === actual.width && size.height === actual.height))
360
+ return false;
361
+ const duration = actual.duration_ms ?? actual.duration_ms_exact;
362
+ const exact = params.duration_ms_exact ?? params.duration_ms;
363
+ if (typeof exact === "number" && duration !== exact) return false;
364
+ if (typeof exact !== "number" && Array.isArray(params.duration_ms_range)) {
365
+ const [min, max] = params.duration_ms_range;
366
+ if (typeof duration !== "number" || typeof min === "number" && duration < min || typeof max === "number" && duration > max)
367
+ return false;
368
+ }
369
+ return true;
370
+ });
371
+ }
316
372
  function isDeferredClientFinalizationContext(value) {
317
373
  if (!value || typeof value !== "object" || Array.isArray(value)) return false;
318
374
  const context = value;
@@ -759,24 +815,7 @@ function isToolSchemaRecord(value) {
759
815
  function isCapabilityEvidence(value) {
760
816
  if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
761
817
  const candidate = value;
762
- return (candidate.version === "v2" || candidate.version === "v3") && Array.isArray(candidate.majorVersions) && candidate.majorVersions.length > 0 && candidate.majorVersions.every((version) => version === 2 || version === 3) && Array.isArray(candidate.protocols) && candidate.protocols.every((protocol) => typeof protocol === "string") && typeof candidate.features === "object" && candidate.features !== null && !Array.isArray(candidate.features) && Array.isArray(candidate.extensions) && candidate.extensions.every((extension) => typeof extension === "string") && typeof candidate._synthetic === "boolean";
763
- }
764
- function valueMatchesSchemaType(value, propSchema) {
765
- if (!propSchema || typeof propSchema !== "object") return false;
766
- const schema = propSchema;
767
- if (schema.$ref) return true;
768
- const valueType = Array.isArray(value) ? "array" : value === null ? "null" : typeof value === "object" ? "object" : typeof value;
769
- for (const key of ["anyOf", "oneOf"]) {
770
- const variants = schema[key];
771
- if (Array.isArray(variants)) {
772
- return variants.some((v) => valueMatchesSchemaType(value, v));
773
- }
774
- }
775
- const declared = schema.type;
776
- if (declared === void 0) return false;
777
- if (typeof declared === "string") return declared === valueType;
778
- if (Array.isArray(declared)) return declared.includes(valueType);
779
- return false;
818
+ return candidate.version === "v3" && Array.isArray(candidate.majorVersions) && candidate.majorVersions.includes(3) && candidate.majorVersions.every((version) => Number.isSafeInteger(version) && version > 0) && Array.isArray(candidate.protocols) && candidate.protocols.every((protocol) => typeof protocol === "string") && typeof candidate.features === "object" && candidate.features !== null && !Array.isArray(candidate.features) && Array.isArray(candidate.extensions) && candidate.extensions.every((extension) => typeof extension === "string") && typeof candidate._synthetic === "boolean";
780
819
  }
781
820
  function productHasPricingOptions(product) {
782
821
  if (!product || typeof product !== "object") return false;
@@ -1218,12 +1257,8 @@ class SingleAgentClient {
1218
1257
  // shared invalidation epoch of that key when the evidence was obtained
1219
1258
  sharedEvidenceKey;
1220
1259
  // discoveryCache key the local capability cache was obtained under
1221
- _v2WarningFired = false;
1222
- // Gate: emit the v2-sunset warning once per client instance
1223
1260
  _syntheticV3WarningFired = false;
1224
1261
  // Gate: emit the synthetic-v3 warning once per client instance
1225
- _syntheticV2WarningFired = false;
1226
- // Gate: emit the synthetic-v2 warning once per client instance
1227
1262
  productPolicyRequestParamsByTask = /* @__PURE__ */ new Map();
1228
1263
  canonicalCreativeTaskAssociations = /* @__PURE__ */ new Map();
1229
1264
  previewCreativeHandlersByTask = /* @__PURE__ */ new Map();
@@ -1494,7 +1529,7 @@ class SingleAgentClient {
1494
1529
  }
1495
1530
  }
1496
1531
  }
1497
- rememberCanonicalProductRoutes(products, account, authoritativeProducts) {
1532
+ rememberCanonicalProductRoutes(products, account, authoritativeProducts, evidence) {
1498
1533
  this.invalidateCanonicalProductRoutes(authoritativeProducts ?? products, account);
1499
1534
  const accountScope = this.canonicalAccountScope(account);
1500
1535
  const declaredOptions = authoritativeProducts ? this.sellerDeclaredFormatOptions(authoritativeProducts) : void 0;
@@ -1514,12 +1549,15 @@ class SingleAgentClient {
1514
1549
  const refs = legacyFormatRefsForDeclaration(option);
1515
1550
  const declared = declaredOptions ? declaredOptions.get(product.product_id)?.some((declaredRef) => this.sameCanonicalOptionRef(declaredRef, ref)) : sellerDeclaredFormatOption(option);
1516
1551
  if (declared !== void 0) rememberSellerDeclaredFormatOption(option, declared);
1552
+ if (declared === true && evidence)
1553
+ rememberSellerFormatEvidence(option, { ...evidence, productId: product.product_id });
1517
1554
  this.rememberCanonicalLegacyRoute(this.canonicalLegacyRouteKey(account, product.product_id, ref), {
1518
1555
  kind: "product",
1519
1556
  accountScope,
1520
1557
  productId: product.product_id,
1521
1558
  optionRef: ref,
1522
1559
  refs,
1560
+ ...declared === true && sellerFormatEvidence(option) ? { declaration: structuredCloneWithLegacyCreativeMetadata(option) } : {},
1523
1561
  ...declared === false ? { undeclaredSelector: undeclaredFormatOptionSelector(option) } : {}
1524
1562
  });
1525
1563
  }
@@ -3501,7 +3539,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
3501
3539
  /**
3502
3540
  * Execute task and call appropriate handler on completion
3503
3541
  *
3504
- * Automatically adapts requests for v2 servers and normalizes responses.
3542
+ * Adapts requests for maintained AdCP 3 releases and normalizes product responses.
3505
3543
  */
3506
3544
  async executeAndHandle(taskType, handlerName, params, inputHandler, options, transformCompletedResponse, legacyFormatConverter, canonicalRequest, projectionCatalogs) {
3507
3545
  const requestParamsSnapshot = structuredClone(params);
@@ -3546,11 +3584,6 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
3546
3584
  await this.requireSupportedMajor(taskType, options);
3547
3585
  throwIfAborted(options?.signal);
3548
3586
  }
3549
- const earlyResult = await this.getEarlyResultForUnsupportedFeatures(taskType, normalizedParams, options);
3550
- throwIfAborted(options?.signal);
3551
- if (earlyResult) {
3552
- return attachMatch(earlyResult);
3553
- }
3554
3587
  const agent = await this.ensureEndpointDiscovered(options);
3555
3588
  throwIfAborted(options?.signal);
3556
3589
  if (!options?.skipIdempotencyAutoInject && !options?.skipAccountValidation && !options?.skipRequestValidation && !options?.preserveGovernedPayload) {
@@ -3589,11 +3622,8 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
3589
3622
  capabilityDiscoveryContext.toolSchemas,
3590
3623
  capabilityDiscoveryContext.capabilities
3591
3624
  );
3592
- const v25DriftLogs = [...adaptDriftLogs];
3593
- if (webhookDriftLog) v25DriftLogs.push(webhookDriftLog);
3594
- if (serverVersion === "v2") {
3595
- this.executor.validateAdaptedRequestAgainstV2(taskType, adaptedParams, v25DriftLogs);
3596
- }
3625
+ const adaptationLogs = [...adaptDriftLogs];
3626
+ if (webhookDriftLog) adaptationLogs.push(webhookDriftLog);
3597
3627
  const canonicalInputHandler = this.canonicalCreativeInputHandler(
3598
3628
  taskType,
3599
3629
  inputHandler,
@@ -3640,7 +3670,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
3640
3670
  );
3641
3671
  throwIfAborted(effectiveOptions?.signal);
3642
3672
  if (!result.success) await this.invalidateDiscoveryOnCapabilityError(result.adcpError?.code, effectiveOptions);
3643
- const postAdapterLogs = [...inputSchemaStripLogs, ...v25DriftLogs];
3673
+ const postAdapterLogs = [...inputSchemaStripLogs, ...adaptationLogs];
3644
3674
  if (postAdapterLogs.length > 0) {
3645
3675
  result.debug_logs = [...result.debug_logs ?? [], ...postAdapterLogs];
3646
3676
  }
@@ -3736,7 +3766,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
3736
3766
  const rawSubmittedWaitForCompletion = result.submitted?.waitForCompletion;
3737
3767
  const finalizerLegacyFormatConverter = legacyFormatConverter ?? this.resolveLegacyFormatConverter(void 0, context.projectionCatalogs);
3738
3768
  if (result.success && result.data) {
3739
- result.data = this.normalizeResponseToV3(taskType, result.data);
3769
+ result.data = this.normalizeEstablishedResponse(taskType, result.data);
3740
3770
  }
3741
3771
  result = this.wrapProductPolicySubmittedContinuation(
3742
3772
  result,
@@ -3882,7 +3912,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
3882
3912
  };
3883
3913
  }
3884
3914
  projectCanonicalCreativeData(taskType, data, transform, legacyFormatConverter) {
3885
- let projected = this.normalizeResponseToV3(taskType, data);
3915
+ let projected = this.normalizeEstablishedResponse(taskType, data);
3886
3916
  const record = projected && typeof projected === "object" ? projected : void 0;
3887
3917
  const canProjectRead = taskType === "get_products" ? Array.isArray(record?.products) : taskType === "list_creatives" ? Array.isArray(record?.creatives) : true;
3888
3918
  if (transform && canProjectRead) {
@@ -4555,7 +4585,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
4555
4585
  waitForCompletion: async (pollInterval, signal) => {
4556
4586
  let completed = await submitted.waitForCompletion(pollInterval, signal);
4557
4587
  if (completed.success && completed.data) {
4558
- completed.data = this.normalizeResponseToV3(taskType, completed.data);
4588
+ completed.data = this.normalizeEstablishedResponse(taskType, completed.data);
4559
4589
  }
4560
4590
  const terminal = completed.status === "completed" || completed.status === "failed";
4561
4591
  try {
@@ -4586,7 +4616,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
4586
4616
  attachMatch({
4587
4617
  success: true,
4588
4618
  status: "completed",
4589
- data: this.normalizeResponseToV3(taskType, taskInfo.result),
4619
+ data: this.normalizeEstablishedResponse(taskType, taskInfo.result),
4590
4620
  metadata: {
4591
4621
  taskId: taskInfo.taskId,
4592
4622
  taskName: taskInfo.taskType,
@@ -4662,8 +4692,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
4662
4692
  }
4663
4693
  /**
4664
4694
  * Adapt a request for the detected server wire version and the seller's
4665
- * AdCP protocol version. Applies wire-format adapters (v2.5) when talking
4666
- * to a v2 server, then applies protocol-version adapters (e.g. stripping
4695
+ * AdCP protocol version. Applies protocol-version adapters (e.g. stripping
4667
4696
  * 3.1-only fields for a 3.0 seller). Returns the adapted params and any
4668
4697
  * drift log entries describing what was changed.
4669
4698
  *
@@ -4671,22 +4700,14 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
4671
4700
  * current call's tool schemas can be supplied without cross-tenant caching.
4672
4701
  */
4673
4702
  adaptRequest(taskType, params, serverVersion, debugLogs, perCallToolSchemas, perCallCapabilities) {
4674
- const driftLogs = [];
4675
- let adapted = params;
4676
4703
  if (serverVersion !== "v3") {
4677
- const pair = getV25Adapter(taskType);
4678
- if (pair) adapted = pair.adaptRequest(adapted);
4704
+ throw new VersionUnsupportedError(taskType, "version", "v2", this.agent.agent_uri);
4679
4705
  }
4706
+ const driftLogs = [];
4707
+ let adapted = params;
4680
4708
  const toolSchema = (perCallToolSchemas ?? this.cachedToolSchemas)?.get(taskType);
4681
4709
  if (toolSchema && Object.keys(toolSchema).length > 0) {
4682
4710
  const declaredFields = new Set(Object.keys(toolSchema));
4683
- const adapterAliases = [["brand_manifest", "brand"]];
4684
- for (const [adapterField, schemaField] of adapterAliases) {
4685
- if (adapted[adapterField] !== void 0 && !declaredFields.has(adapterField) && declaredFields.has(schemaField) && adapted[schemaField] === void 0 && valueMatchesSchemaType(adapted[adapterField], toolSchema[schemaField])) {
4686
- adapted[schemaField] = adapted[adapterField];
4687
- delete adapted[adapterField];
4688
- }
4689
- }
4690
4711
  const envelopeFields = ADCP_ENVELOPE_FIELDS;
4691
4712
  const filtered = {};
4692
4713
  const schemaStripped = [];
@@ -4734,67 +4755,19 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
4734
4755
  }
4735
4756
  return { params: adapted, driftLogs };
4736
4757
  }
4737
- /**
4738
- * Normalize response to v3 format
4739
- *
4740
- * Converts v2 responses to v3 structure for consistent API surface.
4741
- */
4742
- normalizeResponseToV3(taskType, data) {
4743
- const pair = getV25Adapter(taskType);
4744
- if (pair?.normalizeResponse) return pair.normalizeResponse(data);
4745
- return data;
4746
- }
4747
- /**
4748
- * Check if request uses v3 features that the server doesn't support
4749
- *
4750
- * Returns an early empty result if the request requires v3 features
4751
- * that the server doesn't support. This treats "products matching unsupported
4752
- * capability" as an empty result set rather than an error.
4753
- *
4754
- * @returns TaskResult with empty data if v3 features are unsupported, null to proceed normally
4755
- */
4756
- async getEarlyResultForUnsupportedFeatures(taskType, params, options) {
4757
- if (taskType !== "get_products") {
4758
- return null;
4759
- }
4760
- const capabilities = await this.getCapabilities(options);
4761
- if (capabilities.version === "v3") {
4762
- return null;
4763
- }
4764
- const usesUnsupportedFeature = (
4765
- // required_features: content_standards requires contentStandards
4766
- params.filters?.required_features?.includes("content_standards") && !capabilities.features.contentStandards
4767
- );
4768
- if (!usesUnsupportedFeature) {
4769
- return null;
4758
+ normalizeEstablishedResponse(taskType, data) {
4759
+ if (!data) return data;
4760
+ switch (taskType) {
4761
+ case "get_products":
4762
+ return normalizeGetProductsResponse(data);
4763
+ case "create_media_buy":
4764
+ case "update_media_buy":
4765
+ return normalizeMediaBuyResponse(data);
4766
+ case "list_creative_formats":
4767
+ return normalizeFormatsResponse(data);
4768
+ default:
4769
+ return data;
4770
4770
  }
4771
- console.warn(
4772
- `[AdCP] v3-only features not supported by server "${this.agent.id}" (${capabilities.version}). Returning empty results.`
4773
- );
4774
- const emptyResponse = {
4775
- products: [],
4776
- property_list_applied: false
4777
- };
4778
- return {
4779
- success: true,
4780
- status: "completed",
4781
- data: emptyResponse,
4782
- metadata: {
4783
- taskId: `early_${Date.now()}`,
4784
- taskName: taskType,
4785
- agent: {
4786
- id: this.agent.id,
4787
- name: this.agent.name,
4788
- protocol: this.normalizedAgent.protocol
4789
- },
4790
- responseTimeMs: 0,
4791
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
4792
- clarificationRounds: 0,
4793
- status: "completed",
4794
- serverVersion: capabilities.version,
4795
- serverVersionSynthetic: capabilities._synthetic
4796
- }
4797
- };
4798
4771
  }
4799
4772
  // ====== MEDIA BUY TASKS ======
4800
4773
  /**
@@ -4894,6 +4867,13 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
4894
4867
  }
4895
4868
  }
4896
4869
  const conditionalSnapshot = skipCacheRead ? void 0 : cache?.read(cacheScope, cacheParams, true);
4870
+ const productEvidence = this.usesScopedDiscoveryTransport(
4871
+ effectiveOptions
4872
+ ) ? void 0 : {
4873
+ scopeKey: this.getCapabilityEvidenceScope().scopeKey,
4874
+ accountScope: this.canonicalAccountScope(account),
4875
+ expiresAt: Date.now() + resolveAgentDiscoveryTtlMs(this.config.discoveryCache?.ttlMs)
4876
+ };
4897
4877
  const result = await this.executeAndHandle(
4898
4878
  "get_products",
4899
4879
  "onGetProductsStatusChange",
@@ -4906,7 +4886,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
4906
4886
  projectionCatalogs: projectionCatalogs ?? this.config.projectionCatalogs
4907
4887
  });
4908
4888
  const authoritativeProducts = Array.isArray(data.products) ? data.products : response.products;
4909
- this.rememberCanonicalProductRoutes(response.products, account, authoritativeProducts);
4889
+ this.rememberCanonicalProductRoutes(response.products, account, authoritativeProducts, productEvidence);
4910
4890
  const { _message: _dropLegacyMessage, ...canonical } = response;
4911
4891
  void _dropLegacyMessage;
4912
4892
  return { ...canonical, projection: { diagnostics } };
@@ -4917,7 +4897,9 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
4917
4897
  );
4918
4898
  const finishCache = async (completed) => {
4919
4899
  if (!cache) return completed;
4920
- const cachedResult = cache.write(cacheScope, cacheParams, completed, conditionalSnapshot);
4900
+ const cachedResult = cache.write(cacheScope, cacheParams, completed, conditionalSnapshot, (materialized) => {
4901
+ this.rememberCanonicalProductRoutes(materialized.data?.products ?? [], account, void 0, productEvidence);
4902
+ });
4921
4903
  if (cachedResult.success && cachedResult.status === "completed") {
4922
4904
  if (!skipCacheRead && cacheParams.if_wholesale_feed_version === void 0 && cacheParams.if_pricing_version === void 0 && cachedResult.data.unchanged === true) {
4923
4905
  return this.getProducts(params, inputHandler, {
@@ -5095,7 +5077,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5095
5077
  if (hasCreativeFormatData) {
5096
5078
  this.validateBeforeCreativeCapabilityProbe("create_media_buy", params, taskOptions);
5097
5079
  }
5098
- const wireMode = hasCreativeFormatData ? await this.resolveCreativeFormatWireMode("create_media_buy", taskOptions) : "canonical";
5080
+ const wireMode = hasCreativeFormatData ? await this.resolveCreativeWireMode(
5081
+ "create_media_buy",
5082
+ taskOptions,
5083
+ true,
5084
+ () => this.productOptionsSupportCanonicalWire("create_media_buy", params, [], options)
5085
+ ) : "canonical";
5099
5086
  const wireParams = params;
5100
5087
  const result = await this.executeAndHandle(
5101
5088
  "create_media_buy",
@@ -5183,7 +5170,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5183
5170
  if (hasCreativeFormatData) {
5184
5171
  this.validateBeforeCreativeCapabilityProbe("update_media_buy", params, taskOptions);
5185
5172
  }
5186
- const wireMode = hasCreativeFormatData ? await this.resolveCreativeFormatWireMode("update_media_buy", taskOptions) : "canonical";
5173
+ const wireMode = hasCreativeFormatData ? await this.resolveCreativeWireMode(
5174
+ "update_media_buy",
5175
+ taskOptions,
5176
+ true,
5177
+ () => this.productOptionsSupportCanonicalWire("update_media_buy", params, [], options)
5178
+ ) : "canonical";
5187
5179
  const result = await this.executeAndHandle(
5188
5180
  "update_media_buy",
5189
5181
  "onUpdateMediaBuyStatusChange",
@@ -5272,7 +5264,6 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5272
5264
  projectionCatalogs ?? this.config.projectionCatalogs
5273
5265
  );
5274
5266
  this.validateBeforeCreativeCapabilityProbe("sync_creatives", params, taskOptions);
5275
- const wireMode = await this.resolveCreativeFormatWireMode("sync_creatives", taskOptions);
5276
5267
  const configuredSelectorContainers = [
5277
5268
  ...creativeFormatProjection?.selectorContainers ?? []
5278
5269
  ];
@@ -5284,10 +5275,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5284
5275
  const assignmentPackageContainers = Array.isArray(params.assignments) ? params.assignments.flatMap(
5285
5276
  (assignment) => typeof assignment.package_id === "string" && !configuredPackageIds.has(assignment.package_id) ? [{ package_id: assignment.package_id }] : []
5286
5277
  ) : [];
5278
+ const selectorContainers = [...configuredSelectorContainers, ...assignmentPackageContainers];
5279
+ const wireMode = await this.resolveCreativeWireMode(
5280
+ "sync_creatives",
5281
+ taskOptions,
5282
+ true,
5283
+ () => this.productOptionsSupportCanonicalWire("sync_creatives", params, selectorContainers, options)
5284
+ );
5287
5285
  const wireParams = this.projectUndeclaredFormatOptions(
5288
5286
  projectSyncCreativesForDelivery(
5289
5287
  params,
5290
- [...configuredSelectorContainers, ...assignmentPackageContainers],
5288
+ selectorContainers,
5291
5289
  wireMode,
5292
5290
  effectiveLegacyFormatConverter,
5293
5291
  effectiveCanonicalFormatLegacyResolver
@@ -5327,16 +5325,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5327
5325
  * sending a mutation. Discovers capabilities and the current tool's input
5328
5326
  * schema, or reuses fresh cached/primed evidence, with this client's wire pin.
5329
5327
  *
5330
- * `unknown` preserves the conservative legacy projection for older peers
5331
- * whose capabilities and schema do not establish support. Projection still
5332
- * requires an unambiguous legacy reference for each creative in that case.
5328
+ * This context-free check returns `unknown` when capabilities and schema do
5329
+ * not establish support. A write to a proven 3.1 seller can still select
5330
+ * canonical delivery from matching seller-advertised product options;
5331
+ * otherwise projection requires an unambiguous legacy reference.
5333
5332
  * Conflicting evidence and unproven support with a 3.2+ buyer pin throw
5334
5333
  * `CreativeFormatCapabilityError`, just as they do during a write.
5335
5334
  */
5336
5335
  async resolveCreativeFormatWireMode(taskType, options) {
5337
5336
  return this.resolveCreativeWireMode(taskType, options, true);
5338
5337
  }
5339
- async resolveCreativeWireMode(taskType, options, canRediscover) {
5338
+ async resolveCreativeWireMode(taskType, options, canRediscover, matchingProductOptions) {
5340
5339
  const discoveryContext = {};
5341
5340
  const capabilities = await this.getCapabilities({
5342
5341
  ...options,
@@ -5355,13 +5354,16 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5355
5354
  `Seller capability and ${taskType} input schema disagree about canonical creative support`
5356
5355
  );
5357
5356
  }
5358
- const resolved = declared !== "unknown" ? declared : schema;
5357
+ let resolved = declared !== "unknown" ? declared : schema;
5358
+ if (resolved === "unknown" && canUseProductOptionsForCreativeWire(capabilities, wireRelease) && matchingProductOptions?.()) {
5359
+ resolved = "canonical";
5360
+ }
5359
5361
  const release = /^v?(\d+)\.(\d+)(?:\.|-|$)/.exec(wireRelease.trim());
5360
5362
  const canonicalRequiredByBuyerPin = release !== null && (Number(release[1]) > 3 || Number(release[1]) === 3 && Number(release[2]) >= 2);
5361
5363
  if (resolved === "unknown" && canonicalRequiredByBuyerPin) {
5362
5364
  if (canRediscover && !usesScopedFetch && this.normalizedAgent.protocol === "mcp" && this.capabilitiesFromSharedCache && toolSchemas?.has(taskType) && !toolInputSchemasByProperties.has(toolSchemas)) {
5363
5365
  await this.invalidateDiscoveryCache(options);
5364
- return this.resolveCreativeWireMode(taskType, options, false);
5366
+ return this.resolveCreativeWireMode(taskType, options, false, matchingProductOptions);
5365
5367
  }
5366
5368
  throw new CreativeFormatCapabilityError(
5367
5369
  `Cannot prove which AdCP release the seller serves for ${taskType}; a 3.2+ client will not guess a legacy creative wire shape`
@@ -5369,6 +5371,112 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
5369
5371
  }
5370
5372
  return resolved;
5371
5373
  }
5374
+ /** Product evidence applies to this request only; it must never prime a tool-wide capability. */
5375
+ productOptionsSupportCanonicalWire(taskType, request, selectorContainers = [], options) {
5376
+ if (!isPlainRecord(request) || this.usesScopedDiscoveryTransport(options)) return false;
5377
+ const scopeKey = this.getCapabilityEvidenceScope().scopeKey;
5378
+ const accountScope = this.canonicalAccountScope(request.account);
5379
+ const optionRef = (value) => {
5380
+ if (!isPlainRecord(value) || typeof value.format_option_id !== "string" || !value.format_option_id) {
5381
+ return void 0;
5382
+ }
5383
+ if (typeof value.publisher_domain === "string") {
5384
+ return {
5385
+ scope: "publisher",
5386
+ publisher_domain: value.publisher_domain,
5387
+ format_option_id: value.format_option_id
5388
+ };
5389
+ }
5390
+ if (value.scope !== void 0 && value.scope !== "product") return void 0;
5391
+ return { scope: "product", format_option_id: value.format_option_id };
5392
+ };
5393
+ const accepts = (container, creative, depth = 0) => {
5394
+ if (depth > 32) return false;
5395
+ if (Array.isArray(container.selector_containers)) {
5396
+ return container.selector_containers.length > 0 && container.selector_containers.every((nested) => accepts(nested, creative, depth + 1));
5397
+ }
5398
+ const refs = Array.isArray(container.format_option_refs) ? container.format_option_refs.map(optionRef) : [];
5399
+ if (refs.some((ref) => ref === void 0)) return false;
5400
+ const creativeRef = isPlainRecord(creative) ? optionRef(creative.format_option_ref) : void 0;
5401
+ if (isPlainRecord(creative) && creative.format_option_ref !== void 0 && !creativeRef) return false;
5402
+ const isSellerDeclaration = (value) => {
5403
+ if (!isPlainRecord(value) || sellerDeclaredFormatOption(value) !== true || isSynthesizedFormatOption(value)) {
5404
+ return false;
5405
+ }
5406
+ const evidence2 = sellerFormatEvidence(value);
5407
+ if (!evidence2 || evidence2.scopeKey !== scopeKey || typeof container.product_id === "string" && evidence2.productId !== container.product_id || evidence2.expiresAt <= Date.now() || evidence2.accountScope !== accountScope && evidence2.accountScope !== "none")
5408
+ return false;
5409
+ const ref = optionRef(value);
5410
+ if (ref && formatOptionOriginFromRoutes(
5411
+ options?.canonicalFormatLegacyResolver,
5412
+ ref,
5413
+ typeof container.product_id === "string" ? container.product_id : void 0
5414
+ )?.seller_declared === false)
5415
+ return false;
5416
+ return !ref || typeof container.product_id !== "string" || this.cachedFormatOptionOrigin(request.account, ref, container.product_id)?.seller_declared !== false;
5417
+ };
5418
+ const declarations = [
5419
+ ...(Array.isArray(container.format_options) ? container.format_options : []).filter(isSellerDeclaration),
5420
+ ...selectedFormatOptions(container).filter(isSellerDeclaration)
5421
+ ];
5422
+ if (typeof container.product_id === "string") {
5423
+ for (const ref of [...refs, ...creativeRef ? [creativeRef] : []]) {
5424
+ if (!ref) continue;
5425
+ const route = this.routeForOption(request.account, container.product_id, ref);
5426
+ if (route?.kind === "product" && route.declaration && isSellerDeclaration(route.declaration))
5427
+ declarations.push(route.declaration);
5428
+ }
5429
+ }
5430
+ const available = declarations.filter((declaration) => declaration.experimental !== true);
5431
+ const matchesRef = (declaration, ref) => {
5432
+ const declaredRef = optionRef(declaration);
5433
+ return declaredRef !== void 0 && sameFormatOptionRef(declaredRef, ref);
5434
+ };
5435
+ if (!refs.every((ref) => available.some((declaration) => matchesRef(declaration, ref)))) return false;
5436
+ const selected = available.filter(
5437
+ (declaration) => refs.length === 0 || refs.some((ref) => matchesRef(declaration, ref))
5438
+ );
5439
+ if (creative === void 0) return refs.length > 0 && selected.length > 0;
5440
+ if (!isPlainRecord(creative) || typeof creative.format_kind !== "string" || creative.format_id !== void 0)
5441
+ return false;
5442
+ return selected.some(
5443
+ (declaration) => declaration.format_kind === creative.format_kind && (!creativeRef || matchesRef(declaration, creativeRef)) && creativeMatchesProductOption(creative, declaration)
5444
+ );
5445
+ };
5446
+ if (taskType === "sync_creatives") {
5447
+ if (!Array.isArray(request.creatives) || request.creatives.length === 0) return false;
5448
+ const creatives = request.creatives;
5449
+ const assignments = Array.isArray(request.assignments) ? request.assignments : [];
5450
+ if (!assignments.every(
5451
+ (value) => isPlainRecord(value) && typeof value.package_id === "string" && typeof value.creative_id === "string" && creatives.some((creative) => isPlainRecord(creative) && creative.creative_id === value.creative_id)
5452
+ ))
5453
+ return false;
5454
+ return creatives.every((creative) => {
5455
+ if (!isPlainRecord(creative)) return false;
5456
+ const assigned = new Set(
5457
+ assignments.flatMap(
5458
+ (value) => isPlainRecord(value) && value.creative_id === creative.creative_id && typeof value.package_id === "string" ? [value.package_id] : []
5459
+ )
5460
+ );
5461
+ const relevant = assigned.size === 0 ? selectorContainers : selectorContainers.filter(
5462
+ (container) => typeof container.package_id === "string" && assigned.has(container.package_id)
5463
+ );
5464
+ return relevant.length > 0 && [...assigned].every((id) => relevant.some((container) => container.package_id === id)) && relevant.every((container) => accepts(container, creative));
5465
+ });
5466
+ }
5467
+ const packages = ["packages", "new_packages"].flatMap((key) => Array.isArray(request[key]) ? request[key] : []);
5468
+ let evidence = false;
5469
+ return packages.length > 0 && packages.every((pkg) => {
5470
+ if (!isPlainRecord(pkg)) return false;
5471
+ const creatives = Array.isArray(pkg.creatives) ? pkg.creatives : [];
5472
+ const hasSelectors = Array.isArray(pkg.format_option_refs) && pkg.format_option_refs.length > 0;
5473
+ if (!hasSelectors && creatives.length === 0) {
5474
+ return pkg.format_kind === void 0 && pkg.format_ids === void 0;
5475
+ }
5476
+ evidence = true;
5477
+ return (!hasSelectors || accepts(pkg)) && creatives.every((creative) => accepts(pkg, creative));
5478
+ }) && evidence;
5479
+ }
5372
5480
  /** Validate malformed creative payloads before capability discovery can perform I/O. */
5373
5481
  validateBeforeCreativeCapabilityProbe(taskType, params, options) {
5374
5482
  if (options.skipIdempotencyAutoInject || options.skipAccountValidation || options.skipRequestValidation) return;
@@ -6277,11 +6385,8 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
6277
6385
  capabilityDiscoveryContext.toolSchemas,
6278
6386
  capabilityDiscoveryContext.capabilities
6279
6387
  );
6280
- const v25DriftLogs = [...adaptDriftLogs];
6281
- if (webhookDriftLog) v25DriftLogs.push(webhookDriftLog);
6282
- if (serverVersion === "v2") {
6283
- this.executor.validateAdaptedRequestAgainstV2(taskName, adaptedParams, v25DriftLogs);
6284
- }
6388
+ const adaptationLogs = [...adaptDriftLogs];
6389
+ if (webhookDriftLog) adaptationLogs.push(webhookDriftLog);
6285
6390
  const deferredClientContext = {
6286
6391
  kind: "single-agent",
6287
6392
  taskType: taskName,
@@ -6311,7 +6416,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
6311
6416
  deferredClientContext
6312
6417
  );
6313
6418
  if (!result.success) await this.invalidateDiscoveryOnCapabilityError(result.adcpError?.code, effectiveOptions);
6314
- const postAdapterLogs = [...inputSchemaStripLogs, ...v25DriftLogs];
6419
+ const postAdapterLogs = [...inputSchemaStripLogs, ...adaptationLogs];
6315
6420
  if (postAdapterLogs.length > 0) {
6316
6421
  result.debug_logs = [...result.debug_logs ?? [], ...postAdapterLogs];
6317
6422
  }
@@ -6501,6 +6606,10 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
6501
6606
  getProtocol() {
6502
6607
  return this.normalizedAgent.protocol;
6503
6608
  }
6609
+ /** Resolved MCP endpoint already used by this client; never performs discovery. */
6610
+ getDiscoveredMcpEndpoint() {
6611
+ return this.discoveredEndpoint;
6612
+ }
6504
6613
  /**
6505
6614
  * Get the canonical base URL for this agent
6506
6615
  *
@@ -7002,7 +7111,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7002
7111
  * Get agent capabilities, including AdCP version support
7003
7112
  *
7004
7113
  * For v3 servers, calls get_adcp_capabilities tool.
7005
- * For v2 servers, builds synthetic capabilities from available tools.
7114
+ * Requires AdCP 3 capability discovery; retired AdCP 2 agents are rejected.
7006
7115
  *
7007
7116
  * @returns Promise resolving to normalized capabilities object
7008
7117
  *
@@ -7039,7 +7148,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7039
7148
  }
7040
7149
  if (!usesScopedFetch && this.cachedCapabilities) {
7041
7150
  if (discoveryContext) discoveryContext.toolSchemas = this.cachedToolSchemas;
7042
- this.maybeWarnV2Sunset(this.cachedCapabilities);
7151
+ this.assertSupportedServer(this.cachedCapabilities);
7043
7152
  return this.cachedCapabilities;
7044
7153
  }
7045
7154
  if (!usesScopedFetch && this.config.discoveryCache) {
@@ -7123,7 +7232,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7123
7232
  this.capabilitiesFromSharedCache = true;
7124
7233
  this.recordSharedEvidence(key);
7125
7234
  if (discoveryContext) discoveryContext.toolSchemas = this.cachedToolSchemas;
7126
- this.maybeWarnV2Sunset(installed);
7235
+ this.assertSupportedServer(installed);
7127
7236
  return installed;
7128
7237
  }
7129
7238
  async discoverCapabilitiesLive(options, usesScopedFetch, discoveryContext) {
@@ -7173,16 +7282,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7173
7282
  throw createTimeoutError(requestTimeoutMs);
7174
7283
  }
7175
7284
  if (result.success && result.data) {
7176
- const capabilities2 = augmentCapabilitiesFromTools(parseCapabilitiesResponse(result.data), tools);
7285
+ const capabilities = augmentCapabilitiesFromTools(parseCapabilitiesResponse(result.data), tools);
7286
+ this.assertSupportedServer(capabilities);
7177
7287
  if (!usesScopedFetch && !superseded()) {
7178
- this.cachedCapabilities = capabilities2;
7288
+ this.cachedCapabilities = capabilities;
7179
7289
  this.capabilitiesFromSharedCache = false;
7180
- if (!capabilities2._synthetic && this.config.discoveryCache) {
7290
+ if (!capabilities._synthetic && this.config.discoveryCache) {
7181
7291
  this.recordSharedEvidence(this.sharedDiscoveryKey(options));
7182
7292
  const stored = await this.writeSharedDiscovery(
7183
7293
  options,
7184
7294
  {
7185
- capabilities: structuredClone(capabilities2),
7295
+ capabilities: structuredClone(capabilities),
7186
7296
  toolSchemas: Object.fromEntries(discoveredToolSchemas),
7187
7297
  toolInputSchemas: Object.fromEntries(discoveredInputSchemas)
7188
7298
  },
@@ -7190,7 +7300,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7190
7300
  startedAtEpoch
7191
7301
  );
7192
7302
  if (superseded()) {
7193
- if (this.cachedCapabilities === capabilities2) {
7303
+ if (this.cachedCapabilities === capabilities) {
7194
7304
  this.cachedCapabilities = void 0;
7195
7305
  this.cachedToolSchemas = void 0;
7196
7306
  this.primedCapabilitiesExpiresAt = void 0;
@@ -7200,31 +7310,26 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7200
7310
  }
7201
7311
  }
7202
7312
  }
7203
- this.maybeWarnV2Sunset(capabilities2);
7204
- return capabilities2;
7313
+ this.assertSupportedServer(capabilities);
7314
+ return capabilities;
7205
7315
  }
7206
7316
  if (!advertisesCapabilitiesTool) {
7207
7317
  throw new Error("unadvertised official A2A capability probe was not supported");
7208
7318
  }
7209
7319
  if (result.data && looksLikeV3Capabilities(result.data)) {
7320
+ const capabilities = augmentCapabilitiesFromTools(parseCapabilitiesResponse(result.data), tools);
7321
+ this.assertSupportedServer(capabilities);
7210
7322
  console.warn(
7211
7323
  `[AdCP] Agent "${this.agent.id}" returned a get_adcp_capabilities response that failed validation, but the response is structurally v3-shaped. Treating as v3 (the agent has a wire-shape bug \u2014 that's the thing to fix).`,
7212
7324
  { hasError: !!result.error, hasData: !!result.data }
7213
7325
  );
7214
- const parsed = parseCapabilitiesResponse(result.data);
7215
- const v3Capabilities = {
7216
- ...parsed,
7217
- version: "v3",
7218
- majorVersions: parsed.majorVersions.includes(3) ? parsed.majorVersions : [3]
7219
- };
7220
- const capabilities2 = augmentCapabilitiesFromTools(v3Capabilities, tools);
7221
7326
  if (!usesScopedFetch && !superseded()) {
7222
- this.cachedCapabilities = capabilities2;
7327
+ this.cachedCapabilities = capabilities;
7223
7328
  this.capabilitiesFromSharedCache = false;
7224
7329
  this.recordSharedEvidence(this.sharedDiscoveryKey(options));
7225
7330
  }
7226
- this.maybeWarnV2Sunset(capabilities2);
7227
- return capabilities2;
7331
+ this.assertSupportedServer(capabilities);
7332
+ return capabilities;
7228
7333
  }
7229
7334
  console.warn(
7230
7335
  `[AdCP] Agent "${this.agent.id}" advertises get_adcp_capabilities but the call returned non-success and the response is not v3-shaped \u2014 treating as v3 (synthetic) since the agent has the v3-only discovery tool. This client routes to v3 adapters, but calls reading capability details (idempotency TTL, supported_versions, feature flags) will fail until the agent operator fixes the capabilities endpoint.`,
@@ -7235,7 +7340,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7235
7340
  }
7236
7341
  );
7237
7342
  } catch (error) {
7238
- if (error instanceof AuthenticationRequiredError || error instanceof ConfigurationError || error instanceof TaskTimeoutError || isAbortOrTimeoutError(error)) {
7343
+ if (error instanceof AuthenticationRequiredError || error instanceof VersionUnsupportedError || error instanceof ConfigurationError || error instanceof TaskTimeoutError || isAbortOrTimeoutError(error)) {
7239
7344
  throw error;
7240
7345
  }
7241
7346
  if (advertisesCapabilitiesTool) {
@@ -7245,26 +7350,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7245
7350
  }
7246
7351
  }
7247
7352
  if (advertisesCapabilitiesTool) {
7248
- const capabilities2 = augmentCapabilitiesFromTools(buildSyntheticV3Capabilities(tools), tools);
7353
+ const capabilities = augmentCapabilitiesFromTools(buildSyntheticV3Capabilities(tools), tools);
7249
7354
  if (!usesScopedFetch && !superseded()) {
7250
- this.cachedCapabilities = capabilities2;
7355
+ this.cachedCapabilities = capabilities;
7251
7356
  this.capabilitiesFromSharedCache = false;
7252
7357
  this.recordSharedEvidence(this.sharedDiscoveryKey(options));
7253
7358
  }
7254
- this.maybeWarnV2Sunset(capabilities2);
7255
- return capabilities2;
7359
+ this.assertSupportedServer(capabilities);
7360
+ return capabilities;
7256
7361
  }
7257
7362
  }
7258
- console.warn(
7259
- `[AdCP] Agent "${this.agent.id}" detected as v2 (no get_adcp_capabilities tool). Tools: [${tools.map((t) => t.name).join(", ")}]`
7260
- );
7261
- const capabilities = buildSyntheticCapabilities(tools);
7262
- if (!usesScopedFetch && !superseded()) {
7263
- this.cachedCapabilities = capabilities;
7264
- this.capabilitiesFromSharedCache = false;
7265
- this.recordSharedEvidence(this.sharedDiscoveryKey(options));
7266
- }
7267
- return capabilities;
7363
+ throw new VersionUnsupportedError("get_adcp_capabilities", "synthetic", "v2", this.agent.agent_uri);
7268
7364
  }
7269
7365
  /**
7270
7366
  * Return the client-bound scope required by {@link primeCapabilities}.
@@ -7779,28 +7875,11 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7779
7875
  if (!this.config.discoveryCache || !code || !CAPABILITY_STALE_ERROR_CODES.has(code)) return;
7780
7876
  await this.invalidateDiscoveryCache(options);
7781
7877
  }
7782
- /**
7783
- * Emit a one-time warning when the agent reports v2 capabilities.
7784
- *
7785
- * v2 went unsupported on 2026-04-20 (AdCP 3.0 GA — adcp#2220). We still
7786
- * execute v2 code paths (no behaviour change), but clients integrating
7787
- * against an unsupported agent should hear about it loudly.
7788
- *
7789
- * Synthetic capabilities (no `get_adcp_capabilities` tool available) don't
7790
- * trigger the warning — we don't actually know the agent's version, and
7791
- * shouting at legitimately-unversioned agents would be noise.
7792
- *
7793
- * Suppression: `process.env.ADCP_ALLOW_V2 === '1'`.
7794
- */
7795
- maybeWarnV2Sunset(capabilities) {
7796
- if (this._v2WarningFired) return;
7797
- if (capabilities.version === "v3") return;
7798
- if (capabilities._synthetic) return;
7799
- if (process.env.ADCP_ALLOW_V2 === "1") return;
7800
- this._v2WarningFired = true;
7801
- console.warn(
7802
- `[adcp] Warning: agent ${this.agent.agent_uri} reports v2 capabilities. v2 went unsupported on 2026-04-20 (AdCP 3.0 GA). Upgrade the agent to v3 or set ADCP_ALLOW_V2=1 to suppress this warning. See https://github.com/adcontextprotocol/adcp/issues/2220`
7803
- );
7878
+ /** Reject retired protocol generations before caching or dispatching. */
7879
+ assertSupportedServer(capabilities) {
7880
+ if (capabilities.version !== "v3" || !capabilities.majorVersions.includes(3)) {
7881
+ throw new VersionUnsupportedError("get_adcp_capabilities", "version", capabilities.version, this.agent.agent_uri);
7882
+ }
7804
7883
  }
7805
7884
  /**
7806
7885
  * Warn once per client when `requireSupportedMajor` accepts synthetic v3
@@ -7821,24 +7900,6 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7821
7900
  `[adcp] Warning: agent ${this.agent.agent_uri} advertises get_adcp_capabilities (v3-only) but the call failed. Treating as v3 (synthetic) \u2014 version + idempotency-TTL checks skipped. Calls to getIdempotencyReplayTtlSeconds() will throw until the agent's capabilities endpoint is fixed. Report the wire-shape bug to the agent operator at ${this.agent.agent_uri}.`
7822
7901
  );
7823
7902
  }
7824
- /**
7825
- * Warn once per client when `requireSupportedMajor` routes a synthetic-v2
7826
- * seller through the v2 adapter — the agent did not expose
7827
- * `get_adcp_capabilities`, so the version was inferred from `tools/list`.
7828
- * A compliant v3 seller would declare itself; absence of a declaration is
7829
- * read as v2. Idempotency-TTL guarantees are unknown for these sellers,
7830
- * so BYOK retry callers should treat them as such.
7831
- *
7832
- * One-shot via `_syntheticV2WarningFired` (matches `maybeWarnV2Sunset`
7833
- * cadence).
7834
- */
7835
- maybeWarnSyntheticV2() {
7836
- if (this._syntheticV2WarningFired) return;
7837
- this._syntheticV2WarningFired = true;
7838
- console.warn(
7839
- `[adcp] Warning: agent ${this.agent.agent_uri} does not expose get_adcp_capabilities. Routing as v2 (synthetic) \u2014 idempotency-TTL guarantee is unknown. Ask the agent operator to declare v3 via get_adcp_capabilities if v3 routing is intended. Branch on client.isSyntheticV2() to tighten retry policies for these sellers.`
7840
- );
7841
- }
7842
7903
  /**
7843
7904
  * Detect server AdCP version
7844
7905
  *
@@ -7848,36 +7909,15 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7848
7909
  const capabilities = await this.getCapabilities(options);
7849
7910
  const discoveryContext = options?.[CAPABILITY_DISCOVERY_CONTEXT];
7850
7911
  if (discoveryContext) discoveryContext.capabilities = capabilities;
7912
+ this.assertSupportedServer(capabilities);
7851
7913
  return capabilities.version;
7852
7914
  }
7853
- /**
7854
- * Whether the seller's capabilities are synthesized from `tools/list`
7855
- * with no authoritative `get_adcp_capabilities` response — i.e. the
7856
- * dispatcher routes through the v2 adapter and idempotency-TTL is
7857
- * unknown. Use this to gate retry behavior for sellers whose retry
7858
- * safety can't be derived from declared capabilities (lower attempt
7859
- * caps, longer backoff, or fall back to natural-key recovery).
7860
- *
7861
- * Returns `false` for declared v2 sellers, declared v3 sellers, and
7862
- * synthetic v3 sellers (which advertise the v3 discovery tool even
7863
- * when the call itself failed).
7864
- *
7865
- * Caveat for synthetic v3: the predicate returns `false`, but TTL is
7866
- * still unknown for those sellers — `getIdempotencyReplayTtlSeconds()`
7867
- * throws until the agent's capabilities endpoint is fixed (issue
7868
- * #1217). Retry-policy consumers that need a complete "TTL unknown"
7869
- * gate should additionally check `getCapabilities()._synthetic`.
7870
- */
7871
- async isSyntheticV2() {
7872
- const capabilities = await this.getCapabilities();
7873
- return capabilities._synthetic === true && capabilities.version === "v2";
7874
- }
7875
7915
  /**
7876
7916
  * Check if server supports a specific AdCP major version
7877
7917
  */
7878
7918
  async supportsVersion(version) {
7879
7919
  const capabilities = await this.getCapabilities();
7880
- return capabilities.majorVersions.includes(version);
7920
+ return version === 3 && capabilities.majorVersions.includes(3);
7881
7921
  }
7882
7922
  /**
7883
7923
  * Return the seller's declared `adcp.idempotency.replay_ttl_seconds`.
@@ -7888,8 +7928,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7888
7928
  *
7889
7929
  * Fails closed when the seller is v3 but does not declare the field: the
7890
7930
  * spec makes the declaration REQUIRED, and silently defaulting to 24h
7891
- * would mislead buyers about retry safety. Callers on v2 servers get
7892
- * `undefined` instead of a throw — v2 pre-dates the idempotency envelope.
7931
+ * would mislead buyers about retry safety.
7893
7932
  */
7894
7933
  async getIdempotencyReplayTtlSeconds() {
7895
7934
  const capabilities = await this.getCapabilities();
@@ -7898,7 +7937,6 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
7898
7937
  assertValidIdempotencyReplayTtlSeconds(capabilities.idempotency.replayTtlSeconds);
7899
7938
  return capabilities.idempotency.replayTtlSeconds;
7900
7939
  }
7901
- if (capabilities.version !== "v3") return void 0;
7902
7940
  throw new ConfigurationError(
7903
7941
  `Agent "${this.agent.id}" is v3 but does not declare adcp.idempotency.replay_ttl_seconds. The spec requires this for v3 sellers \u2014 treating the agent as non-compliant rather than defaulting to 24h, which would silently mislead retry-sensitive flows.`,
7904
7942
  "adcp.idempotency.replay_ttl_seconds"
@@ -8209,28 +8247,16 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
8209
8247
  * 2. `capabilities.idempotency.replayTtlSeconds` present (spec-required
8210
8248
  * for real major-3+ sellers)
8211
8249
  *
8212
- * Sellers whose capabilities are synthesized from `tools/list` (no
8213
- * authoritative `get_adcp_capabilities` response) are treated as v2: a
8214
- * compliant v3 seller would declare itself, so absence of a declaration
8215
- * is taken as evidence of v2. The dispatcher routes the request through
8216
- * the v2 wire-shape adapter. A one-time warning surfaces the routing
8217
- * decision so adopters can audit it; retry-safety (idempotency TTL) is
8218
- * unknown for these sellers and BYOK callers should treat them as such.
8219
- *
8220
- * Per-client `allowV2: true` or, when that's undefined,
8221
- * `ADCP_ALLOW_V2=1` in the environment bypasses the guard entirely.
8250
+ * Synthetic v3 evidence is accepted only when the agent advertises discovery.
8251
+ * Agents without discovery and AdCP 2-only agents are rejected.
8222
8252
  *
8223
8253
  * Throws `VersionUnsupportedError` with the specific reason on failure.
8224
8254
  */
8225
8255
  async requireSupportedMajor(taskType = "request", options) {
8226
- if (this.isV2Allowed()) return;
8227
8256
  const capabilities = await this.getCapabilities(options);
8257
+ this.assertSupportedServer(capabilities);
8228
8258
  if (capabilities._synthetic) {
8229
- if (capabilities.version === "v3") {
8230
- this.maybeWarnSyntheticV3();
8231
- } else {
8232
- this.maybeWarnSyntheticV2();
8233
- }
8259
+ this.maybeWarnSyntheticV3();
8234
8260
  return;
8235
8261
  }
8236
8262
  const supportedVersions = capabilities.supportedVersions;
@@ -8261,10 +8287,6 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
8261
8287
  async requireV3(taskType = "request") {
8262
8288
  return this.requireSupportedMajor(taskType);
8263
8289
  }
8264
- isV2Allowed() {
8265
- if (this.config.allowV2 !== void 0) return this.config.allowV2 === true;
8266
- return process.env.ADCP_ALLOW_V2 === "1";
8267
- }
8268
8290
  // ====== STATIC HELPER METHODS ======
8269
8291
  /**
8270
8292
  * Query a legacy creative-agent named-format catalog.