@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
@@ -54,8 +54,11 @@ import {
54
54
  createSelfSignedTenantKey,
55
55
  createNoopJwksValidator
56
56
  } from "./tenant-registry.mjs";
57
- import { getAsset, requireAsset } from "./manifest-helpers.mjs";
58
- import { buildListCreativesResponse } from "./list-helpers.mjs";
57
+ import { getAsset, getAssetSlot, requireAsset } from "./manifest-helpers.mjs";
58
+ import {
59
+ buildListCreativesResponse,
60
+ buildListCreativesResponseLegacy
61
+ } from "./list-helpers.mjs";
59
62
  import { resolveStartTime } from "./start-time.mjs";
60
63
  import {
61
64
  createTenantAdminRouter,
@@ -96,7 +99,7 @@ import {
96
99
  releaseProposalReservation,
97
100
  maybeHydrateRecipesForMediaBuyId
98
101
  } from "./proposal/index.mjs";
99
- import { buildProduct, buildPricingOption, buildPackage } from "./assembly-helpers.mjs";
102
+ import { buildProduct, buildProductLegacy, buildPricingOption, buildPackage } from "./assembly-helpers.mjs";
100
103
  export {
101
104
  AccountNotFoundError,
102
105
  AdcpError,
@@ -128,9 +131,11 @@ export {
128
131
  UnsupportedFeatureError,
129
132
  batchPoll,
130
133
  buildListCreativesResponse,
134
+ buildListCreativesResponseLegacy,
131
135
  buildPackage,
132
136
  buildPricingOption,
133
137
  buildProduct,
138
+ buildProductLegacy,
134
139
  composeMethod,
135
140
  createAdcpServerFromPlatform,
136
141
  createDefaultJwksValidator,
@@ -163,6 +168,7 @@ export {
163
168
  finalizeProposalConsumption,
164
169
  getAllAdcpMigrations,
165
170
  getAsset,
171
+ getAssetSlot,
166
172
  getDecisioningTaskRegistryMigration,
167
173
  getStatusChangeBus,
168
174
  identityStatusMappers,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n BuildCreativeReturn,\n BuildCreativePayload,\n BuildCreativeMultiPayload,\n PreviewCreativePayload as CreativePreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n BuildCreativeReturn as CreativeAdServerBuildCreativeReturn,\n BuildCreativePayload as CreativeAdServerBuildCreativePayload,\n BuildCreativeMultiPayload as CreativeAdServerBuildCreativeMultiPayload,\n PreviewCreativePayload as CreativeAdServerPreviewCreativePayload,\n ListCreativeFormatsPayload as CreativeAdServerListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n ListContentStandardsPayload,\n GetContentStandardsPayload,\n CreateContentStandardsPayload,\n UpdateContentStandardsPayload,\n CalibrateContentPayload,\n ValidateContentDeliveryPayload,\n GetMediaBuyArtifactsPayload,\n GetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n GetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n UpdateMediaBuyHandlerResult,\n GetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n ListCreativeFormatsPayload,\n ListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n GetRightsPayload,\n AcquireRightsAcquiredPayload,\n AcquireRightsPendingApprovalPayload,\n AcquireRightsRejectedPayload,\n AcquireRightsPayload,\n UpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest,\n GetRightsSuccess,\n AcquireRightsRequest,\n AcquireRightsAcquired,\n AcquireRightsPendingApproval,\n AcquireRightsRejected,\n AcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, requireAsset } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport { buildListCreativesResponse, type BuildListCreativesResponseOpts } from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Wire-shape assembly helpers — emit correct Product / PricingOption /\n// package shapes from intent-shaped input. Reduces 30+ lines of wire\n// boilerplate per resource. Used in slim skill examples so LLMs scaffold\n// correct shapes from first attempt.\nexport { buildProduct, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type { BuildProductInput, BuildPricingOptionInput, BuildPackageInput } from './assembly-helpers';\n"],"mappings":"AAsBA,SAAmD,iBAAiB;AAQpE;AAAA,EACE;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,OACK;AAUP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAWP,SAAS,4BAA4B,sCAAsC;AA8B3E,SAAS,sBAAsB,oBAAoB;AAMnD,SAAS,mBAAmB,wBAAwB;AAsBpD,SAAS,0BAA0B;AAInC,SAAS,6BAA6B;AAkBtC,SAAS,qBAAqB;AAM9B,SAAS,qBAAqB,wBAAwB,uBAAuB;AAuJ7E;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AACP,SAAS,qBAAqB,wBAAwB;AACtD;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAKP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AAKP,SAAS,UAAU,oBAAoB;AAIvC,SAAS,kCAAuE;AAIhF,SAAS,wBAAsD;AAI/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAIP,SAAS,WAAW,iBAAiB,qBAAqB;AAW1D;AAAA,EACE;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,OACK;AAoBP;AAAA,EACE;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,OACK;AAOP,SAAS,cAAc,oBAAoB,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n LegacyBuildCreativeReturn,\n LegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n LegacyBuildCreativeReturn as CreativeAdServerLegacyBuildCreativeReturn,\n LegacyBuildCreativePayload as CreativeAdServerLegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload as CreativeAdServerLegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload as CreativeAdServerLegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload as CreativeAdServerLegacyListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n LegacyGetCreativeDeliveryPayload as CreativeAdServerLegacyGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n LegacyListContentStandardsPayload,\n LegacyGetContentStandardsPayload,\n LegacyCreateContentStandardsPayload,\n LegacyUpdateContentStandardsPayload,\n LegacyCalibrateContentPayload,\n LegacyValidateContentDeliveryPayload,\n LegacyGetMediaBuyArtifactsPayload,\n LegacyGetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n GetProductsPayload,\n LegacyGetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n LegacyCreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n LegacyUpdateMediaBuyPayload,\n UpdateMediaBuyHandlerResult,\n GetMediaBuyDeliveryPayload,\n LegacyGetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n LegacyGetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload,\n ListCreativesPayload,\n LegacyListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n LegacyGetRightsPayload,\n LegacyAcquireRightsAcquiredPayload,\n LegacyAcquireRightsPendingApprovalPayload,\n LegacyAcquireRightsRejectedPayload,\n LegacyAcquireRightsPayload,\n LegacyUpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest as LegacyGetRightsRequest,\n GetRightsSuccess as LegacyGetRightsSuccess,\n AcquireRightsRequest as LegacyAcquireRightsRequest,\n AcquireRightsAcquired as LegacyAcquireRightsAcquired,\n AcquireRightsPendingApproval as LegacyAcquireRightsPendingApproval,\n AcquireRightsRejected as LegacyAcquireRightsRejected,\n AcquireRightsError as LegacyAcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type LegacyDecisioningHandlerGroups,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, getAssetSlot, requireAsset } from './manifest-helpers';\nexport type { CreativeAssetsContainer } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport {\n buildListCreativesResponse,\n buildListCreativesResponseLegacy,\n type BuildListCreativesResponseOpts,\n type BuildListCreativesResponseLegacyOpts,\n} from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalGetProductsPayload,\n LegacyProposalGetProductsPayload,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Canonical assembly helpers — emit Product / PricingOption / package shapes\n// from intent-shaped input. Raw named-format product assembly is available\n// only through the explicit buildProductLegacy compatibility helper.\nexport { buildProduct, buildProductLegacy, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type {\n BuildProductInput,\n BuildProductLegacyInput,\n BuildPricingOptionInput,\n BuildPackageInput,\n} from './assembly-helpers';\n"],"mappings":"AAsBA,SAAmD,iBAAiB;AAQpE;AAAA,EACE;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,OACK;AAUP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAWP,SAAS,4BAA4B,sCAAsC;AA8B3E,SAAS,sBAAsB,oBAAoB;AAMnD,SAAS,mBAAmB,wBAAwB;AAsBpD,SAAS,0BAA0B;AAInC,SAAS,6BAA6B;AAkBtC,SAAS,qBAAqB;AAM9B,SAAS,qBAAqB,wBAAwB,uBAAuB;AA+J7E;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP,SAAS,qBAAqB,wBAAwB;AACtD;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAKP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AAKP,SAAS,UAAU,cAAc,oBAAoB;AAKrD;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAIP,SAAS,wBAAsD;AAI/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAIP,SAAS,WAAW,iBAAiB,qBAAqB;AAW1D;AAAA,EACE;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,OACK;AAsBP;AAAA,EACE;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,OACK;AAMP,SAAS,cAAc,oBAAoB,oBAAoB,oBAAoB;","names":[]}
@@ -18,11 +18,12 @@
18
18
  */
19
19
  import type { ListCreativesRequest, ListCreativesResponse, PaginationResponse } from '../../types/tools.generated.mjs';
20
20
  import type { ServerPayload } from '../../types/server-payload.mjs';
21
+ import type { CanonicalListCreativesRequest, CanonicalListCreativesResponse } from '../../v2/projection/creative-delivery.mjs';
21
22
  export interface BuildListCreativesResponseOpts {
22
23
  /** Original request — used to surface `filters_applied` + `sort_applied` summaries. */
23
- request: ListCreativesRequest;
24
+ request: CanonicalListCreativesRequest;
24
25
  /** The page of creative rows. Length determines `query_summary.returned`. */
25
- creatives: ServerPayload<ListCreativesResponse>['creatives'];
26
+ creatives: ServerPayload<CanonicalListCreativesResponse>['creatives'];
26
27
  /** Pagination cursor for the next page. Required — pass `{ has_more: false }` when this is the last page. */
27
28
  pagination: PaginationResponse;
28
29
  /**
@@ -33,6 +34,13 @@ export interface BuildListCreativesResponseOpts {
33
34
  */
34
35
  totalMatching?: number;
35
36
  }
37
+ /** @deprecated Explicit compatibility input for legacy `format_id` rows and filters. */
38
+ export interface BuildListCreativesResponseLegacyOpts {
39
+ request: ListCreativesRequest;
40
+ creatives: ServerPayload<ListCreativesResponse>['creatives'];
41
+ pagination: PaginationResponse;
42
+ totalMatching?: number;
43
+ }
36
44
  /**
37
45
  * Build a `ListCreativesResponse` from a row array + pagination + the
38
46
  * original request. Computes `query_summary.filters_applied` from
@@ -50,4 +58,6 @@ export interface BuildListCreativesResponseOpts {
50
58
  * }
51
59
  * ```
52
60
  */
53
- export declare function buildListCreativesResponse(opts: BuildListCreativesResponseOpts): ServerPayload<ListCreativesResponse>;
61
+ export declare function buildListCreativesResponse(opts: BuildListCreativesResponseOpts): ServerPayload<CanonicalListCreativesResponse>;
62
+ /** @deprecated Use `buildListCreativesResponse` with canonical creative rows. */
63
+ export declare function buildListCreativesResponseLegacy(opts: BuildListCreativesResponseLegacyOpts): ServerPayload<ListCreativesResponse>;
@@ -18,11 +18,12 @@
18
18
  */
19
19
  import type { ListCreativesRequest, ListCreativesResponse, PaginationResponse } from '../../types/tools.generated';
20
20
  import type { ServerPayload } from '../../types/server-payload';
21
+ import type { CanonicalListCreativesRequest, CanonicalListCreativesResponse } from '../../v2/projection/creative-delivery';
21
22
  export interface BuildListCreativesResponseOpts {
22
23
  /** Original request — used to surface `filters_applied` + `sort_applied` summaries. */
23
- request: ListCreativesRequest;
24
+ request: CanonicalListCreativesRequest;
24
25
  /** The page of creative rows. Length determines `query_summary.returned`. */
25
- creatives: ServerPayload<ListCreativesResponse>['creatives'];
26
+ creatives: ServerPayload<CanonicalListCreativesResponse>['creatives'];
26
27
  /** Pagination cursor for the next page. Required — pass `{ has_more: false }` when this is the last page. */
27
28
  pagination: PaginationResponse;
28
29
  /**
@@ -33,6 +34,13 @@ export interface BuildListCreativesResponseOpts {
33
34
  */
34
35
  totalMatching?: number;
35
36
  }
37
+ /** @deprecated Explicit compatibility input for legacy `format_id` rows and filters. */
38
+ export interface BuildListCreativesResponseLegacyOpts {
39
+ request: ListCreativesRequest;
40
+ creatives: ServerPayload<ListCreativesResponse>['creatives'];
41
+ pagination: PaginationResponse;
42
+ totalMatching?: number;
43
+ }
36
44
  /**
37
45
  * Build a `ListCreativesResponse` from a row array + pagination + the
38
46
  * original request. Computes `query_summary.filters_applied` from
@@ -50,5 +58,7 @@ export interface BuildListCreativesResponseOpts {
50
58
  * }
51
59
  * ```
52
60
  */
53
- export declare function buildListCreativesResponse(opts: BuildListCreativesResponseOpts): ServerPayload<ListCreativesResponse>;
61
+ export declare function buildListCreativesResponse(opts: BuildListCreativesResponseOpts): ServerPayload<CanonicalListCreativesResponse>;
62
+ /** @deprecated Use `buildListCreativesResponse` with canonical creative rows. */
63
+ export declare function buildListCreativesResponseLegacy(opts: BuildListCreativesResponseLegacyOpts): ServerPayload<ListCreativesResponse>;
54
64
  //# sourceMappingURL=list-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/list-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;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;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,8BAA8B,GACnC,aAAa,CAAC,8BAA8B,CAAC,CAE/C;AAED,iFAAiF;AACjF,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,oCAAoC,GACzC,aAAa,CAAC,qBAAqB,CAAC,CAEtC"}
@@ -18,10 +18,17 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var list_helpers_exports = {};
20
20
  __export(list_helpers_exports, {
21
- buildListCreativesResponse: () => buildListCreativesResponse
21
+ buildListCreativesResponse: () => buildListCreativesResponse,
22
+ buildListCreativesResponseLegacy: () => buildListCreativesResponseLegacy
22
23
  });
23
24
  module.exports = __toCommonJS(list_helpers_exports);
24
25
  function buildListCreativesResponse(opts) {
26
+ return buildListCreativesResponseBase(opts, false);
27
+ }
28
+ function buildListCreativesResponseLegacy(opts) {
29
+ return buildListCreativesResponseBase(opts, true);
30
+ }
31
+ function buildListCreativesResponseBase(opts, includeLegacyFormatFilter) {
25
32
  const { request, creatives, pagination, totalMatching } = opts;
26
33
  const filters = request.filters;
27
34
  const filtersApplied = [];
@@ -41,7 +48,9 @@ function buildListCreativesResponse(opts) {
41
48
  if (filters.unassigned !== void 0) filtersApplied.push("unassigned");
42
49
  if (filters.has_served !== void 0) filtersApplied.push("has_served");
43
50
  if (filters.concept_ids?.length) filtersApplied.push("concept_ids");
44
- if (filters.format_ids?.length) filtersApplied.push("format_ids");
51
+ if (includeLegacyFormatFilter && "format_ids" in filters && Array.isArray(filters.format_ids) && filters.format_ids.length > 0) {
52
+ filtersApplied.push("format_ids");
53
+ }
45
54
  if (filters.has_variables !== void 0) filtersApplied.push("has_variables");
46
55
  }
47
56
  const summary = {
@@ -63,6 +72,7 @@ function buildListCreativesResponse(opts) {
63
72
  }
64
73
  // Annotate the CommonJS export names for ESM import in node:
65
74
  0 && (module.exports = {
66
- buildListCreativesResponse
75
+ buildListCreativesResponse,
76
+ buildListCreativesResponseLegacy
67
77
  });
68
78
  //# sourceMappingURL=list-helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/server/decisioning/list-helpers.ts"],"sourcesContent":["/**\n * Helpers for building paginated list responses.\n *\n * `list_creatives` is the heaviest of the read tools: its response wraps the\n * row array in `query_summary` (`total_matching`, `returned`, `filters_applied`,\n * `sort_applied`) AND `pagination` (`has_more`, `cursor`, `total_count`).\n * Adopters writing the wrapper by hand re-derive the same fields per call;\n * this helper threads a row array + pagination cursor + the original request\n * into the wire shape.\n *\n * `list_property_lists`, `list_collection_lists`, and other governance reads\n * use a simpler `{ lists: [...] }` wrapper that the framework's response\n * builders already cover — those don't need a row helper.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { ListCreativesRequest, ListCreativesResponse, PaginationResponse } from '../../types/tools.generated';\nimport type { ServerPayload } from '../../types/server-payload';\n\nexport interface BuildListCreativesResponseOpts {\n /** Original request — used to surface `filters_applied` + `sort_applied` summaries. */\n request: ListCreativesRequest;\n /** The page of creative rows. Length determines `query_summary.returned`. */\n creatives: ServerPayload<ListCreativesResponse>['creatives'];\n /** Pagination cursor for the next page. Required — pass `{ has_more: false }` when this is the last page. */\n pagination: PaginationResponse;\n /**\n * Total count across all pages. When omitted, defaults to\n * `pagination.total_count` if present, else `creatives.length` (last-page\n * approximation). Set explicitly when your backend can compute the true\n * total.\n */\n totalMatching?: number;\n}\n\n/**\n * Build a `ListCreativesResponse` from a row array + pagination + the\n * original request. Computes `query_summary.filters_applied` from\n * `request.filters` and threads `request.sort` into `sort_applied`.\n *\n * ```ts\n * listCreatives: async (req, ctx) => {\n * const rows = await this.db.queryCreatives(req);\n * const cursor = rows.length === req.pagination?.limit ? this.nextCursor(rows) : undefined;\n * return buildListCreativesResponse({\n * request: req,\n * creatives: rows,\n * pagination: { has_more: cursor != null, cursor, total_count: rows.totalCount },\n * });\n * }\n * ```\n */\nexport function buildListCreativesResponse(opts: BuildListCreativesResponseOpts): ServerPayload<ListCreativesResponse> {\n const { request, creatives, pagination, totalMatching } = opts;\n\n const filters = request.filters;\n const filtersApplied: string[] = [];\n if (filters) {\n if (filters.accounts?.length) filtersApplied.push('accounts');\n if (filters.statuses?.length) filtersApplied.push('statuses');\n if (filters.tags?.length) filtersApplied.push('tags');\n if (filters.tags_any?.length) filtersApplied.push('tags_any');\n if (filters.name_contains) filtersApplied.push('name_contains');\n if (filters.creative_ids?.length) filtersApplied.push('creative_ids');\n if (filters.created_after) filtersApplied.push('created_after');\n if (filters.created_before) filtersApplied.push('created_before');\n if (filters.updated_after) filtersApplied.push('updated_after');\n if (filters.updated_before) filtersApplied.push('updated_before');\n if (filters.assigned_to_packages?.length) filtersApplied.push('assigned_to_packages');\n if (filters.media_buy_ids?.length) filtersApplied.push('media_buy_ids');\n if (filters.unassigned !== undefined) filtersApplied.push('unassigned');\n if (filters.has_served !== undefined) filtersApplied.push('has_served');\n if (filters.concept_ids?.length) filtersApplied.push('concept_ids');\n if (filters.format_ids?.length) filtersApplied.push('format_ids');\n if (filters.has_variables !== undefined) filtersApplied.push('has_variables');\n }\n\n const summary: ServerPayload<ListCreativesResponse>['query_summary'] = {\n total_matching: totalMatching ?? pagination.total_count ?? creatives.length,\n returned: creatives.length,\n ...(filtersApplied.length > 0 && { filters_applied: filtersApplied }),\n ...(request.sort && {\n sort_applied: {\n ...(request.sort.field !== undefined && { field: request.sort.field }),\n ...(request.sort.direction !== undefined && { direction: request.sort.direction }),\n },\n }),\n };\n\n return {\n query_summary: summary,\n pagination,\n creatives,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuDO,SAAS,2BAA2B,MAA4E;AACrH,QAAM,EAAE,SAAS,WAAW,YAAY,cAAc,IAAI;AAE1D,QAAM,UAAU,QAAQ;AACxB,QAAM,iBAA2B,CAAC;AAClC,MAAI,SAAS;AACX,QAAI,QAAQ,UAAU,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EA,SAAO;AAAA,IACL,eAAe;AAAA,IACf;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/server/decisioning/list-helpers.ts"],"sourcesContent":["/**\n * Helpers for building paginated list responses.\n *\n * `list_creatives` is the heaviest of the read tools: its response wraps the\n * row array in `query_summary` (`total_matching`, `returned`, `filters_applied`,\n * `sort_applied`) AND `pagination` (`has_more`, `cursor`, `total_count`).\n * Adopters writing the wrapper by hand re-derive the same fields per call;\n * this helper threads a row array + pagination cursor + the original request\n * into the wire shape.\n *\n * `list_property_lists`, `list_collection_lists`, and other governance reads\n * use a simpler `{ lists: [...] }` wrapper that the framework's response\n * builders already cover — those don't need a row helper.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { ListCreativesRequest, ListCreativesResponse, PaginationResponse } from '../../types/tools.generated';\nimport type { ServerPayload } from '../../types/server-payload';\nimport type {\n CanonicalListCreativesRequest,\n CanonicalListCreativesResponse,\n} from '../../v2/projection/creative-delivery';\n\nexport interface BuildListCreativesResponseOpts {\n /** Original request — used to surface `filters_applied` + `sort_applied` summaries. */\n request: CanonicalListCreativesRequest;\n /** The page of creative rows. Length determines `query_summary.returned`. */\n creatives: ServerPayload<CanonicalListCreativesResponse>['creatives'];\n /** Pagination cursor for the next page. Required — pass `{ has_more: false }` when this is the last page. */\n pagination: PaginationResponse;\n /**\n * Total count across all pages. When omitted, defaults to\n * `pagination.total_count` if present, else `creatives.length` (last-page\n * approximation). Set explicitly when your backend can compute the true\n * total.\n */\n totalMatching?: number;\n}\n\n/** @deprecated Explicit compatibility input for legacy `format_id` rows and filters. */\nexport interface BuildListCreativesResponseLegacyOpts {\n request: ListCreativesRequest;\n creatives: ServerPayload<ListCreativesResponse>['creatives'];\n pagination: PaginationResponse;\n totalMatching?: number;\n}\n\n/**\n * Build a `ListCreativesResponse` from a row array + pagination + the\n * original request. Computes `query_summary.filters_applied` from\n * `request.filters` and threads `request.sort` into `sort_applied`.\n *\n * ```ts\n * listCreatives: async (req, ctx) => {\n * const rows = await this.db.queryCreatives(req);\n * const cursor = rows.length === req.pagination?.limit ? this.nextCursor(rows) : undefined;\n * return buildListCreativesResponse({\n * request: req,\n * creatives: rows,\n * pagination: { has_more: cursor != null, cursor, total_count: rows.totalCount },\n * });\n * }\n * ```\n */\nexport function buildListCreativesResponse(\n opts: BuildListCreativesResponseOpts\n): ServerPayload<CanonicalListCreativesResponse> {\n return buildListCreativesResponseBase(opts, false) as ServerPayload<CanonicalListCreativesResponse>;\n}\n\n/** @deprecated Use `buildListCreativesResponse` with canonical creative rows. */\nexport function buildListCreativesResponseLegacy(\n opts: BuildListCreativesResponseLegacyOpts\n): ServerPayload<ListCreativesResponse> {\n return buildListCreativesResponseBase(opts, true) as ServerPayload<ListCreativesResponse>;\n}\n\nfunction buildListCreativesResponseBase(\n opts: BuildListCreativesResponseOpts | BuildListCreativesResponseLegacyOpts,\n includeLegacyFormatFilter: boolean\n): ServerPayload<CanonicalListCreativesResponse> | ServerPayload<ListCreativesResponse> {\n const { request, creatives, pagination, totalMatching } = opts;\n\n const filters = request.filters;\n const filtersApplied: string[] = [];\n if (filters) {\n if (filters.accounts?.length) filtersApplied.push('accounts');\n if (filters.statuses?.length) filtersApplied.push('statuses');\n if (filters.tags?.length) filtersApplied.push('tags');\n if (filters.tags_any?.length) filtersApplied.push('tags_any');\n if (filters.name_contains) filtersApplied.push('name_contains');\n if (filters.creative_ids?.length) filtersApplied.push('creative_ids');\n if (filters.created_after) filtersApplied.push('created_after');\n if (filters.created_before) filtersApplied.push('created_before');\n if (filters.updated_after) filtersApplied.push('updated_after');\n if (filters.updated_before) filtersApplied.push('updated_before');\n if (filters.assigned_to_packages?.length) filtersApplied.push('assigned_to_packages');\n if (filters.media_buy_ids?.length) filtersApplied.push('media_buy_ids');\n if (filters.unassigned !== undefined) filtersApplied.push('unassigned');\n if (filters.has_served !== undefined) filtersApplied.push('has_served');\n if (filters.concept_ids?.length) filtersApplied.push('concept_ids');\n if (\n includeLegacyFormatFilter &&\n 'format_ids' in filters &&\n Array.isArray(filters.format_ids) &&\n filters.format_ids.length > 0\n ) {\n filtersApplied.push('format_ids');\n }\n if (filters.has_variables !== undefined) filtersApplied.push('has_variables');\n }\n\n const summary: ServerPayload<ListCreativesResponse>['query_summary'] = {\n total_matching: totalMatching ?? pagination.total_count ?? creatives.length,\n returned: creatives.length,\n ...(filtersApplied.length > 0 && { filters_applied: filtersApplied }),\n ...(request.sort && {\n sort_applied: {\n ...(request.sort.field !== undefined && { field: request.sort.field }),\n ...(request.sort.direction !== undefined && { direction: request.sort.direction }),\n },\n }),\n };\n\n return {\n query_summary: summary,\n pagination,\n creatives,\n } as ServerPayload<CanonicalListCreativesResponse> | ServerPayload<ListCreativesResponse>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmEO,SAAS,2BACd,MAC+C;AAC/C,SAAO,+BAA+B,MAAM,KAAK;AACnD;AAGO,SAAS,iCACd,MACsC;AACtC,SAAO,+BAA+B,MAAM,IAAI;AAClD;AAEA,SAAS,+BACP,MACA,2BACsF;AACtF,QAAM,EAAE,SAAS,WAAW,YAAY,cAAc,IAAI;AAE1D,QAAM,UAAU,QAAQ;AACxB,QAAM,iBAA2B,CAAC;AAClC,MAAI,SAAS;AACX,QAAI,QAAQ,UAAU,OAAQ,gBAAe,KAAK,UAAU;AAC5D,QAAI,QAAQ,UAAU,OAAQ,gBAAe,KAAK,UAAU;AAC5D,QAAI,QAAQ,MAAM,OAAQ,gBAAe,KAAK,MAAM;AACpD,QAAI,QAAQ,UAAU,OAAQ,gBAAe,KAAK,UAAU;AAC5D,QAAI,QAAQ,cAAe,gBAAe,KAAK,eAAe;AAC9D,QAAI,QAAQ,cAAc,OAAQ,gBAAe,KAAK,cAAc;AACpE,QAAI,QAAQ,cAAe,gBAAe,KAAK,eAAe;AAC9D,QAAI,QAAQ,eAAgB,gBAAe,KAAK,gBAAgB;AAChE,QAAI,QAAQ,cAAe,gBAAe,KAAK,eAAe;AAC9D,QAAI,QAAQ,eAAgB,gBAAe,KAAK,gBAAgB;AAChE,QAAI,QAAQ,sBAAsB,OAAQ,gBAAe,KAAK,sBAAsB;AACpF,QAAI,QAAQ,eAAe,OAAQ,gBAAe,KAAK,eAAe;AACtE,QAAI,QAAQ,eAAe,OAAW,gBAAe,KAAK,YAAY;AACtE,QAAI,QAAQ,eAAe,OAAW,gBAAe,KAAK,YAAY;AACtE,QAAI,QAAQ,aAAa,OAAQ,gBAAe,KAAK,aAAa;AAClE,QACE,6BACA,gBAAgB,WAChB,MAAM,QAAQ,QAAQ,UAAU,KAChC,QAAQ,WAAW,SAAS,GAC5B;AACA,qBAAe,KAAK,YAAY;AAAA,IAClC;AACA,QAAI,QAAQ,kBAAkB,OAAW,gBAAe,KAAK,eAAe;AAAA,EAC9E;AAEA,QAAM,UAAiE;AAAA,IACrE,gBAAgB,iBAAiB,WAAW,eAAe,UAAU;AAAA,IACrE,UAAU,UAAU;AAAA,IACpB,GAAI,eAAe,SAAS,KAAK,EAAE,iBAAiB,eAAe;AAAA,IACnE,GAAI,QAAQ,QAAQ;AAAA,MAClB,cAAc;AAAA,QACZ,GAAI,QAAQ,KAAK,UAAU,UAAa,EAAE,OAAO,QAAQ,KAAK,MAAM;AAAA,QACpE,GAAI,QAAQ,KAAK,cAAc,UAAa,EAAE,WAAW,QAAQ,KAAK,UAAU;AAAA,MAClF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,eAAe;AAAA,IACf;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -1,4 +1,10 @@
1
1
  function buildListCreativesResponse(opts) {
2
+ return buildListCreativesResponseBase(opts, false);
3
+ }
4
+ function buildListCreativesResponseLegacy(opts) {
5
+ return buildListCreativesResponseBase(opts, true);
6
+ }
7
+ function buildListCreativesResponseBase(opts, includeLegacyFormatFilter) {
2
8
  const { request, creatives, pagination, totalMatching } = opts;
3
9
  const filters = request.filters;
4
10
  const filtersApplied = [];
@@ -18,7 +24,9 @@ function buildListCreativesResponse(opts) {
18
24
  if (filters.unassigned !== void 0) filtersApplied.push("unassigned");
19
25
  if (filters.has_served !== void 0) filtersApplied.push("has_served");
20
26
  if (filters.concept_ids?.length) filtersApplied.push("concept_ids");
21
- if (filters.format_ids?.length) filtersApplied.push("format_ids");
27
+ if (includeLegacyFormatFilter && "format_ids" in filters && Array.isArray(filters.format_ids) && filters.format_ids.length > 0) {
28
+ filtersApplied.push("format_ids");
29
+ }
22
30
  if (filters.has_variables !== void 0) filtersApplied.push("has_variables");
23
31
  }
24
32
  const summary = {
@@ -39,6 +47,7 @@ function buildListCreativesResponse(opts) {
39
47
  };
40
48
  }
41
49
  export {
42
- buildListCreativesResponse
50
+ buildListCreativesResponse,
51
+ buildListCreativesResponseLegacy
43
52
  };
44
53
  //# sourceMappingURL=list-helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/server/decisioning/list-helpers.ts"],"sourcesContent":["/**\n * Helpers for building paginated list responses.\n *\n * `list_creatives` is the heaviest of the read tools: its response wraps the\n * row array in `query_summary` (`total_matching`, `returned`, `filters_applied`,\n * `sort_applied`) AND `pagination` (`has_more`, `cursor`, `total_count`).\n * Adopters writing the wrapper by hand re-derive the same fields per call;\n * this helper threads a row array + pagination cursor + the original request\n * into the wire shape.\n *\n * `list_property_lists`, `list_collection_lists`, and other governance reads\n * use a simpler `{ lists: [...] }` wrapper that the framework's response\n * builders already cover — those don't need a row helper.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { ListCreativesRequest, ListCreativesResponse, PaginationResponse } from '../../types/tools.generated';\nimport type { ServerPayload } from '../../types/server-payload';\n\nexport interface BuildListCreativesResponseOpts {\n /** Original request — used to surface `filters_applied` + `sort_applied` summaries. */\n request: ListCreativesRequest;\n /** The page of creative rows. Length determines `query_summary.returned`. */\n creatives: ServerPayload<ListCreativesResponse>['creatives'];\n /** Pagination cursor for the next page. Required — pass `{ has_more: false }` when this is the last page. */\n pagination: PaginationResponse;\n /**\n * Total count across all pages. When omitted, defaults to\n * `pagination.total_count` if present, else `creatives.length` (last-page\n * approximation). Set explicitly when your backend can compute the true\n * total.\n */\n totalMatching?: number;\n}\n\n/**\n * Build a `ListCreativesResponse` from a row array + pagination + the\n * original request. Computes `query_summary.filters_applied` from\n * `request.filters` and threads `request.sort` into `sort_applied`.\n *\n * ```ts\n * listCreatives: async (req, ctx) => {\n * const rows = await this.db.queryCreatives(req);\n * const cursor = rows.length === req.pagination?.limit ? this.nextCursor(rows) : undefined;\n * return buildListCreativesResponse({\n * request: req,\n * creatives: rows,\n * pagination: { has_more: cursor != null, cursor, total_count: rows.totalCount },\n * });\n * }\n * ```\n */\nexport function buildListCreativesResponse(opts: BuildListCreativesResponseOpts): ServerPayload<ListCreativesResponse> {\n const { request, creatives, pagination, totalMatching } = opts;\n\n const filters = request.filters;\n const filtersApplied: string[] = [];\n if (filters) {\n if (filters.accounts?.length) filtersApplied.push('accounts');\n if (filters.statuses?.length) filtersApplied.push('statuses');\n if (filters.tags?.length) filtersApplied.push('tags');\n if (filters.tags_any?.length) filtersApplied.push('tags_any');\n if (filters.name_contains) filtersApplied.push('name_contains');\n if (filters.creative_ids?.length) filtersApplied.push('creative_ids');\n if (filters.created_after) filtersApplied.push('created_after');\n if (filters.created_before) filtersApplied.push('created_before');\n if (filters.updated_after) filtersApplied.push('updated_after');\n if (filters.updated_before) filtersApplied.push('updated_before');\n if (filters.assigned_to_packages?.length) filtersApplied.push('assigned_to_packages');\n if (filters.media_buy_ids?.length) filtersApplied.push('media_buy_ids');\n if (filters.unassigned !== undefined) filtersApplied.push('unassigned');\n if (filters.has_served !== undefined) filtersApplied.push('has_served');\n if (filters.concept_ids?.length) filtersApplied.push('concept_ids');\n if (filters.format_ids?.length) filtersApplied.push('format_ids');\n if (filters.has_variables !== undefined) filtersApplied.push('has_variables');\n }\n\n const summary: ServerPayload<ListCreativesResponse>['query_summary'] = {\n total_matching: totalMatching ?? pagination.total_count ?? creatives.length,\n returned: creatives.length,\n ...(filtersApplied.length > 0 && { filters_applied: filtersApplied }),\n ...(request.sort && {\n sort_applied: {\n ...(request.sort.field !== undefined && { field: request.sort.field }),\n ...(request.sort.direction !== undefined && { direction: request.sort.direction }),\n },\n }),\n };\n\n return {\n query_summary: summary,\n pagination,\n creatives,\n };\n}\n"],"mappings":"AAuDO,SAAS,2BAA2B,MAA4E;AACrH,QAAM,EAAE,SAAS,WAAW,YAAY,cAAc,IAAI;AAE1D,QAAM,UAAU,QAAQ;AACxB,QAAM,iBAA2B,CAAC;AAClC,MAAI,SAAS;AACX,QAAI,QAAQ,UAAU,OAAQ,gBAAe,KAAK,UAAU;AAC5D,QAAI,QAAQ,UAAU,OAAQ,gBAAe,KAAK,UAAU;AAC5D,QAAI,QAAQ,MAAM,OAAQ,gBAAe,KAAK,MAAM;AACpD,QAAI,QAAQ,UAAU,OAAQ,gBAAe,KAAK,UAAU;AAC5D,QAAI,QAAQ,cAAe,gBAAe,KAAK,eAAe;AAC9D,QAAI,QAAQ,cAAc,OAAQ,gBAAe,KAAK,cAAc;AACpE,QAAI,QAAQ,cAAe,gBAAe,KAAK,eAAe;AAC9D,QAAI,QAAQ,eAAgB,gBAAe,KAAK,gBAAgB;AAChE,QAAI,QAAQ,cAAe,gBAAe,KAAK,eAAe;AAC9D,QAAI,QAAQ,eAAgB,gBAAe,KAAK,gBAAgB;AAChE,QAAI,QAAQ,sBAAsB,OAAQ,gBAAe,KAAK,sBAAsB;AACpF,QAAI,QAAQ,eAAe,OAAQ,gBAAe,KAAK,eAAe;AACtE,QAAI,QAAQ,eAAe,OAAW,gBAAe,KAAK,YAAY;AACtE,QAAI,QAAQ,eAAe,OAAW,gBAAe,KAAK,YAAY;AACtE,QAAI,QAAQ,aAAa,OAAQ,gBAAe,KAAK,aAAa;AAClE,QAAI,QAAQ,YAAY,OAAQ,gBAAe,KAAK,YAAY;AAChE,QAAI,QAAQ,kBAAkB,OAAW,gBAAe,KAAK,eAAe;AAAA,EAC9E;AAEA,QAAM,UAAiE;AAAA,IACrE,gBAAgB,iBAAiB,WAAW,eAAe,UAAU;AAAA,IACrE,UAAU,UAAU;AAAA,IACpB,GAAI,eAAe,SAAS,KAAK,EAAE,iBAAiB,eAAe;AAAA,IACnE,GAAI,QAAQ,QAAQ;AAAA,MAClB,cAAc;AAAA,QACZ,GAAI,QAAQ,KAAK,UAAU,UAAa,EAAE,OAAO,QAAQ,KAAK,MAAM;AAAA,QACpE,GAAI,QAAQ,KAAK,cAAc,UAAa,EAAE,WAAW,QAAQ,KAAK,UAAU;AAAA,MAClF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,eAAe;AAAA,IACf;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/server/decisioning/list-helpers.ts"],"sourcesContent":["/**\n * Helpers for building paginated list responses.\n *\n * `list_creatives` is the heaviest of the read tools: its response wraps the\n * row array in `query_summary` (`total_matching`, `returned`, `filters_applied`,\n * `sort_applied`) AND `pagination` (`has_more`, `cursor`, `total_count`).\n * Adopters writing the wrapper by hand re-derive the same fields per call;\n * this helper threads a row array + pagination cursor + the original request\n * into the wire shape.\n *\n * `list_property_lists`, `list_collection_lists`, and other governance reads\n * use a simpler `{ lists: [...] }` wrapper that the framework's response\n * builders already cover — those don't need a row helper.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { ListCreativesRequest, ListCreativesResponse, PaginationResponse } from '../../types/tools.generated';\nimport type { ServerPayload } from '../../types/server-payload';\nimport type {\n CanonicalListCreativesRequest,\n CanonicalListCreativesResponse,\n} from '../../v2/projection/creative-delivery';\n\nexport interface BuildListCreativesResponseOpts {\n /** Original request — used to surface `filters_applied` + `sort_applied` summaries. */\n request: CanonicalListCreativesRequest;\n /** The page of creative rows. Length determines `query_summary.returned`. */\n creatives: ServerPayload<CanonicalListCreativesResponse>['creatives'];\n /** Pagination cursor for the next page. Required — pass `{ has_more: false }` when this is the last page. */\n pagination: PaginationResponse;\n /**\n * Total count across all pages. When omitted, defaults to\n * `pagination.total_count` if present, else `creatives.length` (last-page\n * approximation). Set explicitly when your backend can compute the true\n * total.\n */\n totalMatching?: number;\n}\n\n/** @deprecated Explicit compatibility input for legacy `format_id` rows and filters. */\nexport interface BuildListCreativesResponseLegacyOpts {\n request: ListCreativesRequest;\n creatives: ServerPayload<ListCreativesResponse>['creatives'];\n pagination: PaginationResponse;\n totalMatching?: number;\n}\n\n/**\n * Build a `ListCreativesResponse` from a row array + pagination + the\n * original request. Computes `query_summary.filters_applied` from\n * `request.filters` and threads `request.sort` into `sort_applied`.\n *\n * ```ts\n * listCreatives: async (req, ctx) => {\n * const rows = await this.db.queryCreatives(req);\n * const cursor = rows.length === req.pagination?.limit ? this.nextCursor(rows) : undefined;\n * return buildListCreativesResponse({\n * request: req,\n * creatives: rows,\n * pagination: { has_more: cursor != null, cursor, total_count: rows.totalCount },\n * });\n * }\n * ```\n */\nexport function buildListCreativesResponse(\n opts: BuildListCreativesResponseOpts\n): ServerPayload<CanonicalListCreativesResponse> {\n return buildListCreativesResponseBase(opts, false) as ServerPayload<CanonicalListCreativesResponse>;\n}\n\n/** @deprecated Use `buildListCreativesResponse` with canonical creative rows. */\nexport function buildListCreativesResponseLegacy(\n opts: BuildListCreativesResponseLegacyOpts\n): ServerPayload<ListCreativesResponse> {\n return buildListCreativesResponseBase(opts, true) as ServerPayload<ListCreativesResponse>;\n}\n\nfunction buildListCreativesResponseBase(\n opts: BuildListCreativesResponseOpts | BuildListCreativesResponseLegacyOpts,\n includeLegacyFormatFilter: boolean\n): ServerPayload<CanonicalListCreativesResponse> | ServerPayload<ListCreativesResponse> {\n const { request, creatives, pagination, totalMatching } = opts;\n\n const filters = request.filters;\n const filtersApplied: string[] = [];\n if (filters) {\n if (filters.accounts?.length) filtersApplied.push('accounts');\n if (filters.statuses?.length) filtersApplied.push('statuses');\n if (filters.tags?.length) filtersApplied.push('tags');\n if (filters.tags_any?.length) filtersApplied.push('tags_any');\n if (filters.name_contains) filtersApplied.push('name_contains');\n if (filters.creative_ids?.length) filtersApplied.push('creative_ids');\n if (filters.created_after) filtersApplied.push('created_after');\n if (filters.created_before) filtersApplied.push('created_before');\n if (filters.updated_after) filtersApplied.push('updated_after');\n if (filters.updated_before) filtersApplied.push('updated_before');\n if (filters.assigned_to_packages?.length) filtersApplied.push('assigned_to_packages');\n if (filters.media_buy_ids?.length) filtersApplied.push('media_buy_ids');\n if (filters.unassigned !== undefined) filtersApplied.push('unassigned');\n if (filters.has_served !== undefined) filtersApplied.push('has_served');\n if (filters.concept_ids?.length) filtersApplied.push('concept_ids');\n if (\n includeLegacyFormatFilter &&\n 'format_ids' in filters &&\n Array.isArray(filters.format_ids) &&\n filters.format_ids.length > 0\n ) {\n filtersApplied.push('format_ids');\n }\n if (filters.has_variables !== undefined) filtersApplied.push('has_variables');\n }\n\n const summary: ServerPayload<ListCreativesResponse>['query_summary'] = {\n total_matching: totalMatching ?? pagination.total_count ?? creatives.length,\n returned: creatives.length,\n ...(filtersApplied.length > 0 && { filters_applied: filtersApplied }),\n ...(request.sort && {\n sort_applied: {\n ...(request.sort.field !== undefined && { field: request.sort.field }),\n ...(request.sort.direction !== undefined && { direction: request.sort.direction }),\n },\n }),\n };\n\n return {\n query_summary: summary,\n pagination,\n creatives,\n } as ServerPayload<CanonicalListCreativesResponse> | ServerPayload<ListCreativesResponse>;\n}\n"],"mappings":"AAmEO,SAAS,2BACd,MAC+C;AAC/C,SAAO,+BAA+B,MAAM,KAAK;AACnD;AAGO,SAAS,iCACd,MACsC;AACtC,SAAO,+BAA+B,MAAM,IAAI;AAClD;AAEA,SAAS,+BACP,MACA,2BACsF;AACtF,QAAM,EAAE,SAAS,WAAW,YAAY,cAAc,IAAI;AAE1D,QAAM,UAAU,QAAQ;AACxB,QAAM,iBAA2B,CAAC;AAClC,MAAI,SAAS;AACX,QAAI,QAAQ,UAAU,OAAQ,g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AE,WAAW,QAAQ,KAAK,UAAU;AAAA,MAClF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,eAAe;AAAA,IACf;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
@@ -13,6 +13,8 @@
13
13
  */
14
14
  import type { CreativeManifest } from '../../types/tools.generated.mjs';
15
15
  import type { AssetInstance, AssetInstanceType } from '../../types/asset-instances.mjs';
16
+ /** Identity-free manifest view accepted by canonical asset helpers. */
17
+ export type CreativeAssetsContainer = Pick<CreativeManifest, 'assets'>;
16
18
  /**
17
19
  * Type-narrowed asset accessor by asset_id and expected asset_type.
18
20
  *
@@ -32,7 +34,7 @@ import type { AssetInstance, AssetInstanceType } from '../../types/asset-instanc
32
34
  *
33
35
  * For the require-or-throw flavor, see {@link requireAsset}.
34
36
  */
35
- export declare function getAsset<T extends AssetInstanceType>(manifest: CreativeManifest | undefined, assetId: string, assetType: T): Extract<AssetInstance, {
37
+ export declare function getAsset<T extends AssetInstanceType>(manifest: CreativeAssetsContainer | undefined, assetId: string, assetType: T): Extract<AssetInstance, {
36
38
  asset_type: T;
37
39
  }> | undefined;
38
40
  /**
@@ -52,7 +54,7 @@ export declare function getAsset<T extends AssetInstanceType>(manifest: Creative
52
54
  *
53
55
  * @since AdCP 3.1.0-beta.2 (slot widening to `AssetVariant | AssetVariant[]`).
54
56
  */
55
- export declare function getAssetSlot<T extends AssetInstanceType>(manifest: CreativeManifest | undefined, assetId: string, assetType: T): Array<Extract<AssetInstance, {
57
+ export declare function getAssetSlot<T extends AssetInstanceType>(manifest: CreativeAssetsContainer | undefined, assetId: string, assetType: T): Array<Extract<AssetInstance, {
56
58
  asset_type: T;
57
59
  }>> | undefined;
58
60
  /**
@@ -70,6 +72,6 @@ export declare function getAssetSlot<T extends AssetInstanceType>(manifest: Crea
70
72
  * await audioStackClient.synthesize({ text: script.content });
71
73
  * ```
72
74
  */
73
- export declare function requireAsset<T extends AssetInstanceType>(manifest: CreativeManifest | undefined, assetId: string, assetType: T, messageOverride?: string): Extract<AssetInstance, {
75
+ export declare function requireAsset<T extends AssetInstanceType>(manifest: CreativeAssetsContainer | undefined, assetId: string, assetType: T, messageOverride?: string): Extract<AssetInstance, {
74
76
  asset_type: T;
75
77
  }>;
@@ -13,6 +13,8 @@
13
13
  */
14
14
  import type { CreativeManifest } from '../../types/tools.generated';
15
15
  import type { AssetInstance, AssetInstanceType } from '../../types/asset-instances';
16
+ /** Identity-free manifest view accepted by canonical asset helpers. */
17
+ export type CreativeAssetsContainer = Pick<CreativeManifest, 'assets'>;
16
18
  /**
17
19
  * Type-narrowed asset accessor by asset_id and expected asset_type.
18
20
  *
@@ -32,7 +34,7 @@ import type { AssetInstance, AssetInstanceType } from '../../types/asset-instanc
32
34
  *
33
35
  * For the require-or-throw flavor, see {@link requireAsset}.
34
36
  */
35
- export declare function getAsset<T extends AssetInstanceType>(manifest: CreativeManifest | undefined, assetId: string, assetType: T): Extract<AssetInstance, {
37
+ export declare function getAsset<T extends AssetInstanceType>(manifest: CreativeAssetsContainer | undefined, assetId: string, assetType: T): Extract<AssetInstance, {
36
38
  asset_type: T;
37
39
  }> | undefined;
38
40
  /**
@@ -52,7 +54,7 @@ export declare function getAsset<T extends AssetInstanceType>(manifest: Creative
52
54
  *
53
55
  * @since AdCP 3.1.0-beta.2 (slot widening to `AssetVariant | AssetVariant[]`).
54
56
  */
55
- export declare function getAssetSlot<T extends AssetInstanceType>(manifest: CreativeManifest | undefined, assetId: string, assetType: T): Array<Extract<AssetInstance, {
57
+ export declare function getAssetSlot<T extends AssetInstanceType>(manifest: CreativeAssetsContainer | undefined, assetId: string, assetType: T): Array<Extract<AssetInstance, {
56
58
  asset_type: T;
57
59
  }>> | undefined;
58
60
  /**
@@ -70,7 +72,7 @@ export declare function getAssetSlot<T extends AssetInstanceType>(manifest: Crea
70
72
  * await audioStackClient.synthesize({ text: script.content });
71
73
  * ```
72
74
  */
73
- export declare function requireAsset<T extends AssetInstanceType>(manifest: CreativeManifest | undefined, assetId: string, assetType: T, messageOverride?: string): Extract<AssetInstance, {
75
+ export declare function requireAsset<T extends AssetInstanceType>(manifest: CreativeAssetsContainer | undefined, assetId: string, assetType: T, messageOverride?: string): Extract<AssetInstance, {
74
76
  asset_type: T;
75
77
  }>;
76
78
  //# sourceMappingURL=manifest-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGpF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EAClD,QAAQ,EAAE,gBAAgB,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,GACX,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,SAAS,CAUvD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,iBAAiB,EACtD,QAAQ,EAAE,gBAAgB,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,GACX,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC,GAAG,SAAS,CAK9D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,iBAAiB,EACtD,QAAQ,EAAE,gBAAgB,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,EACZ,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,CAoB3C"}
1
+ {"version":3,"file":"manifest-helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGpF,uEAAuE;AACvE,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;AAEvE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,iBAAiB,EAClD,QAAQ,EAAE,uBAAuB,GAAG,SAAS,EAC7C,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,GACX,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,SAAS,CAUvD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,iBAAiB,EACtD,QAAQ,EAAE,uBAAuB,GAAG,SAAS,EAC7C,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,GACX,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC,GAAG,SAAS,CAK9D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,iBAAiB,EACtD,QAAQ,EAAE,uBAAuB,GAAG,SAAS,EAC7C,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,EACZ,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,aAAa,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,CAoB3C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"sourcesContent":["/**\n * Helpers for reading typed assets out of `creative_manifest.assets`.\n *\n * `creative_manifest.assets` is a keyed map (`{ [asset_id]: AssetInstance }`)\n * where each value is a discriminated union by `asset_type`. Adopters\n * narrowing per-call write the same null-check + discriminator-check\n * boilerplate over and over. These helpers replace that boilerplate\n * without compromising the discriminator-narrowing story.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { CreativeManifest } from '../../types/tools.generated';\nimport type { AssetInstance, AssetInstanceType } from '../../types/asset-instances';\nimport { AdcpError } from './async-outcome';\n\n/**\n * Type-narrowed asset accessor by asset_id and expected asset_type.\n *\n * Returns the asset narrowed to the matching variant, or `undefined` if the\n * asset is missing or the asset_type doesn't match. Use when you want a\n * silent skip for the wrong-type case (e.g., processing a heterogeneous\n * batch where some entries don't apply to your transform).\n *\n * ```ts\n * const audio = getAsset(req.creative_manifest, 'rendered_audio', 'audio');\n * // audio is `AudioAsset | undefined` — narrowed by the discriminator\n * if (audio) {\n * const url = audio.url; // typed access\n * const ms = audio.duration_ms;\n * }\n * ```\n *\n * For the require-or-throw flavor, see {@link requireAsset}.\n */\nexport function getAsset<T extends AssetInstanceType>(\n manifest: CreativeManifest | undefined,\n assetId: string,\n assetType: T\n): Extract<AssetInstance, { asset_type: T }> | undefined {\n // AdCP 3.1.0-beta.2 widened each slot from `AssetVariant` to\n // `AssetVariant | AssetVariant[]` so carousel `cards` and\n // responsive_creative `headlines` can carry multiple assets per slot.\n // For single-slot callers, take the first array element — preserves the\n // pre-3.1 behavior. Multi-asset slots use {@link getAssetSlot}.\n const slot = manifest?.assets?.[assetId];\n const asset = Array.isArray(slot) ? slot[0] : slot;\n if (!asset || asset.asset_type !== assetType) return undefined;\n return asset as Extract<AssetInstance, { asset_type: T }>;\n}\n\n/**\n * Type-narrowed asset slot accessor for multi-element slots (carousel\n * `cards`, responsive_creative `headlines`, etc.). Returns the full\n * array — every element must match `assetType`; mixed-type slots are\n * the adopter's responsibility to discriminate per-element.\n *\n * Returns `undefined` only when the slot is missing from the manifest\n * (`manifest.assets[assetId]` is absent). Returns `[]` when the slot\n * is present but empty, or present and non-empty with no elements\n * matching `assetType`. Empty arrays are spec-invalid per the\n * `minItems: 1` constraint on slot arrays, but the helper accepts\n * malformed input defensively — returning `[]` is more consistent\n * with the \"filter result on the slot\" contract than collapsing it\n * to `undefined`.\n *\n * @since AdCP 3.1.0-beta.2 (slot widening to `AssetVariant | AssetVariant[]`).\n */\nexport function getAssetSlot<T extends AssetInstanceType>(\n manifest: CreativeManifest | undefined,\n assetId: string,\n assetType: T\n): Array<Extract<AssetInstance, { asset_type: T }>> | undefined {\n const slot = manifest?.assets?.[assetId];\n if (!slot) return undefined;\n const arr = Array.isArray(slot) ? slot : [slot];\n return arr.filter(a => a.asset_type === assetType) as Array<Extract<AssetInstance, { asset_type: T }>>;\n}\n\n/**\n * Same as {@link getAsset} but throws `AdcpError('INVALID_REQUEST')` when\n * the asset is missing or the wrong type. Use when the asset is required\n * for the platform method to proceed (the typical creative-template case).\n *\n * Throws with a precomposed `field` path so the buyer sees actionable\n * feedback. Customize the message via the `messageOverride` arg if the\n * default doesn't fit.\n *\n * ```ts\n * const script = requireAsset(req.creative_manifest, 'script', 'text');\n * // script is `TextAsset` — never undefined past this line\n * await audioStackClient.synthesize({ text: script.content });\n * ```\n */\nexport function requireAsset<T extends AssetInstanceType>(\n manifest: CreativeManifest | undefined,\n assetId: string,\n assetType: T,\n messageOverride?: string\n): Extract<AssetInstance, { asset_type: T }> {\n // Slot widening (3.1.0-beta.2): unwrap array slots to the first element\n // for single-asset callers. Multi-element slots go through getAssetSlot.\n const slot = manifest?.assets?.[assetId];\n const asset = Array.isArray(slot) ? slot[0] : slot;\n if (!asset) {\n throw new AdcpError('INVALID_REQUEST', {\n message: messageOverride ?? `creative_manifest.assets.${assetId} is required`,\n field: `creative_manifest.assets.${assetId}`,\n });\n }\n if (asset.asset_type !== assetType) {\n throw new AdcpError('INVALID_REQUEST', {\n message:\n messageOverride ??\n `creative_manifest.assets.${assetId} must be a ${assetType} asset (got asset_type='${asset.asset_type}')`,\n field: `creative_manifest.assets.${assetId}.asset_type`,\n });\n }\n return asset as Extract<AssetInstance, { asset_type: T }>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,2BAA0B;AAqBnB,SAAS,SACd,UACA,SACA,WACuD;AAMvD,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,QAAM,QAAQ,MAAM,QAAQ,IAAI,IAAI,KAAK,CAAC,IAAI;AAC9C,MAAI,CAAC,SAAS,MAAM,eAAe,UAAW,QAAO;AACrD,SAAO;AACT;AAmBO,SAAS,aACd,UACA,SACA,WAC8D;AAC9D,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,MAAM,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI;AAC9C,SAAO,IAAI,OAAO,OAAK,EAAE,eAAe,SAAS;AACnD;AAiBO,SAAS,aACd,UACA,SACA,WACA,iBAC2C;AAG3C,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,QAAM,QAAQ,MAAM,QAAQ,IAAI,IAAI,KAAK,CAAC,IAAI;AAC9C,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,+BAAU,mBAAmB;AAAA,MACrC,SAAS,mBAAmB,4BAA4B,OAAO;AAAA,MAC/D,OAAO,4BAA4B,OAAO;AAAA,IAC5C,CAAC;AAAA,EACH;AACA,MAAI,MAAM,eAAe,WAAW;AAClC,UAAM,IAAI,+BAAU,mBAAmB;AAAA,MACrC,SACE,mBACA,4BAA4B,OAAO,cAAc,SAAS,2BAA2B,MAAM,UAAU;AAAA,MACvG,OAAO,4BAA4B,OAAO;AAAA,IAC5C,CAAC;AAAA,EACH;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"sourcesContent":["/**\n * Helpers for reading typed assets out of `creative_manifest.assets`.\n *\n * `creative_manifest.assets` is a keyed map (`{ [asset_id]: AssetInstance }`)\n * where each value is a discriminated union by `asset_type`. Adopters\n * narrowing per-call write the same null-check + discriminator-check\n * boilerplate over and over. These helpers replace that boilerplate\n * without compromising the discriminator-narrowing story.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { CreativeManifest } from '../../types/tools.generated';\nimport type { AssetInstance, AssetInstanceType } from '../../types/asset-instances';\nimport { AdcpError } from './async-outcome';\n\n/** Identity-free manifest view accepted by canonical asset helpers. */\nexport type CreativeAssetsContainer = Pick<CreativeManifest, 'assets'>;\n\n/**\n * Type-narrowed asset accessor by asset_id and expected asset_type.\n *\n * Returns the asset narrowed to the matching variant, or `undefined` if the\n * asset is missing or the asset_type doesn't match. Use when you want a\n * silent skip for the wrong-type case (e.g., processing a heterogeneous\n * batch where some entries don't apply to your transform).\n *\n * ```ts\n * const audio = getAsset(req.creative_manifest, 'rendered_audio', 'audio');\n * // audio is `AudioAsset | undefined` — narrowed by the discriminator\n * if (audio) {\n * const url = audio.url; // typed access\n * const ms = audio.duration_ms;\n * }\n * ```\n *\n * For the require-or-throw flavor, see {@link requireAsset}.\n */\nexport function getAsset<T extends AssetInstanceType>(\n manifest: CreativeAssetsContainer | undefined,\n assetId: string,\n assetType: T\n): Extract<AssetInstance, { asset_type: T }> | undefined {\n // AdCP 3.1.0-beta.2 widened each slot from `AssetVariant` to\n // `AssetVariant | AssetVariant[]` so carousel `cards` and\n // responsive_creative `headlines` can carry multiple assets per slot.\n // For single-slot callers, take the first array element — preserves the\n // pre-3.1 behavior. Multi-asset slots use {@link getAssetSlot}.\n const slot = manifest?.assets?.[assetId];\n const asset = Array.isArray(slot) ? slot[0] : slot;\n if (!asset || asset.asset_type !== assetType) return undefined;\n return asset as Extract<AssetInstance, { asset_type: T }>;\n}\n\n/**\n * Type-narrowed asset slot accessor for multi-element slots (carousel\n * `cards`, responsive_creative `headlines`, etc.). Returns the full\n * array — every element must match `assetType`; mixed-type slots are\n * the adopter's responsibility to discriminate per-element.\n *\n * Returns `undefined` only when the slot is missing from the manifest\n * (`manifest.assets[assetId]` is absent). Returns `[]` when the slot\n * is present but empty, or present and non-empty with no elements\n * matching `assetType`. Empty arrays are spec-invalid per the\n * `minItems: 1` constraint on slot arrays, but the helper accepts\n * malformed input defensively — returning `[]` is more consistent\n * with the \"filter result on the slot\" contract than collapsing it\n * to `undefined`.\n *\n * @since AdCP 3.1.0-beta.2 (slot widening to `AssetVariant | AssetVariant[]`).\n */\nexport function getAssetSlot<T extends AssetInstanceType>(\n manifest: CreativeAssetsContainer | undefined,\n assetId: string,\n assetType: T\n): Array<Extract<AssetInstance, { asset_type: T }>> | undefined {\n const slot = manifest?.assets?.[assetId];\n if (!slot) return undefined;\n const arr = Array.isArray(slot) ? slot : [slot];\n return arr.filter(a => a.asset_type === assetType) as Array<Extract<AssetInstance, { asset_type: T }>>;\n}\n\n/**\n * Same as {@link getAsset} but throws `AdcpError('INVALID_REQUEST')` when\n * the asset is missing or the wrong type. Use when the asset is required\n * for the platform method to proceed (the typical creative-template case).\n *\n * Throws with a precomposed `field` path so the buyer sees actionable\n * feedback. Customize the message via the `messageOverride` arg if the\n * default doesn't fit.\n *\n * ```ts\n * const script = requireAsset(req.creative_manifest, 'script', 'text');\n * // script is `TextAsset` — never undefined past this line\n * await audioStackClient.synthesize({ text: script.content });\n * ```\n */\nexport function requireAsset<T extends AssetInstanceType>(\n manifest: CreativeAssetsContainer | undefined,\n assetId: string,\n assetType: T,\n messageOverride?: string\n): Extract<AssetInstance, { asset_type: T }> {\n // Slot widening (3.1.0-beta.2): unwrap array slots to the first element\n // for single-asset callers. Multi-element slots go through getAssetSlot.\n const slot = manifest?.assets?.[assetId];\n const asset = Array.isArray(slot) ? slot[0] : slot;\n if (!asset) {\n throw new AdcpError('INVALID_REQUEST', {\n message: messageOverride ?? `creative_manifest.assets.${assetId} is required`,\n field: `creative_manifest.assets.${assetId}`,\n });\n }\n if (asset.asset_type !== assetType) {\n throw new AdcpError('INVALID_REQUEST', {\n message:\n messageOverride ??\n `creative_manifest.assets.${assetId} must be a ${assetType} asset (got asset_type='${asset.asset_type}')`,\n field: `creative_manifest.assets.${assetId}.asset_type`,\n });\n }\n return asset as Extract<AssetInstance, { asset_type: T }>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,2BAA0B;AAwBnB,SAAS,SACd,UACA,SACA,WACuD;AAMvD,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,QAAM,QAAQ,MAAM,QAAQ,IAAI,IAAI,KAAK,CAAC,IAAI;AAC9C,MAAI,CAAC,SAAS,MAAM,eAAe,UAAW,QAAO;AACrD,SAAO;AACT;AAmBO,SAAS,aACd,UACA,SACA,WAC8D;AAC9D,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,MAAM,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI;AAC9C,SAAO,IAAI,OAAO,OAAK,EAAE,eAAe,SAAS;AACnD;AAiBO,SAAS,aACd,UACA,SACA,WACA,iBAC2C;AAG3C,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,QAAM,QAAQ,MAAM,QAAQ,IAAI,IAAI,KAAK,CAAC,IAAI;AAC9C,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,+BAAU,mBAAmB;AAAA,MACrC,SAAS,mBAAmB,4BAA4B,OAAO;AAAA,MAC/D,OAAO,4BAA4B,OAAO;AAAA,IAC5C,CAAC;AAAA,EACH;AACA,MAAI,MAAM,eAAe,WAAW;AAClC,UAAM,IAAI,+BAAU,mBAAmB;AAAA,MACrC,SACE,mBACA,4BAA4B,OAAO,cAAc,SAAS,2BAA2B,MAAM,UAAU;AAAA,MACvG,OAAO,4BAA4B,OAAO;AAAA,IAC5C,CAAC;AAAA,EACH;AACA,SAAO;AACT;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"sourcesContent":["/**\n * Helpers for reading typed assets out of `creative_manifest.assets`.\n *\n * `creative_manifest.assets` is a keyed map (`{ [asset_id]: AssetInstance }`)\n * where each value is a discriminated union by `asset_type`. Adopters\n * narrowing per-call write the same null-check + discriminator-check\n * boilerplate over and over. These helpers replace that boilerplate\n * without compromising the discriminator-narrowing story.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { CreativeManifest } from '../../types/tools.generated';\nimport type { AssetInstance, AssetInstanceType } from '../../types/asset-instances';\nimport { AdcpError } from './async-outcome';\n\n/**\n * Type-narrowed asset accessor by asset_id and expected asset_type.\n *\n * Returns the asset narrowed to the matching variant, or `undefined` if the\n * asset is missing or the asset_type doesn't match. Use when you want a\n * silent skip for the wrong-type case (e.g., processing a heterogeneous\n * batch where some entries don't apply to your transform).\n *\n * ```ts\n * const audio = getAsset(req.creative_manifest, 'rendered_audio', 'audio');\n * // audio is `AudioAsset | undefined` — narrowed by the discriminator\n * if (audio) {\n * const url = audio.url; // typed access\n * const ms = audio.duration_ms;\n * }\n * ```\n *\n * For the require-or-throw flavor, see {@link requireAsset}.\n */\nexport function getAsset<T extends AssetInstanceType>(\n manifest: CreativeManifest | undefined,\n assetId: string,\n assetType: T\n): Extract<AssetInstance, { asset_type: T }> | undefined {\n // AdCP 3.1.0-beta.2 widened each slot from `AssetVariant` to\n // `AssetVariant | AssetVariant[]` so carousel `cards` and\n // responsive_creative `headlines` can carry multiple assets per slot.\n // For single-slot callers, take the first array element — preserves the\n // pre-3.1 behavior. Multi-asset slots use {@link getAssetSlot}.\n const slot = manifest?.assets?.[assetId];\n const asset = Array.isArray(slot) ? slot[0] : slot;\n if (!asset || asset.asset_type !== assetType) return undefined;\n return asset as Extract<AssetInstance, { asset_type: T }>;\n}\n\n/**\n * Type-narrowed asset slot accessor for multi-element slots (carousel\n * `cards`, responsive_creative `headlines`, etc.). Returns the full\n * array — every element must match `assetType`; mixed-type slots are\n * the adopter's responsibility to discriminate per-element.\n *\n * Returns `undefined` only when the slot is missing from the manifest\n * (`manifest.assets[assetId]` is absent). Returns `[]` when the slot\n * is present but empty, or present and non-empty with no elements\n * matching `assetType`. Empty arrays are spec-invalid per the\n * `minItems: 1` constraint on slot arrays, but the helper accepts\n * malformed input defensively — returning `[]` is more consistent\n * with the \"filter result on the slot\" contract than collapsing it\n * to `undefined`.\n *\n * @since AdCP 3.1.0-beta.2 (slot widening to `AssetVariant | AssetVariant[]`).\n */\nexport function getAssetSlot<T extends AssetInstanceType>(\n manifest: CreativeManifest | undefined,\n assetId: string,\n assetType: T\n): Array<Extract<AssetInstance, { asset_type: T }>> | undefined {\n const slot = manifest?.assets?.[assetId];\n if (!slot) return undefined;\n const arr = Array.isArray(slot) ? slot : [slot];\n return arr.filter(a => a.asset_type === assetType) as Array<Extract<AssetInstance, { asset_type: T }>>;\n}\n\n/**\n * Same as {@link getAsset} but throws `AdcpError('INVALID_REQUEST')` when\n * the asset is missing or the wrong type. Use when the asset is required\n * for the platform method to proceed (the typical creative-template case).\n *\n * Throws with a precomposed `field` path so the buyer sees actionable\n * feedback. Customize the message via the `messageOverride` arg if the\n * default doesn't fit.\n *\n * ```ts\n * const script = requireAsset(req.creative_manifest, 'script', 'text');\n * // script is `TextAsset` — never undefined past this line\n * await audioStackClient.synthesize({ text: script.content });\n * ```\n */\nexport function requireAsset<T extends AssetInstanceType>(\n manifest: CreativeManifest | undefined,\n assetId: string,\n assetType: T,\n messageOverride?: string\n): Extract<AssetInstance, { asset_type: T }> {\n // Slot widening (3.1.0-beta.2): unwrap array slots to the first element\n // for single-asset callers. Multi-element slots go through getAssetSlot.\n const slot = manifest?.assets?.[assetId];\n const asset = Array.isArray(slot) ? slot[0] : slot;\n if (!asset) {\n throw new AdcpError('INVALID_REQUEST', {\n message: messageOverride ?? `creative_manifest.assets.${assetId} is required`,\n field: `creative_manifest.assets.${assetId}`,\n });\n }\n if (asset.asset_type !== assetType) {\n throw new AdcpError('INVALID_REQUEST', {\n message:\n messageOverride ??\n `creative_manifest.assets.${assetId} must be a ${assetType} asset (got asset_type='${asset.asset_type}')`,\n field: `creative_manifest.assets.${assetId}.asset_type`,\n });\n }\n return asset as Extract<AssetInstance, { asset_type: T }>;\n}\n"],"mappings":"AAgBA,SAAS,iBAAiB;AAqBnB,SAAS,SACd,UACA,SACA,WACuD;AAMvD,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,QAAM,QAAQ,MAAM,QAAQ,IAAI,IAAI,KAAK,CAAC,IAAI;AAC9C,MAAI,CAAC,SAAS,MAAM,eAAe,UAAW,QAAO;AACrD,SAAO;AACT;AAmBO,SAAS,aACd,UACA,SACA,WAC8D;AAC9D,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,MAAM,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI;AAC9C,SAAO,IAAI,OAAO,OAAK,EAAE,eAAe,SAAS;AACnD;AAiBO,SAAS,aACd,UACA,SACA,WACA,iBAC2C;AAG3C,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,QAAM,QAAQ,MAAM,QAAQ,IAAI,IAAI,KAAK,CAAC,IAAI;AAC9C,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,UAAU,mBAAmB;AAAA,MACrC,SAAS,mBAAmB,4BAA4B,OAAO;AAAA,MAC/D,OAAO,4BAA4B,OAAO;AAAA,IAC5C,CAAC;AAAA,EACH;AACA,MAAI,MAAM,eAAe,WAAW;AAClC,UAAM,IAAI,UAAU,mBAAmB;AAAA,MACrC,SACE,mBACA,4BAA4B,OAAO,cAAc,SAAS,2BAA2B,MAAM,UAAU;AAAA,MACvG,OAAO,4BAA4B,OAAO;AAAA,IAC5C,CAAC;AAAA,EACH;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/server/decisioning/manifest-helpers.ts"],"sourcesContent":["/**\n * Helpers for reading typed assets out of `creative_manifest.assets`.\n *\n * `creative_manifest.assets` is a keyed map (`{ [asset_id]: AssetInstance }`)\n * where each value is a discriminated union by `asset_type`. Adopters\n * narrowing per-call write the same null-check + discriminator-check\n * boilerplate over and over. These helpers replace that boilerplate\n * without compromising the discriminator-narrowing story.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { CreativeManifest } from '../../types/tools.generated';\nimport type { AssetInstance, AssetInstanceType } from '../../types/asset-instances';\nimport { AdcpError } from './async-outcome';\n\n/** Identity-free manifest view accepted by canonical asset helpers. */\nexport type CreativeAssetsContainer = Pick<CreativeManifest, 'assets'>;\n\n/**\n * Type-narrowed asset accessor by asset_id and expected asset_type.\n *\n * Returns the asset narrowed to the matching variant, or `undefined` if the\n * asset is missing or the asset_type doesn't match. Use when you want a\n * silent skip for the wrong-type case (e.g., processing a heterogeneous\n * batch where some entries don't apply to your transform).\n *\n * ```ts\n * const audio = getAsset(req.creative_manifest, 'rendered_audio', 'audio');\n * // audio is `AudioAsset | undefined` — narrowed by the discriminator\n * if (audio) {\n * const url = audio.url; // typed access\n * const ms = audio.duration_ms;\n * }\n * ```\n *\n * For the require-or-throw flavor, see {@link requireAsset}.\n */\nexport function getAsset<T extends AssetInstanceType>(\n manifest: CreativeAssetsContainer | undefined,\n assetId: string,\n assetType: T\n): Extract<AssetInstance, { asset_type: T }> | undefined {\n // AdCP 3.1.0-beta.2 widened each slot from `AssetVariant` to\n // `AssetVariant | AssetVariant[]` so carousel `cards` and\n // responsive_creative `headlines` can carry multiple assets per slot.\n // For single-slot callers, take the first array element — preserves the\n // pre-3.1 behavior. Multi-asset slots use {@link getAssetSlot}.\n const slot = manifest?.assets?.[assetId];\n const asset = Array.isArray(slot) ? slot[0] : slot;\n if (!asset || asset.asset_type !== assetType) return undefined;\n return asset as Extract<AssetInstance, { asset_type: T }>;\n}\n\n/**\n * Type-narrowed asset slot accessor for multi-element slots (carousel\n * `cards`, responsive_creative `headlines`, etc.). Returns the full\n * array — every element must match `assetType`; mixed-type slots are\n * the adopter's responsibility to discriminate per-element.\n *\n * Returns `undefined` only when the slot is missing from the manifest\n * (`manifest.assets[assetId]` is absent). Returns `[]` when the slot\n * is present but empty, or present and non-empty with no elements\n * matching `assetType`. Empty arrays are spec-invalid per the\n * `minItems: 1` constraint on slot arrays, but the helper accepts\n * malformed input defensively — returning `[]` is more consistent\n * with the \"filter result on the slot\" contract than collapsing it\n * to `undefined`.\n *\n * @since AdCP 3.1.0-beta.2 (slot widening to `AssetVariant | AssetVariant[]`).\n */\nexport function getAssetSlot<T extends AssetInstanceType>(\n manifest: CreativeAssetsContainer | undefined,\n assetId: string,\n assetType: T\n): Array<Extract<AssetInstance, { asset_type: T }>> | undefined {\n const slot = manifest?.assets?.[assetId];\n if (!slot) return undefined;\n const arr = Array.isArray(slot) ? slot : [slot];\n return arr.filter(a => a.asset_type === assetType) as Array<Extract<AssetInstance, { asset_type: T }>>;\n}\n\n/**\n * Same as {@link getAsset} but throws `AdcpError('INVALID_REQUEST')` when\n * the asset is missing or the wrong type. Use when the asset is required\n * for the platform method to proceed (the typical creative-template case).\n *\n * Throws with a precomposed `field` path so the buyer sees actionable\n * feedback. Customize the message via the `messageOverride` arg if the\n * default doesn't fit.\n *\n * ```ts\n * const script = requireAsset(req.creative_manifest, 'script', 'text');\n * // script is `TextAsset` — never undefined past this line\n * await audioStackClient.synthesize({ text: script.content });\n * ```\n */\nexport function requireAsset<T extends AssetInstanceType>(\n manifest: CreativeAssetsContainer | undefined,\n assetId: string,\n assetType: T,\n messageOverride?: string\n): Extract<AssetInstance, { asset_type: T }> {\n // Slot widening (3.1.0-beta.2): unwrap array slots to the first element\n // for single-asset callers. Multi-element slots go through getAssetSlot.\n const slot = manifest?.assets?.[assetId];\n const asset = Array.isArray(slot) ? slot[0] : slot;\n if (!asset) {\n throw new AdcpError('INVALID_REQUEST', {\n message: messageOverride ?? `creative_manifest.assets.${assetId} is required`,\n field: `creative_manifest.assets.${assetId}`,\n });\n }\n if (asset.asset_type !== assetType) {\n throw new AdcpError('INVALID_REQUEST', {\n message:\n messageOverride ??\n `creative_manifest.assets.${assetId} must be a ${assetType} asset (got asset_type='${asset.asset_type}')`,\n field: `creative_manifest.assets.${assetId}.asset_type`,\n });\n }\n return asset as Extract<AssetInstance, { asset_type: T }>;\n}\n"],"mappings":"AAgBA,SAAS,iBAAiB;AAwBnB,SAAS,SACd,UACA,SACA,WACuD;AAMvD,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,QAAM,QAAQ,MAAM,QAAQ,IAAI,IAAI,KAAK,CAAC,IAAI;AAC9C,MAAI,CAAC,SAAS,MAAM,eAAe,UAAW,QAAO;AACrD,SAAO;AACT;AAmBO,SAAS,aACd,UACA,SACA,WAC8D;AAC9D,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,MAAM,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC,IAAI;AAC9C,SAAO,IAAI,OAAO,OAAK,EAAE,eAAe,SAAS;AACnD;AAiBO,SAAS,aACd,UACA,SACA,WACA,iBAC2C;AAG3C,QAAM,OAAO,UAAU,SAAS,OAAO;AACvC,QAAM,QAAQ,MAAM,QAAQ,IAAI,IAAI,KAAK,CAAC,IAAI;AAC9C,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,UAAU,mBAAmB;AAAA,MACrC,SAAS,mBAAmB,4BAA4B,OAAO;AAAA,MAC/D,OAAO,4BAA4B,OAAO;AAAA,IAC5C,CAAC;AAAA,EACH;AACA,MAAI,MAAM,eAAe,WAAW;AAClC,UAAM,IAAI,UAAU,mBAAmB;AAAA,MACrC,SACE,mBACA,4BAA4B,OAAO,cAAc,SAAS,2BAA2B,MAAM,UAAU;AAAA,MACvG,OAAO,4BAA4B,OAAO;AAAA,IAC5C,CAAC;AAAA,EACH;AACA,SAAO;AACT;","names":[]}
@@ -35,7 +35,7 @@
35
35
  * @packageDocumentation
36
36
  */
37
37
  import { type TaskHandoff } from '../async-outcome.mjs';
38
- import type { GetProductsRequest } from '../../../types/tools.generated.mjs';
38
+ import type { CanonicalGetProductsRequest } from '../../../v2/projection/creative-delivery.mjs';
39
39
  import type { ProposalRecord, ProposalStore } from './store.mjs';
40
40
  import type { FinalizeProposalSuccess, ProposalGetProductsPayload, ProposalManager, Recipe } from './types.mjs';
41
41
  /**
@@ -88,7 +88,7 @@ export type FinalizeInterceptResult<TRecipe extends Recipe = Recipe> = {
88
88
  * @public
89
89
  */
90
90
  export declare function maybeInterceptFinalize<TRecipe extends Recipe, TCtxMeta>(args: {
91
- request: GetProductsRequest;
91
+ request: CanonicalGetProductsRequest;
92
92
  manager: ProposalManager<TRecipe, TCtxMeta> | undefined;
93
93
  store: ProposalStore<TRecipe> | undefined;
94
94
  ctx: {
@@ -35,7 +35,7 @@
35
35
  * @packageDocumentation
36
36
  */
37
37
  import { type TaskHandoff } from '../async-outcome';
38
- import type { GetProductsRequest } from '../../../types/tools.generated';
38
+ import type { CanonicalGetProductsRequest } from '../../../v2/projection/creative-delivery';
39
39
  import type { ProposalRecord, ProposalStore } from './store';
40
40
  import type { FinalizeProposalSuccess, ProposalGetProductsPayload, ProposalManager, Recipe } from './types';
41
41
  /**
@@ -88,7 +88,7 @@ export type FinalizeInterceptResult<TRecipe extends Recipe = Recipe> = {
88
88
  * @public
89
89
  */
90
90
  export declare function maybeInterceptFinalize<TRecipe extends Recipe, TCtxMeta>(args: {
91
- request: GetProductsRequest;
91
+ request: CanonicalGetProductsRequest;
92
92
  manager: ProposalManager<TRecipe, TCtxMeta> | undefined;
93
93
  store: ProposalStore<TRecipe> | undefined;
94
94
  ctx: {
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../../../src/lib/server/decisioning/proposal/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAA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