@adcp/sdk 16.0.0-beta.7 → 16.0.0-beta.9

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 (408) hide show
  1. package/AGENTS.md +3 -3
  2. package/README.md +20 -0
  3. package/bin/adcp.js +10 -13
  4. package/dist/lib/conformance/index.d.mts +2 -0
  5. package/dist/lib/conformance/index.d.ts +2 -0
  6. package/dist/lib/conformance/index.js +3 -0
  7. package/dist/lib/conformance/index.mjs +2 -0
  8. package/dist/lib/conformance/property-lists.d.mts +14 -0
  9. package/dist/lib/conformance/property-lists.d.ts +14 -0
  10. package/dist/lib/conformance/property-lists.js +45 -0
  11. package/dist/lib/conformance/property-lists.mjs +21 -0
  12. package/dist/lib/conformance/runConformance.js +20 -1
  13. package/dist/lib/conformance/runConformance.mjs +20 -1
  14. package/dist/lib/conformance/types.d.mts +3 -0
  15. package/dist/lib/conformance/types.d.ts +3 -0
  16. package/dist/lib/core/AgentClient.d.mts +8 -5
  17. package/dist/lib/core/AgentClient.d.ts +8 -5
  18. package/dist/lib/core/AgentClient.js +9 -4
  19. package/dist/lib/core/AgentClient.mjs +9 -4
  20. package/dist/lib/core/SingleAgentClient.d.mts +32 -115
  21. package/dist/lib/core/SingleAgentClient.d.ts +32 -115
  22. package/dist/lib/core/SingleAgentClient.js +379 -273
  23. package/dist/lib/core/SingleAgentClient.mjs +387 -275
  24. package/dist/lib/core/TaskExecutor.d.mts +1 -16
  25. package/dist/lib/core/TaskExecutor.d.ts +1 -16
  26. package/dist/lib/core/TaskExecutor.js +34 -51
  27. package/dist/lib/core/TaskExecutor.mjs +12 -29
  28. package/dist/lib/core/product-cache.d.mts +3 -1
  29. package/dist/lib/core/product-cache.d.ts +3 -1
  30. package/dist/lib/core/product-cache.js +2 -1
  31. package/dist/lib/core/product-cache.mjs +2 -1
  32. package/dist/lib/errors/index.d.mts +2 -8
  33. package/dist/lib/errors/index.d.ts +2 -8
  34. package/dist/lib/errors/index.js +4 -4
  35. package/dist/lib/errors/index.mjs +4 -4
  36. package/dist/lib/identifiers.d.mts +53 -0
  37. package/dist/lib/identifiers.d.ts +53 -0
  38. package/dist/lib/identifiers.js +212 -0
  39. package/dist/lib/identifiers.mjs +163 -0
  40. package/dist/lib/index.d.mts +7 -5
  41. package/dist/lib/index.d.ts +7 -5
  42. package/dist/lib/index.js +2 -14
  43. package/dist/lib/index.mjs +1 -14
  44. package/dist/lib/media-buy/compatibility.d.mts +1 -1
  45. package/dist/lib/media-buy/compatibility.d.ts +1 -1
  46. package/dist/lib/media-buy/compatibility.js +26 -45
  47. package/dist/lib/media-buy/compatibility.mjs +26 -45
  48. package/dist/lib/media-buy/index.d.mts +1 -1
  49. package/dist/lib/media-buy/index.d.ts +1 -1
  50. package/dist/lib/media-buy/legacy-purchase-continuation.d.mts +2 -2
  51. package/dist/lib/media-buy/legacy-purchase-continuation.d.ts +2 -2
  52. package/dist/lib/media-buy/property-policy.d.mts +15 -1
  53. package/dist/lib/media-buy/property-policy.d.ts +15 -1
  54. package/dist/lib/media-buy/property-policy.js +135 -3
  55. package/dist/lib/media-buy/property-policy.mjs +134 -3
  56. package/dist/lib/protocols/index.js +14 -22
  57. package/dist/lib/protocols/index.mjs +5 -13
  58. package/dist/lib/registry/index.d.mts +12 -0
  59. package/dist/lib/registry/index.d.ts +12 -0
  60. package/dist/lib/registry/index.js +159 -5
  61. package/dist/lib/registry/index.mjs +156 -4
  62. package/dist/lib/registry/types.d.mts +26 -2
  63. package/dist/lib/registry/types.d.ts +26 -2
  64. package/dist/lib/registry/types.generated.d.mts +51 -11
  65. package/dist/lib/registry/types.generated.d.ts +51 -11
  66. package/dist/lib/reporting/source/conformance.d.mts +8 -8
  67. package/dist/lib/reporting/source/conformance.d.ts +8 -8
  68. package/dist/lib/reporting/source/manifest.d.mts +27 -27
  69. package/dist/lib/reporting/source/manifest.d.ts +27 -27
  70. package/dist/lib/server/create-adcp-server.js +6 -0
  71. package/dist/lib/server/create-adcp-server.mjs +6 -0
  72. package/dist/lib/server/decisioning/specialisms/lists.d.mts +4 -4
  73. package/dist/lib/server/decisioning/specialisms/lists.d.ts +4 -4
  74. package/dist/lib/server/index.d.mts +3 -0
  75. package/dist/lib/server/index.d.ts +3 -0
  76. package/dist/lib/server/index.js +8 -1
  77. package/dist/lib/server/index.mjs +4 -0
  78. package/dist/lib/server/property-lists.d.mts +36 -0
  79. package/dist/lib/server/property-lists.d.ts +36 -0
  80. package/dist/lib/server/property-lists.js +154 -0
  81. package/dist/lib/server/property-lists.mjs +129 -0
  82. package/dist/lib/server/targeting-helpers.d.mts +2 -0
  83. package/dist/lib/server/targeting-helpers.d.ts +2 -0
  84. package/dist/lib/server/targeting-helpers.js +28 -1
  85. package/dist/lib/server/targeting-helpers.mjs +18 -1
  86. package/dist/lib/signing/parser.js +2 -2
  87. package/dist/lib/signing/parser.mjs +2 -2
  88. package/dist/lib/signing/server.d.mts +1 -1
  89. package/dist/lib/signing/server.d.ts +1 -1
  90. package/dist/lib/signing/server.mjs +5 -1
  91. package/dist/lib/signing/webhook-verifier.d.mts +11 -0
  92. package/dist/lib/signing/webhook-verifier.d.ts +11 -0
  93. package/dist/lib/signing/webhook-verifier.js +11 -3
  94. package/dist/lib/signing/webhook-verifier.mjs +11 -3
  95. package/dist/lib/supply-path/verify.js +12 -2
  96. package/dist/lib/supply-path/verify.mjs +2 -2
  97. package/dist/lib/testing/compliance/comply.js +0 -8
  98. package/dist/lib/testing/compliance/comply.mjs +0 -8
  99. package/dist/lib/testing/compliance/storyboard-tracks.js +11 -0
  100. package/dist/lib/testing/compliance/storyboard-tracks.mjs +11 -0
  101. package/dist/lib/testing/index.d.mts +2 -0
  102. package/dist/lib/testing/index.d.ts +2 -0
  103. package/dist/lib/testing/index.js +5 -0
  104. package/dist/lib/testing/index.mjs +3 -0
  105. package/dist/lib/testing/scenarios/capabilities.d.mts +2 -2
  106. package/dist/lib/testing/scenarios/capabilities.d.ts +2 -2
  107. package/dist/lib/testing/scenarios/capabilities.js +8 -41
  108. package/dist/lib/testing/scenarios/capabilities.mjs +9 -42
  109. package/dist/lib/testing/storyboard/creative-build-probe.d.mts +34 -0
  110. package/dist/lib/testing/storyboard/creative-build-probe.d.ts +34 -0
  111. package/dist/lib/testing/storyboard/creative-build-probe.js +395 -0
  112. package/dist/lib/testing/storyboard/creative-build-probe.mjs +373 -0
  113. package/dist/lib/testing/storyboard/index.d.mts +2 -0
  114. package/dist/lib/testing/storyboard/index.d.ts +2 -0
  115. package/dist/lib/testing/storyboard/index.js +5 -0
  116. package/dist/lib/testing/storyboard/index.mjs +3 -0
  117. package/dist/lib/testing/storyboard/loader.js +12 -0
  118. package/dist/lib/testing/storyboard/loader.mjs +12 -0
  119. package/dist/lib/testing/storyboard/property-list-reference.d.mts +15 -0
  120. package/dist/lib/testing/storyboard/property-list-reference.d.ts +15 -0
  121. package/dist/lib/testing/storyboard/property-list-reference.js +514 -0
  122. package/dist/lib/testing/storyboard/property-list-reference.mjs +487 -0
  123. package/dist/lib/testing/storyboard/runner.js +318 -58
  124. package/dist/lib/testing/storyboard/runner.mjs +322 -58
  125. package/dist/lib/testing/storyboard/types.d.mts +38 -16
  126. package/dist/lib/testing/storyboard/types.d.ts +38 -16
  127. package/dist/lib/testing/storyboard/types.js +1 -0
  128. package/dist/lib/testing/storyboard/types.mjs +1 -0
  129. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  130. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  131. package/dist/lib/testing/storyboard/validations.js +64 -0
  132. package/dist/lib/testing/storyboard/validations.mjs +67 -1
  133. package/dist/lib/testing/types.d.mts +15 -1
  134. package/dist/lib/testing/types.d.ts +15 -1
  135. package/dist/lib/types/schemas.generated.d.ts +65 -65
  136. package/dist/lib/types/wellknown-schemas.generated.d.mts +21 -21
  137. package/dist/lib/types/wellknown-schemas.generated.d.ts +21 -21
  138. package/dist/lib/utils/adcp-version-config.js +6 -0
  139. package/dist/lib/utils/adcp-version-config.mjs +6 -0
  140. package/dist/lib/utils/capabilities.d.mts +7 -9
  141. package/dist/lib/utils/capabilities.d.ts +7 -9
  142. package/dist/lib/utils/capabilities.js +14 -28
  143. package/dist/lib/utils/capabilities.mjs +14 -27
  144. package/dist/lib/utils/creative-adapter.d.mts +15 -113
  145. package/dist/lib/utils/creative-adapter.d.ts +15 -113
  146. package/dist/lib/utils/creative-adapter.js +7 -106
  147. package/dist/lib/utils/creative-adapter.mjs +7 -102
  148. package/dist/lib/utils/format-renders.d.mts +20 -80
  149. package/dist/lib/utils/format-renders.d.ts +20 -80
  150. package/dist/lib/utils/format-renders.js +7 -67
  151. package/dist/lib/utils/format-renders.mjs +7 -66
  152. package/dist/lib/utils/index.d.mts +1 -2
  153. package/dist/lib/utils/index.d.ts +1 -2
  154. package/dist/lib/utils/index.js +0 -7
  155. package/dist/lib/utils/index.mjs +0 -6
  156. package/dist/lib/utils/preview-normalizer.d.mts +31 -80
  157. package/dist/lib/utils/preview-normalizer.d.ts +31 -80
  158. package/dist/lib/utils/preview-normalizer.js +5 -50
  159. package/dist/lib/utils/preview-normalizer.mjs +5 -49
  160. package/dist/lib/utils/pricing-adapter.d.mts +2 -36
  161. package/dist/lib/utils/pricing-adapter.d.ts +2 -36
  162. package/dist/lib/utils/pricing-adapter.js +0 -105
  163. package/dist/lib/utils/pricing-adapter.mjs +0 -100
  164. package/dist/lib/utils/request-normalizer.d.mts +1 -2
  165. package/dist/lib/utils/request-normalizer.d.ts +1 -2
  166. package/dist/lib/v2/projection/creative-delivery.d.mts +2 -0
  167. package/dist/lib/v2/projection/creative-delivery.d.ts +2 -0
  168. package/dist/lib/v2/projection/creative-delivery.js +7 -0
  169. package/dist/lib/v2/projection/creative-delivery.mjs +6 -0
  170. package/dist/lib/v2/projection/legacy-metadata.d.mts +12 -0
  171. package/dist/lib/v2/projection/legacy-metadata.d.ts +12 -0
  172. package/dist/lib/v2/projection/legacy-metadata.js +41 -1
  173. package/dist/lib/v2/projection/legacy-metadata.mjs +37 -1
  174. package/dist/lib/v2/projection/legacy-normalization.d.mts +1 -1
  175. package/dist/lib/v2/projection/legacy-normalization.d.ts +1 -1
  176. package/dist/lib/v2/projection/v1-to-v2.js +13 -0
  177. package/dist/lib/v2/projection/v1-to-v2.mjs +14 -0
  178. package/dist/lib/validation/client-hooks.d.mts +1 -4
  179. package/dist/lib/validation/client-hooks.d.ts +1 -4
  180. package/dist/lib/validation/get-products-request.d.mts +1 -1
  181. package/dist/lib/validation/get-products-request.d.ts +1 -1
  182. package/dist/lib/validation/schema-loader.js +6 -0
  183. package/dist/lib/validation/schema-loader.mjs +6 -0
  184. package/dist/lib/validation/schema-validator.js +1 -26
  185. package/dist/lib/validation/schema-validator.mjs +1 -26
  186. package/dist/lib/version.d.mts +5 -5
  187. package/dist/lib/version.d.ts +5 -5
  188. package/dist/lib/version.js +3 -5
  189. package/dist/lib/version.mjs +3 -5
  190. package/docs/TYPE-SUMMARY.md +2 -2
  191. package/docs/development/PROTOCOL_DIFFERENCES.md +1 -1
  192. package/docs/guides/CONFORMANCE.md +25 -0
  193. package/docs/guides/CREATIVE-BUILD-PROBE.md +156 -0
  194. package/docs/guides/CREATIVE-DELIVERY.md +45 -6
  195. package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +15 -18
  196. package/docs/guides/PROPERTY-LISTS.md +264 -0
  197. package/docs/guides/SIGNING-GUIDE.md +25 -0
  198. package/docs/guides/VALIDATE-YOUR-AGENT.md +5 -0
  199. package/docs/llms.txt +2 -2
  200. package/docs/migration-13-to-14.md +20 -16
  201. package/docs/migration-14.x-rc-worksheet.md +5 -5
  202. package/docs/migration-4.x-to-5.x.md +12 -7
  203. package/docs/migration-drop-adcp-2.md +25 -0
  204. package/package.json +3 -18
  205. package/skills/call-adcp-agent/SKILL.md +23 -25
  206. package/dist/lib/adapters/legacy/v2-5/create_media_buy.d.mts +0 -3
  207. package/dist/lib/adapters/legacy/v2-5/create_media_buy.d.ts +0 -3
  208. package/dist/lib/adapters/legacy/v2-5/create_media_buy.js +0 -33
  209. package/dist/lib/adapters/legacy/v2-5/create_media_buy.mjs +0 -9
  210. package/dist/lib/adapters/legacy/v2-5/get_products.d.mts +0 -8
  211. package/dist/lib/adapters/legacy/v2-5/get_products.d.ts +0 -8
  212. package/dist/lib/adapters/legacy/v2-5/get_products.js +0 -33
  213. package/dist/lib/adapters/legacy/v2-5/get_products.mjs +0 -9
  214. package/dist/lib/adapters/legacy/v2-5/index.d.mts +0 -34
  215. package/dist/lib/adapters/legacy/v2-5/index.d.ts +0 -34
  216. package/dist/lib/adapters/legacy/v2-5/index.js +0 -50
  217. package/dist/lib/adapters/legacy/v2-5/index.mjs +0 -25
  218. package/dist/lib/adapters/legacy/v2-5/list_creative_formats.d.mts +0 -8
  219. package/dist/lib/adapters/legacy/v2-5/list_creative_formats.d.ts +0 -8
  220. package/dist/lib/adapters/legacy/v2-5/list_creative_formats.js +0 -33
  221. package/dist/lib/adapters/legacy/v2-5/list_creative_formats.mjs +0 -9
  222. package/dist/lib/adapters/legacy/v2-5/preview_creative.d.mts +0 -3
  223. package/dist/lib/adapters/legacy/v2-5/preview_creative.d.ts +0 -3
  224. package/dist/lib/adapters/legacy/v2-5/preview_creative.js +0 -33
  225. package/dist/lib/adapters/legacy/v2-5/preview_creative.mjs +0 -9
  226. package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.mts +0 -11
  227. package/dist/lib/adapters/legacy/v2-5/sync_creatives.d.ts +0 -11
  228. package/dist/lib/adapters/legacy/v2-5/sync_creatives.js +0 -32
  229. package/dist/lib/adapters/legacy/v2-5/sync_creatives.mjs +0 -8
  230. package/dist/lib/adapters/legacy/v2-5/types.d.mts +0 -39
  231. package/dist/lib/adapters/legacy/v2-5/types.d.ts +0 -39
  232. package/dist/lib/adapters/legacy/v2-5/types.js +0 -16
  233. package/dist/lib/adapters/legacy/v2-5/types.mjs +0 -0
  234. package/dist/lib/adapters/legacy/v2-5/update_media_buy.d.mts +0 -3
  235. package/dist/lib/adapters/legacy/v2-5/update_media_buy.d.ts +0 -3
  236. package/dist/lib/adapters/legacy/v2-5/update_media_buy.js +0 -35
  237. package/dist/lib/adapters/legacy/v2-5/update_media_buy.mjs +0 -11
  238. package/dist/lib/schemas-data/v2.5/_provenance.json +0 -8
  239. package/dist/lib/schemas-data/v2.5/adagents.json +0 -494
  240. package/dist/lib/schemas-data/v2.5/core/activation-key.json +0 -50
  241. package/dist/lib/schemas-data/v2.5/core/assets/audio-asset.json +0 -32
  242. package/dist/lib/schemas-data/v2.5/core/assets/css-asset.json +0 -21
  243. package/dist/lib/schemas-data/v2.5/core/assets/daast-asset.json +0 -87
  244. package/dist/lib/schemas-data/v2.5/core/assets/html-asset.json +0 -21
  245. package/dist/lib/schemas-data/v2.5/core/assets/image-asset.json +0 -38
  246. package/dist/lib/schemas-data/v2.5/core/assets/javascript-asset.json +0 -21
  247. package/dist/lib/schemas-data/v2.5/core/assets/markdown-asset.json +0 -31
  248. package/dist/lib/schemas-data/v2.5/core/assets/text-asset.json +0 -21
  249. package/dist/lib/schemas-data/v2.5/core/assets/url-asset.json +0 -26
  250. package/dist/lib/schemas-data/v2.5/core/assets/vast-asset.json +0 -87
  251. package/dist/lib/schemas-data/v2.5/core/assets/video-asset.json +0 -44
  252. package/dist/lib/schemas-data/v2.5/core/assets/webhook-asset.json +0 -71
  253. package/dist/lib/schemas-data/v2.5/core/async-response-data.json +0 -88
  254. package/dist/lib/schemas-data/v2.5/core/brand-manifest-ref.json +0 -33
  255. package/dist/lib/schemas-data/v2.5/core/brand-manifest.json +0 -409
  256. package/dist/lib/schemas-data/v2.5/core/context.json +0 -8
  257. package/dist/lib/schemas-data/v2.5/core/creative-asset.json +0 -125
  258. package/dist/lib/schemas-data/v2.5/core/creative-assignment.json +0 -31
  259. package/dist/lib/schemas-data/v2.5/core/creative-filters.json +0 -111
  260. package/dist/lib/schemas-data/v2.5/core/creative-manifest.json +0 -72
  261. package/dist/lib/schemas-data/v2.5/core/creative-policy.json +0 -27
  262. package/dist/lib/schemas-data/v2.5/core/delivery-metrics.json +0 -171
  263. package/dist/lib/schemas-data/v2.5/core/deployment.json +0 -93
  264. package/dist/lib/schemas-data/v2.5/core/destination.json +0 -53
  265. package/dist/lib/schemas-data/v2.5/core/error.json +0 -40
  266. package/dist/lib/schemas-data/v2.5/core/ext.json +0 -8
  267. package/dist/lib/schemas-data/v2.5/core/format-id.json +0 -47
  268. package/dist/lib/schemas-data/v2.5/core/format.json +0 -324
  269. package/dist/lib/schemas-data/v2.5/core/frequency-cap.json +0 -18
  270. package/dist/lib/schemas-data/v2.5/core/mcp-webhook-payload.json +0 -152
  271. package/dist/lib/schemas-data/v2.5/core/measurement.json +0 -48
  272. package/dist/lib/schemas-data/v2.5/core/media-buy.json +0 -62
  273. package/dist/lib/schemas-data/v2.5/core/package.json +0 -72
  274. package/dist/lib/schemas-data/v2.5/core/performance-feedback.json +0 -90
  275. package/dist/lib/schemas-data/v2.5/core/placement.json +0 -34
  276. package/dist/lib/schemas-data/v2.5/core/pricing-option.json +0 -35
  277. package/dist/lib/schemas-data/v2.5/core/product-filters.json +0 -102
  278. package/dist/lib/schemas-data/v2.5/core/product.json +0 -153
  279. package/dist/lib/schemas-data/v2.5/core/promoted-offerings.json +0 -115
  280. package/dist/lib/schemas-data/v2.5/core/promoted-products.json +0 -67
  281. package/dist/lib/schemas-data/v2.5/core/property-id.json +0 -14
  282. package/dist/lib/schemas-data/v2.5/core/property-tag.json +0 -16
  283. package/dist/lib/schemas-data/v2.5/core/property.json +0 -62
  284. package/dist/lib/schemas-data/v2.5/core/protocol-envelope.json +0 -146
  285. package/dist/lib/schemas-data/v2.5/core/publisher-property-selector.json +0 -92
  286. package/dist/lib/schemas-data/v2.5/core/push-notification-config.json +0 -48
  287. package/dist/lib/schemas-data/v2.5/core/reporting-capabilities.json +0 -71
  288. package/dist/lib/schemas-data/v2.5/core/response.json +0 -24
  289. package/dist/lib/schemas-data/v2.5/core/signal-filters.json +0 -35
  290. package/dist/lib/schemas-data/v2.5/core/start-timing.json +0 -18
  291. package/dist/lib/schemas-data/v2.5/core/sub-asset.json +0 -79
  292. package/dist/lib/schemas-data/v2.5/core/targeting.json +0 -50
  293. package/dist/lib/schemas-data/v2.5/core/tasks-get-request.json +0 -43
  294. package/dist/lib/schemas-data/v2.5/core/tasks-get-response.json +0 -166
  295. package/dist/lib/schemas-data/v2.5/core/tasks-list-request.json +0 -192
  296. package/dist/lib/schemas-data/v2.5/core/tasks-list-response.json +0 -183
  297. package/dist/lib/schemas-data/v2.5/creative/asset-types/index.json +0 -101
  298. package/dist/lib/schemas-data/v2.5/creative/list-creative-formats-request.json +0 -73
  299. package/dist/lib/schemas-data/v2.5/creative/list-creative-formats-response.json +0 -61
  300. package/dist/lib/schemas-data/v2.5/creative/preview-creative-request.json +0 -164
  301. package/dist/lib/schemas-data/v2.5/creative/preview-creative-response.json +0 -245
  302. package/dist/lib/schemas-data/v2.5/creative/preview-render.json +0 -225
  303. package/dist/lib/schemas-data/v2.5/enums/adcp-domain.json +0 -11
  304. package/dist/lib/schemas-data/v2.5/enums/asset-content-type.json +0 -22
  305. package/dist/lib/schemas-data/v2.5/enums/auth-scheme.json +0 -11
  306. package/dist/lib/schemas-data/v2.5/enums/available-metric.json +0 -18
  307. package/dist/lib/schemas-data/v2.5/enums/channels.json +0 -18
  308. package/dist/lib/schemas-data/v2.5/enums/co-branding-requirement.json +0 -12
  309. package/dist/lib/schemas-data/v2.5/enums/creative-action.json +0 -14
  310. package/dist/lib/schemas-data/v2.5/enums/creative-agent-capability.json +0 -13
  311. package/dist/lib/schemas-data/v2.5/enums/creative-sort-field.json +0 -15
  312. package/dist/lib/schemas-data/v2.5/enums/creative-status.json +0 -19
  313. package/dist/lib/schemas-data/v2.5/enums/daast-tracking-event.json +0 -20
  314. package/dist/lib/schemas-data/v2.5/enums/daast-version.json +0 -11
  315. package/dist/lib/schemas-data/v2.5/enums/delivery-type.json +0 -15
  316. package/dist/lib/schemas-data/v2.5/enums/dimension-unit.json +0 -13
  317. package/dist/lib/schemas-data/v2.5/enums/feed-format.json +0 -12
  318. package/dist/lib/schemas-data/v2.5/enums/feedback-source.json +0 -13
  319. package/dist/lib/schemas-data/v2.5/enums/format-category.json +0 -16
  320. package/dist/lib/schemas-data/v2.5/enums/format-id-parameter.json +0 -11
  321. package/dist/lib/schemas-data/v2.5/enums/frequency-cap-scope.json +0 -13
  322. package/dist/lib/schemas-data/v2.5/enums/history-entry-type.json +0 -11
  323. package/dist/lib/schemas-data/v2.5/enums/http-method.json +0 -11
  324. package/dist/lib/schemas-data/v2.5/enums/identifier-types.json +0 -34
  325. package/dist/lib/schemas-data/v2.5/enums/javascript-module-type.json +0 -12
  326. package/dist/lib/schemas-data/v2.5/enums/landing-page-requirement.json +0 -12
  327. package/dist/lib/schemas-data/v2.5/enums/markdown-flavor.json +0 -11
  328. package/dist/lib/schemas-data/v2.5/enums/media-buy-status.json +0 -19
  329. package/dist/lib/schemas-data/v2.5/enums/metric-type.json +0 -17
  330. package/dist/lib/schemas-data/v2.5/enums/notification-type.json +0 -13
  331. package/dist/lib/schemas-data/v2.5/enums/pacing.json +0 -17
  332. package/dist/lib/schemas-data/v2.5/enums/preview-output-format.json +0 -11
  333. package/dist/lib/schemas-data/v2.5/enums/pricing-model.json +0 -25
  334. package/dist/lib/schemas-data/v2.5/enums/property-type.json +0 -16
  335. package/dist/lib/schemas-data/v2.5/enums/publisher-identifier-types.json +0 -19
  336. package/dist/lib/schemas-data/v2.5/enums/reporting-frequency.json +0 -12
  337. package/dist/lib/schemas-data/v2.5/enums/signal-catalog-type.json +0 -12
  338. package/dist/lib/schemas-data/v2.5/enums/sort-direction.json +0 -11
  339. package/dist/lib/schemas-data/v2.5/enums/standard-format-ids.json +0 -103
  340. package/dist/lib/schemas-data/v2.5/enums/task-status.json +0 -29
  341. package/dist/lib/schemas-data/v2.5/enums/task-type.json +0 -27
  342. package/dist/lib/schemas-data/v2.5/enums/update-frequency.json +0 -13
  343. package/dist/lib/schemas-data/v2.5/enums/url-asset-type.json +0 -12
  344. package/dist/lib/schemas-data/v2.5/enums/validation-mode.json +0 -11
  345. package/dist/lib/schemas-data/v2.5/enums/vast-tracking-event.json +0 -25
  346. package/dist/lib/schemas-data/v2.5/enums/vast-version.json +0 -14
  347. package/dist/lib/schemas-data/v2.5/enums/webhook-response-type.json +0 -13
  348. package/dist/lib/schemas-data/v2.5/enums/webhook-security-method.json +0 -12
  349. package/dist/lib/schemas-data/v2.5/index.json +0 -604
  350. package/dist/lib/schemas-data/v2.5/media-buy/build-creative-request.json +0 -31
  351. package/dist/lib/schemas-data/v2.5/media-buy/build-creative-response.json +0 -65
  352. package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-async-response-input-required.json +0 -31
  353. package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-async-response-submitted.json +0 -16
  354. package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-async-response-working.json +0 -36
  355. package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-request.json +0 -126
  356. package/dist/lib/schemas-data/v2.5/media-buy/create-media-buy-response.json +0 -97
  357. package/dist/lib/schemas-data/v2.5/media-buy/get-media-buy-delivery-request.json +0 -54
  358. package/dist/lib/schemas-data/v2.5/media-buy/get-media-buy-delivery-response.json +0 -285
  359. package/dist/lib/schemas-data/v2.5/media-buy/get-products-async-response-input-required.json +0 -38
  360. package/dist/lib/schemas-data/v2.5/media-buy/get-products-async-response-submitted.json +0 -21
  361. package/dist/lib/schemas-data/v2.5/media-buy/get-products-async-response-working.json +0 -34
  362. package/dist/lib/schemas-data/v2.5/media-buy/get-products-request.json +0 -28
  363. package/dist/lib/schemas-data/v2.5/media-buy/get-products-response.json +0 -33
  364. package/dist/lib/schemas-data/v2.5/media-buy/list-authorized-properties-request.json +0 -26
  365. package/dist/lib/schemas-data/v2.5/media-buy/list-authorized-properties-response.json +0 -70
  366. package/dist/lib/schemas-data/v2.5/media-buy/list-creative-formats-request.json +0 -58
  367. package/dist/lib/schemas-data/v2.5/media-buy/list-creative-formats-response.json +0 -61
  368. package/dist/lib/schemas-data/v2.5/media-buy/list-creatives-request.json +0 -137
  369. package/dist/lib/schemas-data/v2.5/media-buy/list-creatives-response.json +0 -437
  370. package/dist/lib/schemas-data/v2.5/media-buy/package-request.json +0 -80
  371. package/dist/lib/schemas-data/v2.5/media-buy/provide-performance-feedback-request.json +0 -88
  372. package/dist/lib/schemas-data/v2.5/media-buy/provide-performance-feedback-response.json +0 -66
  373. package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-async-response-input-required.json +0 -25
  374. package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-async-response-submitted.json +0 -16
  375. package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-async-response-working.json +0 -46
  376. package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-request.json +0 -178
  377. package/dist/lib/schemas-data/v2.5/media-buy/sync-creatives-response.json +0 -149
  378. package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-async-response-input-required.json +0 -24
  379. package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-async-response-submitted.json +0 -16
  380. package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-async-response-working.json +0 -36
  381. package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-request.json +0 -129
  382. package/dist/lib/schemas-data/v2.5/media-buy/update-media-buy-response.json +0 -99
  383. package/dist/lib/schemas-data/v2.5/pricing-options/cpc-option.json +0 -52
  384. package/dist/lib/schemas-data/v2.5/pricing-options/cpcv-option.json +0 -52
  385. package/dist/lib/schemas-data/v2.5/pricing-options/cpm-auction-option.json +0 -81
  386. package/dist/lib/schemas-data/v2.5/pricing-options/cpm-fixed-option.json +0 -52
  387. package/dist/lib/schemas-data/v2.5/pricing-options/cpp-option.json +0 -73
  388. package/dist/lib/schemas-data/v2.5/pricing-options/cpv-option.json +0 -88
  389. package/dist/lib/schemas-data/v2.5/pricing-options/flat-rate-option.json +0 -93
  390. package/dist/lib/schemas-data/v2.5/pricing-options/vcpm-auction-option.json +0 -81
  391. package/dist/lib/schemas-data/v2.5/pricing-options/vcpm-fixed-option.json +0 -52
  392. package/dist/lib/schemas-data/v2.5/protocols/adcp-extension.json +0 -33
  393. package/dist/lib/schemas-data/v2.5/signals/activate-signal-request.json +0 -32
  394. package/dist/lib/schemas-data/v2.5/signals/activate-signal-response.json +0 -68
  395. package/dist/lib/schemas-data/v2.5/signals/get-signals-request.json +0 -59
  396. package/dist/lib/schemas-data/v2.5/signals/get-signals-response.json +0 -100
  397. package/dist/lib/types/v2-5/index.d.mts +0 -1
  398. package/dist/lib/types/v2-5/index.d.ts +0 -1
  399. package/dist/lib/types/v2-5/index.js +0 -22
  400. package/dist/lib/types/v2-5/index.mjs +0 -1
  401. package/dist/lib/types/v2-5/tools.generated.d.mts +0 -3568
  402. package/dist/lib/types/v2-5/tools.generated.d.ts +0 -3568
  403. package/dist/lib/types/v2-5/tools.generated.js +0 -16
  404. package/dist/lib/types/v2-5/tools.generated.mjs +0 -0
  405. package/dist/lib/utils/sync-creatives-adapter.d.mts +0 -33
  406. package/dist/lib/utils/sync-creatives-adapter.d.ts +0 -33
  407. package/dist/lib/utils/sync-creatives-adapter.js +0 -83
  408. package/dist/lib/utils/sync-creatives-adapter.mjs +0 -59
