@adcp/sdk 12.1.1 → 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 (410) 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/provider-cache.d.mts +7 -0
  18. package/dist/lib/auth/oauth/provider-cache.d.ts +8 -0
  19. package/dist/lib/auth/oauth/provider-cache.d.ts.map +1 -0
  20. package/dist/lib/auth/oauth/provider-cache.js +44 -0
  21. package/dist/lib/auth/oauth/provider-cache.js.map +1 -0
  22. package/dist/lib/auth/oauth/provider-cache.mjs +19 -0
  23. package/dist/lib/auth/oauth/provider-cache.mjs.map +1 -0
  24. package/dist/lib/conformance/invariants/uniformError.js +1 -1
  25. package/dist/lib/conformance/invariants/uniformError.js.map +1 -1
  26. package/dist/lib/conformance/invariants/uniformError.mjs +1 -1
  27. package/dist/lib/conformance/invariants/uniformError.mjs.map +1 -1
  28. package/dist/lib/conformance/runners.js +1 -1
  29. package/dist/lib/conformance/runners.js.map +1 -1
  30. package/dist/lib/conformance/runners.mjs +1 -1
  31. package/dist/lib/conformance/runners.mjs.map +1 -1
  32. package/dist/lib/conformance/seeder.js +5 -5
  33. package/dist/lib/conformance/seeder.js.map +1 -1
  34. package/dist/lib/conformance/seeder.mjs +5 -5
  35. package/dist/lib/conformance/seeder.mjs.map +1 -1
  36. package/dist/lib/core/ADCPMultiAgentClient.d.mts +26 -29
  37. package/dist/lib/core/ADCPMultiAgentClient.d.ts +26 -29
  38. package/dist/lib/core/ADCPMultiAgentClient.d.ts.map +1 -1
  39. package/dist/lib/core/ADCPMultiAgentClient.js +27 -19
  40. package/dist/lib/core/ADCPMultiAgentClient.js.map +1 -1
  41. package/dist/lib/core/ADCPMultiAgentClient.mjs +27 -19
  42. package/dist/lib/core/ADCPMultiAgentClient.mjs.map +1 -1
  43. package/dist/lib/core/AgentClient.d.mts +148 -138
  44. package/dist/lib/core/AgentClient.d.ts +148 -138
  45. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  46. package/dist/lib/core/AgentClient.js +174 -85
  47. package/dist/lib/core/AgentClient.js.map +1 -1
  48. package/dist/lib/core/AgentClient.mjs +174 -85
  49. package/dist/lib/core/AgentClient.mjs.map +1 -1
  50. package/dist/lib/core/AsyncHandler.d.mts +18 -16
  51. package/dist/lib/core/AsyncHandler.d.ts +18 -16
  52. package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
  53. package/dist/lib/core/AsyncHandler.js +22 -1
  54. package/dist/lib/core/AsyncHandler.js.map +1 -1
  55. package/dist/lib/core/AsyncHandler.mjs +22 -1
  56. package/dist/lib/core/AsyncHandler.mjs.map +1 -1
  57. package/dist/lib/core/ConversationTypes.d.mts +6 -2
  58. package/dist/lib/core/ConversationTypes.d.ts +6 -2
  59. package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
  60. package/dist/lib/core/ConversationTypes.js.map +1 -1
  61. package/dist/lib/core/CreativeAgentClient.d.mts +41 -17
  62. package/dist/lib/core/CreativeAgentClient.d.ts +41 -17
  63. package/dist/lib/core/CreativeAgentClient.d.ts.map +1 -1
  64. package/dist/lib/core/CreativeAgentClient.js +39 -12
  65. package/dist/lib/core/CreativeAgentClient.js.map +1 -1
  66. package/dist/lib/core/CreativeAgentClient.mjs +39 -12
  67. package/dist/lib/core/CreativeAgentClient.mjs.map +1 -1
  68. package/dist/lib/core/SingleAgentClient.d.mts +127 -50
  69. package/dist/lib/core/SingleAgentClient.d.ts +127 -50
  70. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  71. package/dist/lib/core/SingleAgentClient.js +1617 -177
  72. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  73. package/dist/lib/core/SingleAgentClient.mjs +1627 -177
  74. package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
  75. package/dist/lib/core/TaskExecutor.d.mts +9 -0
  76. package/dist/lib/core/TaskExecutor.d.ts +9 -0
  77. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  78. package/dist/lib/core/TaskExecutor.js +136 -43
  79. package/dist/lib/core/TaskExecutor.js.map +1 -1
  80. package/dist/lib/core/TaskExecutor.mjs +136 -43
  81. package/dist/lib/core/TaskExecutor.mjs.map +1 -1
  82. package/dist/lib/index.d.mts +111 -17
  83. package/dist/lib/index.d.ts +111 -17
  84. package/dist/lib/index.d.ts.map +1 -1
  85. package/dist/lib/index.js +94 -94
  86. package/dist/lib/index.js.map +1 -1
  87. package/dist/lib/index.mjs +93 -94
  88. package/dist/lib/index.mjs.map +1 -1
  89. package/dist/lib/protocols/index.d.ts.map +1 -1
  90. package/dist/lib/protocols/index.js +6 -15
  91. package/dist/lib/protocols/index.js.map +1 -1
  92. package/dist/lib/protocols/index.mjs +6 -16
  93. package/dist/lib/protocols/index.mjs.map +1 -1
  94. package/dist/lib/protocols/mcp-modern.d.ts.map +1 -1
  95. package/dist/lib/protocols/mcp-modern.js +87 -12
  96. package/dist/lib/protocols/mcp-modern.js.map +1 -1
  97. package/dist/lib/protocols/mcp-modern.mjs +89 -12
  98. package/dist/lib/protocols/mcp-modern.mjs.map +1 -1
  99. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  100. package/dist/lib/server/create-adcp-server.d.mts +6 -0
  101. package/dist/lib/server/create-adcp-server.d.ts +6 -0
  102. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  103. package/dist/lib/server/create-adcp-server.js +295 -48
  104. package/dist/lib/server/create-adcp-server.js.map +1 -1
  105. package/dist/lib/server/create-adcp-server.mjs +301 -50
  106. package/dist/lib/server/create-adcp-server.mjs.map +1 -1
  107. package/dist/lib/server/decisioning/assembly-helpers.d.mts +27 -13
  108. package/dist/lib/server/decisioning/assembly-helpers.d.ts +27 -13
  109. package/dist/lib/server/decisioning/assembly-helpers.d.ts.map +1 -1
  110. package/dist/lib/server/decisioning/assembly-helpers.js +136 -14
  111. package/dist/lib/server/decisioning/assembly-helpers.js.map +1 -1
  112. package/dist/lib/server/decisioning/assembly-helpers.mjs +134 -13
  113. package/dist/lib/server/decisioning/assembly-helpers.mjs.map +1 -1
  114. package/dist/lib/server/decisioning/index.d.mts +13 -12
  115. package/dist/lib/server/decisioning/index.d.ts +13 -12
  116. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  117. package/dist/lib/server/decisioning/index.js +6 -0
  118. package/dist/lib/server/decisioning/index.js.map +1 -1
  119. package/dist/lib/server/decisioning/index.mjs +9 -3
  120. package/dist/lib/server/decisioning/index.mjs.map +1 -1
  121. package/dist/lib/server/decisioning/list-helpers.d.mts +13 -3
  122. package/dist/lib/server/decisioning/list-helpers.d.ts +13 -3
  123. package/dist/lib/server/decisioning/list-helpers.d.ts.map +1 -1
  124. package/dist/lib/server/decisioning/list-helpers.js +13 -3
  125. package/dist/lib/server/decisioning/list-helpers.js.map +1 -1
  126. package/dist/lib/server/decisioning/list-helpers.mjs +11 -2
  127. package/dist/lib/server/decisioning/list-helpers.mjs.map +1 -1
  128. package/dist/lib/server/decisioning/manifest-helpers.d.mts +5 -3
  129. package/dist/lib/server/decisioning/manifest-helpers.d.ts +5 -3
  130. package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -1
  131. package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -1
  132. package/dist/lib/server/decisioning/manifest-helpers.mjs.map +1 -1
  133. package/dist/lib/server/decisioning/proposal/dispatch.d.mts +2 -2
  134. package/dist/lib/server/decisioning/proposal/dispatch.d.ts +2 -2
  135. package/dist/lib/server/decisioning/proposal/dispatch.d.ts.map +1 -1
  136. package/dist/lib/server/decisioning/proposal/dispatch.js.map +1 -1
  137. package/dist/lib/server/decisioning/proposal/dispatch.mjs.map +1 -1
  138. package/dist/lib/server/decisioning/proposal/index.d.mts +1 -1
  139. package/dist/lib/server/decisioning/proposal/index.d.ts +1 -1
  140. package/dist/lib/server/decisioning/proposal/index.d.ts.map +1 -1
  141. package/dist/lib/server/decisioning/proposal/index.js.map +1 -1
  142. package/dist/lib/server/decisioning/proposal/index.mjs.map +1 -1
  143. package/dist/lib/server/decisioning/proposal/lifecycle.d.mts +3 -2
  144. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts +3 -2
  145. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts.map +1 -1
  146. package/dist/lib/server/decisioning/proposal/lifecycle.js.map +1 -1
  147. package/dist/lib/server/decisioning/proposal/lifecycle.mjs.map +1 -1
  148. package/dist/lib/server/decisioning/proposal/mock-manager.d.mts +3 -3
  149. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts +3 -3
  150. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts.map +1 -1
  151. package/dist/lib/server/decisioning/proposal/mock-manager.js.map +1 -1
  152. package/dist/lib/server/decisioning/proposal/mock-manager.mjs.map +1 -1
  153. package/dist/lib/server/decisioning/proposal/types.d.mts +10 -6
  154. package/dist/lib/server/decisioning/proposal/types.d.ts +10 -6
  155. package/dist/lib/server/decisioning/proposal/types.d.ts.map +1 -1
  156. package/dist/lib/server/decisioning/proposal/types.js.map +1 -1
  157. package/dist/lib/server/decisioning/proposal/types.mjs.map +1 -1
  158. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +21 -2
  159. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +21 -2
  160. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  161. package/dist/lib/server/decisioning/runtime/from-platform.js +754 -81
  162. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  163. package/dist/lib/server/decisioning/runtime/from-platform.mjs +763 -81
  164. package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
  165. package/dist/lib/server/decisioning/specialisms/brand-rights.d.mts +9 -9
  166. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +9 -9
  167. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
  168. package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -1
  169. package/dist/lib/server/decisioning/specialisms/content-standards.d.mts +16 -16
  170. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts +16 -16
  171. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts.map +1 -1
  172. package/dist/lib/server/decisioning/specialisms/content-standards.js.map +1 -1
  173. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.mts +15 -13
  174. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +15 -13
  175. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
  176. package/dist/lib/server/decisioning/specialisms/creative-ad-server.js.map +1 -1
  177. package/dist/lib/server/decisioning/specialisms/creative.d.mts +12 -11
  178. package/dist/lib/server/decisioning/specialisms/creative.d.ts +12 -11
  179. package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
  180. package/dist/lib/server/decisioning/specialisms/creative.js.map +1 -1
  181. package/dist/lib/server/decisioning/specialisms/sales.d.mts +25 -15
  182. package/dist/lib/server/decisioning/specialisms/sales.d.ts +25 -15
  183. package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
  184. package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
  185. package/dist/lib/server/index.d.mts +3 -3
  186. package/dist/lib/server/index.d.ts +3 -3
  187. package/dist/lib/server/index.d.ts.map +1 -1
  188. package/dist/lib/server/index.js +72 -72
  189. package/dist/lib/server/index.js.map +1 -1
  190. package/dist/lib/server/index.mjs +36 -36
  191. package/dist/lib/server/index.mjs.map +1 -1
  192. package/dist/lib/server/legacy/v5/index.d.mts +1 -0
  193. package/dist/lib/server/legacy/v5/index.d.ts +1 -0
  194. package/dist/lib/server/legacy/v5/index.d.ts.map +1 -1
  195. package/dist/lib/server/legacy/v5/index.js +74 -1
  196. package/dist/lib/server/legacy/v5/index.js.map +1 -1
  197. package/dist/lib/server/legacy/v5/index.mjs +75 -1
  198. package/dist/lib/server/legacy/v5/index.mjs.map +1 -1
  199. package/dist/lib/server/responses.d.mts +2 -2
  200. package/dist/lib/server/responses.d.ts +2 -2
  201. package/dist/lib/server/responses.js.map +1 -1
  202. package/dist/lib/server/responses.mjs.map +1 -1
  203. package/dist/lib/testing/client.js +1 -1
  204. package/dist/lib/testing/client.js.map +1 -1
  205. package/dist/lib/testing/client.mjs +1 -1
  206. package/dist/lib/testing/client.mjs.map +1 -1
  207. package/dist/lib/testing/scenarios/brand-rights.js +6 -6
  208. package/dist/lib/testing/scenarios/brand-rights.js.map +1 -1
  209. package/dist/lib/testing/scenarios/brand-rights.mjs +6 -6
  210. package/dist/lib/testing/scenarios/brand-rights.mjs.map +1 -1
  211. package/dist/lib/testing/scenarios/creative.js +7 -7
  212. package/dist/lib/testing/scenarios/creative.js.map +1 -1
  213. package/dist/lib/testing/scenarios/creative.mjs +7 -7
  214. package/dist/lib/testing/scenarios/creative.mjs.map +1 -1
  215. package/dist/lib/testing/scenarios/discovery.js +2 -2
  216. package/dist/lib/testing/scenarios/discovery.js.map +1 -1
  217. package/dist/lib/testing/scenarios/discovery.mjs +2 -2
  218. package/dist/lib/testing/scenarios/discovery.mjs.map +1 -1
  219. package/dist/lib/testing/scenarios/edge-cases.js +11 -11
  220. package/dist/lib/testing/scenarios/edge-cases.js.map +1 -1
  221. package/dist/lib/testing/scenarios/edge-cases.mjs +11 -11
  222. package/dist/lib/testing/scenarios/edge-cases.mjs.map +1 -1
  223. package/dist/lib/testing/scenarios/governance.d.ts.map +1 -1
  224. package/dist/lib/testing/scenarios/governance.js +16 -22
  225. package/dist/lib/testing/scenarios/governance.js.map +1 -1
  226. package/dist/lib/testing/scenarios/governance.mjs +16 -22
  227. package/dist/lib/testing/scenarios/governance.mjs.map +1 -1
  228. package/dist/lib/testing/scenarios/media-buy.js +5 -5
  229. package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
  230. package/dist/lib/testing/scenarios/media-buy.mjs +5 -5
  231. package/dist/lib/testing/scenarios/media-buy.mjs.map +1 -1
  232. package/dist/lib/testing/scenarios/schema-compliance.js +1 -1
  233. package/dist/lib/testing/scenarios/schema-compliance.js.map +1 -1
  234. package/dist/lib/testing/scenarios/schema-compliance.mjs +1 -1
  235. package/dist/lib/testing/scenarios/schema-compliance.mjs.map +1 -1
  236. package/dist/lib/testing/scenarios/trusted-match.d.ts.map +1 -1
  237. package/dist/lib/testing/scenarios/trusted-match.js +4 -3
  238. package/dist/lib/testing/scenarios/trusted-match.js.map +1 -1
  239. package/dist/lib/testing/scenarios/trusted-match.mjs +4 -3
  240. package/dist/lib/testing/scenarios/trusted-match.mjs.map +1 -1
  241. package/dist/lib/testing/storyboard/shape-drift-hints.d.mts +3 -4
  242. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts +3 -4
  243. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts.map +1 -1
  244. package/dist/lib/testing/storyboard/shape-drift-hints.js +27 -27
  245. package/dist/lib/testing/storyboard/shape-drift-hints.js.map +1 -1
  246. package/dist/lib/testing/storyboard/shape-drift-hints.mjs +27 -27
  247. package/dist/lib/testing/storyboard/shape-drift-hints.mjs.map +1 -1
  248. package/dist/lib/testing/storyboard/task-map.d.ts.map +1 -1
  249. package/dist/lib/testing/storyboard/task-map.js +43 -5
  250. package/dist/lib/testing/storyboard/task-map.js.map +1 -1
  251. package/dist/lib/testing/storyboard/task-map.mjs +43 -5
  252. package/dist/lib/testing/storyboard/task-map.mjs.map +1 -1
  253. package/dist/lib/testing/test-helpers.d.mts +2 -2
  254. package/dist/lib/testing/test-helpers.d.ts +2 -2
  255. package/dist/lib/testing/test-helpers.js.map +1 -1
  256. package/dist/lib/testing/test-helpers.mjs.map +1 -1
  257. package/dist/lib/types/adcp.d.mts +14 -14
  258. package/dist/lib/types/adcp.d.ts +14 -14
  259. package/dist/lib/types/adcp.d.ts.map +1 -1
  260. package/dist/lib/types/adcp.js.map +1 -1
  261. package/dist/lib/types/adcp.mjs.map +1 -1
  262. package/dist/lib/types/index.d.mts +2 -2
  263. package/dist/lib/types/index.d.ts +2 -2
  264. package/dist/lib/types/index.d.ts.map +1 -1
  265. package/dist/lib/types/index.js.map +1 -1
  266. package/dist/lib/types/index.mjs.map +1 -1
  267. package/dist/lib/utils/capabilities.d.mts +6 -0
  268. package/dist/lib/utils/capabilities.d.ts +6 -0
  269. package/dist/lib/utils/capabilities.d.ts.map +1 -1
  270. package/dist/lib/utils/capabilities.js +4 -0
  271. package/dist/lib/utils/capabilities.js.map +1 -1
  272. package/dist/lib/utils/capabilities.mjs +4 -0
  273. package/dist/lib/utils/capabilities.mjs.map +1 -1
  274. package/dist/lib/utils/creative-delivery.d.mts +52 -10
  275. package/dist/lib/utils/creative-delivery.d.ts +52 -10
  276. package/dist/lib/utils/creative-delivery.d.ts.map +1 -1
  277. package/dist/lib/utils/creative-delivery.js +104 -9
  278. package/dist/lib/utils/creative-delivery.js.map +1 -1
  279. package/dist/lib/utils/creative-delivery.mjs +104 -8
  280. package/dist/lib/utils/creative-delivery.mjs.map +1 -1
  281. package/dist/lib/utils/format-assets.d.mts +41 -38
  282. package/dist/lib/utils/format-assets.d.ts +41 -38
  283. package/dist/lib/utils/format-assets.d.ts.map +1 -1
  284. package/dist/lib/utils/format-assets.js +3 -1
  285. package/dist/lib/utils/format-assets.js.map +1 -1
  286. package/dist/lib/utils/format-assets.mjs +3 -1
  287. package/dist/lib/utils/format-assets.mjs.map +1 -1
  288. package/dist/lib/utils/index.d.mts +8 -8
  289. package/dist/lib/utils/index.d.ts +8 -8
  290. package/dist/lib/utils/index.d.ts.map +1 -1
  291. package/dist/lib/utils/index.js +11 -9
  292. package/dist/lib/utils/index.js.map +1 -1
  293. package/dist/lib/utils/index.mjs +9 -8
  294. package/dist/lib/utils/index.mjs.map +1 -1
  295. package/dist/lib/utils/preview-utils.d.mts +11 -8
  296. package/dist/lib/utils/preview-utils.d.ts +11 -8
  297. package/dist/lib/utils/preview-utils.d.ts.map +1 -1
  298. package/dist/lib/utils/preview-utils.js +4 -4
  299. package/dist/lib/utils/preview-utils.js.map +1 -1
  300. package/dist/lib/utils/preview-utils.mjs +3 -3
  301. package/dist/lib/utils/preview-utils.mjs.map +1 -1
  302. package/dist/lib/utils/tool-request-schemas.d.mts +2 -2
  303. package/dist/lib/utils/tool-request-schemas.d.ts +2 -2
  304. package/dist/lib/v2/projection/aao-reference-formats.json +492 -0
  305. package/dist/lib/v2/projection/augment-response.d.mts +31 -11
  306. package/dist/lib/v2/projection/augment-response.d.ts +31 -11
  307. package/dist/lib/v2/projection/augment-response.d.ts.map +1 -1
  308. package/dist/lib/v2/projection/augment-response.js +233 -27
  309. package/dist/lib/v2/projection/augment-response.js.map +1 -1
  310. package/dist/lib/v2/projection/augment-response.mjs +232 -27
  311. package/dist/lib/v2/projection/augment-response.mjs.map +1 -1
  312. package/dist/lib/v2/projection/builders.d.mts +7 -6
  313. package/dist/lib/v2/projection/builders.d.ts +7 -6
  314. package/dist/lib/v2/projection/builders.d.ts.map +1 -1
  315. package/dist/lib/v2/projection/builders.js +11 -8
  316. package/dist/lib/v2/projection/builders.js.map +1 -1
  317. package/dist/lib/v2/projection/builders.mjs +9 -6
  318. package/dist/lib/v2/projection/builders.mjs.map +1 -1
  319. package/dist/lib/v2/projection/catalog-snapshot.d.mts +47 -0
  320. package/dist/lib/v2/projection/catalog-snapshot.d.ts +48 -0
  321. package/dist/lib/v2/projection/catalog-snapshot.d.ts.map +1 -0
  322. package/dist/lib/v2/projection/catalog-snapshot.js +291 -0
  323. package/dist/lib/v2/projection/catalog-snapshot.js.map +1 -0
  324. package/dist/lib/v2/projection/catalog-snapshot.mjs +265 -0
  325. package/dist/lib/v2/projection/catalog-snapshot.mjs.map +1 -0
  326. package/dist/lib/v2/projection/catalog.d.mts +23 -2
  327. package/dist/lib/v2/projection/catalog.d.ts +23 -2
  328. package/dist/lib/v2/projection/catalog.d.ts.map +1 -1
  329. package/dist/lib/v2/projection/catalog.js +34 -10
  330. package/dist/lib/v2/projection/catalog.js.map +1 -1
  331. package/dist/lib/v2/projection/catalog.mjs +33 -10
  332. package/dist/lib/v2/projection/catalog.mjs.map +1 -1
  333. package/dist/lib/v2/projection/creative-delivery.d.mts +157 -0
  334. package/dist/lib/v2/projection/creative-delivery.d.ts +158 -0
  335. package/dist/lib/v2/projection/creative-delivery.d.ts.map +1 -0
  336. package/dist/lib/v2/projection/creative-delivery.js +967 -0
  337. package/dist/lib/v2/projection/creative-delivery.js.map +1 -0
  338. package/dist/lib/v2/projection/creative-delivery.mjs +941 -0
  339. package/dist/lib/v2/projection/creative-delivery.mjs.map +1 -0
  340. package/dist/lib/v2/projection/index.d.mts +8 -6
  341. package/dist/lib/v2/projection/index.d.ts +8 -6
  342. package/dist/lib/v2/projection/index.d.ts.map +1 -1
  343. package/dist/lib/v2/projection/index.js +26 -4
  344. package/dist/lib/v2/projection/index.js.map +1 -1
  345. package/dist/lib/v2/projection/index.mjs +28 -4
  346. package/dist/lib/v2/projection/index.mjs.map +1 -1
  347. package/dist/lib/v2/projection/legacy-metadata.d.mts +21 -0
  348. package/dist/lib/v2/projection/legacy-metadata.d.ts +22 -0
  349. package/dist/lib/v2/projection/legacy-metadata.d.ts.map +1 -0
  350. package/dist/lib/v2/projection/legacy-metadata.js +73 -0
  351. package/dist/lib/v2/projection/legacy-metadata.js.map +1 -0
  352. package/dist/lib/v2/projection/legacy-metadata.mjs +45 -0
  353. package/dist/lib/v2/projection/legacy-metadata.mjs.map +1 -0
  354. package/dist/lib/v2/projection/types.d.mts +29 -23
  355. package/dist/lib/v2/projection/types.d.ts +29 -23
  356. package/dist/lib/v2/projection/types.d.ts.map +1 -1
  357. package/dist/lib/v2/projection/types.js.map +1 -1
  358. package/dist/lib/v2/projection/v1-to-v2.d.mts +29 -6
  359. package/dist/lib/v2/projection/v1-to-v2.d.ts +29 -6
  360. package/dist/lib/v2/projection/v1-to-v2.d.ts.map +1 -1
  361. package/dist/lib/v2/projection/v1-to-v2.js +218 -9
  362. package/dist/lib/v2/projection/v1-to-v2.js.map +1 -1
  363. package/dist/lib/v2/projection/v1-to-v2.mjs +219 -10
  364. package/dist/lib/v2/projection/v1-to-v2.mjs.map +1 -1
  365. package/dist/lib/v2/projection/v2-to-v1.d.mts +31 -2
  366. package/dist/lib/v2/projection/v2-to-v1.d.ts +31 -2
  367. package/dist/lib/v2/projection/v2-to-v1.d.ts.map +1 -1
  368. package/dist/lib/v2/projection/v2-to-v1.js +138 -7
  369. package/dist/lib/v2/projection/v2-to-v1.js.map +1 -1
  370. package/dist/lib/v2/projection/v2-to-v1.mjs +135 -6
  371. package/dist/lib/v2/projection/v2-to-v1.mjs.map +1 -1
  372. package/dist/lib/v2/projection/write-side.d.mts +12 -13
  373. package/dist/lib/v2/projection/write-side.d.ts +12 -13
  374. package/dist/lib/v2/projection/write-side.d.ts.map +1 -1
  375. package/dist/lib/v2/projection/write-side.js +16 -12
  376. package/dist/lib/v2/projection/write-side.js.map +1 -1
  377. package/dist/lib/v2/projection/write-side.mjs +16 -12
  378. package/dist/lib/v2/projection/write-side.mjs.map +1 -1
  379. package/dist/lib/version.d.mts +3 -3
  380. package/dist/lib/version.d.ts +3 -3
  381. package/dist/lib/version.d.ts.map +1 -1
  382. package/dist/lib/version.js +3 -3
  383. package/dist/lib/version.js.map +1 -1
  384. package/dist/lib/version.mjs +3 -3
  385. package/dist/lib/version.mjs.map +1 -1
  386. package/docs/guides/BUILD-AN-AGENT.md +7 -2
  387. package/docs/guides/PREVIEW-ASSET-DURABILITY.md +6 -2
  388. package/docs/llms.txt +1 -0
  389. package/examples/README.md +1 -1
  390. package/examples/batch-preview-test.ts +3 -3
  391. package/examples/conversation-client.ts +2 -2
  392. package/examples/debug-preview-response.ts +1 -1
  393. package/examples/decisioning-platform-broadcast-tv.ts +10 -4
  394. package/examples/decisioning-platform-mock-seller.ts +16 -9
  395. package/examples/decisioning-platform-programmatic.ts +18 -7
  396. package/examples/error-compliant-server.ts +26 -16
  397. package/examples/generative-creative-demo.ts +7 -19
  398. package/examples/hello_creative_adapter_ad_server.ts +37 -16
  399. package/examples/hello_creative_adapter_template.ts +12 -10
  400. package/examples/hello_seller_adapter_guaranteed.ts +52 -23
  401. package/examples/hello_seller_adapter_multi_tenant.ts +6 -3
  402. package/examples/hello_seller_adapter_non_guaranteed.ts +54 -26
  403. package/examples/hello_seller_adapter_proposal_mode.ts +40 -14
  404. package/examples/hello_seller_adapter_social.ts +2 -7
  405. package/examples/inspect-card-formats.ts +1 -1
  406. package/examples/simple-getting-started.ts +1 -1
  407. package/examples/test-helpers-demo.ts +1 -1
  408. package/package.json +2 -2
  409. package/skills/build-decisioning-creative-template/SKILL.md +11 -11
  410. package/skills/build-decisioning-platform/advanced/REFERENCE.md +8 -2
