@adcp/sdk 12.1.0 → 13.0.0-rc.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 (464) hide show
  1. package/README.md +19 -3
  2. package/bin/adcp-fuzz.js +3 -1
  3. package/dist/lib/adapters/content-standards-adapter.d.mts +9 -9
  4. package/dist/lib/adapters/content-standards-adapter.d.ts +9 -9
  5. package/dist/lib/adapters/content-standards-adapter.d.ts.map +1 -1
  6. package/dist/lib/adapters/content-standards-adapter.js +22 -22
  7. package/dist/lib/adapters/content-standards-adapter.js.map +1 -1
  8. package/dist/lib/adapters/content-standards-adapter.mjs +18 -18
  9. package/dist/lib/adapters/content-standards-adapter.mjs.map +1 -1
  10. package/dist/lib/adapters/index.d.mts +2 -2
  11. package/dist/lib/adapters/index.d.ts +2 -2
  12. package/dist/lib/adapters/index.d.ts.map +1 -1
  13. package/dist/lib/adapters/index.js +10 -10
  14. package/dist/lib/adapters/index.js.map +1 -1
  15. package/dist/lib/adapters/index.mjs +9 -9
  16. package/dist/lib/adapters/index.mjs.map +1 -1
  17. package/dist/lib/auth/oauth/authorization-required.d.mts +3 -0
  18. package/dist/lib/auth/oauth/authorization-required.d.ts +3 -0
  19. package/dist/lib/auth/oauth/authorization-required.d.ts.map +1 -1
  20. package/dist/lib/auth/oauth/authorization-required.js +12 -9
  21. package/dist/lib/auth/oauth/authorization-required.js.map +1 -1
  22. package/dist/lib/auth/oauth/authorization-required.mjs +12 -9
  23. package/dist/lib/auth/oauth/authorization-required.mjs.map +1 -1
  24. package/dist/lib/auth/oauth/provider-cache.d.mts +7 -0
  25. package/dist/lib/auth/oauth/provider-cache.d.ts +8 -0
  26. package/dist/lib/auth/oauth/provider-cache.d.ts.map +1 -0
  27. package/dist/lib/auth/oauth/provider-cache.js +44 -0
  28. package/dist/lib/auth/oauth/provider-cache.js.map +1 -0
  29. package/dist/lib/auth/oauth/provider-cache.mjs +19 -0
  30. package/dist/lib/auth/oauth/provider-cache.mjs.map +1 -0
  31. package/dist/lib/conformance/invariants/uniformError.js +1 -1
  32. package/dist/lib/conformance/invariants/uniformError.js.map +1 -1
  33. package/dist/lib/conformance/invariants/uniformError.mjs +1 -1
  34. package/dist/lib/conformance/invariants/uniformError.mjs.map +1 -1
  35. package/dist/lib/conformance/runners.js +1 -1
  36. package/dist/lib/conformance/runners.js.map +1 -1
  37. package/dist/lib/conformance/runners.mjs +1 -1
  38. package/dist/lib/conformance/runners.mjs.map +1 -1
  39. package/dist/lib/conformance/seeder.js +5 -5
  40. package/dist/lib/conformance/seeder.js.map +1 -1
  41. package/dist/lib/conformance/seeder.mjs +5 -5
  42. package/dist/lib/conformance/seeder.mjs.map +1 -1
  43. package/dist/lib/core/ADCPMultiAgentClient.d.mts +26 -29
  44. package/dist/lib/core/ADCPMultiAgentClient.d.ts +26 -29
  45. package/dist/lib/core/ADCPMultiAgentClient.d.ts.map +1 -1
  46. package/dist/lib/core/ADCPMultiAgentClient.js +27 -19
  47. package/dist/lib/core/ADCPMultiAgentClient.js.map +1 -1
  48. package/dist/lib/core/ADCPMultiAgentClient.mjs +27 -19
  49. package/dist/lib/core/ADCPMultiAgentClient.mjs.map +1 -1
  50. package/dist/lib/core/AgentClient.d.mts +148 -138
  51. package/dist/lib/core/AgentClient.d.ts +148 -138
  52. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  53. package/dist/lib/core/AgentClient.js +174 -85
  54. package/dist/lib/core/AgentClient.js.map +1 -1
  55. package/dist/lib/core/AgentClient.mjs +174 -85
  56. package/dist/lib/core/AgentClient.mjs.map +1 -1
  57. package/dist/lib/core/AsyncHandler.d.mts +18 -16
  58. package/dist/lib/core/AsyncHandler.d.ts +18 -16
  59. package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
  60. package/dist/lib/core/AsyncHandler.js +22 -1
  61. package/dist/lib/core/AsyncHandler.js.map +1 -1
  62. package/dist/lib/core/AsyncHandler.mjs +22 -1
  63. package/dist/lib/core/AsyncHandler.mjs.map +1 -1
  64. package/dist/lib/core/ConversationTypes.d.mts +6 -2
  65. package/dist/lib/core/ConversationTypes.d.ts +6 -2
  66. package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
  67. package/dist/lib/core/ConversationTypes.js.map +1 -1
  68. package/dist/lib/core/CreativeAgentClient.d.mts +41 -17
  69. package/dist/lib/core/CreativeAgentClient.d.ts +41 -17
  70. package/dist/lib/core/CreativeAgentClient.d.ts.map +1 -1
  71. package/dist/lib/core/CreativeAgentClient.js +39 -12
  72. package/dist/lib/core/CreativeAgentClient.js.map +1 -1
  73. package/dist/lib/core/CreativeAgentClient.mjs +39 -12
  74. package/dist/lib/core/CreativeAgentClient.mjs.map +1 -1
  75. package/dist/lib/core/SingleAgentClient.d.mts +129 -52
  76. package/dist/lib/core/SingleAgentClient.d.ts +129 -52
  77. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  78. package/dist/lib/core/SingleAgentClient.js +1748 -218
  79. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  80. package/dist/lib/core/SingleAgentClient.mjs +1758 -218
  81. package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
  82. package/dist/lib/core/TaskExecutor.d.mts +9 -0
  83. package/dist/lib/core/TaskExecutor.d.ts +9 -0
  84. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  85. package/dist/lib/core/TaskExecutor.js +137 -44
  86. package/dist/lib/core/TaskExecutor.js.map +1 -1
  87. package/dist/lib/core/TaskExecutor.mjs +137 -44
  88. package/dist/lib/core/TaskExecutor.mjs.map +1 -1
  89. package/dist/lib/index.d.mts +111 -17
  90. package/dist/lib/index.d.ts +111 -17
  91. package/dist/lib/index.d.ts.map +1 -1
  92. package/dist/lib/index.js +94 -94
  93. package/dist/lib/index.js.map +1 -1
  94. package/dist/lib/index.mjs +93 -94
  95. package/dist/lib/index.mjs.map +1 -1
  96. package/dist/lib/net/ssrf-fetch.d.mts +13 -1
  97. package/dist/lib/net/ssrf-fetch.d.ts +13 -1
  98. package/dist/lib/net/ssrf-fetch.d.ts.map +1 -1
  99. package/dist/lib/net/ssrf-fetch.js +14 -7
  100. package/dist/lib/net/ssrf-fetch.js.map +1 -1
  101. package/dist/lib/net/ssrf-fetch.mjs +14 -7
  102. package/dist/lib/net/ssrf-fetch.mjs.map +1 -1
  103. package/dist/lib/protocols/a2a.d.mts +2 -2
  104. package/dist/lib/protocols/a2a.d.ts +2 -2
  105. package/dist/lib/protocols/a2a.d.ts.map +1 -1
  106. package/dist/lib/protocols/a2a.js +14 -9
  107. package/dist/lib/protocols/a2a.js.map +1 -1
  108. package/dist/lib/protocols/a2a.mjs +14 -9
  109. package/dist/lib/protocols/a2a.mjs.map +1 -1
  110. package/dist/lib/protocols/index.d.mts +20 -3
  111. package/dist/lib/protocols/index.d.ts +20 -3
  112. package/dist/lib/protocols/index.d.ts.map +1 -1
  113. package/dist/lib/protocols/index.js +44 -31
  114. package/dist/lib/protocols/index.js.map +1 -1
  115. package/dist/lib/protocols/index.mjs +44 -32
  116. package/dist/lib/protocols/index.mjs.map +1 -1
  117. package/dist/lib/protocols/mcp-modern.d.ts.map +1 -1
  118. package/dist/lib/protocols/mcp-modern.js +87 -12
  119. package/dist/lib/protocols/mcp-modern.js.map +1 -1
  120. package/dist/lib/protocols/mcp-modern.mjs +89 -12
  121. package/dist/lib/protocols/mcp-modern.mjs.map +1 -1
  122. package/dist/lib/protocols/mcp-tasks.d.mts +3 -0
  123. package/dist/lib/protocols/mcp-tasks.d.ts +3 -0
  124. package/dist/lib/protocols/mcp-tasks.d.ts.map +1 -1
  125. package/dist/lib/protocols/mcp-tasks.js +21 -11
  126. package/dist/lib/protocols/mcp-tasks.js.map +1 -1
  127. package/dist/lib/protocols/mcp-tasks.mjs +21 -11
  128. package/dist/lib/protocols/mcp-tasks.mjs.map +1 -1
  129. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  130. package/dist/lib/server/create-adcp-server.d.mts +6 -0
  131. package/dist/lib/server/create-adcp-server.d.ts +6 -0
  132. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  133. package/dist/lib/server/create-adcp-server.js +295 -48
  134. package/dist/lib/server/create-adcp-server.js.map +1 -1
  135. package/dist/lib/server/create-adcp-server.mjs +301 -50
  136. package/dist/lib/server/create-adcp-server.mjs.map +1 -1
  137. package/dist/lib/server/decisioning/assembly-helpers.d.mts +27 -13
  138. package/dist/lib/server/decisioning/assembly-helpers.d.ts +27 -13
  139. package/dist/lib/server/decisioning/assembly-helpers.d.ts.map +1 -1
  140. package/dist/lib/server/decisioning/assembly-helpers.js +136 -14
  141. package/dist/lib/server/decisioning/assembly-helpers.js.map +1 -1
  142. package/dist/lib/server/decisioning/assembly-helpers.mjs +134 -13
  143. package/dist/lib/server/decisioning/assembly-helpers.mjs.map +1 -1
  144. package/dist/lib/server/decisioning/index.d.mts +13 -12
  145. package/dist/lib/server/decisioning/index.d.ts +13 -12
  146. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  147. package/dist/lib/server/decisioning/index.js +6 -0
  148. package/dist/lib/server/decisioning/index.js.map +1 -1
  149. package/dist/lib/server/decisioning/index.mjs +9 -3
  150. package/dist/lib/server/decisioning/index.mjs.map +1 -1
  151. package/dist/lib/server/decisioning/list-helpers.d.mts +13 -3
  152. package/dist/lib/server/decisioning/list-helpers.d.ts +13 -3
  153. package/dist/lib/server/decisioning/list-helpers.d.ts.map +1 -1
  154. package/dist/lib/server/decisioning/list-helpers.js +13 -3
  155. package/dist/lib/server/decisioning/list-helpers.js.map +1 -1
  156. package/dist/lib/server/decisioning/list-helpers.mjs +11 -2
  157. package/dist/lib/server/decisioning/list-helpers.mjs.map +1 -1
  158. package/dist/lib/server/decisioning/manifest-helpers.d.mts +5 -3
  159. package/dist/lib/server/decisioning/manifest-helpers.d.ts +5 -3
  160. package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -1
  161. package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -1
  162. package/dist/lib/server/decisioning/manifest-helpers.mjs.map +1 -1
  163. package/dist/lib/server/decisioning/proposal/dispatch.d.mts +2 -2
  164. package/dist/lib/server/decisioning/proposal/dispatch.d.ts +2 -2
  165. package/dist/lib/server/decisioning/proposal/dispatch.d.ts.map +1 -1
  166. package/dist/lib/server/decisioning/proposal/dispatch.js.map +1 -1
  167. package/dist/lib/server/decisioning/proposal/dispatch.mjs.map +1 -1
  168. package/dist/lib/server/decisioning/proposal/index.d.mts +1 -1
  169. package/dist/lib/server/decisioning/proposal/index.d.ts +1 -1
  170. package/dist/lib/server/decisioning/proposal/index.d.ts.map +1 -1
  171. package/dist/lib/server/decisioning/proposal/index.js.map +1 -1
  172. package/dist/lib/server/decisioning/proposal/index.mjs.map +1 -1
  173. package/dist/lib/server/decisioning/proposal/lifecycle.d.mts +3 -2
  174. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts +3 -2
  175. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts.map +1 -1
  176. package/dist/lib/server/decisioning/proposal/lifecycle.js.map +1 -1
  177. package/dist/lib/server/decisioning/proposal/lifecycle.mjs.map +1 -1
  178. package/dist/lib/server/decisioning/proposal/mock-manager.d.mts +3 -3
  179. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts +3 -3
  180. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts.map +1 -1
  181. package/dist/lib/server/decisioning/proposal/mock-manager.js.map +1 -1
  182. package/dist/lib/server/decisioning/proposal/mock-manager.mjs.map +1 -1
  183. package/dist/lib/server/decisioning/proposal/types.d.mts +10 -6
  184. package/dist/lib/server/decisioning/proposal/types.d.ts +10 -6
  185. package/dist/lib/server/decisioning/proposal/types.d.ts.map +1 -1
  186. package/dist/lib/server/decisioning/proposal/types.js.map +1 -1
  187. package/dist/lib/server/decisioning/proposal/types.mjs.map +1 -1
  188. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +21 -2
  189. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +21 -2
  190. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  191. package/dist/lib/server/decisioning/runtime/from-platform.js +754 -81
  192. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  193. package/dist/lib/server/decisioning/runtime/from-platform.mjs +763 -81
  194. package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
  195. package/dist/lib/server/decisioning/specialisms/brand-rights.d.mts +9 -9
  196. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +9 -9
  197. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
  198. package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -1
  199. package/dist/lib/server/decisioning/specialisms/content-standards.d.mts +16 -16
  200. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts +16 -16
  201. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts.map +1 -1
  202. package/dist/lib/server/decisioning/specialisms/content-standards.js.map +1 -1
  203. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.mts +15 -13
  204. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +15 -13
  205. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
  206. package/dist/lib/server/decisioning/specialisms/creative-ad-server.js.map +1 -1
  207. package/dist/lib/server/decisioning/specialisms/creative.d.mts +12 -11
  208. package/dist/lib/server/decisioning/specialisms/creative.d.ts +12 -11
  209. package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
  210. package/dist/lib/server/decisioning/specialisms/creative.js.map +1 -1
  211. package/dist/lib/server/decisioning/specialisms/sales.d.mts +25 -15
  212. package/dist/lib/server/decisioning/specialisms/sales.d.ts +25 -15
  213. package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
  214. package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
  215. package/dist/lib/server/index.d.mts +3 -3
  216. package/dist/lib/server/index.d.ts +3 -3
  217. package/dist/lib/server/index.d.ts.map +1 -1
  218. package/dist/lib/server/index.js +72 -72
  219. package/dist/lib/server/index.js.map +1 -1
  220. package/dist/lib/server/index.mjs +36 -36
  221. package/dist/lib/server/index.mjs.map +1 -1
  222. package/dist/lib/server/legacy/v5/index.d.mts +1 -0
  223. package/dist/lib/server/legacy/v5/index.d.ts +1 -0
  224. package/dist/lib/server/legacy/v5/index.d.ts.map +1 -1
  225. package/dist/lib/server/legacy/v5/index.js +74 -1
  226. package/dist/lib/server/legacy/v5/index.js.map +1 -1
  227. package/dist/lib/server/legacy/v5/index.mjs +75 -1
  228. package/dist/lib/server/legacy/v5/index.mjs.map +1 -1
  229. package/dist/lib/server/responses.d.mts +2 -2
  230. package/dist/lib/server/responses.d.ts +2 -2
  231. package/dist/lib/server/responses.js.map +1 -1
  232. package/dist/lib/server/responses.mjs.map +1 -1
  233. package/dist/lib/testing/client.d.ts.map +1 -1
  234. package/dist/lib/testing/client.js +13 -5
  235. package/dist/lib/testing/client.js.map +1 -1
  236. package/dist/lib/testing/client.mjs +13 -5
  237. package/dist/lib/testing/client.mjs.map +1 -1
  238. package/dist/lib/testing/compliance/comply.d.mts +1 -1
  239. package/dist/lib/testing/compliance/comply.d.ts +1 -1
  240. package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
  241. package/dist/lib/testing/compliance/comply.js +16 -6
  242. package/dist/lib/testing/compliance/comply.js.map +1 -1
  243. package/dist/lib/testing/compliance/comply.mjs +16 -6
  244. package/dist/lib/testing/compliance/comply.mjs.map +1 -1
  245. package/dist/lib/testing/scenarios/brand-rights.js +6 -6
  246. package/dist/lib/testing/scenarios/brand-rights.js.map +1 -1
  247. package/dist/lib/testing/scenarios/brand-rights.mjs +6 -6
  248. package/dist/lib/testing/scenarios/brand-rights.mjs.map +1 -1
  249. package/dist/lib/testing/scenarios/creative.js +7 -7
  250. package/dist/lib/testing/scenarios/creative.js.map +1 -1
  251. package/dist/lib/testing/scenarios/creative.mjs +7 -7
  252. package/dist/lib/testing/scenarios/creative.mjs.map +1 -1
  253. package/dist/lib/testing/scenarios/discovery.js +2 -2
  254. package/dist/lib/testing/scenarios/discovery.js.map +1 -1
  255. package/dist/lib/testing/scenarios/discovery.mjs +2 -2
  256. package/dist/lib/testing/scenarios/discovery.mjs.map +1 -1
  257. package/dist/lib/testing/scenarios/edge-cases.js +11 -11
  258. package/dist/lib/testing/scenarios/edge-cases.js.map +1 -1
  259. package/dist/lib/testing/scenarios/edge-cases.mjs +11 -11
  260. package/dist/lib/testing/scenarios/edge-cases.mjs.map +1 -1
  261. package/dist/lib/testing/scenarios/governance.d.ts.map +1 -1
  262. package/dist/lib/testing/scenarios/governance.js +16 -22
  263. package/dist/lib/testing/scenarios/governance.js.map +1 -1
  264. package/dist/lib/testing/scenarios/governance.mjs +16 -22
  265. package/dist/lib/testing/scenarios/governance.mjs.map +1 -1
  266. package/dist/lib/testing/scenarios/media-buy.js +5 -5
  267. package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
  268. package/dist/lib/testing/scenarios/media-buy.mjs +5 -5
  269. package/dist/lib/testing/scenarios/media-buy.mjs.map +1 -1
  270. package/dist/lib/testing/scenarios/schema-compliance.js +1 -1
  271. package/dist/lib/testing/scenarios/schema-compliance.js.map +1 -1
  272. package/dist/lib/testing/scenarios/schema-compliance.mjs +1 -1
  273. package/dist/lib/testing/scenarios/schema-compliance.mjs.map +1 -1
  274. package/dist/lib/testing/scenarios/trusted-match.d.ts.map +1 -1
  275. package/dist/lib/testing/scenarios/trusted-match.js +4 -3
  276. package/dist/lib/testing/scenarios/trusted-match.js.map +1 -1
  277. package/dist/lib/testing/scenarios/trusted-match.mjs +4 -3
  278. package/dist/lib/testing/scenarios/trusted-match.mjs.map +1 -1
  279. package/dist/lib/testing/storyboard/probes.d.mts +6 -0
  280. package/dist/lib/testing/storyboard/probes.d.ts +6 -0
  281. package/dist/lib/testing/storyboard/probes.d.ts.map +1 -1
  282. package/dist/lib/testing/storyboard/probes.js +16 -5
  283. package/dist/lib/testing/storyboard/probes.js.map +1 -1
  284. package/dist/lib/testing/storyboard/probes.mjs +16 -5
  285. package/dist/lib/testing/storyboard/probes.mjs.map +1 -1
  286. package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
  287. package/dist/lib/testing/storyboard/runner.js +6 -2
  288. package/dist/lib/testing/storyboard/runner.js.map +1 -1
  289. package/dist/lib/testing/storyboard/runner.mjs +6 -2
  290. package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
  291. package/dist/lib/testing/storyboard/shape-drift-hints.d.mts +3 -4
  292. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts +3 -4
  293. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts.map +1 -1
  294. package/dist/lib/testing/storyboard/shape-drift-hints.js +27 -27
  295. package/dist/lib/testing/storyboard/shape-drift-hints.js.map +1 -1
  296. package/dist/lib/testing/storyboard/shape-drift-hints.mjs +27 -27
  297. package/dist/lib/testing/storyboard/shape-drift-hints.mjs.map +1 -1
  298. package/dist/lib/testing/storyboard/task-map.d.ts.map +1 -1
  299. package/dist/lib/testing/storyboard/task-map.js +43 -5
  300. package/dist/lib/testing/storyboard/task-map.js.map +1 -1
  301. package/dist/lib/testing/storyboard/task-map.mjs +43 -5
  302. package/dist/lib/testing/storyboard/task-map.mjs.map +1 -1
  303. package/dist/lib/testing/test-helpers.d.mts +2 -2
  304. package/dist/lib/testing/test-helpers.d.ts +2 -2
  305. package/dist/lib/testing/test-helpers.js.map +1 -1
  306. package/dist/lib/testing/test-helpers.mjs.map +1 -1
  307. package/dist/lib/testing/types.d.mts +7 -1
  308. package/dist/lib/testing/types.d.ts +7 -1
  309. package/dist/lib/testing/types.d.ts.map +1 -1
  310. package/dist/lib/testing/types.js.map +1 -1
  311. package/dist/lib/types/adcp.d.mts +14 -14
  312. package/dist/lib/types/adcp.d.ts +14 -14
  313. package/dist/lib/types/adcp.d.ts.map +1 -1
  314. package/dist/lib/types/adcp.js.map +1 -1
  315. package/dist/lib/types/adcp.mjs.map +1 -1
  316. package/dist/lib/types/index.d.mts +2 -2
  317. package/dist/lib/types/index.d.ts +2 -2
  318. package/dist/lib/types/index.d.ts.map +1 -1
  319. package/dist/lib/types/index.js.map +1 -1
  320. package/dist/lib/types/index.mjs.map +1 -1
  321. package/dist/lib/utils/capabilities.d.mts +6 -0
  322. package/dist/lib/utils/capabilities.d.ts +6 -0
  323. package/dist/lib/utils/capabilities.d.ts.map +1 -1
  324. package/dist/lib/utils/capabilities.js +4 -0
  325. package/dist/lib/utils/capabilities.js.map +1 -1
  326. package/dist/lib/utils/capabilities.mjs +4 -0
  327. package/dist/lib/utils/capabilities.mjs.map +1 -1
  328. package/dist/lib/utils/creative-delivery.d.mts +52 -10
  329. package/dist/lib/utils/creative-delivery.d.ts +52 -10
  330. package/dist/lib/utils/creative-delivery.d.ts.map +1 -1
  331. package/dist/lib/utils/creative-delivery.js +104 -9
  332. package/dist/lib/utils/creative-delivery.js.map +1 -1
  333. package/dist/lib/utils/creative-delivery.mjs +104 -8
  334. package/dist/lib/utils/creative-delivery.mjs.map +1 -1
  335. package/dist/lib/utils/format-assets.d.mts +41 -38
  336. package/dist/lib/utils/format-assets.d.ts +41 -38
  337. package/dist/lib/utils/format-assets.d.ts.map +1 -1
  338. package/dist/lib/utils/format-assets.js +3 -1
  339. package/dist/lib/utils/format-assets.js.map +1 -1
  340. package/dist/lib/utils/format-assets.mjs +3 -1
  341. package/dist/lib/utils/format-assets.mjs.map +1 -1
  342. package/dist/lib/utils/index.d.mts +8 -8
  343. package/dist/lib/utils/index.d.ts +8 -8
  344. package/dist/lib/utils/index.d.ts.map +1 -1
  345. package/dist/lib/utils/index.js +11 -9
  346. package/dist/lib/utils/index.js.map +1 -1
  347. package/dist/lib/utils/index.mjs +9 -8
  348. package/dist/lib/utils/index.mjs.map +1 -1
  349. package/dist/lib/utils/preview-utils.d.mts +11 -8
  350. package/dist/lib/utils/preview-utils.d.ts +11 -8
  351. package/dist/lib/utils/preview-utils.d.ts.map +1 -1
  352. package/dist/lib/utils/preview-utils.js +4 -4
  353. package/dist/lib/utils/preview-utils.js.map +1 -1
  354. package/dist/lib/utils/preview-utils.mjs +3 -3
  355. package/dist/lib/utils/preview-utils.mjs.map +1 -1
  356. package/dist/lib/utils/tool-request-schemas.d.mts +2 -2
  357. package/dist/lib/utils/tool-request-schemas.d.ts +2 -2
  358. package/dist/lib/v2/projection/aao-reference-formats.json +492 -0
  359. package/dist/lib/v2/projection/augment-response.d.mts +31 -11
  360. package/dist/lib/v2/projection/augment-response.d.ts +31 -11
  361. package/dist/lib/v2/projection/augment-response.d.ts.map +1 -1
  362. package/dist/lib/v2/projection/augment-response.js +233 -27
  363. package/dist/lib/v2/projection/augment-response.js.map +1 -1
  364. package/dist/lib/v2/projection/augment-response.mjs +232 -27
  365. package/dist/lib/v2/projection/augment-response.mjs.map +1 -1
  366. package/dist/lib/v2/projection/builders.d.mts +7 -6
  367. package/dist/lib/v2/projection/builders.d.ts +7 -6
  368. package/dist/lib/v2/projection/builders.d.ts.map +1 -1
  369. package/dist/lib/v2/projection/builders.js +11 -8
  370. package/dist/lib/v2/projection/builders.js.map +1 -1
  371. package/dist/lib/v2/projection/builders.mjs +9 -6
  372. package/dist/lib/v2/projection/builders.mjs.map +1 -1
  373. package/dist/lib/v2/projection/catalog-snapshot.d.mts +47 -0
  374. package/dist/lib/v2/projection/catalog-snapshot.d.ts +48 -0
  375. package/dist/lib/v2/projection/catalog-snapshot.d.ts.map +1 -0
  376. package/dist/lib/v2/projection/catalog-snapshot.js +291 -0
  377. package/dist/lib/v2/projection/catalog-snapshot.js.map +1 -0
  378. package/dist/lib/v2/projection/catalog-snapshot.mjs +265 -0
  379. package/dist/lib/v2/projection/catalog-snapshot.mjs.map +1 -0
  380. package/dist/lib/v2/projection/catalog.d.mts +23 -2
  381. package/dist/lib/v2/projection/catalog.d.ts +23 -2
  382. package/dist/lib/v2/projection/catalog.d.ts.map +1 -1
  383. package/dist/lib/v2/projection/catalog.js +34 -10
  384. package/dist/lib/v2/projection/catalog.js.map +1 -1
  385. package/dist/lib/v2/projection/catalog.mjs +33 -10
  386. package/dist/lib/v2/projection/catalog.mjs.map +1 -1
  387. package/dist/lib/v2/projection/creative-delivery.d.mts +157 -0
  388. package/dist/lib/v2/projection/creative-delivery.d.ts +158 -0
  389. package/dist/lib/v2/projection/creative-delivery.d.ts.map +1 -0
  390. package/dist/lib/v2/projection/creative-delivery.js +967 -0
  391. package/dist/lib/v2/projection/creative-delivery.js.map +1 -0
  392. package/dist/lib/v2/projection/creative-delivery.mjs +941 -0
  393. package/dist/lib/v2/projection/creative-delivery.mjs.map +1 -0
  394. package/dist/lib/v2/projection/index.d.mts +8 -6
  395. package/dist/lib/v2/projection/index.d.ts +8 -6
  396. package/dist/lib/v2/projection/index.d.ts.map +1 -1
  397. package/dist/lib/v2/projection/index.js +26 -4
  398. package/dist/lib/v2/projection/index.js.map +1 -1
  399. package/dist/lib/v2/projection/index.mjs +28 -4
  400. package/dist/lib/v2/projection/index.mjs.map +1 -1
  401. package/dist/lib/v2/projection/legacy-metadata.d.mts +21 -0
  402. package/dist/lib/v2/projection/legacy-metadata.d.ts +22 -0
  403. package/dist/lib/v2/projection/legacy-metadata.d.ts.map +1 -0
  404. package/dist/lib/v2/projection/legacy-metadata.js +73 -0
  405. package/dist/lib/v2/projection/legacy-metadata.js.map +1 -0
  406. package/dist/lib/v2/projection/legacy-metadata.mjs +45 -0
  407. package/dist/lib/v2/projection/legacy-metadata.mjs.map +1 -0
  408. package/dist/lib/v2/projection/types.d.mts +29 -23
  409. package/dist/lib/v2/projection/types.d.ts +29 -23
  410. package/dist/lib/v2/projection/types.d.ts.map +1 -1
  411. package/dist/lib/v2/projection/types.js.map +1 -1
  412. package/dist/lib/v2/projection/v1-to-v2.d.mts +29 -6
  413. package/dist/lib/v2/projection/v1-to-v2.d.ts +29 -6
  414. package/dist/lib/v2/projection/v1-to-v2.d.ts.map +1 -1
  415. package/dist/lib/v2/projection/v1-to-v2.js +218 -9
  416. package/dist/lib/v2/projection/v1-to-v2.js.map +1 -1
  417. package/dist/lib/v2/projection/v1-to-v2.mjs +219 -10
  418. package/dist/lib/v2/projection/v1-to-v2.mjs.map +1 -1
  419. package/dist/lib/v2/projection/v2-to-v1.d.mts +31 -2
  420. package/dist/lib/v2/projection/v2-to-v1.d.ts +31 -2
  421. package/dist/lib/v2/projection/v2-to-v1.d.ts.map +1 -1
  422. package/dist/lib/v2/projection/v2-to-v1.js +138 -7
  423. package/dist/lib/v2/projection/v2-to-v1.js.map +1 -1
  424. package/dist/lib/v2/projection/v2-to-v1.mjs +135 -6
  425. package/dist/lib/v2/projection/v2-to-v1.mjs.map +1 -1
  426. package/dist/lib/v2/projection/write-side.d.mts +12 -13
  427. package/dist/lib/v2/projection/write-side.d.ts +12 -13
  428. package/dist/lib/v2/projection/write-side.d.ts.map +1 -1
  429. package/dist/lib/v2/projection/write-side.js +16 -12
  430. package/dist/lib/v2/projection/write-side.js.map +1 -1
  431. package/dist/lib/v2/projection/write-side.mjs +16 -12
  432. package/dist/lib/v2/projection/write-side.mjs.map +1 -1
  433. package/dist/lib/version.d.mts +3 -3
  434. package/dist/lib/version.d.ts +3 -3
  435. package/dist/lib/version.d.ts.map +1 -1
  436. package/dist/lib/version.js +3 -3
  437. package/dist/lib/version.js.map +1 -1
  438. package/dist/lib/version.mjs +3 -3
  439. package/dist/lib/version.mjs.map +1 -1
  440. package/docs/guides/BUILD-AN-AGENT.md +7 -2
  441. package/docs/guides/PREVIEW-ASSET-DURABILITY.md +6 -2
  442. package/docs/llms.txt +1 -0
  443. package/examples/README.md +1 -1
  444. package/examples/batch-preview-test.ts +3 -3
  445. package/examples/conversation-client.ts +2 -2
  446. package/examples/debug-preview-response.ts +1 -1
  447. package/examples/decisioning-platform-broadcast-tv.ts +10 -4
  448. package/examples/decisioning-platform-mock-seller.ts +16 -9
  449. package/examples/decisioning-platform-programmatic.ts +18 -7
  450. package/examples/error-compliant-server.ts +26 -16
  451. package/examples/generative-creative-demo.ts +7 -19
  452. package/examples/hello_creative_adapter_ad_server.ts +37 -16
  453. package/examples/hello_creative_adapter_template.ts +12 -10
  454. package/examples/hello_seller_adapter_guaranteed.ts +52 -23
  455. package/examples/hello_seller_adapter_multi_tenant.ts +6 -3
  456. package/examples/hello_seller_adapter_non_guaranteed.ts +54 -26
  457. package/examples/hello_seller_adapter_proposal_mode.ts +40 -14
  458. package/examples/hello_seller_adapter_social.ts +2 -7
  459. package/examples/inspect-card-formats.ts +1 -1
  460. package/examples/simple-getting-started.ts +1 -1
  461. package/examples/test-helpers-demo.ts +1 -1
  462. package/package.json +2 -2
  463. package/skills/build-decisioning-creative-template/SKILL.md +11 -11
  464. package/skills/build-decisioning-platform/advanced/REFERENCE.md +8 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/version.ts"],"sourcesContent":["// Generated version information\n// This file is auto-generated by sync-version.ts\n\n/**\n * AdCP SDK library version\n */\nexport const LIBRARY_VERSION = '12.1.0';\n\n/**\n * AdCP specification version this library is built for\n */\nexport const ADCP_VERSION = '3.1.5';\n\n/**\n * AdCP major version sent with every request (adcp_major_version field).\n * Sellers validate this against their supported versions and return\n * VERSION_UNSUPPORTED if the version is not in range.\n */\nexport const ADCP_MAJOR_VERSION = 3;\n\n/**\n * AdCP versions this library maintains backward compatibility with.\n *\n * Auto-derived from `ADCP_VERSION` by scripts/sync-version.ts. Do not edit\n * this list by hand; bumping the AdCP pin via `npm run sync-version`\n * extends it.\n */\nexport const COMPATIBLE_ADCP_VERSIONS = [\n 'v2.5',\n 'v2.6',\n 'v3',\n '3.0.0-beta.1',\n '3.0-beta.1',\n '3.0-beta',\n '3.0.0-beta.3',\n '3.0-beta.3',\n '3.0.0',\n '3.0',\n '3.0.1',\n '3.0.2',\n '3.0.3',\n '3.0.4',\n '3.0.5',\n '3.0.6',\n '3.0.7',\n '3.0.8',\n '3.0.9',\n '3.0.10',\n '3.0.11',\n '3.0.12',\n '3.1.0',\n '3.1',\n '3.1.1',\n '3.1.2',\n '3.1.3',\n '3.1.4',\n '3.1.5',\n] as const;\n\n/**\n * String literal union of every AdCP version the SDK formally supports.\n *\n * Used by the per-instance `adcpVersion` constructor option to give callers\n * autocomplete in editors. The intersection with `(string & {})` in the\n * config type preserves the escape hatch — any string is still accepted at\n * the type level — while the literal union surfaces canonical values first.\n */\nexport type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];\n\n/**\n * Full version information\n */\nexport const VERSION_INFO = {\n library: '12.1.0',\n adcp: '3.1.5',\n compatibleVersions: COMPATIBLE_ADCP_VERSIONS,\n generatedAt: '2026-07-25T23:35:53.939Z',\n} as const;\n\n/**\n * Get the AdCP specification version this library is built for\n */\nexport function getAdcpVersion(): string {\n return ADCP_VERSION;\n}\n\n/**\n * Get the library version\n */\nexport function getLibraryVersion(): string {\n return LIBRARY_VERSION;\n}\n\n/**\n * Check if this library version is compatible with a given AdCP version\n */\nexport function isCompatibleWith(adcpVersion: string): boolean {\n return (COMPATIBLE_ADCP_VERSIONS as readonly string[]).includes(adcpVersion);\n}\n\n/**\n * Get all AdCP versions this library is compatible with\n */\nexport function getCompatibleVersions(): readonly string[] {\n return COMPATIBLE_ADCP_VERSIONS;\n}\n\n/**\n * Extract the major version number from an AdCP version string.\n *\n * Accepts:\n * - Semver: '3.0.0', '3.0.1', '3.1.0-beta.1' → 3\n * - Legacy aliases: 'v3' → 3, 'v2.5' / 'v2.6' → 2\n *\n * Returns NaN for unrecognized strings — callers should validate before passing.\n */\nexport function parseAdcpMajorVersion(version: string): number {\n const trimmed = version.trim();\n const semverLike = trimmed.startsWith('v') ? trimmed.slice(1) : trimmed;\n const major = parseInt(semverLike.split('.')[0] ?? '', 10);\n return Number.isFinite(major) ? major : NaN;\n}\n\n/**\n * Normalize a full-semver AdCP version (`MAJOR.MINOR.PATCH[-prerelease]`) to\n * the release-precision form that AdCP 3.1+ requires on the wire:\n * `MAJOR.MINOR[-prerelease]` — the patch digit is dropped.\n *\n * Per the spec note on `adcp_version`: \"SDKs that read full-semver values\n * from bundle metadata (e.g. `ComplianceIndex.published_version =\n * \"3.1.0-beta.1\"`) MUST normalize to release-precision (`\"3.1-beta.1\"`)\n * before emitting on the wire — meta-field values are NOT valid wire\n * values.\" The wire regex (`^\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?$`) rejects strings\n * with a patch digit.\n *\n * Behavior:\n * - `\"3.1.0-beta.7\"` → `\"3.1-beta.7\"`\n * - `\"3.1.0\"` → `\"3.1\"`\n * - `\"3.0.12\"` → `\"3.0\"`\n * - Already-release-precision input (`\"3.1\"`, `\"3.1-beta.7\"`) passes through\n * - Legacy aliases (`\"v2.5\"`, `\"v3\"`) pass through unchanged — the wire\n * regex doesn't accept them anyway; the v2.5 path uses\n * `adcp_major_version` instead of `adcp_version` for transport.\n * - Unrecognized strings pass through unchanged so callers can detect drift\n * via the wire validator rather than have it masked by this helper.\n */\nexport function toReleasePrecisionVersion(version: string): string {\n const trimmed = version.trim();\n // Pre-release form `MAJOR.MINOR.PATCH-prerelease` → `MAJOR.MINOR-prerelease`\n const semverMatch = trimmed.match(/^(\\d+)\\.(\\d+)\\.\\d+(-[A-Za-z0-9.-]+)?$/);\n if (semverMatch) {\n const [, major, minor, pre = ''] = semverMatch;\n return `${major}.${minor}${pre}`;\n }\n // Already release-precision (no patch digit). Includes `3.1`, `3.1-beta.7`.\n if (/^\\d+\\.\\d+(-[A-Za-z0-9.-]+)?$/.test(trimmed)) return trimmed;\n // Legacy aliases (`v3`, `v2.5`, `v2.6`) and anything we don't recognize —\n // pass through so the wire validator can flag genuine drift.\n return version;\n}\n"],"mappings":"AAMO,MAAM,kBAAkB;AAKxB,MAAM,eAAe;AAOrB,MAAM,qBAAqB;AAS3B,MAAM,2BAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAeO,MAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,EACT,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,aAAa;AACf;AAKO,SAAS,iBAAyB;AACvC,SAAO;AACT;AAKO,SAAS,oBAA4B;AAC1C,SAAO;AACT;AAKO,SAAS,iBAAiB,aAA8B;AAC7D,SAAQ,yBAA+C,SAAS,WAAW;AAC7E;AAKO,SAAS,wBAA2C;AACzD,SAAO;AACT;AAWO,SAAS,sBAAsB,SAAyB;AAC7D,QAAM,UAAU,QAAQ,KAAK;AAC7B,QAAM,aAAa,QAAQ,WAAW,GAAG,IAAI,QAAQ,MAAM,CAAC,IAAI;AAChE,QAAM,QAAQ,SAAS,WAAW,MAAM,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE;AACzD,SAAO,OAAO,SAAS,KAAK,IAAI,QAAQ;AAC1C;AAyBO,SAAS,0BAA0B,SAAyB;AACjE,QAAM,UAAU,QAAQ,KAAK;AAE7B,QAAM,cAAc,QAAQ,MAAM,uCAAuC;AACzE,MAAI,aAAa;AACf,UAAM,CAAC,EAAE,OAAO,OAAO,MAAM,EAAE,IAAI;AACnC,WAAO,GAAG,KAAK,IAAI,KAAK,GAAG,GAAG;AAAA,EAChC;AAEA,MAAI,+BAA+B,KAAK,OAAO,EAAG,QAAO;AAGzD,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/lib/version.ts"],"sourcesContent":["// Generated version information\n// This file is auto-generated by sync-version.ts\n\n/**\n * AdCP SDK library version\n */\nexport const LIBRARY_VERSION = '13.0.0-rc.0';\n\n/**\n * AdCP specification version this library is built for\n */\nexport const ADCP_VERSION = '3.1.5';\n\n/**\n * AdCP major version sent with every request (adcp_major_version field).\n * Sellers validate this against their supported versions and return\n * VERSION_UNSUPPORTED if the version is not in range.\n */\nexport const ADCP_MAJOR_VERSION = 3;\n\n/**\n * AdCP versions this library maintains backward compatibility with.\n *\n * Auto-derived from `ADCP_VERSION` by scripts/sync-version.ts. Do not edit\n * this list by hand; bumping the AdCP pin via `npm run sync-version`\n * extends it.\n */\nexport const COMPATIBLE_ADCP_VERSIONS = [\n 'v2.5',\n 'v2.6',\n 'v3',\n '3.0.0-beta.1',\n '3.0-beta.1',\n '3.0-beta',\n '3.0.0-beta.3',\n '3.0-beta.3',\n '3.0.0',\n '3.0',\n '3.0.1',\n '3.0.2',\n '3.0.3',\n '3.0.4',\n '3.0.5',\n '3.0.6',\n '3.0.7',\n '3.0.8',\n '3.0.9',\n '3.0.10',\n '3.0.11',\n '3.0.12',\n '3.1.0',\n '3.1',\n '3.1.1',\n '3.1.2',\n '3.1.3',\n '3.1.4',\n '3.1.5',\n] as const;\n\n/**\n * String literal union of every AdCP version the SDK formally supports.\n *\n * Used by the per-instance `adcpVersion` constructor option to give callers\n * autocomplete in editors. The intersection with `(string & {})` in the\n * config type preserves the escape hatch — any string is still accepted at\n * the type level — while the literal union surfaces canonical values first.\n */\nexport type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];\n\n/**\n * Full version information\n */\nexport const VERSION_INFO = {\n library: '13.0.0-rc.0',\n adcp: '3.1.5',\n compatibleVersions: COMPATIBLE_ADCP_VERSIONS,\n generatedAt: '2026-07-27T16:31:55.282Z',\n} as const;\n\n/**\n * Get the AdCP specification version this library is built for\n */\nexport function getAdcpVersion(): string {\n return ADCP_VERSION;\n}\n\n/**\n * Get the library version\n */\nexport function getLibraryVersion(): string {\n return LIBRARY_VERSION;\n}\n\n/**\n * Check if this library version is compatible with a given AdCP version\n */\nexport function isCompatibleWith(adcpVersion: string): boolean {\n return (COMPATIBLE_ADCP_VERSIONS as readonly string[]).includes(adcpVersion);\n}\n\n/**\n * Get all AdCP versions this library is compatible with\n */\nexport function getCompatibleVersions(): readonly string[] {\n return COMPATIBLE_ADCP_VERSIONS;\n}\n\n/**\n * Extract the major version number from an AdCP version string.\n *\n * Accepts:\n * - Semver: '3.0.0', '3.0.1', '3.1.0-beta.1' → 3\n * - Legacy aliases: 'v3' → 3, 'v2.5' / 'v2.6' → 2\n *\n * Returns NaN for unrecognized strings — callers should validate before passing.\n */\nexport function parseAdcpMajorVersion(version: string): number {\n const trimmed = version.trim();\n const semverLike = trimmed.startsWith('v') ? trimmed.slice(1) : trimmed;\n const major = parseInt(semverLike.split('.')[0] ?? '', 10);\n return Number.isFinite(major) ? major : NaN;\n}\n\n/**\n * Normalize a full-semver AdCP version (`MAJOR.MINOR.PATCH[-prerelease]`) to\n * the release-precision form that AdCP 3.1+ requires on the wire:\n * `MAJOR.MINOR[-prerelease]` — the patch digit is dropped.\n *\n * Per the spec note on `adcp_version`: \"SDKs that read full-semver values\n * from bundle metadata (e.g. `ComplianceIndex.published_version =\n * \"3.1.0-beta.1\"`) MUST normalize to release-precision (`\"3.1-beta.1\"`)\n * before emitting on the wire — meta-field values are NOT valid wire\n * values.\" The wire regex (`^\\d+\\.\\d+(-[a-zA-Z0-9.-]+)?$`) rejects strings\n * with a patch digit.\n *\n * Behavior:\n * - `\"3.1.0-beta.7\"` → `\"3.1-beta.7\"`\n * - `\"3.1.0\"` → `\"3.1\"`\n * - `\"3.0.12\"` → `\"3.0\"`\n * - Already-release-precision input (`\"3.1\"`, `\"3.1-beta.7\"`) passes through\n * - Legacy aliases (`\"v2.5\"`, `\"v3\"`) pass through unchanged — the wire\n * regex doesn't accept them anyway; the v2.5 path uses\n * `adcp_major_version` instead of `adcp_version` for transport.\n * - Unrecognized strings pass through unchanged so callers can detect drift\n * via the wire validator rather than have it masked by this helper.\n */\nexport function toReleasePrecisionVersion(version: string): string {\n const trimmed = version.trim();\n // Pre-release form `MAJOR.MINOR.PATCH-prerelease` → `MAJOR.MINOR-prerelease`\n const semverMatch = trimmed.match(/^(\\d+)\\.(\\d+)\\.\\d+(-[A-Za-z0-9.-]+)?$/);\n if (semverMatch) {\n const [, major, minor, pre = ''] = semverMatch;\n return `${major}.${minor}${pre}`;\n }\n // Already release-precision (no patch digit). Includes `3.1`, `3.1-beta.7`.\n if (/^\\d+\\.\\d+(-[A-Za-z0-9.-]+)?$/.test(trimmed)) return trimmed;\n // Legacy aliases (`v3`, `v2.5`, `v2.6`) and anything we don't recognize —\n // pass through so the wire validator can flag genuine drift.\n return version;\n}\n"],"mappings":"AAMO,MAAM,kBAAkB;AAKxB,MAAM,eAAe;AAOrB,MAAM,qBAAqB;AAS3B,MAAM,2BAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAeO,MAAM,eAAe;AAAA,EAC1B,SAAS;AAAA,EACT,MAAM;AAAA,EACN,oBAAoB;AAAA,EACpB,aAAa;AACf;AAKO,SAAS,iBAAyB;AACvC,SAAO;AACT;AAKO,SAAS,oBAA4B;AAC1C,SAAO;AACT;AAKO,SAAS,iBAAiB,aAA8B;AAC7D,SAAQ,yBAA+C,SAAS,WAAW;AAC7E;AAKO,SAAS,wBAA2C;AACzD,SAAO;AACT;AAWO,SAAS,sBAAsB,SAAyB;AAC7D,QAAM,UAAU,QAAQ,KAAK;AAC7B,QAAM,aAAa,QAAQ,WAAW,GAAG,IAAI,QAAQ,MAAM,CAAC,IAAI;AAChE,QAAM,QAAQ,SAAS,WAAW,MAAM,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE;AACzD,SAAO,OAAO,SAAS,KAAK,IAAI,QAAQ;AAC1C;AAyBO,SAAS,0BAA0B,SAAyB;AACjE,QAAM,UAAU,QAAQ,KAAK;AAE7B,QAAM,cAAc,QAAQ,MAAM,uCAAuC;AACzE,MAAI,aAAa;AACf,UAAM,CAAC,EAAE,OAAO,OAAO,MAAM,EAAE,IAAI;AACnC,WAAO,GAAG,KAAK,IAAI,KAAK,GAAG,GAAG;AAAA,EAChC;AAEA,MAAI,+BAA+B,KAAK,OAAO,EAAG,QAAO;AAGzD,SAAO;AACT;","names":[]}