@@ -1,6 +1,6 @@
1
1
  import { getOrCreateClient, runStep, getOrDiscoverProfile } from "../client.mjs";
2
2
  import {
3
- buildSyntheticCapabilities,
3
+ buildSyntheticV3Capabilities,
4
4
  parseCapabilitiesResponse,
5
5
  MEDIA_BUY_TOOLS,
6
6
  SIGNALS_TOOLS,
@@ -58,8 +58,8 @@ async function testCapabilityDiscovery(agentUrl, options) {
58
58
  step.error = result.error || "get_adcp_capabilities failed";
59
59
  steps.push(step);
60
60
  const toolInfos = profile.tools.map((name) => ({ name }));
61
- capabilities = buildSyntheticCapabilities(toolInfos);
62
- profile.adcp_version = "v2";
61
+ capabilities = buildSyntheticV3Capabilities(toolInfos);
62
+ profile.adcp_version = "v3";
63
63
  profile.supported_protocols = capabilities.protocols;
64
64
  steps.push({
65
65
  step: "Fallback to synthetic capabilities",
@@ -69,54 +69,21 @@ async function testCapabilityDiscovery(agentUrl, options) {
69
69
  });
70
70
  } else {
71
71
  const toolInfos = profile.tools.map((name) => ({ name }));
72
- capabilities = buildSyntheticCapabilities(toolInfos);
73
- profile.adcp_version = "v2";
72
+ capabilities = buildSyntheticV3Capabilities(toolInfos);
73
+ profile.adcp_version = "v3";
74
74
  profile.supported_protocols = capabilities.protocols;
75
75
  step.passed = false;
76
76
  step.error = "get_adcp_capabilities returned no data";
77
77
  steps.push(step);
78
78
  }
79
79
  } else {
80
- const toolInfos = profile.tools.map((name) => ({ name }));
81
- capabilities = buildSyntheticCapabilities(toolInfos);
82
- profile.adcp_version = "v2";
83
- profile.supported_protocols = capabilities.protocols;
84
- profile.supports_governance = capabilities.protocols.includes("governance");
85
- profile.supports_si = capabilities.protocols.includes("sponsored_intelligence");
86
80
  steps.push({
87
- step: "Build synthetic capabilities (v2)",
88
- task: void 0,
89
- passed: true,
81
+ step: "Require AdCP 3 capability discovery",
82
+ passed: false,
90
83
  duration_ms: 0,
91
- details: `Agent does not support get_adcp_capabilities. Detected ${capabilities.protocols.length} protocol(s) from tools.`,
92
- response_preview: JSON.stringify(
93
- {
94
- version: capabilities.version,
95
- protocols: capabilities.protocols,
96
- features: capabilities.features,
97
- _synthetic: true
98
- },
99
- null,
100
- 2
101
- )
84
+ error: "Agent does not advertise get_adcp_capabilities. AdCP 2 reached end of life on 2026-08-01; upgrade the agent to AdCP 3."
102
85
  });
103
- const v3ToolsPresent = [
104
- ...GOVERNANCE_TOOLS,
105
- ...SPONSORED_INTELLIGENCE_TOOLS,
106
- ...TRUSTED_MATCH_TOOLS,
107
- ...COMPLIANCE_TOOLS
108
- ].filter((t) => profile.tools.includes(t));
109
- if (v3ToolsPresent.length > 0) {
110
- steps.push({
111
- step: "v3 upgrade potential detected",
112
- passed: true,
113
- duration_ms: 0,
114
- details: `Agent has ${v3ToolsPresent.length} v3 tool(s) but missing get_adcp_capabilities`,
115
- warnings: [
116
- `Consider implementing get_adcp_capabilities for better protocol discovery. v3 tools detected: ${v3ToolsPresent.join(", ")}`
117
- ]
118
- });
119
- }
86
+ return { steps, profile };
120
87
  }
121
88
  const { steps: crossValidationSteps } = crossValidateProtocolsAndTools(capabilities, profile.tools);
122
89
  steps.push(...crossValidationSteps);
@@ -0,0 +1,34 @@
1
+ import type { FixtureMatchClause, StoryboardContext } from './types.mjs';
2
+ export interface CreativeBuildProbeSpec {
3
+ context_prefix: string;
4
+ message: string;
5
+ }
6
+ export interface CreativeBuildProbeInputFixture {
7
+ match: FixtureMatchClause[];
8
+ /** Operator-provisioned valid input for every route matched by this recipe. */
9
+ input: Record<string, unknown>;
10
+ }
11
+ export type CreativeBuildProbeResolution = {
12
+ status: 'resolved';
13
+ capabilityId?: string;
14
+ formatId?: Record<string, unknown>;
15
+ context: StoryboardContext;
16
+ source: 'generation' | 'test_kit';
17
+ requirements: FixtureMatchClause[];
18
+ } | {
19
+ status: 'unsatisfied';
20
+ detail: string;
21
+ } | {
22
+ status: 'failed';
23
+ detail: string;
24
+ };
25
+ export declare function validateCreativeBuildProbeSpec(value: unknown): asserts value is CreativeBuildProbeSpec;
26
+ /**
27
+ * Uses only actual catalog entries and explicitly provisioned test-kit inputs.
28
+ * Global generation support does not identify a generation route in a mixed
29
+ * catalog: the automatic brief recipe is therefore used only when the catalog
30
+ * has exactly one build route (including legacy unaddressable build entries),
31
+ * and a complete, understood declaration proves there are no technical seeds.
32
+ * Other modes require a matching operator recipe, not inferred source assets.
33
+ */
34
+ export declare function resolveCreativeBuildProbe(creative: unknown, spec: CreativeBuildProbeSpec, testKit?: unknown, adcpVersion?: string, governanceEnforcement?: unknown): CreativeBuildProbeResolution;
@@ -0,0 +1,34 @@
1
+ import type { FixtureMatchClause, StoryboardContext } from './types';
2
+ export interface CreativeBuildProbeSpec {
3
+ context_prefix: string;
4
+ message: string;
5
+ }
6
+ export interface CreativeBuildProbeInputFixture {
7
+ match: FixtureMatchClause[];
8
+ /** Operator-provisioned valid input for every route matched by this recipe. */
9
+ input: Record<string, unknown>;
10
+ }
11
+ export type CreativeBuildProbeResolution = {
12
+ status: 'resolved';
13
+ capabilityId?: string;
14
+ formatId?: Record<string, unknown>;
15
+ context: StoryboardContext;
16
+ source: 'generation' | 'test_kit';
17
+ requirements: FixtureMatchClause[];
18
+ } | {
19
+ status: 'unsatisfied';
20
+ detail: string;
21
+ } | {
22
+ status: 'failed';
23
+ detail: string;
24
+ };
25
+ export declare function validateCreativeBuildProbeSpec(value: unknown): asserts value is CreativeBuildProbeSpec;
26
+ /**
27
+ * Uses only actual catalog entries and explicitly provisioned test-kit inputs.
28
+ * Global generation support does not identify a generation route in a mixed
29
+ * catalog: the automatic brief recipe is therefore used only when the catalog
30
+ * has exactly one build route (including legacy unaddressable build entries),
31
+ * and a complete, understood declaration proves there are no technical seeds.
32
+ * Other modes require a matching operator recipe, not inferred source assets.
33
+ */
34
+ export declare function resolveCreativeBuildProbe(creative: unknown, spec: CreativeBuildProbeSpec, testKit?: unknown, adcpVersion?: string, governanceEnforcement?: unknown): CreativeBuildProbeResolution;
@@ -0,0 +1,395 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var creative_build_probe_exports = {};
20
+ __export(creative_build_probe_exports, {
21
+ prepareCreativeBuildProbe: () => prepareCreativeBuildProbe,
22
+ resolveCreativeBuildProbe: () => resolveCreativeBuildProbe,
23
+ validateCreativeBuildProbeSpec: () => validateCreativeBuildProbeSpec
24
+ });
25
+ module.exports = __toCommonJS(creative_build_probe_exports);
26
+ var import_fixture_resolution = require('./fixture-resolution.js');
27
+ var import_schema_loader = require('../../validation/schema-loader.js');
28
+ var import_version = require('../../version.js');
29
+ var import_redact_secrets = require('../../utils/redact-secrets.js');
30
+ var import_json_depth = require('../../utils/json-depth.js');
31
+ var import_resolve_agent_properties = require('../../discovery/resolve-agent-properties.js');
32
+ const INPUT_FIELDS = /* @__PURE__ */ new Set([
33
+ "message",
34
+ "creative_manifest",
35
+ "creative_id",
36
+ "transformer_id",
37
+ "config",
38
+ "target_format_id"
39
+ ]);
40
+ const TRUST_FIELDS = /^(auth|private[_-]?key|bearer[_-]?token|id[_-]?token|jwk|jwks|jwks[_-]?uri|x[_-]api[_-]key|signing[_-]?key|secret[_-]?key|hmac[_-]?key|client[_-]?key)$/i;
41
+ const isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
42
+ function at(value, ...keys) {
43
+ for (const key of keys) value = isRecord(value) ? value[key] : void 0;
44
+ return value;
45
+ }
46
+ function displayDiagnostic(value, limit) {
47
+ let displayed = "";
48
+ for (const char of value) {
49
+ const escaped = JSON.stringify(char).slice(1, -1).replace(/[\u007f-\u009f\u2028\u2029]/g, (control) => `\\u${control.charCodeAt(0).toString(16).padStart(4, "0")}`);
50
+ if (displayed.length + escaped.length > limit - 1) return `${displayed}\u2026`;
51
+ displayed += escaped;
52
+ }
53
+ return displayed;
54
+ }
55
+ function displayUnknownKind(kind) {
56
+ return `"${displayDiagnostic(kind.slice(0, 128), 768)}"`;
57
+ }
58
+ function displayValidationErrors(errors) {
59
+ const message = errors.slice(0, 8).map((error) => `${(error.instancePath || "/").slice(0, 2048)} ${(error.message ?? "").slice(0, 2048)}`).join("; ");
60
+ return displayDiagnostic(message, 2048);
61
+ }
62
+ function validateCreativeBuildProbeSpec(value) {
63
+ if (!isRecord(value) || Object.keys(value).some((key) => key !== "context_prefix" && key !== "message") || typeof value.context_prefix !== "string" || !/^[a-z][a-z0-9_]*$/.test(value.context_prefix) || typeof value.message !== "string" || value.message.trim().length === 0) {
64
+ throw new Error("creative_build_probe requires context_prefix (lowercase identifier) and a nonempty message");
65
+ }
66
+ }
67
+ function containsSecretField(value, depth = 0, seen = /* @__PURE__ */ new Set()) {
68
+ if (depth > import_json_depth.MAX_JSON_DEPTH) throw new Error("creative_build_probe: fixture nesting exceeds the JSON depth bound");
69
+ if (typeof value === "string" && /^https?:\/\//i.test(value)) {
70
+ let url;
71
+ try {
72
+ url = new URL(value);
73
+ } catch {
74
+ throw new Error("creative_build_probe: invalid URL in fixture");
75
+ }
76
+ return !!(url.username || url.password) || [...url.searchParams.keys()].some((key) => import_redact_secrets.SECRET_KEY_PATTERN.test(key) || TRUST_FIELDS.test(key));
77
+ }
78
+ if (!value || typeof value !== "object") return false;
79
+ if (seen.has(value)) throw new Error("creative_build_probe: fixture must be acyclic JSON");
80
+ seen.add(value);
81
+ const found = Array.isArray(value) ? value.some((item) => containsSecretField(item, depth + 1, seen)) : Object.entries(value).some(
82
+ ([key, item]) => import_redact_secrets.SECRET_KEY_PATTERN.test(key) || TRUST_FIELDS.test(key) || containsSecretField(item, depth + 1, seen)
83
+ );
84
+ seen.delete(value);
85
+ return found;
86
+ }
87
+ function validateRecipeBudget(value, location) {
88
+ let nodes = 0;
89
+ let bytes = 0;
90
+ const ancestors = /* @__PURE__ */ new Set();
91
+ const visit = (item, depth) => {
92
+ if (++nodes > 1e5 || depth > import_json_depth.MAX_JSON_DEPTH)
93
+ throw new Error(`${location}: recipe exceeds the fixture node/depth budget`);
94
+ if (typeof item === "string") bytes += Buffer.byteLength(item, "utf8");
95
+ if (bytes > 4 * 1024 * 1024) throw new Error(`${location}: recipe exceeds the 4 MiB fixture string budget`);
96
+ if (!item || typeof item !== "object") return;
97
+ if (ancestors.has(item)) throw new Error(`${location}: recipe must be acyclic JSON`);
98
+ ancestors.add(item);
99
+ for (const [key, child] of Object.entries(item)) {
100
+ bytes += Buffer.byteLength(key, "utf8");
101
+ visit(child, depth + 1);
102
+ }
103
+ ancestors.delete(item);
104
+ };
105
+ visit(value, 0);
106
+ }
107
+ function validateInput(value, location, validateManifest) {
108
+ if (!isRecord(value) || Object.keys(value).some((key) => !INPUT_FIELDS.has(key))) {
109
+ throw new Error(
110
+ `${location}: input may only contain message, creative_manifest, creative_id, transformer_id, config and target_format_id`
111
+ );
112
+ }
113
+ if (containsSecretField(value))
114
+ throw new Error(`${location}: input must not carry credential or trust-material fields`);
115
+ for (const key of ["message", "creative_id", "transformer_id"]) {
116
+ if (value[key] !== void 0 && (typeof value[key] !== "string" || value[key].trim().length === 0)) {
117
+ throw new Error(`${location}: ${key} must be a nonempty string`);
118
+ }
119
+ }
120
+ if (value.config !== void 0 && (!isRecord(value.config) || !value.transformer_id))
121
+ throw new Error(
122
+ `${location}: this probe contract requires config to be an object bound to a provisioned transformer_id`
123
+ );
124
+ if (value.creative_id && value.creative_manifest)
125
+ throw new Error(
126
+ `${location}: this probe contract requires one unambiguous source, not both creative_id and creative_manifest`
127
+ );
128
+ if (value.creative_manifest !== void 0) {
129
+ const manifest = value.creative_manifest;
130
+ if (!validateManifest || !validateManifest(manifest)) {
131
+ throw new Error(`${location}: creative_manifest must be a complete manifest, including format and assets`);
132
+ }
133
+ }
134
+ if (!value.message && !value.creative_manifest && !value.creative_id && !value.transformer_id) {
135
+ throw new Error(
136
+ `${location}: input must identify a brief, source manifest or provisioned library creative/transformer`
137
+ );
138
+ }
139
+ }
140
+ function resolveCreativeBuildProbe(creative, spec, testKit, adcpVersion, governanceEnforcement) {
141
+ return resolveCreativeBuildProbeWithSchemas(
142
+ creative,
143
+ spec,
144
+ testKit,
145
+ governanceEnforcement,
146
+ adcpVersion,
147
+ captureRequestSchemas(adcpVersion)
148
+ );
149
+ }
150
+ function captureRequestSchemas(adcpVersion) {
151
+ return {
152
+ request: (0, import_schema_loader.getSchemaDocumentByRef)("media-buy/build-creative-request.json", adcpVersion)?.schema,
153
+ validateManifest: (0, import_schema_loader.getSchemaValidatorByRef)("core/creative-manifest.json", adcpVersion),
154
+ validateFormatId: (0, import_schema_loader.getSchemaValidatorByRef)("core/format-id.json", adcpVersion),
155
+ formatIdProperties: at((0, import_schema_loader.getSchemaDocumentByRef)("core/format-id.json", adcpVersion)?.schema, "properties")
156
+ };
157
+ }
158
+ function prepareCreativeBuildProbe(capabilities, spec, testKit, adcpVersion) {
159
+ const requestSchemas = captureRequestSchemas(adcpVersion);
160
+ return (0, import_schema_loader.withServedValidationVersion)(
161
+ capabilities,
162
+ adcpVersion ?? import_version.ADCP_VERSION,
163
+ (catalogVersion) => resolveCreativeBuildProbeWithSchemas(
164
+ at(capabilities, "creative"),
165
+ spec,
166
+ testKit,
167
+ at(capabilities, "adcp", "governance_enforcement"),
168
+ catalogVersion,
169
+ requestSchemas
170
+ )
171
+ );
172
+ }
173
+ function resolveCreativeBuildProbeWithSchemas(creative, spec, testKit, governanceEnforcement, catalogAdcpVersion, requestSchemas) {
174
+ validateCreativeBuildProbeSpec(spec);
175
+ if (isRecord(creative) && creative.supported_formats !== void 0 && !Array.isArray(creative.supported_formats)) {
176
+ return { status: "failed", detail: "creative.supported_formats: malformed catalog (expected array)" };
177
+ }
178
+ if (!isRecord(creative) || !Array.isArray(creative.supported_formats)) {
179
+ return {
180
+ status: "unsatisfied",
181
+ detail: `fixture_unsatisfied: creative_format:${spec.context_prefix}: no advertised creative build catalog`
182
+ };
183
+ }
184
+ const recipes = isRecord(testKit) && testKit.creative_build_probes !== void 0 ? testKit.creative_build_probes : [];
185
+ if (!Array.isArray(recipes)) throw new Error("test_kit.creative_build_probes must be an array");
186
+ if (recipes.some(
187
+ (recipe) => isRecord(recipe) && isRecord(recipe.input) && recipe.input.creative_manifest !== void 0
188
+ ) && !requestSchemas.validateManifest) {
189
+ return {
190
+ status: "unsatisfied",
191
+ detail: `fixture_unsatisfied: creative_format:${spec.context_prefix}: selected-version source manifest schema validator is unavailable`
192
+ };
193
+ }
194
+ const normalized = recipes.map((recipe, index) => {
195
+ const location = `test_kit.creative_build_probes[${index}]`;
196
+ validateRecipeBudget(recipe, location);
197
+ if (!isRecord(recipe) || Object.keys(recipe).some((key) => key !== "match" && key !== "input")) {
198
+ throw new Error(`${location}: expected only match and input`);
199
+ }
200
+ const match = (0, import_fixture_resolution.normalizeFixtureMatchExpression)(recipe.match, `${location}.match`);
201
+ if (match.length === 0) throw new Error(`${location}: at least one explicit match predicate is required`);
202
+ validateInput(recipe.input, location, requestSchemas.validateManifest);
203
+ return { match, input: recipe.input };
204
+ });
205
+ const catalogDocument = (0, import_schema_loader.getSchemaDocumentByRef)("protocol/get-adcp-capabilities-response.json", catalogAdcpVersion);
206
+ const catalog = catalogDocument?.schema;
207
+ const selectedVersion = catalogDocument?.resolvedVersion ?? catalogAdcpVersion ?? "selected bundle";
208
+ const item = at(catalog, "properties", "creative", "properties", "supported_formats", "items");
209
+ const request = requestSchemas.request;
210
+ const canonicalSelector = !!at(request, "properties", "target_capability_id");
211
+ const legacySelector = !!at(request, "properties", "target_format_id");
212
+ const catalogRequest = (0, import_schema_loader.getSchemaDocumentByRef)("media-buy/build-creative-request.json", catalogAdcpVersion)?.schema;
213
+ const canonicalCatalog = !!at(catalogRequest, "properties", "target_capability_id");
214
+ const requestIdPattern = at(request, "properties", "target_capability_id", "pattern");
215
+ const canonicalAddressable = (route) => canonicalCatalog && canonicalSelector && typeof route.capability_id === "string" && (typeof requestIdPattern !== "string" || new RegExp(requestIdPattern).test(route.capability_id));
216
+ const ref = at(item, "properties", "format", "$ref");
217
+ const formatRef = typeof ref === "string" ? ref.replace(/^(?:https:\/\/adcontextprotocol\.org)?\/schemas\/(?:(?:v?\d[^/]*|latest)\/)?/, "") : void 0;
218
+ const validateFormat = formatRef ? (0, import_schema_loader.getSchemaValidatorByRef)(formatRef, catalogAdcpVersion) : void 0;
219
+ const validateKind = (0, import_schema_loader.getSchemaValidatorByRef)("core/canonical-format-kind.json", catalogAdcpVersion);
220
+ if (!validateFormat || !validateKind || !catalogRequest || !canonicalSelector && !legacySelector) {
221
+ return {
222
+ status: "unsatisfied",
223
+ detail: `fixture_unsatisfied: creative_format:${spec.context_prefix}: selected-version creative catalog schema validators are unavailable`
224
+ };
225
+ }
226
+ for (const recipe of normalized) {
227
+ if (recipe.input.target_format_id !== void 0) {
228
+ if (!legacySelector)
229
+ throw new Error(
230
+ "test_kit.creative_build_probes: target_format_id is not supported by the selected build request"
231
+ );
232
+ const validateId = requestSchemas.validateFormatId;
233
+ if (!validateId)
234
+ return {
235
+ status: "unsatisfied",
236
+ detail: `fixture_unsatisfied: creative_format:${spec.context_prefix}: selected-version legacy FormatID schema validator is unavailable`
237
+ };
238
+ if (!validateId(recipe.input.target_format_id))
239
+ throw new Error(
240
+ "test_kit.creative_build_probes: target_format_id must be a selected-version valid provisioned FormatID"
241
+ );
242
+ }
243
+ }
244
+ const idPattern = at(item, "properties", "capability_id", "pattern");
245
+ const hasOperations = at(item, "properties", "operations") !== void 0;
246
+ const isBuildRoute = (entry) => !hasOperations || entry.operations === void 0 || Array.isArray(entry.operations) && entry.operations.includes("build");
247
+ const selectorProperties = at(
248
+ (0, import_schema_loader.getSchemaDocumentByRef)("core/format-id.json", catalogAdcpVersion)?.schema,
249
+ "properties"
250
+ );
251
+ const requestSelectorProperties = requestSchemas.formatIdProperties;
252
+ const requestHasPixelRatio = at(requestSelectorProperties, "pixel_ratio") !== void 0;
253
+ const legacyDimensions = ["width", "height", "duration_ms", "pixel_ratio"].filter(
254
+ (key) => at(selectorProperties, key) !== void 0
255
+ );
256
+ const unavailableKinds = /* @__PURE__ */ new Set();
257
+ const ids = /* @__PURE__ */ new Set();
258
+ const buildRoutes = [];
259
+ for (const [index, entry] of creative.supported_formats.entries()) {
260
+ const location = `creative.supported_formats[${index}]`;
261
+ const invalid = (detail) => ({
262
+ status: "failed",
263
+ detail: `${location}: ${detail}`
264
+ });
265
+ if (!isRecord(entry)) return invalid("malformed catalog entry (expected object)");
266
+ if (entry.capability_id !== void 0) {
267
+ if (typeof entry.capability_id !== "string" || typeof idPattern === "string" && !new RegExp(idPattern).test(entry.capability_id) || canonicalCatalog && ids.has(entry.capability_id)) {
268
+ return invalid("capability_id must be usable and unique within the catalog");
269
+ }
270
+ ids.add(entry.capability_id);
271
+ }
272
+ const operations = entry.operations;
273
+ if (hasOperations && operations !== void 0 && (!Array.isArray(operations) || operations.length === 0 || operations.some(
274
+ (operation, index2) => typeof operation !== "string" || !["build", "validate", "preview"].includes(operation) || operations.indexOf(operation) !== index2
275
+ ))) {
276
+ return invalid("operations must be a nonempty unique array of build, validate or preview");
277
+ }
278
+ if (!isRecord(entry.format) || typeof entry.format.format_kind !== "string" || !isRecord(entry.format.params)) {
279
+ return invalid("format must declare format_kind and params");
280
+ }
281
+ if (!canonicalCatalog && !validateKind(entry.format.format_kind)) {
282
+ unavailableKinds.add(entry.format.format_kind);
283
+ if (isBuildRoute(entry)) buildRoutes.push(entry);
284
+ continue;
285
+ }
286
+ if (!validateFormat(entry.format) || !validateKind(entry.format.format_kind)) {
287
+ return invalid(
288
+ `malformed format declaration: ${displayValidationErrors([...validateFormat.errors ?? [], ...validateKind.errors ?? []])}`
289
+ );
290
+ }
291
+ const validateParams = (0, import_schema_loader.getSchemaValidatorByRef)(
292
+ `formats/canonical/${entry.format.format_kind}.json`,
293
+ catalogAdcpVersion
294
+ );
295
+ if (entry.format.format_kind !== "custom" && !validateParams) {
296
+ unavailableKinds.add(entry.format.format_kind);
297
+ if (isBuildRoute(entry)) buildRoutes.push(entry);
298
+ continue;
299
+ }
300
+ if (validateParams && !validateParams(entry.format.params) || validateFormat && !validateFormat(entry.format) || validateKind && !validateKind(entry.format.format_kind)) {
301
+ return invalid(
302
+ `malformed format declaration: ${displayValidationErrors([...validateParams?.errors ?? [], ...validateFormat?.errors ?? [], ...validateKind?.errors ?? []])}`
303
+ );
304
+ }
305
+ if (isBuildRoute(entry)) buildRoutes.push(entry);
306
+ }
307
+ if (isRecord(governanceEnforcement) && Array.isArray(governanceEnforcement.tasks) && governanceEnforcement.tasks.some(
308
+ (task) => isRecord(task) && task.task === "build_creative" && Array.isArray(task.modes) && task.modes.includes("signed_context")
309
+ )) {
310
+ return {
311
+ status: "unsatisfied",
312
+ detail: `fixture_unsatisfied: creative_format:${spec.context_prefix}: payload-bound build governance authorization is not prepared by this runner contract`
313
+ };
314
+ }
315
+ for (const route of buildRoutes) {
316
+ const knownKind = validateKind(route.format.format_kind);
317
+ if (!knownKind || route.format.format_kind !== "custom" && !(0, import_schema_loader.getSchemaValidatorByRef)(
318
+ `formats/canonical/${route.format.format_kind}.json`,
319
+ catalogAdcpVersion
320
+ ))
321
+ continue;
322
+ let source = "test_kit";
323
+ const usable = (input2) => {
324
+ if (input2.transformer_id) return creative.supports_transformers === true;
325
+ if (input2.creative_id) return creative.has_creative_library === true;
326
+ if (input2.creative_manifest)
327
+ return creative.supports_transformation === true || creative.supports_generation === true;
328
+ return creative.supports_generation === true;
329
+ };
330
+ const format = route.format;
331
+ const legacyBindingAgrees = (input2) => {
332
+ if (input2.target_format_id === void 0) return canonicalAddressable(route);
333
+ if (format.canonical_formats_only === true || !isRecord(input2.target_format_id)) return false;
334
+ if (!Array.isArray(format.v1_format_ref)) return true;
335
+ const target = input2.target_format_id;
336
+ const targetUrl = typeof target.agent_url === "string" ? (0, import_resolve_agent_properties.canonicalizeAgentUrl)(target.agent_url) : null;
337
+ if (targetUrl === null) return false;
338
+ return format.v1_format_ref.some(
339
+ (ref2) => isRecord(ref2) && ref2.id === target.id && typeof ref2.agent_url === "string" && typeof target.agent_url === "string" && (0, import_resolve_agent_properties.canonicalizeAgentUrl)(ref2.agent_url) === targetUrl && legacyDimensions.every(
340
+ (key) => key === "pixel_ratio" ? (ref2[key] ?? 1) === (requestHasPixelRatio ? target[key] ?? 1 : 1) : ref2[key] === void 0 || ref2[key] === target[key]
341
+ )
342
+ );
343
+ };
344
+ const selectedRecipe = normalized.find(
345
+ (recipe) => (0, import_fixture_resolution.matchesFixtureRequirements)(route, recipe.match) && usable(recipe.input) && legacyBindingAgrees(recipe.input)
346
+ );
347
+ let input = selectedRecipe?.input;
348
+ const kindValidator = (0, import_schema_loader.getSchemaValidatorByRef)("core/canonical-format-kind.json", catalogAdcpVersion);
349
+ const emptyCompleteFormat = format.technical_requirements_complete === true && format.format_kind !== "custom" && kindValidator?.(format.format_kind) === true && Object.keys(format.params).length === 0 && Object.keys(format).every(
350
+ (key) => [
351
+ "format_kind",
352
+ "params",
353
+ "technical_requirements_complete",
354
+ "display_name",
355
+ "seller_preference",
356
+ "experimental",
357
+ "sample_render_url",
358
+ "format_option_id",
359
+ "publisher_domain",
360
+ "applies_to_channels",
361
+ "canonical_formats_only"
362
+ ].includes(key)
363
+ ) && Object.keys(route).every((key) => ["capability_id", "operations", "format"].includes(key));
364
+ if (!input && canonicalAddressable(route) && creative.supports_generation === true && buildRoutes.length === 1 && emptyCompleteFormat) {
365
+ source = "generation";
366
+ const manifest = { format_kind: format.format_kind, assets: {} };
367
+ const validateManifest = requestSchemas.validateManifest;
368
+ if (!validateManifest?.(manifest)) continue;
369
+ input = { message: spec.message, creative_manifest: manifest };
370
+ }
371
+ if (!input) continue;
372
+ const useCanonicalSelector = input.target_format_id === void 0;
373
+ const context = useCanonicalSelector ? { [`${spec.context_prefix}_capability_id`]: route.capability_id } : { [`${spec.context_prefix}_target_format_id`]: structuredClone(input.target_format_id) };
374
+ for (const key of ["message", "creative_manifest", "creative_id", "transformer_id", "config"]) {
375
+ if (input[key] !== void 0) context[`${spec.context_prefix}_${key}`] = structuredClone(input[key]);
376
+ }
377
+ return {
378
+ status: "resolved",
379
+ ...useCanonicalSelector ? { capabilityId: route.capability_id } : { formatId: structuredClone(input.target_format_id) },
380
+ context,
381
+ source,
382
+ requirements: selectedRecipe?.match ?? []
383
+ };
384
+ }
385
+ return {
386
+ status: "unsatisfied",
387
+ detail: `fixture_unsatisfied: creative_format:${spec.context_prefix}: no routable build entry has a known-valid generation input or a matching provisioned test-kit recipe${unavailableKinds.size ? `; ${unavailableKinds.size} unvalidated kind(s) in schema bundle ${selectedVersion}: ${[...unavailableKinds].slice(0, 8).map(displayUnknownKind).join(", ")}${unavailableKinds.size > 8 ? ", \u2026" : ""}` : ""}`
388
+ };
389
+ }
390
+ // Annotate the CommonJS export names for ESM import in node:
391
+ 0 && (module.exports = {
392
+ prepareCreativeBuildProbe,
393
+ resolveCreativeBuildProbe,
394
+ validateCreativeBuildProbeSpec
395
+ });