@@ -41,7 +41,7 @@ import {
41
41
  assertNoExampleTlds,
42
42
  type DecisioningPlatform,
43
43
  type CreativeBuilderPlatform,
44
- type BuildCreativeReturn,
44
+ type LegacyBuildCreativeReturn,
45
45
  type AccountStore,
46
46
  type Account,
47
47
  } from '@adcp/sdk/server';
@@ -55,13 +55,15 @@ import {
55
55
  urlRender,
56
56
  buildCreativeReturn,
57
57
  previewCreative,
58
- type Format,
59
- type ListCreativeFormatsResponse,
60
- type BuildCreativeRequest,
61
- type CreativeManifest,
62
- type PreviewCreativeRequest,
63
- type PreviewCreativeResponse,
64
58
  } from '@adcp/sdk';
59
+ import type {
60
+ Format,
61
+ ListCreativeFormatsResponse,
62
+ BuildCreativeRequest,
63
+ CreativeManifest,
64
+ PreviewCreativeRequest,
65
+ PreviewCreativeResponse,
66
+ } from '@adcp/sdk/types';
65
67
  import { randomUUID } from 'node:crypto';
66
68
 
67
69
  const UPSTREAM_URL = process.env['UPSTREAM_URL'] ?? 'http://127.0.0.1:4250';