@@ -686,11 +686,16 @@ For `getProducts`, any response that includes `products` or `unchanged: true` mu
686
686
  If you need manual control (e.g., with `createTaskCapableServer`), builders are available:
687
687
 
688
688
  ```typescript
689
- import { productsResponse, mediaBuyResponse, deliveryResponse, taskToolResponse } from '@adcp/sdk';
689
+ import {
690
+ legacyProductsResponse,
691
+ legacyMediaBuyResponse,
692
+ legacyDeliveryResponse,
693
+ taskToolResponse,
694
+ } from '@adcp/sdk';
690
695
  // For error envelopes, throw a typed error class — `AuthMissingError`,
691
696
  // `PermissionDeniedError`, `RateLimitedError`, etc. — from `@adcp/sdk/server`.
692
697
 
693
- const response = productsResponse({ products, cache_scope: 'public' });
698
+ const response = legacyProductsResponse({ products, cache_scope: 'public' });
694
699
  ```
695
700
 
696
701
  ### Task Statuses (Server-Side Contract)
@@ -81,11 +81,15 @@ campaign creative.
81
81
  batch preview helpers. That cache stores the result of `preview_creative`; it is
82
82
  not a durable asset store and is not shared across pods.
83
83
 
84
+ `batchPreviewFormatsLegacy()` is intentionally a migration API for legacy
85
+ named-format catalogs. Canonical product cards are self-contained and should be
86
+ rendered from `product.product_card` without a creative-agent round trip.
87
+
84
88
  Production services that cache preview results should pass a shared