@@ -410,7 +412,7 @@ class CreativeTemplateAdapter implements DecisioningPlatform<Record<string, neve
410
412
  };
411
413
 
412
414
  creative: CreativeBuilderPlatform<CreativeMeta> = defineCreativeBuilderPlatform<CreativeMeta>({
413
- listCreativeFormats: async (_req, ctx): Promise<ListCreativeFormatsResponse> => {
415
+ listCreativeFormatsLegacy: async (_req, ctx): Promise<ListCreativeFormatsResponse> => {
414
416
  // `list_creative_formats` is a no-account tool — `ctx.account` is
415
417
  // narrowed to `Account<TCtxMeta> | undefined`. The default
416
418
  // listing workspace fallback in `accounts.resolve(undefined)` ensures
@@ -424,7 +426,7 @@ class CreativeTemplateAdapter implements DecisioningPlatform<Record<string, neve
424
426
  return { status: 'completed', formats: templates.map(templateToFormat) };
425
427
  },
426
428
 
427
- buildCreative: async (req: BuildCreativeRequest, ctx): Promise<BuildCreativeReturn> => {
429
+ buildCreativeLegacy: async (req: BuildCreativeRequest, ctx): Promise<LegacyBuildCreativeReturn> => {
428
430
  const workspaceId = ctx.account.ctx_metadata.workspace_id;
429
431
 
430
432
  // Templates the workspace can render. Used to resolve the AdCP
@@ -472,7 +474,7 @@ class CreativeTemplateAdapter implements DecisioningPlatform<Record<string, neve
472
474
  return buildCreativeReturn.single(await buildOne(req.target_format_id, 0));
473
475
  },
474
476
 
475
- previewCreative: async (req: PreviewCreativeRequest, ctx): Promise<PreviewCreativeResponse> => {
477
+ previewCreativeLegacy: async (req: PreviewCreativeRequest, ctx): Promise<PreviewCreativeResponse> => {
476
478
  // `preview_creative` is a no-account tool — the wire request schema
477
479
  // doesn't carry `account`, so the framework types `ctx.account` as
478
480
  // `Account<TCtxMeta> | undefined` per the framework's `NoAccountCtx` narrow.
@@ -71,7 +71,7 @@ import {
71
71
  type DecisioningPlatform,
72
72
  type SalesCorePlatform,
73
73
  type SalesIngestionPlatform,
74
- type GetProductsPayload,
74
+ type GetProductsHandlerResult,
75
75
  type GetMediaBuyDeliveryPayload,
76
76
  type GetMediaBuysPayload,
77
77
  type AccountStore,
@@ -80,9 +80,8 @@ import {
80
80
  type SyncAccountsResultRow,
81
81
  } from '@adcp/sdk/server';
82
82
  import { buildGAMLikeRecipe, type GAMLikeRecipe } from '@adcp/sdk/mock-server';
83
+ import type { CanonicalProduct, GetProductsRequest } from '@adcp/sdk';
83
84
  import type {
84
- GetProductsRequest,
85
- GetProductsResponse,
86
85
  CreateMediaBuyRequest,
87
86
  CreateMediaBuySuccess,
88
87
  UpdateMediaBuyRequest,
@@ -92,15 +91,13 @@ import type {
92
91
  GetMediaBuyDeliveryResponse,
93
92
  } from '@adcp/sdk/types';
94
93
 
95
- // `Product` isn't re-exported from `@adcp/sdk/types` (#1254 in the rollup);
96
- // derive the shape from the response array.
97
- type Product = NonNullable<GetProductsResponse['products']>[number];
98
94
  type AdcpPackage = NonNullable<UpdateMediaBuySuccess['affected_packages']>[number];
99
95
 
100
96
  const UPSTREAM_URL = process.env['UPSTREAM_URL'] ?? 'http://127.0.0.1:4450';
101
97
  const UPSTREAM_API_KEY = process.env['UPSTREAM_API_KEY'] ?? 'mock_sales_guaranteed_key_do_not_use_in_prod';
102
98
  const PORT = Number(process.env['PORT'] ?? 3004);
103
99
  const ADCP_AUTH_TOKEN = process.env['ADCP_AUTH_TOKEN'] ?? 'sk_harness_do_not_use_in_prod';
100
+ const PUBLIC_AGENT_URL = process.env['PUBLIC_AGENT_URL'] ?? `http://127.0.0.1:${PORT}`;
104
101
  const DEFAULT_PRICING_OPTION_ID = 'cpm_guaranteed_fixed';
105
102
  // Test-kit principal for the `comply_controller_mode_gate` storyboard
106
103
  // (adcp#4028). The runner authenticates with this bearer to probe the
@@ -118,7 +115,6 @@ const DEFAULT_PRICING_OPTION_ID = 'cpm_guaranteed_fixed';
118
115
  // from a worked example.
119
116
  const ADCP_LIVE_MODE_AUTH_TOKEN = 'demo-acme-outdoor-live-v1';
120
117
  const LIVE_MODE_PROBE_PRINCIPAL = 'compliance-live-mode-probe' as const;
121
- const PUBLIC_AGENT_URL = process.env['PUBLIC_AGENT_URL'] ?? `http://127.0.0.1:${PORT}`;
122
118
 
123
119
  const KNOWN_PUBLISHERS = ['acmeoutdoor.example', 'pinnacle-agency.example', 'premium-sports.example'];
124
120
  assertNoExampleTlds(
@@ -447,8 +443,6 @@ interface NetworkMeta {
447
443
  [key: string]: unknown;
448
444
  }
449
445
 
450
- const FORMAT_AGENT_URL = PUBLIC_AGENT_URL;
451
-
452
446
  /** Project upstream product onto AdCP `Product`. The wire `Product` shape
453
447
  * has many optional fields; we populate only the ones the storyboard
454
448
  * validates plus the bare-minimum required spec fields. Production
@@ -462,9 +456,39 @@ const FORMAT_AGENT_URL = PUBLIC_AGENT_URL;
462
456
  * the `sales_guaranteed` storyboard; the recipe is opt-in carrier the
463
457
  * framework reads only when the buyer goes through proposal-mode.
464
458
  */
465
- function projectProduct(p: UpstreamProduct, publisherDomain: string): Product {
459
+ function canonicalFormatOptions(p: UpstreamProduct): CanonicalProduct['format_options'] {
460
+ const options = p.format_ids.map(id => {
461
+ const durationSeconds = id.match(/(?:^|_)(\d+)s(?:_|$)/)?.[1];
462
+ if (p.channel === 'video' || p.channel === 'ctv') {
463
+ return {
464
+ format_option_id: id,
465
+ format_kind: 'video_hosted' as const,
466
+ params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
467
+ };
468
+ }
469
+ if (p.channel === 'audio') {
470
+ return {
471
+ format_option_id: id,
472
+ format_kind: 'audio_hosted' as const,
473
+ params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
474
+ };
475
+ }
476
+ const dimensions = id.match(/(?:^|_)(\d+)x(\d+)(?:_|$)/);
477
+ return {
478
+ format_option_id: id,
479
+ format_kind: 'image' as const,
480
+ params: dimensions ? { width: Number(dimensions[1]), height: Number(dimensions[2]) } : {},
481
+ };
482
+ });
483
+ if (options.length === 0) {
484
+ throw new AdcpError('INVALID_REQUEST', { message: `product ${p.product_id} has no creative formats` });
485
+ }
486
+ return [options[0]!, ...options.slice(1)];
487
+ }
488
+
489
+ function projectProduct(p: UpstreamProduct, publisherDomain: string): CanonicalProduct {
466
490
  const recipe = buildGAMLikeRecipe(p);
467
- const product: Product = {
491
+ const product: CanonicalProduct = {
468
492
  product_id: p.product_id,
469
493
  name: p.name,
470
494
  description: `${p.name} — ${p.delivery_type} ${p.channel}`,
@@ -482,7 +506,7 @@ function projectProduct(p: UpstreamProduct, publisherDomain: string): Product {
482
506
  ? 'streaming_audio'
483
507
  : 'display',
484
508
  ],
485
- format_ids: p.format_ids.map(id => ({ agent_url: FORMAT_AGENT_URL, id })),
509
+ format_options: canonicalFormatOptions(p),
486
510
  delivery_type: p.delivery_type,
487
511
  pricing_options: [
488
512
  {
@@ -802,7 +826,7 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
802
826
  // level. See `decisioning.type-checks.ts` for the regression-locked
803
827
  // patterns.
804
828
  sales: SalesCorePlatform<NetworkMeta> & SalesIngestionPlatform<NetworkMeta> = {
805
- getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsPayload> => {
829
+ getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsHandlerResult> => {
806
830
  const networkCode = ctx.account.ctx_metadata.network_code;
807
831
  const publisherDomain = ctx.account.ctx_metadata.publisher_domain;
808
832
  // Storyboard sends buying_mode: 'brief' with a free-text brief —
@@ -819,10 +843,17 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
819
843
  // into `inventoryService` (catalog) + `forecastService.getDeliveryForecast`
820
844
  // (per-product forecast). Use the discrete `getForecast` below if
821
845
  // your backend can't fold forecast into the catalog response.
822
- const briefBudget = (req.filters?.budget_range as { max?: number } | undefined)?.max;
846
+ const filters = req['filters'] as
847
+ | {
848
+ budget_range?: { max?: number };
849
+ start_date?: string;
850
+ end_date?: string;
851
+ }
852
+ | undefined;
853
+ const briefBudget = filters?.budget_range?.max;
823
854
  const products = await upstream.listProducts(networkCode, {
824
- ...(req.filters?.start_date && { flightStart: req.filters.start_date }),
825
- ...(req.filters?.end_date && { flightEnd: req.filters.end_date }),
855
+ ...(filters?.start_date && { flightStart: filters.start_date }),
856
+ ...(filters?.end_date && { flightEnd: filters.end_date }),
826
857
  ...(briefBudget !== undefined && { budget: briefBudget }),
827
858
  });
828
859
  return {
@@ -1166,15 +1197,9 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
1166
1197
  const rows: SyncCreativesRow[] = [];
1167
1198
  for (const c of creatives) {
1168
1199
  try {
1169
- if (!c.format_id) {
1170
- throw new AdcpError('INVALID_REQUEST', {
1171
- message: 'format_id required on creative manifest',
1172
- field: 'format_id',
1173
- });
1174
- }
1175
1200
  const created = await upstream.createCreative(networkCode, {
1176
1201
  name: c.name,
1177
- format_id: c.format_id.id,
1202
+ format_id: c.format_kind,
1178
1203
  advertiser_id: networkCode,
1179
1204
  });
1180
1205
  rows.push({
@@ -1336,6 +1361,10 @@ serve(
1336
1361
  taskRegistry,
1337
1362
  idempotency: idempotencyStore,
1338
1363
  mediaBuyStore,
1364
+ canonicalFormatLegacyResolver: context => {
1365
+ if (context.source !== 'product' || !context.declaration.format_option_id) return undefined;
1366
+ return { agent_url: PUBLIC_AGENT_URL, id: context.declaration.format_option_id };
1367
+ },
1339
1368
  resolveSessionKey: ctx => {
1340
1369
  const acct = ctx.account as Account<NetworkMeta> | undefined;
1341
1370
  return acct?.id ?? 'anonymous';
@@ -806,7 +806,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
806
806
  };
807
807
  },
808
808
 
809
- getRights: async (req: GetRightsRequest, ctx): Promise<GetRightsSuccess> => {
809
+ getRightsLegacy: async (req: GetRightsRequest, ctx): Promise<GetRightsSuccess> => {
810
810
  const tenant = getTenant(ctx);
811
811
  const requestedUses = new Set(req.uses);
812
812
  const matches = Array.from(tenant.rights.values()).filter(r => {
@@ -833,7 +833,10 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
833
833
  };
834
834
  },
835
835
 
836
- acquireRights: async (req: AcquireRightsRequest, ctx): Promise<AcquireRightsAcquired | AcquireRightsRejected> => {
836
+ acquireRightsLegacy: async (
837
+ req: AcquireRightsRequest,
838
+ ctx
839
+ ): Promise<AcquireRightsAcquired | AcquireRightsRejected> => {
837
840
  const tenant = getTenant(ctx);
838
841
  const offering = tenant.rights.get(req.rights_id);
839
842
  if (!offering) {
@@ -916,7 +919,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
916
919
  };
917
920
  },
918
921
 
919
- updateRights: async (req: UpdateRightsRequest, _ctx): Promise<UpdateRightsSuccess> => {
922
+ updateRightsLegacy: async (req: UpdateRightsRequest, _ctx): Promise<UpdateRightsSuccess> => {
920
923
  // Hello adapter doesn't persist a grant ledger; production adopters
921
924
  // hydrate by `req.rights_id`, apply the patch (extend dates, adjust
922
925
  // impression cap, change pricing, pause/resume), and re-issue
@@ -67,20 +67,18 @@ import {
67
67
  type DecisioningPlatform,
68
68
  type SalesCorePlatform,
69
69
  type SalesIngestionPlatform,
70
- type GetProductsPayload,
70
+ type GetProductsHandlerResult,
71
71
  type GetMediaBuyDeliveryPayload,
72
72
  type GetMediaBuysPayload,
73
- type ListCreativeFormatsPayload,
73
+ type SalesLegacyListCreativeFormatsPayload,
74
74
  type AccountStore,
75
75
  type Account,
76
76
  type AdcpMediaBuyStatus,
77
77
  type SyncCreativesRow,
78
78
  type SyncAccountsResultRow,
79
79
  } from '@adcp/sdk/server';
80
- import { FormatAsset } from '@adcp/sdk';
80
+ import { FormatAsset, type CanonicalProduct, type GetProductsRequest } from '@adcp/sdk';
81
81
  import type {
82
- GetProductsRequest,
83
- GetProductsResponse,
84
82
  CreateMediaBuyRequest,
85
83
  CreateMediaBuySuccess,
86
84
  UpdateMediaBuyRequest,
@@ -90,8 +88,6 @@ import type {
90
88
  GetMediaBuyDeliveryResponse,
91
89
  } from '@adcp/sdk/types';
92
90
 
93
- // `Product` isn't re-exported from `@adcp/sdk/types`; derive from response.
94
- type Product = NonNullable<GetProductsResponse['products']>[number];
95
91
  type AdcpPackage = NonNullable<UpdateMediaBuySuccess['affected_packages']>[number];
96
92
  type ViewabilityMetrics = NonNullable<
97
93
  GetMediaBuyDeliveryResponse['media_buy_deliveries'][number]['totals']['viewability']
@@ -380,11 +376,41 @@ const toAdcpDateTime = (value: string, fallback: string): string => {
380
376
  /** Project upstream product onto AdCP `Product`. Auction-cleared inventory
381
377
  * surfaces `min_cpm` as `floor_price` when buyers request auction pricing,
382
378
  * while unfiltered protocol storyboards still get a fixed CPM option first. */
379
+ function canonicalFormatOptions(p: UpstreamProduct): CanonicalProduct['format_options'] {
380
+ const options = p.format_ids.map(id => {
381
+ const durationSeconds = id.match(/(?:^|_)(\d+)s(?:_|$)/)?.[1];
382
+ if (p.channel === 'video' || p.channel === 'ctv') {
383
+ return {
384
+ format_option_id: id,
385
+ format_kind: 'video_hosted' as const,
386
+ params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
387
+ };
388
+ }
389
+ if (p.channel === 'audio') {
390
+ return {
391
+ format_option_id: id,
392
+ format_kind: 'audio_hosted' as const,
393
+ params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
394
+ };
395
+ }
396
+ const dimensions = id.match(/(?:^|_)(\d+)x(\d+)(?:_|$)/);
397
+ return {
398
+ format_option_id: id,
399
+ format_kind: 'image' as const,
400
+ params: dimensions ? { width: Number(dimensions[1]), height: Number(dimensions[2]) } : {},
401
+ };
402
+ });
403
+ if (options.length === 0) {
404
+ throw new AdcpError('INVALID_REQUEST', { message: `product ${p.product_id} has no creative formats` });
405
+ }
406
+ return [options[0]!, ...options.slice(1)];
407
+ }
408
+
383
409
  function projectProduct(
384
410
  p: UpstreamProduct,
385
411
  publisherDomain: string,
386
412
  pricingMode: 'fixed' | 'auction' = 'fixed'
387
- ): Product {
413
+ ): CanonicalProduct {
388
414
  const auctionMidpoint = p.pricing.target_cpm ?? round2(p.pricing.min_cpm * 1.3);
389
415
  const pricingOption =
390
416
  pricingMode === 'auction'
@@ -421,7 +447,7 @@ function projectProduct(
421
447
  ? 'streaming_audio'
422
448
  : 'display',
423
449
  ],
424
- format_ids: p.format_ids.map(id => ({ agent_url: FORMAT_AGENT_URL, id })),
450
+ format_options: canonicalFormatOptions(p),
425
451
  delivery_type: 'non_guaranteed',
426
452
  pricing_options: [pricingOption],
427
453
  reporting_capabilities: {
@@ -638,20 +664,28 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
638
664
  // all-optional and `RequiredPlatformsFor<'sales-non-guaranteed'>` requires
639
665
  // the closed shape on the way out.
640
666
  sales: SalesCorePlatform<NetworkMeta> & SalesIngestionPlatform<NetworkMeta> = {
641
- getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsPayload> => {
667
+ getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsHandlerResult> => {
642
668
  const networkCode = ctx.account.ctx_metadata.network_code;
643
669
  const publisherDomain = ctx.account.ctx_metadata.publisher_domain;
644
670
  // When the buyer provides structured filters (flight dates, budget),
645
671
  // forward them so each product comes back with a per-query forecast.
646
672
  // Single upstream round-trip surfaces both the catalog and the
647
673
  // forecast curve.
648
- const briefBudget = (req.filters?.budget_range as { max?: number } | undefined)?.max;
674
+ const filters = req['filters'] as
675
+ | {
676
+ budget_range?: { max?: number };
677
+ start_date?: string;
678
+ end_date?: string;
679
+ is_fixed_price?: boolean;
680
+ }
681
+ | undefined;
682
+ const briefBudget = filters?.budget_range?.max;
649
683
  const products = await upstream.listProducts(networkCode, {
650
- ...(req.filters?.start_date && { flightStart: req.filters.start_date }),
651
- ...(req.filters?.end_date && { flightEnd: req.filters.end_date }),
684
+ ...(filters?.start_date && { flightStart: filters.start_date }),
685
+ ...(filters?.end_date && { flightEnd: filters.end_date }),
652
686
  ...(briefBudget !== undefined && { budget: briefBudget }),
653
687
  });
654
- const pricingMode = req.filters?.is_fixed_price === false ? 'auction' : 'fixed';
688
+ const pricingMode = filters?.is_fixed_price === false ? 'auction' : 'fixed';
655
689
  return {
656
690
  products: products.map(p => projectProduct(p, publisherDomain, pricingMode)),
657
691
  cache_scope: 'account',
@@ -1023,17 +1057,7 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
1023
1057
  const advertiserId = networkCode; // SWAP: same collapse caveat as createMediaBuy.
1024
1058
  const out: SyncCreativesRow[] = [];
1025
1059
  for (const c of creatives) {
1026
- const formatRef = (c as { format_id?: { id?: string } | string }).format_id;
1027
- const formatId = typeof formatRef === 'string' ? formatRef : formatRef?.id;
1028
- if (!formatId) {
1029
- out.push({
1030
- creative_id: (c as { creative_id?: string }).creative_id ?? 'unknown',
1031
- action: 'failed',
1032
- status: 'rejected',
1033
- errors: [{ code: 'CREATIVE_REJECTED', message: 'format_id is required' }],
1034
- });
1035
- continue;
1036
- }
1060
+ const formatId = c.format_kind;
1037
1061
  try {
1038
1062
  const creativeIdHint = (c as { creative_id?: string }).creative_id;
1039
1063
  const created = await upstream.createCreative(networkCode, {
@@ -1061,7 +1085,7 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
1061
1085
  return out;
1062
1086
  },
1063
1087
 
1064
- listCreativeFormats: async (_req, _ctx): Promise<ListCreativeFormatsPayload> => {
1088
+ listCreativeFormatsLegacy: async (_req, _ctx): Promise<SalesLegacyListCreativeFormatsPayload> => {
1065
1089
  // Publisher-owned format catalog. The mock doesn't have a discrete
1066
1090
  // formats endpoint (formats live inline on Product); production sellers
1067
1091
  // typically expose `/v1/formats` separately. SWAP: replace with your
@@ -1153,6 +1177,10 @@ serve(
1153
1177
  taskStore,
1154
1178
  idempotency: idempotencyStore,
1155
1179
  mediaBuyStore,
1180
+ canonicalFormatLegacyResolver: context => {
1181
+ if (context.source !== 'product' || !context.declaration.format_option_id) return undefined;
1182
+ return { agent_url: FORMAT_AGENT_URL, id: context.declaration.format_option_id };
1183
+ },
1156
1184
  resolveSessionKey: ctx => {
1157
1185
  const acct = ctx.account as Account<NetworkMeta> | undefined;
1158
1186
  return acct?.id ?? 'anonymous';
@@ -51,6 +51,7 @@ import {
51
51
  type ProposalManager,
52
52
  type SalesCorePlatform,
53
53
  } from '@adcp/sdk/server';
54
+ import type { CanonicalProduct, GetProductsRequest } from '@adcp/sdk';
54
55
  import { buildGAMLikeRecipe, GAM_LIKE_OVERLAP, type GAMLikeRecipe } from '@adcp/sdk/mock-server';
55
56
  import type {
56
57
  AccountReference,
@@ -60,16 +61,13 @@ import type {
60
61
  GetMediaBuyDeliveryResponse,
61
62
  GetMediaBuysRequest,
62
63
  GetMediaBuysResponse,
63
- GetProductsRequest,
64
64
  GetProductsResponse,
65
65
  UpdateMediaBuyRequest,
66
66
  UpdateMediaBuySuccess,
67
67
  } from '@adcp/sdk/types';
68
68
 
69
- // Wire `Product` and `Proposal` aren't directly re-exported from
70
- // `@adcp/sdk/types` derive from the response array (same pattern as
71
- // `hello_seller_adapter_guaranteed.ts`).
72
- type Product = NonNullable<GetProductsResponse['products']>[number];
69
+ // Proposal remains a generated wire type. Products use the SDK's canonical
70
+ // primary surface; legacy format IDs are projected only at the wire boundary.
73
71
  type Proposal = NonNullable<GetProductsResponse['proposals']>[number];
74
72
  type Package = CreateMediaBuySuccess['packages'][number];
75
73
 
@@ -274,13 +272,38 @@ const accounts: AccountStore<NetworkMeta> = {
274
272
  // recipes onto ctx.recipes for sales.createMediaBuy.
275
273
  // ---------------------------------------------------------------------------
276
274
 
277
- const FORMAT_AGENT_URL = PUBLIC_AGENT_URL;
275
+ function canonicalFormatOptions(p: UpstreamProduct): CanonicalProduct['format_options'] {
276
+ const options = p.format_ids.map(id => {
277
+ const durationSeconds = id.match(/(?:^|_)(\d+)s(?:_|$)/)?.[1];
278
+ if (p.channel === 'video' || p.channel === 'ctv') {
279
+ return {
280
+ format_option_id: id,
281
+ format_kind: 'video_hosted' as const,
282
+ params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
283
+ };
284
+ }
285
+ if (p.channel === 'audio') {
286
+ return {
287
+ format_option_id: id,
288
+ format_kind: 'audio_hosted' as const,
289
+ params: durationSeconds ? { duration_ms_exact: Number(durationSeconds) * 1_000 } : {},
290
+ };
291
+ }
292
+ const dimensions = id.match(/(?:^|_)(\d+)x(\d+)(?:_|$)/);
293
+ return {
294
+ format_option_id: id,
295
+ format_kind: 'image' as const,
296
+ params: dimensions ? { width: Number(dimensions[1]), height: Number(dimensions[2]) } : {},
297
+ };
298
+ });
299
+ if (options.length === 0) {
300
+ throw new AdcpError('INVALID_REQUEST', { message: `product ${p.product_id} has no creative formats` });
301
+ }
302
+ return [options[0]!, ...options.slice(1)];
303
+ }
278
304
 
279
- function projectProduct(p: UpstreamProduct, publisherDomain: string, recipe: GAMLikeRecipe): Product {
280
- // The wire `Product` shape doesn't enumerate `implementation_config`
281
- // — adapters attach it on the wire and the framework reads it back
282
- // via cast in the dispatch helpers. We do the same on the way out.
283
- const product: Product = {
305
+ function projectProduct(p: UpstreamProduct, publisherDomain: string, recipe: GAMLikeRecipe): CanonicalProduct {
306
+ const product: CanonicalProduct = {
284
307
  product_id: p.product_id,
285
308
  name: p.name,
286
309
  description: `${p.name} — ${p.delivery_type} ${p.channel}`,
@@ -294,7 +317,7 @@ function projectProduct(p: UpstreamProduct, publisherDomain: string, recipe: GAM
294
317
  ? 'streaming_audio'
295
318
  : 'display',
296
319
  ],
297
- format_ids: p.format_ids.map(id => ({ agent_url: FORMAT_AGENT_URL, id })),
320
+ format_options: canonicalFormatOptions(p),
298
321
  delivery_type: p.delivery_type,
299
322
  pricing_options: [
300
323
  {
@@ -314,8 +337,7 @@ function projectProduct(p: UpstreamProduct, publisherDomain: string, recipe: GAM
314
337
  date_range_support: 'date_range',
315
338
  },
316
339
  };
317
- // Attach the recipe via cast so strict TS doesn't reject the field
318
- // that's not in the generated `Product` interface.
340
+ // implementation_config is an adopter-private recipe carrier.
319
341
  (product as { implementation_config?: GAMLikeRecipe }).implementation_config = recipe;
320
342
  return product;
321
343
  }
@@ -627,6 +649,10 @@ serve(
627
649
  stateStore,
628
650
  mediaBuyStore,
629
651
  proposalStore,
652
+ canonicalFormatLegacyResolver: context => {
653
+ if (context.source !== 'product' || !context.declaration.format_option_id) return undefined;
654
+ return { agent_url: PUBLIC_AGENT_URL, id: context.declaration.format_option_id };
655
+ },
630
656
  resolveSessionKey: ctx => {
631
657
  const acct = ctx.account as Account<NetworkMeta> | undefined;
632
658
  return acct?.id ?? 'anonymous';
@@ -705,12 +705,6 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
705
705
  const rows: SyncCreativesRow[] = [];
706
706
  for (const c of creatives) {
707
707
  try {
708
- if (!c.format_id) {
709
- throw new AdcpError('INVALID_REQUEST', {
710
- message: 'format_id required on creative manifest',
711
- field: 'format_id',
712
- });
713
- }
714
708
  // Project AdCP `CreativeAsset.assets` (the asset map keyed by
715
709
  // asset_id) onto the upstream native creative shape. Asset values
716
710
  // carry an `asset_type` discriminator; we read the typed sub-shapes
@@ -722,11 +716,12 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
722
716
  const landingPageUrl =
723
717
  readUrl(assets['click_url']) ?? readUrl(assets['landing_page']) ?? 'https://example.com';
724
718
  const mediaUrl = readUrl(assets['image']) ?? readUrl(assets['video']) ?? 'https://example.com/asset';
719
+ const upstreamFormatId = c.format_kind === 'native_in_feed' ? 'native_feed' : c.format_kind;
725
720
 
726
721
  const created = await upstream.createCreative(advertiserId, {
727
722
  creative_id: c.creative_id,
728
723
  name: c.name,
729
- format_id: c.format_id.id,
724
+ format_id: upstreamFormatId,
730
725
  primary_text: primaryText,
731
726
  landing_page_url: landingPageUrl,
732
727
  media_url: mediaUrl,
@@ -29,7 +29,7 @@ async function main() {
29
29
 
30
30
  // List all formats
31
31
  console.log('📋 Fetching all creative formats...');
32
- const result = await creativeAgent.listCreativeFormats({});
32
+ const result = await creativeAgent.listCreativeFormatsLegacy({});
33
33
 
34
34
  if (!result.success || !result.data) {
35
35
  console.error('❌ Failed to fetch formats:', result.error);
@@ -161,7 +161,7 @@ async function campaignWorkflow() {
161
161
 
162
162
  // Step 2: Check available creative formats
163
163
  console.log('\n2️⃣ Checking creative format options...');
164
- const formats = await agent.listCreativeFormats(
164
+ const formats = await agent.listCreativeFormatsLegacy(
165
165
  {
166
166
  type: 'video',
167
167
  },
@@ -180,7 +180,7 @@ async function variousOperations() {
180
180
 
181
181
  // List creative formats
182
182
  console.log('2. Listing creative formats...');
183
- const formats = await testAgent.listCreativeFormats({});
183
+ const formats = await testAgent.listCreativeFormatsLegacy({});
184
184
  console.log(` ${formats.success ? '✅' : '❌'} Formats: ${formats.data.formats?.length || 0}`);
185
185
 
186
186
  // Create a media buy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adcp/sdk",
3
- "version": "12.1.1",
3
+ "version": "13.0.0-rc.0",
4
4
  "description": "AdCP SDK — client, server, and compliance harnesses for the AdContext Protocol (MCP + A2A)",
5
5
  "workspaces": [
6
6
  ".",
@@ -568,7 +568,7 @@
568
568
  "email": "bugs@adcontextprotocol.org"
569
569
  },
570
570
  "dependencies": {
571
- "@modelcontextprotocol/client": "2.0.0-beta.4",
571
+ "@modelcontextprotocol/client": "2.0.0-beta.5",
572
572
  "@modelcontextprotocol/node": "2.0.0-beta.4",
573
573
  "@modelcontextprotocol/server": "2.0.0-beta.4",
574
574
  "@types/ws": "^8.18.1",
@@ -104,7 +104,7 @@ class WatermarkPlatform implements DecisioningPlatform<WatermarkConfig, Watermar
104
104
 
105
105
  creative: CreativeBuilderPlatform<WatermarkMeta> = {
106
106
  /** Sync transform — fast operation, return result immediately. */
107
- buildCreative: async (req: BuildCreativeRequest): Promise<CreativeManifest> => {
107
+ buildCreativeLegacy: async (req: BuildCreativeRequest): Promise<CreativeManifest> => {
108
108
  // requireAsset throws AdcpError with field path if missing/wrong type.
109
109
  // After the call, TS narrows `source` to `ImageAsset` — no cast needed.
110
110
  const source = requireAsset(req.creative_manifest, 'source_image', 'image');
@@ -132,7 +132,7 @@ class WatermarkPlatform implements DecisioningPlatform<WatermarkConfig, Watermar
132
132
  },
133
133
 
134
134
  /** Always sync — preview is just a sandbox URL. */
135
- previewCreative: async (req: PreviewCreativeRequest): Promise<PreviewCreativeResponse> => {
135
+ previewCreativeLegacy: async (req: PreviewCreativeRequest): Promise<PreviewCreativeResponse> => {
136
136
  // Soft-form helper — preview is best-effort even if source is missing.
137
137
  const source = getAsset(req.creative_manifest, 'source_image', 'image');
138
138
  const sourceUrl = source?.url ?? '';
@@ -228,17 +228,17 @@ return {
228
228
 
229
229
  `CreativeBuilderPlatform` has 5 method slots. **For each method-pair you implement EXACTLY ONE — sync OR `*Task`** — `validatePlatform()` will throw at construction if you provide both.
230
230
 
231
- | Slot | Sync variant | HITL `*Task` variant | Required? |
232
- | ---------------- | ------------------------------- | ------------------------------------------- | ------------ |
233
- | build creative | `buildCreative(req, ctx)` | `buildCreativeTask(taskId, req, ctx)` | One required |
234
- | preview creative | `previewCreative(req, ctx)` | — (always sync) | Required |
235
- | sync creatives | `syncCreatives(creatives, ctx)` | `syncCreativesTask(taskId, creatives, ctx)` | One required |
231
+ | Slot | Sync variant | HITL `*Task` variant | Required? |
232
+ | ---------------- | --------------------------------- | ------------------------------------------- | ------------ |
233
+ | build creative | `buildCreativeLegacy(req, ctx)` | `buildCreativeTask(taskId, req, ctx)` | One required |
234
+ | preview creative | `previewCreativeLegacy(req, ctx)` | — (always sync) | Required |
235
+ | sync creatives | `syncCreatives(creatives, ctx)` | `syncCreativesTask(taskId, creatives, ctx)` | One required |
236
236
 
237
237
  ### Sync vs `*Task` — pick by latency, not by preference
238
238
 
239
239
  | Your operation typically takes... | Pick |
240
240
  | ----------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
241
- | Under ~5 seconds (image manipulation, simple template fill) | **Sync** (`buildCreative`) |
241
+ | Under ~5 seconds (image manipulation, simple template fill) | **Sync** (`buildCreativeLegacy`) |
242
242
  | 10-60 seconds (TTS, audio mixing, video transcode) | **Sync** is fine — buyer awaits in the request |
243
243
  | 1-30 minutes (heavy generation, multi-pass rendering) | **HITL** (`buildCreativeTask`) — buyer immediately gets a `submitted` envelope with `task_id` |
244
244
  | Unknown / variable | Pick sync; switch to `*Task` only if observed latency > 30s |
@@ -310,7 +310,7 @@ Both helpers preserve the discriminator narrowing — `script.content` types cor
310
310
  Every method either returns its success type OR throws `AdcpError` for structured rejection. Generic thrown errors map to `SERVICE_UNAVAILABLE` with `recovery: 'transient'`.
311
311
 
312
312
  ```ts
313
- buildCreative: async req => {
313
+ buildCreativeLegacy: async req => {
314
314
  if (!req.format_id?.id?.startsWith('image_')) {
315
315
  throw new AdcpError('UNSUPPORTED_FEATURE', {
316
316
  recovery: 'terminal',
@@ -352,7 +352,7 @@ The framework consumes `idempotency_key` on every mutating request before dispat
352
352
  What you SHOULD do: pass `req.idempotency_key` to your upstream API's idempotency parameter when you call into GAM / Snap / Meta / your internal services. That makes the dedupe story end-to-end — if the AdCP layer dedupes a request, your upstream platform won't double-charge a CPM either.
353
353
 
354
354
  ```ts
355
- buildCreative: async req => {
355
+ buildCreativeLegacy: async req => {
356
356
  // Framework already deduped for the (idempotency_key, account) pair.
357
357
  // Thread the same key into the upstream call so YOUR platform's API
358
358
  // also dedupes if the same key arrives twice (defensive).
@@ -489,7 +489,7 @@ For HITL platforms, `server.awaitTask(taskId)` settles the background promise; `
489
489
 
490
490
  ❌ **Don't use `ctx.runAsync(...)` or `ctx.startTask(...)`.** The async story is dual-method (`xxx` vs `xxxTask`), period.
491
491
 
492
- ❌ **Don't define both `buildCreative` and `buildCreativeTask`.** `validatePlatform()` will throw with a clear diagnostic. Pick one.
492
+ ❌ **Don't define both `buildCreativeLegacy` and `buildCreativeTask`.** `validatePlatform()` will throw with a clear diagnostic. Pick one.
493
493
 
494
494
  ❌ **Don't return error envelopes manually.** Throw `AdcpError`; the framework projects to the wire shape.
495
495