85
89
  `PreviewCacheBackend`:
86
90
 
87
91
  ```ts
88
- import { batchPreviewFormats, type PreviewCacheBackend } from '@adcp/sdk';
92
+ import { batchPreviewFormatsLegacy, type PreviewCacheBackend } from '@adcp/sdk';
89
93
  import type { RedisClientType } from 'redis';
90
94
 
91
95
  function redisPreviewCache(redis: RedisClientType): PreviewCacheBackend {
@@ -103,7 +107,7 @@ function redisPreviewCache(redis: RedisClientType): PreviewCacheBackend {
103
107
  };
104
108
  }
105
109
 
106
- const previews = await batchPreviewFormats(formats, creativeAgentClient, {
110
+ const previews = await batchPreviewFormatsLegacy(formats, creativeAgentClient, {
107
111
  cacheBackend: redisPreviewCache(redis),
108
112
  });
109
113
  ```
package/docs/llms.txt CHANGED
@@ -244,6 +244,7 @@ await client.createMediaBuy({ ...params, ...useIdempotencyKey(key) });
244
244
  | Key | Stamped by | Purpose |
245
245
  |-----|-----------|---------|
246
246
  | `ext.adcp.disable_sandbox` | `adcp storyboard run --no-sandbox` | Hint (value: `true`) to bypass internal sandbox routing and exercise real adapter paths. Seller agents that honor this key serve production-shaped responses regardless of internal sandbox heuristics (env-var fallbacks, brand-domain detection, fixture substitutes). |
247
+ | `ext.adcp.creative_wire` | SDK storyboard/conformance tooling | Transitional 3.1 hint (value: `legacy` or `canonical`) for read requests whose creative dialect is otherwise structurally ambiguous. Application buyer agents do not emit this key; normal SDK methods negotiate from capabilities and payload shape. |
247
248
 
248
249
  Third-party extensions MUST use a distinct namespace (e.g. `ext.com.example.*`) to avoid collisions with future `ext.adcp.*` keys.
249
250
 
@@ -149,7 +149,7 @@ const client = ADCPMultiAgentClient.fromEnv();
149
149
  AdCP tools available on `AgentClient`:
150
150
 
151
151
  - `getProducts()` - Discover advertising products
152
- - `listCreativeFormats()` - Get supported creative formats
152
+ - `listCreativeFormatsLegacy()` - Inspect the legacy named-format catalog during migration
153
153
  - `createMediaBuy()` - Create a media buy
154
154
  - `updateMediaBuy()` - Update a media buy
155
155
  - `syncCreatives()` - Sync creative assets
@@ -5,12 +5,12 @@
5
5
  *
6
6
  * This example demonstrates:
7
7
  * 1. Creating mock products/formats with product_card/format_card manifests
8
- * 2. Using batchPreviewProducts/batchPreviewFormats to render cards
8
+ * 2. Using batchPreviewProducts/batchPreviewFormatsLegacy to render cards
9
9
  * 3. Caching behavior
10
10
  */
11
11
 
12
12
  import { AdCPClient } from '../src/lib/core/AdCPClient';
13
- import { batchPreviewProducts, batchPreviewFormats, clearPreviewCache } from '../src/lib/utils/preview-utils';
13
+ import { batchPreviewProducts, batchPreviewFormatsLegacy, clearPreviewCache } from '../src/lib/utils/preview-utils';
14
14
  import type { Product, Format } from '../src/lib/types/tools.generated';
15
15
 
16
16
  // Configuration
@@ -217,7 +217,7 @@ async function main() {
217
217
  console.log(`📦 Testing with ${testFormats.length} formats...`);
218
218
  const startTime = Date.now();
219
219
 
220
- const formatPreviews = await batchPreviewFormats(testFormats, creativeAgent);
220
+ const formatPreviews = await batchPreviewFormatsLegacy(testFormats, creativeAgent);
221
221
 
222
222
  const elapsed = Date.now() - startTime;
223
223
  console.log(`✅ Batch preview completed in ${elapsed}ms\n`);
@@ -180,7 +180,7 @@ async function advancedHandlersExample() {
180
180
 
181
181
  try {
182
182
  console.log('🎯 Testing advanced input handling...');
183
- const result = await agent.listCreativeFormats(
183
+ const result = await agent.listCreativeFormatsLegacy(
184
184
  {
185
185
  type: 'video',
186
186
  },
@@ -239,7 +239,7 @@ async function conversationHistoryExample() {
239
239
  });
240
240
 
241
241
  // Second request in same conversation
242
- await agent.listCreativeFormats(
242
+ await agent.listCreativeFormatsLegacy(
243
243
  {
244
244
  type: 'display',
245
245
  },
@@ -22,7 +22,7 @@ async function main() {
22
22
  // Simple preview_creative request
23
23
  // Note: Using type assertion to bypass strict TypeScript validation
24
24
  // The actual creative agent expects plain strings for text assets
25
- const response = await creativeAgent.previewCreative({
25
+ const response = await creativeAgent.previewCreativeLegacy({
26
26
  format_id: {
27
27
  agent_url: 'https://creative.adcontextprotocol.org/',
28
28
  id: 'product_card_standard',
@@ -34,11 +34,11 @@ import {
34
34
  type SalesCorePlatform,
35
35
  type SalesIngestionPlatform,
36
36
  type AccountStore,
37
- type GetProductsPayload,
37
+ type GetProductsHandlerResult,
38
38
  type SyncCreativesRow,
39
39
  } from '@adcp/sdk/server';
40
+ import type { GetProductsRequest } from '@adcp/sdk';
40
41
  import type {
41
- GetProductsRequest,
42
42
  CreateMediaBuyRequest,
43
43
  CreateMediaBuySuccess,
44
44
  UpdateMediaBuyRequest,
@@ -117,7 +117,7 @@ export class BroadcastTvSeller implements DecisioningPlatform<BroadcastTvConfig,
117
117
  * the eventual products via `publishStatusChange` on
118
118
  * `resource_type: 'proposal'`.
119
119
  */
120
- getProducts: async (req: GetProductsRequest): Promise<GetProductsPayload> => {
120
+ getProducts: async (req: GetProductsRequest): Promise<GetProductsHandlerResult> => {
121
121
  const promotedOffering = (req as { promoted_offering?: string }).promoted_offering ?? '';
122
122
  if (/political|cannabis|gambling/i.test(promotedOffering)) {
123
123
  throw new AdcpError('POLICY_VIOLATION', {
@@ -135,7 +135,13 @@ export class BroadcastTvSeller implements DecisioningPlatform<BroadcastTvConfig,
135
135
  product_id: 'prod_primetime_30s',
136
136
  name: 'Primetime 30s — M-F 8-11pm',
137
137
  description: 'Local broadcast primetime, :30 spots',
138
- format_ids: [{ id: 'video_30s', agent_url: 'https://example.com/broadcast-creative-agent/mcp' }],
138
+ format_options: [
139
+ {
140
+ format_option_id: 'video_30s',
141
+ format_kind: 'video_hosted',
142
+ params: { duration_ms_exact: 30_000 },
143
+ },
144
+ ],
139
145
  delivery_type: 'guaranteed',
140
146
  publisher_properties: [{ publisher_domain: 'broadcast.example.com', selection_type: 'all' }],
141
147
  reporting_capabilities: DEFAULT_REPORTING_CAPABILITIES,
@@ -47,11 +47,11 @@ import {
47
47
  type SalesIngestionPlatform,
48
48
  type AccountStore,
49
49
  type AdcpStructuredError,
50
- type GetProductsPayload,
50
+ type GetProductsHandlerResult,
51
51
  type SyncCreativesRow,
52
52
  } from '@adcp/sdk/server';
53
+ import type { GetProductsRequest } from '@adcp/sdk';
53
54
  import type {
54
- GetProductsRequest,
55
55
  CreateMediaBuyRequest,
56
56
  CreateMediaBuySuccess,
57
57
  UpdateMediaBuyRequest,
@@ -146,7 +146,7 @@ function rejectPreflight(errors: AdcpStructuredError[]): never {
146
146
  });
147
147
  }
148
148
 
149
- const SHARED_GET_PRODUCTS = async (_req: GetProductsRequest): Promise<GetProductsPayload> => ({
149
+ const SHARED_GET_PRODUCTS = async (_req: GetProductsRequest): Promise<GetProductsHandlerResult> => ({
150
150
  cache_scope: 'account' as const,
151
151
  products: [
152
152
  {
@@ -154,7 +154,13 @@ const SHARED_GET_PRODUCTS = async (_req: GetProductsRequest): Promise<GetProduct
154
154
  name: 'Premium Video',
155
155
  description: 'Pre-roll video on premium inventory',
156
156
  delivery_type: 'non_guaranteed',
157
- format_ids: [{ id: 'video_15s', agent_url: 'https://example.com/creative-agent/mcp' }],
157
+ format_options: [
158
+ {
159
+ format_option_id: 'video_15s',
160
+ format_kind: 'video_hosted',
161
+ params: { duration_ms_exact: 15_000 },
162
+ },
163
+ ],
158
164
  publisher_properties: [{ publisher_domain: 'publisher.example.com', selection_type: 'all' }],
159
165
  pricing_options: [
160
166
  {
@@ -176,7 +182,7 @@ const SHARED_GET_PRODUCTS = async (_req: GetProductsRequest): Promise<GetProduct
176
182
  const SHARED_SYNC_CREATIVES = async (creatives: CreativeAsset[]): Promise<SyncCreativesRow[]> => {
177
183
  return creatives.map(c => {
178
184
  const id = (c as { creative_id?: string }).creative_id ?? `cr_${Math.random()}`;
179
- const needsReview = (c as { format_id?: { id?: string } }).format_id?.id?.startsWith('video_');
185
+ const needsReview = c.format_kind === 'video_hosted' || c.format_kind === 'video_vast';
180
186
  return {
181
187
  creative_id: id,
182
188
  action: 'created',
@@ -327,10 +333,11 @@ export function buildHybridServerExample(platform: MockHybridSeller) {
327
333
  version: '0.0.1',
328
334
  validation: { requests: 'off', responses: 'off' },
329
335
  mergeSeam: 'strict',
330
- mediaBuy: {
331
- // v5 leftover — listCreativeFormats isn't on SalesPlatform v1.0
332
- // (deferred to rc.1). Custom handler here fills the gap until then.
333
- listCreativeFormats: async () => ({ status: 'completed' as const, formats: [] }),
336
+ legacyHandlers: {
337
+ mediaBuy: {
338
+ // Explicit v5 raw-handler compatibility seam.
339
+ listCreativeFormats: async () => ({ status: 'completed' as const, formats: [] }),
340
+ },
334
341
  },
335
342
  });
336
343
  }
@@ -28,11 +28,11 @@ import {
28
28
  type SalesCorePlatform,
29
29
  type SalesIngestionPlatform,
30
30
  type AccountStore,
31
- type GetProductsPayload,
31
+ type GetProductsHandlerResult,
32
32
  type SyncCreativesRow,
33
33
  } from '@adcp/sdk/server';
34
+ import type { GetProductsRequest } from '@adcp/sdk';
34
35
  import type {
35
- GetProductsRequest,
36
36
  CreateMediaBuyRequest,
37
37
  CreateMediaBuySuccess,
38
38
  UpdateMediaBuyRequest,
@@ -97,14 +97,20 @@ export class ProgrammaticSeller implements DecisioningPlatform<ProgrammaticConfi
97
97
 
98
98
  sales: SalesCorePlatform<ProgrammaticMeta> & SalesIngestionPlatform<ProgrammaticMeta> = {
99
99
  /** Sync discovery: catalog read; no async ceremony. */
100
- getProducts: async (_req: GetProductsRequest): Promise<GetProductsPayload> => ({
100
+ getProducts: async (_req: GetProductsRequest): Promise<GetProductsHandlerResult> => ({
101
101
  cache_scope: 'account' as const,
102
102
  products: [
103
103
  {
104
104
  product_id: 'prod_run_of_network_display',
105
105
  name: 'RON Display',
106
106
  description: 'Run-of-network display, 300x250 + 728x90',
107
- format_ids: [{ id: 'display_300x250', agent_url: 'https://example.com/programmatic-creative-agent/mcp' }],
107
+ format_options: [
108
+ {
109
+ format_option_id: 'display_300x250',
110
+ format_kind: 'image',
111
+ params: { width: 300, height: 250 },
112
+ },
113
+ ],
108
114
  delivery_type: 'non_guaranteed',
109
115
  publisher_properties: [{ publisher_domain: 'programmatic.example.com', selection_type: 'all' }],
110
116
  reporting_capabilities: { ...DEFAULT_REPORTING_CAPABILITIES, expected_delay_minutes: 60 },
@@ -121,7 +127,13 @@ export class ProgrammaticSeller implements DecisioningPlatform<ProgrammaticConfi
121
127
  product_id: 'prod_premium_video_15s',
122
128
  name: 'Premium Video 15s',
123
129
  description: 'In-stream video on premium publishers',
124
- format_ids: [{ id: 'video_15s', agent_url: 'https://example.com/programmatic-creative-agent/mcp' }],
130
+ format_options: [
131
+ {
132
+ format_option_id: 'video_15s',
133
+ format_kind: 'video_hosted',
134
+ params: { duration_ms_exact: 15_000 },
135
+ },
136
+ ],
125
137
  delivery_type: 'non_guaranteed',
126
138
  publisher_properties: [{ publisher_domain: 'programmatic.example.com', selection_type: 'all' }],
127
139
  reporting_capabilities: { ...DEFAULT_REPORTING_CAPABILITIES, expected_delay_minutes: 60 },
@@ -206,8 +218,7 @@ export class ProgrammaticSeller implements DecisioningPlatform<ProgrammaticConfi
206
218
  syncCreatives: async (creatives: CreativeAsset[]): Promise<SyncCreativesRow[]> => {
207
219
  return creatives.map(c => {
208
220
  const id = (c as { creative_id?: string }).creative_id ?? `cr_${Math.random()}`;
209
- const formatId = (c as { format_id?: { id?: string } }).format_id?.id ?? '';
210
- const needsReview = formatId.startsWith('video_');
221
+ const needsReview = c.format_kind === 'video_hosted' || c.format_kind === 'video_vast';
211
222
  if (needsReview) {
212
223
  // Schedule the pending → approved transition for the demo
213
224
  setTimeout(() => {
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Example: AdCP-Compliant MCP Server
3
3
  *
4
- * Demonstrates building a server using @adcp/sdk response builders
5
- * for type-safe responses. Run with:
4
+ * Demonstrates the explicit legacy handler-bag server and its raw response
5
+ * builders. New servers should use `createAdcpServerFromPlatform` instead.
6
6
  *
7
7
  * npx tsx examples/error-compliant-server.ts
8
8
  *
@@ -14,10 +14,10 @@
14
14
  import {
15
15
  createTaskCapableServer,
16
16
  adcpError,
17
- capabilitiesResponse,
18
- productsResponse,
19
- mediaBuyResponse,
20
- deliveryResponse,
17
+ legacyCapabilitiesResponse,
18
+ legacyProductsResponse,
19
+ legacyMediaBuyResponse,
20
+ legacyDeliveryResponse,
21
21
  serve,
22
22
  DEFAULT_REPORTING_CAPABILITIES,
23
23
  } from '@adcp/sdk';
@@ -26,7 +26,7 @@ import {
26
26
  CreateMediaBuyRequestSchema,
27
27
  GetMediaBuyDeliveryRequestSchema,
28
28
  } from '@adcp/sdk/schemas';
29
- import type { Product, ServerPayload } from '@adcp/sdk';
29
+ import type { LegacyProduct, ServerPayload } from '@adcp/sdk';
30
30
  import type { GetAdCPCapabilitiesResponse } from '@adcp/sdk/types';
31
31
 
32
32
  // CreateMediaBuyRequestSchema requires account/brand per spec, but a lenient
@@ -38,17 +38,21 @@ const LenientCreateMediaBuyInput = CreateMediaBuyRequestSchema.extend({
38
38
  });
39
39
 
40
40
  // ---------------------------------------------------------------------------
41
- // Product catalog typed as Product[] so the compiler enforces the schema
41
+ // Product catalog for the explicit raw handler-bag example.
42
42
  // ---------------------------------------------------------------------------
43
- const PRODUCTS: Product[] = [
43
+ const PRODUCTS: LegacyProduct[] = [
44
44
  {
45
45
  product_id: 'prod_display_300x250',
46
46
  name: 'Display Banner 300x250',
47
47
  description: 'Standard IAB display banner ad unit served across premium news and lifestyle sites.',
48
48
  publisher_properties: [{ publisher_domain: 'example-publisher.com', selection_type: 'all' }],
49
49
  channels: ['display'],
50
- format_ids: [
51
- { agent_url: 'https://creatives.adcontextprotocol.org', id: 'display_static', width: 300, height: 250 },
50
+ format_options: [
51
+ {
52
+ format_option_id: 'display-static-300x250',
53
+ format_kind: 'image',
54
+ params: { width: 300, height: 250 },
55
+ },
52
56
  ],
53
57
  delivery_type: 'non_guaranteed',
54
58
  pricing_options: [
@@ -68,7 +72,13 @@ const PRODUCTS: Product[] = [
68
72
  description: 'Skippable pre-roll video ads served on premium video content.',
69
73
  publisher_properties: [{ publisher_domain: 'example-publisher.com', selection_type: 'all' }],
70
74
  channels: ['olv'],
71
- format_ids: [{ agent_url: 'https://creatives.adcontextprotocol.org', id: 'video_hosted' }],
75
+ format_options: [
76
+ {
77
+ format_option_id: 'video-hosted-15s',
78
+ format_kind: 'video_hosted',
79
+ params: { duration_ms_exact: 15000 },
80
+ },
81
+ ],
72
82
  delivery_type: 'non_guaranteed',
73
83
  pricing_options: [
74
84
  {
@@ -130,7 +140,7 @@ function createAgentServer() {
130
140
  },
131
141
  },
132
142
  };
133
- return capabilitiesResponse(capabilities);
143
+ return legacyCapabilitiesResponse(capabilities);
134
144
  });
135
145
 
136
146
  // --- get_products ---
@@ -138,7 +148,7 @@ function createAgentServer() {
138
148
  const limited = checkRateLimit();
139
149
  if (limited) return limited;
140
150
 
141
- return productsResponse({ products: PRODUCTS, cache_scope: 'public' });
151
+ return legacyProductsResponse({ products: PRODUCTS, cache_scope: 'public' });
142
152
  });
143
153
 
144
154
  // --- create_media_buy ---
@@ -197,7 +207,7 @@ function createAgentServer() {
197
207
 
198
208
  const mediaBuyId = `mb_${Date.now()}`;
199
209
 
200
- return mediaBuyResponse({
210
+ return legacyMediaBuyResponse({
201
211
  media_buy_id: mediaBuyId,
202
212
  packages: (packages ?? []).map((pkg, i) => ({
203
213
  package_id: `pkg_${i}_${Date.now()}`,
@@ -221,7 +231,7 @@ function createAgentServer() {
221
231
  const now = new Date();
222
232
  const yesterday = new Date(now.getTime() - 86400000);
223
233
 
224
- return deliveryResponse({
234
+ return legacyDeliveryResponse({
225
235
  reporting_period: {
226
236
  start: yesterday.toISOString(),
227
237
  end: now.toISOString(),
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env tsx
2
2
  // Demonstrates the new generative creative format support introduced in AdCP v1.7.0
3
- // This example shows how to use the new format_id and assets structure for both
3
+ // This example shows how to use canonical format_kind and assets for both
4
4
  // static and generative creative workflows
5
5
 
6
6
  import { ADCPMultiAgentClient, imageAsset, textAsset, urlAsset, type SyncCreativesRequest } from '../src/lib';
@@ -24,17 +24,14 @@ async function demonstrateGenerativeCreatives() {
24
24
  console.log(` Protocol: ${agent.config.protocol}\n`);
25
25
 
26
26
  // Example 1: Traditional static creative with new format
27
- console.log('📝 Example 1: Static Creative with new format_id structure\n');
27
+ console.log('📝 Example 1: Static Creative with canonical format_kind\n');
28
28
 
29
29
  const staticCreativeRequest: SyncCreativesRequest = {
30
30
  creatives: [
31
31
  {
32
32
  creative_id: `static_banner_${Date.now()}`,
33
33
  name: 'Static Display Banner 300x250',
34
- format_id: {
35
- agent_url: 'https://creative.adcontextprotocol.org',
36
- id: 'display_300x250',
37
- },
34
+ format_kind: 'image',
38
35
  assets: {
39
36
  image: imageAsset({
40
37
  url: 'https://example.com/banner-300x250.jpg',
@@ -64,10 +61,7 @@ async function demonstrateGenerativeCreatives() {
64
61
  {
65
62
  creative_id: `gen_banner_${Date.now()}`,
66
63
  name: 'AI-Generated Display Banner',
67
- format_id: {
68
- agent_url: 'https://creative.adcontextprotocol.org',
69
- id: 'display_300x250_generative',
70
- },
64
+ format_kind: 'image',
71
65
  assets: {
72
66
  brand_context: urlAsset({
73
67
  url: 'https://example.com',
@@ -115,10 +109,7 @@ async function demonstrateGenerativeCreatives() {
115
109
  {
116
110
  creative_id: 'gen_banner_12345', // Existing creative ID from previous sync
117
111
  name: 'AI-Generated Display Banner',
118
- format_id: {
119
- agent_url: 'https://creative.adcontextprotocol.org',
120
- id: 'display_300x250_generative',
121
- },
112
+ format_kind: 'image',
122
113
  assets: {
123
114
  brand_context: urlAsset({
124
115
  url: 'https://example.com',
@@ -146,10 +137,7 @@ async function demonstrateGenerativeCreatives() {
146
137
  {
147
138
  creative_id: 'gen_banner_12345',
148
139
  name: 'AI-Generated Display Banner',
149
- format_id: {
150
- agent_url: 'https://creative.adcontextprotocol.org',
151
- id: 'display_300x250_generative',
152
- },
140
+ format_kind: 'image',
153
141
  assets: {
154
142
  brand_context: urlAsset({
155
143
  url: 'https://example.com',
@@ -172,7 +160,7 @@ async function demonstrateGenerativeCreatives() {
172
160
 
173
161
  console.log('🎉 Demo complete!');
174
162
  console.log('\n📚 Key Changes in AdCP v1.7.0:');
175
- console.log(' ✓ format_id is now an object with agent_url and id');
163
+ console.log(' ✓ format_kind identifies the canonical creative format');
176
164
  console.log(' ✓ assets is now a flexible object keyed by asset_role');
177
165
  console.log(' ✓ New asset types: url and brand_manifest');
178
166
  console.log(' ✓ inputs array for defining preview contexts');
@@ -67,15 +67,20 @@ import {
67
67
  type DecisioningPlatform,
68
68
  type SyncCreativesRow,
69
69
  } from '@adcp/sdk/server';
70
- import { FormatAsset, buildCreativeReturn, previewCreative, urlRender } from '@adcp/sdk';
70
+ import {
71
+ FormatAsset,
72
+ buildCreativeReturn,
73
+ previewCreative,
74
+ urlRender,
75
+ type CanonicalCreativeAsset,
76
+ type CanonicalListedCreative,
77
+ } from '@adcp/sdk';
71
78
  import type {
72
79
  BuildCreativeRequest,
73
80
  BuildCreativeSuccess,
74
- CreativeAsset,
75
81
  GetCreativeDeliveryRequest,
76
82
  GetCreativeDeliveryResponse,
77
83
  ListCreativeFormatsResponse,
78
- ListCreativesResponse,
79
84
  PreviewCreativeRequest,
80
85
  PreviewCreativeResponse,
81
86
  } from '@adcp/sdk/types';
@@ -328,17 +333,26 @@ function projectFormat(f: UpstreamFormat): ListCreativeFormatsResponse['formats'
328
333
  };
329
334
  }
330
335
 
331
- /** Project upstream creative → AdCP `CreativeAsset`. The list-creatives
332
- * response schema requires `creative_id`, `name`, `format_id`, `status`,
333
- * `created_date`, `updated_date`. We wrap the upstream snippet as a single
336
+ function canonicalCreativeKind(formatId: string): CanonicalCreativeAsset['format_kind'] {
337
+ if (/video|vast|ctv/i.test(formatId)) return 'video_hosted';
338
+ if (/audio|daast/i.test(formatId)) return 'audio_hosted';
339
+ if (/native|feed|social/i.test(formatId)) return 'native_in_feed';
340
+ return 'image';
341
+ }
342
+
343
+ /** Project upstream creative onto the canonical SDK surface. We retain the
344
+ * upstream option id as a product-scoped canonical reference so the explicit
345
+ * canonical→legacy resolver below can restore the seller-owned format ID for
346
+ * a 3.0 or legacy-3.1 buyer. We wrap the upstream snippet as a single
334
347
  * inline html asset so adopters see how `assets` is keyed; production
335
348
  * sellers project the upstream's structured asset graph (image_url,
336
349
  * video_url, click_url, headline, etc.) here. */
337
- function projectCreative(c: UpstreamCreative): CreativeAsset {
350
+ function projectCreative(c: UpstreamCreative): CanonicalListedCreative {
338
351
  return {
339
352
  creative_id: c.creative_id,
340
353
  name: c.name,
341
- format_id: { agent_url: FORMAT_AGENT_URL, id: c.format_id },
354
+ format_kind: canonicalCreativeKind(c.format_id),
355
+ format_option_ref: { scope: 'product', format_option_id: c.format_id },
342
356
  status: mapCreativeStatus(c.status),
343
357
  created_date: c.created_at,
344
358
  updated_date: c.updated_at,
@@ -350,12 +364,12 @@ function projectCreative(c: UpstreamCreative): CreativeAsset {
350
364
  click_url: { asset_type: 'url', url: c.click_url },
351
365
  }),
352
366
  },
353
- // CAST: schema-pickiness — `CreativeAsset` requires `assets` keys to
367
+ // CAST: schema-pickiness — the canonical creative requires `assets` keys to
354
368
  // satisfy the discriminated `AssetVariant` union. The `html` and `url`
355
369
  // variants we emit ARE valid (asset_type: 'html' + content; asset_type:
356
370
  // 'url' + url), but TS's structural inference can't prove it through
357
371
  // the spread. Adopters who project richer asset graphs can drop the cast.
358
- } as unknown as CreativeAsset;
372
+ } as unknown as CanonicalListedCreative;
359
373
  }
360
374
 
361
375
  function mapCreativeStatus(s: UpstreamCreative['status']): 'approved' | 'pending_review' | 'rejected' {
@@ -466,7 +480,7 @@ class CreativeAdServerAdapter implements DecisioningPlatform<Record<string, neve
466
480
  * the creative first (push to upstream) then renders. SWAP for adapters
467
481
  * that don't support inline build to throw INVALID_REQUEST instead.
468
482
  */
469
- buildCreative: async (req: BuildCreativeRequest, ctx): Promise<BuildCreativeSuccess> => {
483
+ buildCreativeLegacy: async (req: BuildCreativeRequest, ctx): Promise<BuildCreativeSuccess> => {
470
484
  const networkCode = ctx.account.ctx_metadata.network_code;
471
485
  const creativeId = (req as { creative_id?: string }).creative_id;
472
486
  const creativeManifest = (req as { creative_manifest?: { creative_id?: string; assets?: unknown } })
@@ -540,7 +554,7 @@ class CreativeAdServerAdapter implements DecisioningPlatform<Record<string, neve
540
554
  * request doesn't carry `account`. Resolver synthesizes a fallback
541
555
  * (KNOWN_PUBLISHERS[0]) so we have tenant context.
542
556
  */
543
- previewCreative: async (req: PreviewCreativeRequest, ctx): Promise<PreviewCreativeResponse> => {
557
+ previewCreativeLegacy: async (req: PreviewCreativeRequest, ctx): Promise<PreviewCreativeResponse> => {
544
558
  // No-account narrow: ctx.account is `Account<NetworkMeta> | undefined`
545
559
  // per the type. Defensive guard per migration recipe #11.
546
560
  const acct = ctx.account as Account<NetworkMeta> | undefined;
@@ -588,7 +602,7 @@ class CreativeAdServerAdapter implements DecisioningPlatform<Record<string, neve
588
602
  };
589
603
  },
590
604
 
591
- listCreativeFormats: async (_req, _ctx): Promise<ListCreativeFormatsResponse> => {
605
+ listCreativeFormatsLegacy: async (_req, _ctx): Promise<ListCreativeFormatsResponse> => {
592
606
  // No-account tool. Use the default workspace's catalog. Production
593
607
  // sellers expose a global format catalog or the workspace tied to
594
608
  // the API key's principal.
@@ -597,14 +611,14 @@ class CreativeAdServerAdapter implements DecisioningPlatform<Record<string, neve
597
611
  return { status: 'completed' as const, formats: upstreamFormats.map(projectFormat) };
598
612
  },
599
613
 
600
- syncCreatives: async (creatives: CreativeAsset[], ctx): Promise<SyncCreativesRow[]> => {
614
+ syncCreatives: async (creatives: CanonicalCreativeAsset[], ctx): Promise<SyncCreativesRow[]> => {
601
615
  const networkCode = ctx.account.ctx_metadata.network_code;
602
616
  const advertiserId = ctx.account.id;
603
617
  const rows: SyncCreativesRow[] = [];
604
618
  for (const c of creatives) {
605
619
  const opaque = c as unknown as Record<string, unknown>;
606
- const fmtRef = opaque['format_id'] as { id?: string } | string | undefined;
607
- const formatId = typeof fmtRef === 'string' ? fmtRef : fmtRef?.id;
620
+ const optionRef = opaque['format_option_ref'] as { format_option_id?: string } | undefined;
621
+ const formatId = optionRef?.format_option_id ?? c.format_kind;
608
622
  const idempotencyHint =
609
623
  typeof opaque['creative_id'] === 'string' ? (opaque['creative_id'] as string) : undefined;
610
624
  // Extract upstream-specific fields the AdCP `CreativeAsset` shape
@@ -810,6 +824,13 @@ serve(
810
824
  },
811
825
  },
812
826
  },
827
+ canonicalFormatLegacyResolver: context => {
828
+ if (context.source !== 'creative') return undefined;
829
+ const optionRef = context.creative['format_option_ref'];
830
+ if (optionRef === null || typeof optionRef !== 'object' || Array.isArray(optionRef)) return undefined;
831
+ const formatOptionId = (optionRef as { format_option_id?: unknown }).format_option_id;
832
+ return typeof formatOptionId === 'string' ? { agent_url: FORMAT_AGENT_URL, id: formatOptionId } : undefined;
833
+ },
813
834
  }),
814
835
  {
815
836
  port: PORT,