@adcp/sdk 12.1.1 → 13.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/README.md +19 -3
  2. package/bin/adcp-fuzz.js +3 -1
  3. package/dist/lib/adapters/content-standards-adapter.d.mts +9 -9
  4. package/dist/lib/adapters/content-standards-adapter.d.ts +9 -9
  5. package/dist/lib/adapters/content-standards-adapter.d.ts.map +1 -1
  6. package/dist/lib/adapters/content-standards-adapter.js +22 -22
  7. package/dist/lib/adapters/content-standards-adapter.js.map +1 -1
  8. package/dist/lib/adapters/content-standards-adapter.mjs +18 -18
  9. package/dist/lib/adapters/content-standards-adapter.mjs.map +1 -1
  10. package/dist/lib/adapters/index.d.mts +2 -2
  11. package/dist/lib/adapters/index.d.ts +2 -2
  12. package/dist/lib/adapters/index.d.ts.map +1 -1
  13. package/dist/lib/adapters/index.js +10 -10
  14. package/dist/lib/adapters/index.js.map +1 -1
  15. package/dist/lib/adapters/index.mjs +9 -9
  16. package/dist/lib/adapters/index.mjs.map +1 -1
  17. package/dist/lib/auth/oauth/provider-cache.d.mts +7 -0
  18. package/dist/lib/auth/oauth/provider-cache.d.ts +8 -0
  19. package/dist/lib/auth/oauth/provider-cache.d.ts.map +1 -0
  20. package/dist/lib/auth/oauth/provider-cache.js +44 -0
  21. package/dist/lib/auth/oauth/provider-cache.js.map +1 -0
  22. package/dist/lib/auth/oauth/provider-cache.mjs +19 -0
  23. package/dist/lib/auth/oauth/provider-cache.mjs.map +1 -0
  24. package/dist/lib/conformance/invariants/uniformError.js +1 -1
  25. package/dist/lib/conformance/invariants/uniformError.js.map +1 -1
  26. package/dist/lib/conformance/invariants/uniformError.mjs +1 -1
  27. package/dist/lib/conformance/invariants/uniformError.mjs.map +1 -1
  28. package/dist/lib/conformance/runners.js +1 -1
  29. package/dist/lib/conformance/runners.js.map +1 -1
  30. package/dist/lib/conformance/runners.mjs +1 -1
  31. package/dist/lib/conformance/runners.mjs.map +1 -1
  32. package/dist/lib/conformance/seeder.js +5 -5
  33. package/dist/lib/conformance/seeder.js.map +1 -1
  34. package/dist/lib/conformance/seeder.mjs +5 -5
  35. package/dist/lib/conformance/seeder.mjs.map +1 -1
  36. package/dist/lib/core/ADCPMultiAgentClient.d.mts +26 -29
  37. package/dist/lib/core/ADCPMultiAgentClient.d.ts +26 -29
  38. package/dist/lib/core/ADCPMultiAgentClient.d.ts.map +1 -1
  39. package/dist/lib/core/ADCPMultiAgentClient.js +27 -19
  40. package/dist/lib/core/ADCPMultiAgentClient.js.map +1 -1
  41. package/dist/lib/core/ADCPMultiAgentClient.mjs +27 -19
  42. package/dist/lib/core/ADCPMultiAgentClient.mjs.map +1 -1
  43. package/dist/lib/core/AgentClient.d.mts +148 -138
  44. package/dist/lib/core/AgentClient.d.ts +148 -138
  45. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  46. package/dist/lib/core/AgentClient.js +174 -85
  47. package/dist/lib/core/AgentClient.js.map +1 -1
  48. package/dist/lib/core/AgentClient.mjs +174 -85
  49. package/dist/lib/core/AgentClient.mjs.map +1 -1
  50. package/dist/lib/core/AsyncHandler.d.mts +18 -16
  51. package/dist/lib/core/AsyncHandler.d.ts +18 -16
  52. package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
  53. package/dist/lib/core/AsyncHandler.js +22 -1
  54. package/dist/lib/core/AsyncHandler.js.map +1 -1
  55. package/dist/lib/core/AsyncHandler.mjs +22 -1
  56. package/dist/lib/core/AsyncHandler.mjs.map +1 -1
  57. package/dist/lib/core/ConversationTypes.d.mts +6 -2
  58. package/dist/lib/core/ConversationTypes.d.ts +6 -2
  59. package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
  60. package/dist/lib/core/ConversationTypes.js.map +1 -1
  61. package/dist/lib/core/CreativeAgentClient.d.mts +41 -17
  62. package/dist/lib/core/CreativeAgentClient.d.ts +41 -17
  63. package/dist/lib/core/CreativeAgentClient.d.ts.map +1 -1
  64. package/dist/lib/core/CreativeAgentClient.js +39 -12
  65. package/dist/lib/core/CreativeAgentClient.js.map +1 -1
  66. package/dist/lib/core/CreativeAgentClient.mjs +39 -12
  67. package/dist/lib/core/CreativeAgentClient.mjs.map +1 -1
  68. package/dist/lib/core/SingleAgentClient.d.mts +127 -50
  69. package/dist/lib/core/SingleAgentClient.d.ts +127 -50
  70. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  71. package/dist/lib/core/SingleAgentClient.js +1617 -177
  72. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  73. package/dist/lib/core/SingleAgentClient.mjs +1627 -177
  74. package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
  75. package/dist/lib/core/TaskExecutor.d.mts +9 -0
  76. package/dist/lib/core/TaskExecutor.d.ts +9 -0
  77. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  78. package/dist/lib/core/TaskExecutor.js +136 -43
  79. package/dist/lib/core/TaskExecutor.js.map +1 -1
  80. package/dist/lib/core/TaskExecutor.mjs +136 -43
  81. package/dist/lib/core/TaskExecutor.mjs.map +1 -1
  82. package/dist/lib/index.d.mts +111 -17
  83. package/dist/lib/index.d.ts +111 -17
  84. package/dist/lib/index.d.ts.map +1 -1
  85. package/dist/lib/index.js +94 -94
  86. package/dist/lib/index.js.map +1 -1
  87. package/dist/lib/index.mjs +93 -94
  88. package/dist/lib/index.mjs.map +1 -1
  89. package/dist/lib/protocols/index.d.ts.map +1 -1
  90. package/dist/lib/protocols/index.js +6 -15
  91. package/dist/lib/protocols/index.js.map +1 -1
  92. package/dist/lib/protocols/index.mjs +6 -16
  93. package/dist/lib/protocols/index.mjs.map +1 -1
  94. package/dist/lib/protocols/mcp-modern.d.ts.map +1 -1
  95. package/dist/lib/protocols/mcp-modern.js +87 -12
  96. package/dist/lib/protocols/mcp-modern.js.map +1 -1
  97. package/dist/lib/protocols/mcp-modern.mjs +89 -12
  98. package/dist/lib/protocols/mcp-modern.mjs.map +1 -1
  99. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  100. package/dist/lib/server/create-adcp-server.d.mts +6 -0
  101. package/dist/lib/server/create-adcp-server.d.ts +6 -0
  102. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  103. package/dist/lib/server/create-adcp-server.js +295 -48
  104. package/dist/lib/server/create-adcp-server.js.map +1 -1
  105. package/dist/lib/server/create-adcp-server.mjs +301 -50
  106. package/dist/lib/server/create-adcp-server.mjs.map +1 -1
  107. package/dist/lib/server/decisioning/assembly-helpers.d.mts +27 -13
  108. package/dist/lib/server/decisioning/assembly-helpers.d.ts +27 -13
  109. package/dist/lib/server/decisioning/assembly-helpers.d.ts.map +1 -1
  110. package/dist/lib/server/decisioning/assembly-helpers.js +136 -14
  111. package/dist/lib/server/decisioning/assembly-helpers.js.map +1 -1
  112. package/dist/lib/server/decisioning/assembly-helpers.mjs +134 -13
  113. package/dist/lib/server/decisioning/assembly-helpers.mjs.map +1 -1
  114. package/dist/lib/server/decisioning/index.d.mts +13 -12
  115. package/dist/lib/server/decisioning/index.d.ts +13 -12
  116. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  117. package/dist/lib/server/decisioning/index.js +6 -0
  118. package/dist/lib/server/decisioning/index.js.map +1 -1
  119. package/dist/lib/server/decisioning/index.mjs +9 -3
  120. package/dist/lib/server/decisioning/index.mjs.map +1 -1
  121. package/dist/lib/server/decisioning/list-helpers.d.mts +13 -3
  122. package/dist/lib/server/decisioning/list-helpers.d.ts +13 -3
  123. package/dist/lib/server/decisioning/list-helpers.d.ts.map +1 -1
  124. package/dist/lib/server/decisioning/list-helpers.js +13 -3
  125. package/dist/lib/server/decisioning/list-helpers.js.map +1 -1
  126. package/dist/lib/server/decisioning/list-helpers.mjs +11 -2
  127. package/dist/lib/server/decisioning/list-helpers.mjs.map +1 -1
  128. package/dist/lib/server/decisioning/manifest-helpers.d.mts +5 -3
  129. package/dist/lib/server/decisioning/manifest-helpers.d.ts +5 -3
  130. package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -1
  131. package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -1
  132. package/dist/lib/server/decisioning/manifest-helpers.mjs.map +1 -1
  133. package/dist/lib/server/decisioning/proposal/dispatch.d.mts +2 -2
  134. package/dist/lib/server/decisioning/proposal/dispatch.d.ts +2 -2
  135. package/dist/lib/server/decisioning/proposal/dispatch.d.ts.map +1 -1
  136. package/dist/lib/server/decisioning/proposal/dispatch.js.map +1 -1
  137. package/dist/lib/server/decisioning/proposal/dispatch.mjs.map +1 -1
  138. package/dist/lib/server/decisioning/proposal/index.d.mts +1 -1
  139. package/dist/lib/server/decisioning/proposal/index.d.ts +1 -1
  140. package/dist/lib/server/decisioning/proposal/index.d.ts.map +1 -1
  141. package/dist/lib/server/decisioning/proposal/index.js.map +1 -1
  142. package/dist/lib/server/decisioning/proposal/index.mjs.map +1 -1
  143. package/dist/lib/server/decisioning/proposal/lifecycle.d.mts +3 -2
  144. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts +3 -2
  145. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts.map +1 -1
  146. package/dist/lib/server/decisioning/proposal/lifecycle.js.map +1 -1
  147. package/dist/lib/server/decisioning/proposal/lifecycle.mjs.map +1 -1
  148. package/dist/lib/server/decisioning/proposal/mock-manager.d.mts +3 -3
  149. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts +3 -3
  150. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts.map +1 -1
  151. package/dist/lib/server/decisioning/proposal/mock-manager.js.map +1 -1
  152. package/dist/lib/server/decisioning/proposal/mock-manager.mjs.map +1 -1
  153. package/dist/lib/server/decisioning/proposal/types.d.mts +10 -6
  154. package/dist/lib/server/decisioning/proposal/types.d.ts +10 -6
  155. package/dist/lib/server/decisioning/proposal/types.d.ts.map +1 -1
  156. package/dist/lib/server/decisioning/proposal/types.js.map +1 -1
  157. package/dist/lib/server/decisioning/proposal/types.mjs.map +1 -1
  158. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +21 -2
  159. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +21 -2
  160. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  161. package/dist/lib/server/decisioning/runtime/from-platform.js +754 -81
  162. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  163. package/dist/lib/server/decisioning/runtime/from-platform.mjs +763 -81
  164. package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
  165. package/dist/lib/server/decisioning/specialisms/brand-rights.d.mts +9 -9
  166. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +9 -9
  167. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
  168. package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -1
  169. package/dist/lib/server/decisioning/specialisms/content-standards.d.mts +16 -16
  170. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts +16 -16
  171. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts.map +1 -1
  172. package/dist/lib/server/decisioning/specialisms/content-standards.js.map +1 -1
  173. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.mts +15 -13
  174. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +15 -13
  175. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
  176. package/dist/lib/server/decisioning/specialisms/creative-ad-server.js.map +1 -1
  177. package/dist/lib/server/decisioning/specialisms/creative.d.mts +12 -11
  178. package/dist/lib/server/decisioning/specialisms/creative.d.ts +12 -11
  179. package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
  180. package/dist/lib/server/decisioning/specialisms/creative.js.map +1 -1
  181. package/dist/lib/server/decisioning/specialisms/sales.d.mts +25 -15
  182. package/dist/lib/server/decisioning/specialisms/sales.d.ts +25 -15
  183. package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
  184. package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
  185. package/dist/lib/server/index.d.mts +3 -3
  186. package/dist/lib/server/index.d.ts +3 -3
  187. package/dist/lib/server/index.d.ts.map +1 -1
  188. package/dist/lib/server/index.js +72 -72
  189. package/dist/lib/server/index.js.map +1 -1
  190. package/dist/lib/server/index.mjs +36 -36
  191. package/dist/lib/server/index.mjs.map +1 -1
  192. package/dist/lib/server/legacy/v5/index.d.mts +1 -0
  193. package/dist/lib/server/legacy/v5/index.d.ts +1 -0
  194. package/dist/lib/server/legacy/v5/index.d.ts.map +1 -1
  195. package/dist/lib/server/legacy/v5/index.js +74 -1
  196. package/dist/lib/server/legacy/v5/index.js.map +1 -1
  197. package/dist/lib/server/legacy/v5/index.mjs +75 -1
  198. package/dist/lib/server/legacy/v5/index.mjs.map +1 -1
  199. package/dist/lib/server/responses.d.mts +2 -2
  200. package/dist/lib/server/responses.d.ts +2 -2
  201. package/dist/lib/server/responses.js.map +1 -1
  202. package/dist/lib/server/responses.mjs.map +1 -1
  203. package/dist/lib/testing/client.js +1 -1
  204. package/dist/lib/testing/client.js.map +1 -1
  205. package/dist/lib/testing/client.mjs +1 -1
  206. package/dist/lib/testing/client.mjs.map +1 -1
  207. package/dist/lib/testing/scenarios/brand-rights.js +6 -6
  208. package/dist/lib/testing/scenarios/brand-rights.js.map +1 -1
  209. package/dist/lib/testing/scenarios/brand-rights.mjs +6 -6
  210. package/dist/lib/testing/scenarios/brand-rights.mjs.map +1 -1
  211. package/dist/lib/testing/scenarios/creative.js +7 -7
  212. package/dist/lib/testing/scenarios/creative.js.map +1 -1
  213. package/dist/lib/testing/scenarios/creative.mjs +7 -7
  214. package/dist/lib/testing/scenarios/creative.mjs.map +1 -1
  215. package/dist/lib/testing/scenarios/discovery.js +2 -2
  216. package/dist/lib/testing/scenarios/discovery.js.map +1 -1
  217. package/dist/lib/testing/scenarios/discovery.mjs +2 -2
  218. package/dist/lib/testing/scenarios/discovery.mjs.map +1 -1
  219. package/dist/lib/testing/scenarios/edge-cases.js +11 -11
  220. package/dist/lib/testing/scenarios/edge-cases.js.map +1 -1
  221. package/dist/lib/testing/scenarios/edge-cases.mjs +11 -11
  222. package/dist/lib/testing/scenarios/edge-cases.mjs.map +1 -1
  223. package/dist/lib/testing/scenarios/governance.d.ts.map +1 -1
  224. package/dist/lib/testing/scenarios/governance.js +16 -22
  225. package/dist/lib/testing/scenarios/governance.js.map +1 -1
  226. package/dist/lib/testing/scenarios/governance.mjs +16 -22
  227. package/dist/lib/testing/scenarios/governance.mjs.map +1 -1
  228. package/dist/lib/testing/scenarios/media-buy.js +5 -5
  229. package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
  230. package/dist/lib/testing/scenarios/media-buy.mjs +5 -5
  231. package/dist/lib/testing/scenarios/media-buy.mjs.map +1 -1
  232. package/dist/lib/testing/scenarios/schema-compliance.js +1 -1
  233. package/dist/lib/testing/scenarios/schema-compliance.js.map +1 -1
  234. package/dist/lib/testing/scenarios/schema-compliance.mjs +1 -1
  235. package/dist/lib/testing/scenarios/schema-compliance.mjs.map +1 -1
  236. package/dist/lib/testing/scenarios/trusted-match.d.ts.map +1 -1
  237. package/dist/lib/testing/scenarios/trusted-match.js +4 -3
  238. package/dist/lib/testing/scenarios/trusted-match.js.map +1 -1
  239. package/dist/lib/testing/scenarios/trusted-match.mjs +4 -3
  240. package/dist/lib/testing/scenarios/trusted-match.mjs.map +1 -1
  241. package/dist/lib/testing/storyboard/shape-drift-hints.d.mts +3 -4
  242. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts +3 -4
  243. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts.map +1 -1
  244. package/dist/lib/testing/storyboard/shape-drift-hints.js +27 -27
  245. package/dist/lib/testing/storyboard/shape-drift-hints.js.map +1 -1
  246. package/dist/lib/testing/storyboard/shape-drift-hints.mjs +27 -27
  247. package/dist/lib/testing/storyboard/shape-drift-hints.mjs.map +1 -1
  248. package/dist/lib/testing/storyboard/task-map.d.ts.map +1 -1
  249. package/dist/lib/testing/storyboard/task-map.js +43 -5
  250. package/dist/lib/testing/storyboard/task-map.js.map +1 -1
  251. package/dist/lib/testing/storyboard/task-map.mjs +43 -5
  252. package/dist/lib/testing/storyboard/task-map.mjs.map +1 -1
  253. package/dist/lib/testing/test-helpers.d.mts +2 -2
  254. package/dist/lib/testing/test-helpers.d.ts +2 -2
  255. package/dist/lib/testing/test-helpers.js.map +1 -1
  256. package/dist/lib/testing/test-helpers.mjs.map +1 -1
  257. package/dist/lib/types/adcp.d.mts +14 -14
  258. package/dist/lib/types/adcp.d.ts +14 -14
  259. package/dist/lib/types/adcp.d.ts.map +1 -1
  260. package/dist/lib/types/adcp.js.map +1 -1
  261. package/dist/lib/types/adcp.mjs.map +1 -1
  262. package/dist/lib/types/index.d.mts +2 -2
  263. package/dist/lib/types/index.d.ts +2 -2
  264. package/dist/lib/types/index.d.ts.map +1 -1
  265. package/dist/lib/types/index.js.map +1 -1
  266. package/dist/lib/types/index.mjs.map +1 -1
  267. package/dist/lib/utils/capabilities.d.mts +6 -0
  268. package/dist/lib/utils/capabilities.d.ts +6 -0
  269. package/dist/lib/utils/capabilities.d.ts.map +1 -1
  270. package/dist/lib/utils/capabilities.js +4 -0
  271. package/dist/lib/utils/capabilities.js.map +1 -1
  272. package/dist/lib/utils/capabilities.mjs +4 -0
  273. package/dist/lib/utils/capabilities.mjs.map +1 -1
  274. package/dist/lib/utils/creative-delivery.d.mts +52 -10
  275. package/dist/lib/utils/creative-delivery.d.ts +52 -10
  276. package/dist/lib/utils/creative-delivery.d.ts.map +1 -1
  277. package/dist/lib/utils/creative-delivery.js +104 -9
  278. package/dist/lib/utils/creative-delivery.js.map +1 -1
  279. package/dist/lib/utils/creative-delivery.mjs +104 -8
  280. package/dist/lib/utils/creative-delivery.mjs.map +1 -1
  281. package/dist/lib/utils/format-assets.d.mts +41 -38
  282. package/dist/lib/utils/format-assets.d.ts +41 -38
  283. package/dist/lib/utils/format-assets.d.ts.map +1 -1
  284. package/dist/lib/utils/format-assets.js +3 -1
  285. package/dist/lib/utils/format-assets.js.map +1 -1
  286. package/dist/lib/utils/format-assets.mjs +3 -1
  287. package/dist/lib/utils/format-assets.mjs.map +1 -1
  288. package/dist/lib/utils/index.d.mts +8 -8
  289. package/dist/lib/utils/index.d.ts +8 -8
  290. package/dist/lib/utils/index.d.ts.map +1 -1
  291. package/dist/lib/utils/index.js +11 -9
  292. package/dist/lib/utils/index.js.map +1 -1
  293. package/dist/lib/utils/index.mjs +9 -8
  294. package/dist/lib/utils/index.mjs.map +1 -1
  295. package/dist/lib/utils/preview-utils.d.mts +11 -8
  296. package/dist/lib/utils/preview-utils.d.ts +11 -8
  297. package/dist/lib/utils/preview-utils.d.ts.map +1 -1
  298. package/dist/lib/utils/preview-utils.js +4 -4
  299. package/dist/lib/utils/preview-utils.js.map +1 -1
  300. package/dist/lib/utils/preview-utils.mjs +3 -3
  301. package/dist/lib/utils/preview-utils.mjs.map +1 -1
  302. package/dist/lib/utils/tool-request-schemas.d.mts +2 -2
  303. package/dist/lib/utils/tool-request-schemas.d.ts +2 -2
  304. package/dist/lib/v2/projection/aao-reference-formats.json +492 -0
  305. package/dist/lib/v2/projection/augment-response.d.mts +31 -11
  306. package/dist/lib/v2/projection/augment-response.d.ts +31 -11
  307. package/dist/lib/v2/projection/augment-response.d.ts.map +1 -1
  308. package/dist/lib/v2/projection/augment-response.js +233 -27
  309. package/dist/lib/v2/projection/augment-response.js.map +1 -1
  310. package/dist/lib/v2/projection/augment-response.mjs +232 -27
  311. package/dist/lib/v2/projection/augment-response.mjs.map +1 -1
  312. package/dist/lib/v2/projection/builders.d.mts +7 -6
  313. package/dist/lib/v2/projection/builders.d.ts +7 -6
  314. package/dist/lib/v2/projection/builders.d.ts.map +1 -1
  315. package/dist/lib/v2/projection/builders.js +11 -8
  316. package/dist/lib/v2/projection/builders.js.map +1 -1
  317. package/dist/lib/v2/projection/builders.mjs +9 -6
  318. package/dist/lib/v2/projection/builders.mjs.map +1 -1
  319. package/dist/lib/v2/projection/catalog-snapshot.d.mts +47 -0
  320. package/dist/lib/v2/projection/catalog-snapshot.d.ts +48 -0
  321. package/dist/lib/v2/projection/catalog-snapshot.d.ts.map +1 -0
  322. package/dist/lib/v2/projection/catalog-snapshot.js +291 -0
  323. package/dist/lib/v2/projection/catalog-snapshot.js.map +1 -0
  324. package/dist/lib/v2/projection/catalog-snapshot.mjs +265 -0
  325. package/dist/lib/v2/projection/catalog-snapshot.mjs.map +1 -0
  326. package/dist/lib/v2/projection/catalog.d.mts +23 -2
  327. package/dist/lib/v2/projection/catalog.d.ts +23 -2
  328. package/dist/lib/v2/projection/catalog.d.ts.map +1 -1
  329. package/dist/lib/v2/projection/catalog.js +34 -10
  330. package/dist/lib/v2/projection/catalog.js.map +1 -1
  331. package/dist/lib/v2/projection/catalog.mjs +33 -10
  332. package/dist/lib/v2/projection/catalog.mjs.map +1 -1
  333. package/dist/lib/v2/projection/creative-delivery.d.mts +157 -0
  334. package/dist/lib/v2/projection/creative-delivery.d.ts +158 -0
  335. package/dist/lib/v2/projection/creative-delivery.d.ts.map +1 -0
  336. package/dist/lib/v2/projection/creative-delivery.js +967 -0
  337. package/dist/lib/v2/projection/creative-delivery.js.map +1 -0
  338. package/dist/lib/v2/projection/creative-delivery.mjs +941 -0
  339. package/dist/lib/v2/projection/creative-delivery.mjs.map +1 -0
  340. package/dist/lib/v2/projection/index.d.mts +8 -6
  341. package/dist/lib/v2/projection/index.d.ts +8 -6
  342. package/dist/lib/v2/projection/index.d.ts.map +1 -1
  343. package/dist/lib/v2/projection/index.js +26 -4
  344. package/dist/lib/v2/projection/index.js.map +1 -1
  345. package/dist/lib/v2/projection/index.mjs +28 -4
  346. package/dist/lib/v2/projection/index.mjs.map +1 -1
  347. package/dist/lib/v2/projection/legacy-metadata.d.mts +21 -0
  348. package/dist/lib/v2/projection/legacy-metadata.d.ts +22 -0
  349. package/dist/lib/v2/projection/legacy-metadata.d.ts.map +1 -0
  350. package/dist/lib/v2/projection/legacy-metadata.js +73 -0
  351. package/dist/lib/v2/projection/legacy-metadata.js.map +1 -0
  352. package/dist/lib/v2/projection/legacy-metadata.mjs +45 -0
  353. package/dist/lib/v2/projection/legacy-metadata.mjs.map +1 -0
  354. package/dist/lib/v2/projection/types.d.mts +29 -23
  355. package/dist/lib/v2/projection/types.d.ts +29 -23
  356. package/dist/lib/v2/projection/types.d.ts.map +1 -1
  357. package/dist/lib/v2/projection/types.js.map +1 -1
  358. package/dist/lib/v2/projection/v1-to-v2.d.mts +29 -6
  359. package/dist/lib/v2/projection/v1-to-v2.d.ts +29 -6
  360. package/dist/lib/v2/projection/v1-to-v2.d.ts.map +1 -1
  361. package/dist/lib/v2/projection/v1-to-v2.js +218 -9
  362. package/dist/lib/v2/projection/v1-to-v2.js.map +1 -1
  363. package/dist/lib/v2/projection/v1-to-v2.mjs +219 -10
  364. package/dist/lib/v2/projection/v1-to-v2.mjs.map +1 -1
  365. package/dist/lib/v2/projection/v2-to-v1.d.mts +31 -2
  366. package/dist/lib/v2/projection/v2-to-v1.d.ts +31 -2
  367. package/dist/lib/v2/projection/v2-to-v1.d.ts.map +1 -1
  368. package/dist/lib/v2/projection/v2-to-v1.js +138 -7
  369. package/dist/lib/v2/projection/v2-to-v1.js.map +1 -1
  370. package/dist/lib/v2/projection/v2-to-v1.mjs +135 -6
  371. package/dist/lib/v2/projection/v2-to-v1.mjs.map +1 -1
  372. package/dist/lib/v2/projection/write-side.d.mts +12 -13
  373. package/dist/lib/v2/projection/write-side.d.ts +12 -13
  374. package/dist/lib/v2/projection/write-side.d.ts.map +1 -1
  375. package/dist/lib/v2/projection/write-side.js +16 -12
  376. package/dist/lib/v2/projection/write-side.js.map +1 -1
  377. package/dist/lib/v2/projection/write-side.mjs +16 -12
  378. package/dist/lib/v2/projection/write-side.mjs.map +1 -1
  379. package/dist/lib/version.d.mts +3 -3
  380. package/dist/lib/version.d.ts +3 -3
  381. package/dist/lib/version.d.ts.map +1 -1
  382. package/dist/lib/version.js +3 -3
  383. package/dist/lib/version.js.map +1 -1
  384. package/dist/lib/version.mjs +3 -3
  385. package/dist/lib/version.mjs.map +1 -1
  386. package/docs/guides/BUILD-AN-AGENT.md +7 -2
  387. package/docs/guides/PREVIEW-ASSET-DURABILITY.md +6 -2
  388. package/docs/llms.txt +1 -0
  389. package/examples/README.md +1 -1
  390. package/examples/batch-preview-test.ts +3 -3
  391. package/examples/conversation-client.ts +2 -2
  392. package/examples/debug-preview-response.ts +1 -1
  393. package/examples/decisioning-platform-broadcast-tv.ts +10 -4
  394. package/examples/decisioning-platform-mock-seller.ts +16 -9
  395. package/examples/decisioning-platform-programmatic.ts +18 -7
  396. package/examples/error-compliant-server.ts +26 -16
  397. package/examples/generative-creative-demo.ts +7 -19
  398. package/examples/hello_creative_adapter_ad_server.ts +37 -16
  399. package/examples/hello_creative_adapter_template.ts +12 -10
  400. package/examples/hello_seller_adapter_guaranteed.ts +52 -23
  401. package/examples/hello_seller_adapter_multi_tenant.ts +6 -3
  402. package/examples/hello_seller_adapter_non_guaranteed.ts +54 -26
  403. package/examples/hello_seller_adapter_proposal_mode.ts +40 -14
  404. package/examples/hello_seller_adapter_social.ts +2 -7
  405. package/examples/inspect-card-formats.ts +1 -1
  406. package/examples/simple-getting-started.ts +1 -1
  407. package/examples/test-helpers-demo.ts +1 -1
  408. package/package.json +2 -2
  409. package/skills/build-decisioning-creative-template/SKILL.md +11 -11
  410. package/skills/build-decisioning-platform/advanced/REFERENCE.md +8 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/v2/projection/builders.ts"],"sourcesContent":["import type { FormatReferenceStructuredObject } from '../../types/core.generated';\nimport type {\n AgentPlacementFormatDeclaration,\n CustomFormatDeclaration,\n DAASTAudioFormatDeclaration,\n DisplayTagFormatDeclaration,\n HTML5FormatDeclaration,\n HostedAudioFormatDeclaration,\n HostedVideoFormatDeclaration,\n ImageAsset,\n ImageCarouselFormatDeclaration,\n ImageFormatDeclaration,\n NativeInFeedFormatDeclaration,\n ProductFormatDeclaration,\n ResponsiveCreativeFormatDeclaration,\n SponsoredPlacementFormatDeclaration,\n VASTVideoFormatDeclaration,\n} from '../../types/tools.generated';\n\ntype WithCommonDeclaration<T> = ProductFormatDeclaration & T;\n\ninterface CanonicalFormatDeclarationMap {\n image: WithCommonDeclaration<ImageFormatDeclaration>;\n html5: WithCommonDeclaration<HTML5FormatDeclaration>;\n display_tag: WithCommonDeclaration<DisplayTagFormatDeclaration>;\n image_carousel: WithCommonDeclaration<ImageCarouselFormatDeclaration>;\n video_hosted: WithCommonDeclaration<HostedVideoFormatDeclaration>;\n video_vast: WithCommonDeclaration<VASTVideoFormatDeclaration>;\n audio_hosted: WithCommonDeclaration<HostedAudioFormatDeclaration>;\n audio_daast: WithCommonDeclaration<DAASTAudioFormatDeclaration>;\n sponsored_placement: WithCommonDeclaration<SponsoredPlacementFormatDeclaration>;\n native_in_feed: WithCommonDeclaration<NativeInFeedFormatDeclaration>;\n responsive_creative: WithCommonDeclaration<ResponsiveCreativeFormatDeclaration>;\n agent_placement: WithCommonDeclaration<AgentPlacementFormatDeclaration>;\n custom: WithCommonDeclaration<CustomFormatDeclaration>;\n}\n\nexport type CanonicalFormatKind = keyof CanonicalFormatDeclarationMap;\nexport type CanonicalFormatDeclaration<K extends CanonicalFormatKind = CanonicalFormatKind> =\n CanonicalFormatDeclarationMap[K];\nexport type CanonicalFormatParams<K extends CanonicalFormatKind> = CanonicalFormatDeclaration<K>['params'];\nexport type CanonicalFormatDeclarationFields<K extends CanonicalFormatKind = CanonicalFormatKind> = Omit<\n CanonicalFormatDeclaration<K>,\n 'format_kind' | 'params'\n>;\n\nexport type FormatReferenceInput = FormatReferenceStructuredObject & Record<string, unknown>;\n\nexport interface ProductCardFields {\n image?: ImageAsset;\n title?: string;\n description?: string;\n price_label?: string;\n cta_label?: string;\n}\n\nexport interface ProductCardDetailedFields {\n hero_image?: ImageAsset;\n carousel_images?: ImageAsset[];\n title?: string;\n description?: string;\n specifications?: Array<{ label: string; value: string }>;\n price_label?: string;\n cta_label?: string;\n}\n\n/**\n * Build the structured v1 format_id reference shape. Use this instead of a\n * bare string when populating Product.format_ids, ProductFormatDeclaration\n * v1_format_ref, or list_creative_formats filters.\n */\nexport function formatRef(\n agent_url: string,\n id: string,\n fields: Omit<Partial<FormatReferenceStructuredObject>, 'agent_url' | 'id'> & Record<string, unknown> = {}\n): FormatReferenceStructuredObject {\n return { ...fields, agent_url, id };\n}\n\nexport function formatRefs(...refs: FormatReferenceInput[]): FormatReferenceStructuredObject[] {\n return refs.map(ref => ({ ...ref }));\n}\n\n/**\n * Generic canonical-format declaration builder. It sets the format_kind\n * discriminator and keeps common declaration metadata in the third argument.\n */\nexport function canonicalFormatDeclaration<K extends CanonicalFormatKind>(\n format_kind: K,\n params: CanonicalFormatParams<K>,\n fields: CanonicalFormatDeclarationFields<K> = {} as CanonicalFormatDeclarationFields<K>\n): CanonicalFormatDeclaration<K> {\n return { ...fields, format_kind, params } as CanonicalFormatDeclaration<K>;\n}\n\nexport function imageFormatDeclaration(\n params: CanonicalFormatParams<'image'>,\n fields: CanonicalFormatDeclarationFields<'image'> = {}\n): CanonicalFormatDeclaration<'image'> {\n return canonicalFormatDeclaration('image', params, fields);\n}\n\nexport function html5FormatDeclaration(\n params: CanonicalFormatParams<'html5'>,\n fields: CanonicalFormatDeclarationFields<'html5'> = {}\n): CanonicalFormatDeclaration<'html5'> {\n return canonicalFormatDeclaration('html5', params, fields);\n}\n\nexport function displayTagFormatDeclaration(\n params: CanonicalFormatParams<'display_tag'>,\n fields: CanonicalFormatDeclarationFields<'display_tag'> = {}\n): CanonicalFormatDeclaration<'display_tag'> {\n return canonicalFormatDeclaration('display_tag', params, fields);\n}\n\nexport function imageCarouselFormatDeclaration(\n params: CanonicalFormatParams<'image_carousel'>,\n fields: CanonicalFormatDeclarationFields<'image_carousel'> = {}\n): CanonicalFormatDeclaration<'image_carousel'> {\n return canonicalFormatDeclaration('image_carousel', params, fields);\n}\n\nexport function videoHostedFormatDeclaration(\n params: CanonicalFormatParams<'video_hosted'>,\n fields: CanonicalFormatDeclarationFields<'video_hosted'> = {}\n): CanonicalFormatDeclaration<'video_hosted'> {\n return canonicalFormatDeclaration('video_hosted', params, fields);\n}\n\nexport function videoVastFormatDeclaration(\n params: CanonicalFormatParams<'video_vast'>,\n fields: CanonicalFormatDeclarationFields<'video_vast'> = {}\n): CanonicalFormatDeclaration<'video_vast'> {\n return canonicalFormatDeclaration('video_vast', params, fields);\n}\n\nexport function audioHostedFormatDeclaration(\n params: CanonicalFormatParams<'audio_hosted'>,\n fields: CanonicalFormatDeclarationFields<'audio_hosted'> = {}\n): CanonicalFormatDeclaration<'audio_hosted'> {\n return canonicalFormatDeclaration('audio_hosted', params, fields);\n}\n\nexport function audioDaastFormatDeclaration(\n params: CanonicalFormatParams<'audio_daast'>,\n fields: CanonicalFormatDeclarationFields<'audio_daast'> = {}\n): CanonicalFormatDeclaration<'audio_daast'> {\n return canonicalFormatDeclaration('audio_daast', params, fields);\n}\n\nexport function sponsoredPlacementFormatDeclaration(\n params: CanonicalFormatParams<'sponsored_placement'>,\n fields: CanonicalFormatDeclarationFields<'sponsored_placement'> = {}\n): CanonicalFormatDeclaration<'sponsored_placement'> {\n return canonicalFormatDeclaration('sponsored_placement', params, fields);\n}\n\nexport function nativeInFeedFormatDeclaration(\n params: CanonicalFormatParams<'native_in_feed'>,\n fields: CanonicalFormatDeclarationFields<'native_in_feed'> = {}\n): CanonicalFormatDeclaration<'native_in_feed'> {\n return canonicalFormatDeclaration('native_in_feed', params, fields);\n}\n\nexport function responsiveCreativeFormatDeclaration(\n params: CanonicalFormatParams<'responsive_creative'>,\n fields: CanonicalFormatDeclarationFields<'responsive_creative'> = {}\n): CanonicalFormatDeclaration<'responsive_creative'> {\n return canonicalFormatDeclaration('responsive_creative', params, fields);\n}\n\nexport function agentPlacementFormatDeclaration(\n params: CanonicalFormatParams<'agent_placement'>,\n fields: CanonicalFormatDeclarationFields<'agent_placement'> = {}\n): CanonicalFormatDeclaration<'agent_placement'> {\n return canonicalFormatDeclaration('agent_placement', params, fields);\n}\n\nexport function customFormatDeclaration(\n format_shape: string,\n format_schema: NonNullable<CanonicalFormatDeclarationFields<'custom'>['format_schema']>,\n params: CanonicalFormatParams<'custom'>,\n fields: Omit<CanonicalFormatDeclarationFields<'custom'>, 'format_shape' | 'format_schema'> = {}\n): CanonicalFormatDeclaration<'custom'> {\n return canonicalFormatDeclaration('custom', params, { ...fields, format_shape, format_schema });\n}\n\n/**\n * Product cards describe the merchandising UI for a product. They do not carry\n * format_id and are intentionally separate from creative format declarations.\n */\nexport function productCard(fields: ProductCardFields): ProductCardFields {\n return { ...fields };\n}\n\nexport function productCardDetailed(fields: ProductCardDetailedFields): ProductCardDetailedFields {\n return {\n ...fields,\n carousel_images: fields.carousel_images?.map(image => ({ ...image })),\n specifications: fields.specifications?.map(spec => ({ ...spec })),\n };\n}\n\nexport const CanonicalFormat = {\n ref: formatRef,\n refs: formatRefs,\n declaration: canonicalFormatDeclaration,\n image: imageFormatDeclaration,\n html5: html5FormatDeclaration,\n displayTag: displayTagFormatDeclaration,\n imageCarousel: imageCarouselFormatDeclaration,\n videoHosted: videoHostedFormatDeclaration,\n videoVast: videoVastFormatDeclaration,\n audioHosted: audioHostedFormatDeclaration,\n audioDaast: audioDaastFormatDeclaration,\n sponsoredPlacement: sponsoredPlacementFormatDeclaration,\n nativeInFeed: nativeInFeedFormatDeclaration,\n responsiveCreative: responsiveCreativeFormatDeclaration,\n agentPlacement: agentPlacementFormatDeclaration,\n custom: customFormatDeclaration,\n productCard,\n productCardDetailed,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuEO,SAAS,UACd,WACA,IACA,SAAuG,CAAC,GACvE;AACjC,SAAO,EAAE,GAAG,QAAQ,WAAW,GAAG;AACpC;AAEO,SAA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mBAAmB,QAAQ,MAAM;AACrE;AAEO,SAAS,wBACd,cACA,eACA,QACA,SAA6F,CAAC,GACxD;AACtC,SAAO,2BAA2B,UAAU,QAAQ,EAAE,GAAG,QAAQ,cAAc,cAAc,CAAC;AAChG;AAMO,SAAS,YAAY,QAA8C;AACxE,SAAO,EAAE,GAAG,OAAO;AACrB;AAEO,SAAS,oBAAoB,QAA8D;AAChG,SAAO;AAAA,IACL,GAAG;AAAA,IACH,iBAAiB,OAAO,iBAAiB,IAAI,YAAU,EAAE,GAAG,MAAM,EAAE;AAAA,IACpE,gBAAgB,OAAO,gBAAgB,IAAI,WAAS,EAAE,GAAG,KAAK,EAAE;AAAA,EAClE;AACF;AAEO,MAAM,kBAAkB;AAAA,EAC7B,KAAK;AAAA,EACL,MAAM;AAAA,EACN,aAAa;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR;AAAA,EACA;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/v2/projection/builders.ts"],"sourcesContent":["import type { FormatReferenceStructuredObject } from '../../types/core.generated';\nimport type {\n AgentPlacementFormatDeclaration,\n CustomFormatDeclaration,\n DAASTAudioFormatDeclaration,\n DisplayTagFormatDeclaration,\n HTML5FormatDeclaration,\n HostedAudioFormatDeclaration,\n HostedVideoFormatDeclaration,\n ImageAsset,\n ImageCarouselFormatDeclaration,\n ImageFormatDeclaration,\n NativeInFeedFormatDeclaration,\n ResponsiveCreativeFormatDeclaration,\n SponsoredPlacementFormatDeclaration,\n VASTVideoFormatDeclaration,\n} from '../../types/tools.generated';\nimport type { CanonicalFormatDeclaration as CanonicalBaseFormatDeclaration } from './legacy-metadata';\n\ntype WithCommonDeclaration<T> = CanonicalBaseFormatDeclaration &\n Omit<T, 'v1_format_ref'> & {\n v1_format_ref?: never;\n };\n\ninterface CanonicalFormatDeclarationMap {\n image: WithCommonDeclaration<ImageFormatDeclaration>;\n html5: WithCommonDeclaration<HTML5FormatDeclaration>;\n display_tag: WithCommonDeclaration<DisplayTagFormatDeclaration>;\n image_carousel: WithCommonDeclaration<ImageCarouselFormatDeclaration>;\n video_hosted: WithCommonDeclaration<HostedVideoFormatDeclaration>;\n video_vast: WithCommonDeclaration<VASTVideoFormatDeclaration>;\n audio_hosted: WithCommonDeclaration<HostedAudioFormatDeclaration>;\n audio_daast: WithCommonDeclaration<DAASTAudioFormatDeclaration>;\n sponsored_placement: WithCommonDeclaration<SponsoredPlacementFormatDeclaration>;\n native_in_feed: WithCommonDeclaration<NativeInFeedFormatDeclaration>;\n responsive_creative: WithCommonDeclaration<ResponsiveCreativeFormatDeclaration>;\n agent_placement: WithCommonDeclaration<AgentPlacementFormatDeclaration>;\n custom: WithCommonDeclaration<CustomFormatDeclaration>;\n}\n\nexport type CanonicalFormatKind = keyof CanonicalFormatDeclarationMap;\nexport type CanonicalFormatDeclaration<K extends CanonicalFormatKind = CanonicalFormatKind> =\n CanonicalFormatDeclarationMap[K];\nexport type CanonicalFormatParams<K extends CanonicalFormatKind> = CanonicalFormatDeclaration<K>['params'];\nexport type CanonicalFormatDeclarationFields<K extends CanonicalFormatKind = CanonicalFormatKind> = Omit<\n CanonicalFormatDeclaration<K>,\n 'format_kind' | 'params'\n>;\n\nexport type FormatReferenceInput = FormatReferenceStructuredObject & Record<string, unknown>;\n\nexport interface ProductCardFields {\n image?: ImageAsset;\n title?: string;\n description?: string;\n price_label?: string;\n cta_label?: string;\n}\n\nexport interface ProductCardDetailedFields {\n hero_image?: ImageAsset;\n carousel_images?: ImageAsset[];\n title?: string;\n description?: string;\n specifications?: Array<{ label: string; value: string }>;\n price_label?: string;\n cta_label?: string;\n}\n\n/**\n * Build the structured v1 format_id reference shape. Use this instead of a\n * bare string when populating Product.format_ids, ProductFormatDeclaration\n * v1_format_ref, or list_creative_formats filters.\n */\nexport function legacyFormatRef(\n agent_url: string,\n id: string,\n fields: Omit<Partial<FormatReferenceStructuredObject>, 'agent_url' | 'id'> & Record<string, unknown> = {}\n): FormatReferenceStructuredObject {\n return { ...fields, agent_url, id };\n}\n\nexport function legacyFormatRefs(...refs: FormatReferenceInput[]): FormatReferenceStructuredObject[] {\n return refs.map(ref => ({ ...ref }));\n}\n\n/**\n * Generic canonical-format declaration builder. It sets the format_kind\n * discriminator and keeps common declaration metadata in the third argument.\n */\nexport function canonicalFormatDeclaration<K extends CanonicalFormatKind>(\n format_kind: K,\n params: CanonicalFormatParams<K>,\n fields: CanonicalFormatDeclarationFields<K> = {} as CanonicalFormatDeclarationFields<K>\n): CanonicalFormatDeclaration<K> {\n if (Reflect.has(fields as object, 'v1_format_ref')) {\n throw new Error(\n 'canonicalFormatDeclaration does not accept legacy routing references; use explicitly named legacy migration helpers outside the canonical surface'\n );\n }\n return { ...fields, format_kind, params } as CanonicalFormatDeclaration<K>;\n}\n\nexport function imageFormatDeclaration(\n params: CanonicalFormatParams<'image'>,\n fields: CanonicalFormatDeclarationFields<'image'> = {}\n): CanonicalFormatDeclaration<'image'> {\n return canonicalFormatDeclaration('image', params, fields);\n}\n\nexport function html5FormatDeclaration(\n params: CanonicalFormatParams<'html5'>,\n fields: CanonicalFormatDeclarationFields<'html5'> = {}\n): CanonicalFormatDeclaration<'html5'> {\n return canonicalFormatDeclaration('html5', params, fields);\n}\n\nexport function displayTagFormatDeclaration(\n params: CanonicalFormatParams<'display_tag'>,\n fields: CanonicalFormatDeclarationFields<'display_tag'> = {}\n): CanonicalFormatDeclaration<'display_tag'> {\n return canonicalFormatDeclaration('display_tag', params, fields);\n}\n\nexport function imageCarouselFormatDeclaration(\n params: CanonicalFormatParams<'image_carousel'>,\n fields: CanonicalFormatDeclarationFields<'image_carousel'> = {}\n): CanonicalFormatDeclaration<'image_carousel'> {\n return canonicalFormatDeclaration('image_carousel', params, fields);\n}\n\nexport function videoHostedFormatDeclaration(\n params: CanonicalFormatParams<'video_hosted'>,\n fields: CanonicalFormatDeclarationFields<'video_hosted'> = {}\n): CanonicalFormatDeclaration<'video_hosted'> {\n return canonicalFormatDeclaration('video_hosted', params, fields);\n}\n\nexport function videoVastFormatDeclaration(\n params: CanonicalFormatParams<'video_vast'>,\n fields: CanonicalFormatDeclarationFields<'video_vast'> = {}\n): CanonicalFormatDeclaration<'video_vast'> {\n return canonicalFormatDeclaration('video_vast', params, fields);\n}\n\nexport function audioHostedFormatDeclaration(\n params: CanonicalFormatParams<'audio_hosted'>,\n fields: CanonicalFormatDeclarationFields<'audio_hosted'> = {}\n): CanonicalFormatDeclaration<'audio_hosted'> {\n return canonicalFormatDeclaration('audio_hosted', params, fields);\n}\n\nexport function audioDaastFormatDeclaration(\n params: CanonicalFormatParams<'audio_daast'>,\n fields: CanonicalFormatDeclarationFields<'audio_daast'> = {}\n): CanonicalFormatDeclaration<'audio_daast'> {\n return canonicalFormatDeclaration('audio_daast', params, fields);\n}\n\nexport function sponsoredPlacementFormatDeclaration(\n params: CanonicalFormatParams<'sponsored_placement'>,\n fields: CanonicalFormatDeclarationFields<'sponsored_placement'> = {}\n): CanonicalFormatDeclaration<'sponsored_placement'> {\n return canonicalFormatDeclaration('sponsored_placement', params, fields);\n}\n\nexport function nativeInFeedFormatDeclaration(\n params: CanonicalFormatParams<'native_in_feed'>,\n fields: CanonicalFormatDeclarationFields<'native_in_feed'> = {}\n): CanonicalFormatDeclaration<'native_in_feed'> {\n return canonicalFormatDeclaration('native_in_feed', params, fields);\n}\n\nexport function responsiveCreativeFormatDeclaration(\n params: CanonicalFormatParams<'responsive_creative'>,\n fields: CanonicalFormatDeclarationFields<'responsive_creative'> = {}\n): CanonicalFormatDeclaration<'responsive_creative'> {\n return canonicalFormatDeclaration('responsive_creative', params, fields);\n}\n\nexport function agentPlacementFormatDeclaration(\n params: CanonicalFormatParams<'agent_placement'>,\n fields: CanonicalFormatDeclarationFields<'agent_placement'> = {}\n): CanonicalFormatDeclaration<'agent_placement'> {\n return canonicalFormatDeclaration('agent_placement', params, fields);\n}\n\nexport function customFormatDeclaration(\n format_shape: string,\n format_schema: NonNullable<CanonicalFormatDeclarationFields<'custom'>['format_schema']>,\n params: CanonicalFormatParams<'custom'>,\n fields: Omit<CanonicalFormatDeclarationFields<'custom'>, 'format_shape' | 'format_schema'> = {}\n): CanonicalFormatDeclaration<'custom'> {\n return canonicalFormatDeclaration('custom', params, { ...fields, format_shape, format_schema });\n}\n\n/**\n * Product cards describe the merchandising UI for a product. They do not carry\n * format_id and are intentionally separate from creative format declarations.\n */\nexport function productCard(fields: ProductCardFields): ProductCardFields {\n return { ...fields };\n}\n\nexport function productCardDetailed(fields: ProductCardDetailedFields): ProductCardDetailedFields {\n return {\n ...fields,\n carousel_images: fields.carousel_images?.map(image => ({ ...image })),\n specifications: fields.specifications?.map(spec => ({ ...spec })),\n };\n}\n\nexport const CanonicalFormat = {\n declaration: canonicalFormatDeclaration,\n image: imageFormatDeclaration,\n html5: html5FormatDeclaration,\n displayTag: displayTagFormatDeclaration,\n imageCarousel: imageCarouselFormatDeclaration,\n videoHosted: videoHostedFormatDeclaration,\n videoVast: videoVastFormatDeclaration,\n audioHosted: audioHostedFormatDeclaration,\n audioDaast: audioDaastFormatDeclaration,\n sponsoredPlacement: sponsoredPlacementFormatDeclaration,\n nativeInFeed: nativeInFeedFormatDeclaration,\n responsiveCreative: responsiveCreativeFormatDeclaration,\n agentPlacement: agentPlacementFormatDeclaration,\n custom: customFormatDeclaration,\n productCard,\n productCardDetailed,\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0EO,SAAS,gBACd,WACA,IACA,SA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AQ,MAAM;AACpE;AAEO,SAAS,oCACd,QACA,SAAkE,CAAC,GAChB;AACnD,SAAO,2BAA2B,uBAAuB,QAAQ,MAAM;AACzE;AAEO,SAAS,gCACd,QACA,SAA8D,CAAC,GAChB;AAC/C,SAAO,2BAA2B,mBAAmB,QAAQ,MAAM;AACrE;AAEO,SAAS,wBACd,cACA,eACA,QACA,SAA6F,CAAC,GACxD;AACtC,SAAO,2BAA2B,UAAU,QAAQ,EAAE,GAAG,QAAQ,cAAc,cAAc,CAAC;AAChG;AAMO,SAAS,YAAY,QAA8C;AACxE,SAAO,EAAE,GAAG,OAAO;AACrB;AAEO,SAAS,oBAAoB,QAA8D;AAChG,SAAO;AAAA,IACL,GAAG;AAAA,IACH,iBAAiB,OAAO,iBAAiB,IAAI,YAAU,EAAE,GAAG,MAAM,EAAE;AAAA,IACpE,gBAAgB,OAAO,gBAAgB,IAAI,WAAS,EAAE,GAAG,KAAK,EAAE;AAAA,EAClE;AACF;AAEO,MAAM,kBAAkB;AAAA,EAC7B,aAAa;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR;AAAA,EACA;AACF;","names":[]}
@@ -1,10 +1,15 @@
1
- function formatRef(agent_url, id, fields = {}) {
1
+ function legacyFormatRef(agent_url, id, fields = {}) {
2
2
  return { ...fields, agent_url, id };
3
3
  }
4
- function formatRefs(...refs) {
4
+ function legacyFormatRefs(...refs) {
5
5
  return refs.map((ref) => ({ ...ref }));
6
6
  }
7
7
  function canonicalFormatDeclaration(format_kind, params, fields = {}) {
8
+ if (Reflect.has(fields, "v1_format_ref")) {
9
+ throw new Error(
10
+ "canonicalFormatDeclaration does not accept legacy routing references; use explicitly named legacy migration helpers outside the canonical surface"
11
+ );
12
+ }
8
13
  return { ...fields, format_kind, params };
9
14
  }
10
15
  function imageFormatDeclaration(params, fields = {}) {
@@ -57,8 +62,6 @@ function productCardDetailed(fields) {
57
62
  };
58
63
  }
59
64
  const CanonicalFormat = {
60
- ref: formatRef,
61
- refs: formatRefs,
62
65
  declaration: canonicalFormatDeclaration,
63
66
  image: imageFormatDeclaration,
64
67
  html5: html5FormatDeclaration,
@@ -84,11 +87,11 @@ export {
84
87
  canonicalFormatDeclaration,
85
88
  customFormatDeclaration,
86
89
  displayTagFormatDeclaration,
87
- formatRef,
88
- formatRefs,
89
90
  html5FormatDeclaration,
90
91
  imageCarouselFormatDeclaration,
91
92
  imageFormatDeclaration,
93
+ legacyFormatRef,
94
+ legacyFormatRefs,
92
95
  nativeInFeedFormatDeclaration,
93
96
  productCard,
94
97
  productCardDetailed,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/v2/projection/builders.ts"],"sourcesContent":["import type { FormatReferenceStructuredObject } from '../../types/core.generated';\nimport type {\n AgentPlacementFormatDeclaration,\n CustomFormatDeclaration,\n DAASTAudioFormatDeclaration,\n DisplayTagFormatDeclaration,\n HTML5FormatDeclaration,\n HostedAudioFormatDeclaration,\n HostedVideoFormatDeclaration,\n ImageAsset,\n ImageCarouselFormatDeclaration,\n ImageFormatDeclaration,\n NativeInFeedFormatDeclaration,\n ProductFormatDeclaration,\n ResponsiveCreativeFormatDeclaration,\n SponsoredPlacementFormatDeclaration,\n VASTVideoFormatDeclaration,\n} from '../../types/tools.generated';\n\ntype WithCommonDeclaration<T> = ProductFormatDeclaration & T;\n\ninterface CanonicalFormatDeclarationMap {\n image: WithCommonDeclaration<ImageFormatDeclaration>;\n html5: WithCommonDeclaration<HTML5FormatDeclaration>;\n display_tag: WithCommonDeclaration<DisplayTagFormatDeclaration>;\n image_carousel: WithCommonDeclaration<ImageCarouselFormatDeclaration>;\n video_hosted: WithCommonDeclaration<HostedVideoFormatDeclaration>;\n video_vast: WithCommonDeclaration<VASTVideoFormatDeclaration>;\n audio_hosted: WithCommonDeclaration<HostedAudioFormatDeclaration>;\n audio_daast: WithCommonDeclaration<DAASTAudioFormatDeclaration>;\n sponsored_placement: WithCommonDeclaration<SponsoredPlacementFormatDeclaration>;\n native_in_feed: WithCommonDeclaration<NativeInFeedFormatDeclaration>;\n responsive_creative: WithCommonDeclaration<ResponsiveCreativeFormatDeclaration>;\n agent_placement: WithCommonDeclaration<AgentPlacementFormatDeclaration>;\n custom: WithCommonDeclaration<CustomFormatDeclaration>;\n}\n\nexport type CanonicalFormatKind = keyof CanonicalFormatDeclarationMap;\nexport type CanonicalFormatDeclaration<K extends CanonicalFormatKind = CanonicalFormatKind> =\n CanonicalFormatDeclarationMap[K];\nexport type CanonicalFormatParams<K extends CanonicalFormatKind> = CanonicalFormatDeclaration<K>['params'];\nexport type CanonicalFormatDeclarationFields<K extends CanonicalFormatKind = CanonicalFormatKind> = Omit<\n CanonicalFormatDeclaration<K>,\n 'format_kind' | 'params'\n>;\n\nexport type FormatReferenceInput = FormatReferenceStructuredObject & Record<string, unknown>;\n\nexport interface ProductCardFields {\n image?: ImageAsset;\n title?: string;\n description?: string;\n price_label?: string;\n cta_label?: string;\n}\n\nexport interface ProductCardDetailedFields {\n hero_image?: ImageAsset;\n carousel_images?: ImageAsset[];\n title?: string;\n description?: string;\n specifications?: Array<{ label: string; value: string }>;\n price_label?: string;\n cta_label?: string;\n}\n\n/**\n * Build the structured v1 format_id reference shape. Use this instead of a\n * bare string when populating Product.format_ids, ProductFormatDeclaration\n * v1_format_ref, or list_creative_formats filters.\n */\nexport function formatRef(\n agent_url: string,\n id: string,\n fields: Omit<Partial<FormatReferenceStructuredObject>, 'agent_url' | 'id'> & Record<string, unknown> = {}\n): FormatReferenceStructuredObject {\n return { ...fields, agent_url, id };\n}\n\nexport function formatRefs(...refs: FormatReferenceInput[]): FormatReferenceStructuredObject[] {\n return refs.map(ref => ({ ...ref }));\n}\n\n/**\n * Generic canonical-format declaration builder. It sets the format_kind\n * discriminator and keeps common declaration metadata in the third argument.\n */\nexport function canonicalFormatDeclaration<K extends CanonicalFormatKind>(\n format_kind: K,\n params: CanonicalFormatParams<K>,\n fields: CanonicalFormatDeclarationFields<K> = {} as CanonicalFormatDeclarationFields<K>\n): CanonicalFormatDeclaration<K> {\n return { ...fields, format_kind, params } as CanonicalFormatDeclaration<K>;\n}\n\nexport function imageFormatDeclaration(\n params: CanonicalFormatParams<'image'>,\n fields: CanonicalFormatDeclarationFields<'image'> = {}\n): CanonicalFormatDeclaration<'image'> {\n return canonicalFormatDeclaration('image', params, fields);\n}\n\nexport function html5FormatDeclaration(\n params: CanonicalFormatParams<'html5'>,\n fields: CanonicalFormatDeclarationFields<'html5'> = {}\n): CanonicalFormatDeclaration<'html5'> {\n return canonicalFormatDeclaration('html5', params, fields);\n}\n\nexport function displayTagFormatDeclaration(\n params: CanonicalFormatParams<'display_tag'>,\n fields: CanonicalFormatDeclarationFields<'display_tag'> = {}\n): CanonicalFormatDeclaration<'display_tag'> {\n return canonicalFormatDeclaration('display_tag', params, fields);\n}\n\nexport function imageCarouselFormatDeclaration(\n params: CanonicalFormatParams<'image_carousel'>,\n fields: CanonicalFormatDeclarationFields<'image_carousel'> = {}\n): CanonicalFormatDeclaration<'image_carousel'> {\n return canonicalFormatDeclaration('image_carousel', params, fields);\n}\n\nexport function videoHostedFormatDeclaration(\n params: CanonicalFormatParams<'video_hosted'>,\n fields: CanonicalFormatDeclarationFields<'video_hosted'> = {}\n): CanonicalFormatDeclaration<'video_hosted'> {\n return canonicalFormatDeclaration('video_hosted', params, fields);\n}\n\nexport function videoVastFormatDeclaration(\n params: CanonicalFormatParams<'video_vast'>,\n fields: CanonicalFormatDeclarationFields<'video_vast'> = {}\n): CanonicalFormatDeclaration<'video_vast'> {\n return canonicalFormatDeclaration('video_vast', params, fields);\n}\n\nexport function audioHostedFormatDeclaration(\n params: CanonicalFormatParams<'audio_hosted'>,\n fields: CanonicalFormatDeclarationFields<'audio_hosted'> = {}\n): CanonicalFormatDeclaration<'audio_hosted'> {\n return canonicalFormatDeclaration('audio_hosted', params, fields);\n}\n\nexport function audioDaastFormatDeclaration(\n params: CanonicalFormatParams<'audio_daast'>,\n fields: CanonicalFormatDeclarationFields<'audio_daast'> = {}\n): CanonicalFormatDeclaration<'audio_daast'> {\n return canonicalFormatDeclaration('audio_daast', params, fields);\n}\n\nexport function sponsoredPlacementFormatDeclaration(\n params: CanonicalFormatParams<'sponsored_placement'>,\n fields: CanonicalFormatDeclarationFields<'sponsored_placement'> = {}\n): CanonicalFormatDeclaration<'sponsored_placement'> {\n return canonicalFormatDeclaration('sponsored_placement', params, fields);\n}\n\nexport function nativeInFeedFormatDeclaration(\n params: CanonicalFormatParams<'native_in_feed'>,\n fields: CanonicalFormatDeclarationFields<'native_in_feed'> = {}\n): CanonicalFormatDeclaration<'native_in_feed'> {\n return canonicalFormatDeclaration('native_in_feed', params, fields);\n}\n\nexport function responsiveCreativeFormatDeclaration(\n params: CanonicalFormatParams<'responsive_creative'>,\n fields: CanonicalFormatDeclarationFields<'responsive_creative'> = {}\n): CanonicalFormatDeclaration<'responsive_creative'> {\n return canonicalFormatDeclaration('responsive_creative', params, fields);\n}\n\nexport function agentPlacementFormatDeclaration(\n params: CanonicalFormatParams<'agent_placement'>,\n fields: CanonicalFormatDeclarationFields<'agent_placement'> = {}\n): CanonicalFormatDeclaration<'agent_placement'> {\n return canonicalFormatDeclaration('agent_placement', params, fields);\n}\n\nexport function customFormatDeclaration(\n format_shape: string,\n format_schema: NonNullable<CanonicalFormatDeclarationFields<'custom'>['format_schema']>,\n params: CanonicalFormatParams<'custom'>,\n fields: Omit<CanonicalFormatDeclarationFields<'custom'>, 'format_shape' | 'format_schema'> = {}\n): CanonicalFormatDeclaration<'custom'> {\n return canonicalFormatDeclaration('custom', params, { ...fields, format_shape, format_schema });\n}\n\n/**\n * Product cards describe the merchandising UI for a product. They do not carry\n * format_id and are intentionally separate from creative format declarations.\n */\nexport function productCard(fields: ProductCardFields): ProductCardFields {\n return { ...fields };\n}\n\nexport function productCardDetailed(fields: ProductCardDetailedFields): ProductCardDetailedFields {\n return {\n ...fields,\n carousel_images: fields.carousel_images?.map(image => ({ ...image })),\n specifications: fields.specifications?.map(spec => ({ ...spec })),\n };\n}\n\nexport const CanonicalFormat = {\n ref: formatRef,\n refs: formatRefs,\n declaration: canonicalFormatDeclaration,\n image: imageFormatDeclaration,\n html5: html5FormatDeclaration,\n displayTag: displayTagFormatDeclaration,\n imageCarousel: imageCarouselFormatDeclaration,\n videoHosted: videoHostedFormatDeclaration,\n videoVast: videoVastFormatDeclaration,\n audioHosted: audioHostedFormatDeclaration,\n audioDaast: audioDaastFormatDeclaration,\n sponsoredPlacement: sponsoredPlacementFormatDeclaration,\n nativeInFeed: nativeInFeedFormatDeclaration,\n responsiveCreative: responsiveCreativeFormatDeclaration,\n agentPlacement: agentPlacementFormatDeclaration,\n custom: customFormatDeclaration,\n productCard,\n productCardDetailed,\n} as const;\n"],"mappings":"AAuEO,SAAS,UACd,WACA,IACA,SAAuG,CAAC,GACvE;AACjC,SAAO,EAAE,GAAG,QAAQ,WAAW,GAAG;AACpC;AAEO,SAAS,cAAc,MAAiE;AAC7F,SAAO,KAAK,IAAI,UAAQ,EAAE,GAAG,IAAI,EAAE;AACrC;AAMO,SAAS,2BACd,aACA,QACA,SAA8C,CAAC,GAChB;AAC/B,SAAO,EAAE,GAAG,QAAQ,aAAa,OAAO;AAC1C;AAEO,SAAS,uBACd,QACA,SAAoD,CAAC,GAChB;AACrC,SAAO,2BAA2B,SAAS,QAAQ,MAAM;AAC3D;AAEO,SAAS,uBACd,QACA,SAAoD,CAAC,GAChB;AACrC,SAAO,2BAA2B,SAAS,QAAQ,MAAM;AAC3D;AAEO,SAAS,4BACd,QACA,SAA0D,CAAC,GAChB;AAC3C,SAAO,2BAA2B,eAAe,QAAQ,MAAM;AACjE;AAEO,SAAS,+BACd,QACA,SAA6D,C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A,EACL,MAAM;AAAA,EACN,aAAa;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR;AAAA,EACA;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/v2/projection/builders.ts"],"sourcesContent":["import type { FormatReferenceStructuredObject } from '../../types/core.generated';\nimport type {\n AgentPlacementFormatDeclaration,\n CustomFormatDeclaration,\n DAASTAudioFormatDeclaration,\n DisplayTagFormatDeclaration,\n HTML5FormatDeclaration,\n HostedAudioFormatDeclaration,\n HostedVideoFormatDeclaration,\n ImageAsset,\n ImageCarouselFormatDeclaration,\n ImageFormatDeclaration,\n NativeInFeedFormatDeclaration,\n ResponsiveCreativeFormatDeclaration,\n SponsoredPlacementFormatDeclaration,\n VASTVideoFormatDeclaration,\n} from '../../types/tools.generated';\nimport type { CanonicalFormatDeclaration as CanonicalBaseFormatDeclaration } from './legacy-metadata';\n\ntype WithCommonDeclaration<T> = CanonicalBaseFormatDeclaration &\n Omit<T, 'v1_format_ref'> & {\n v1_format_ref?: never;\n };\n\ninterface CanonicalFormatDeclarationMap {\n image: WithCommonDeclaration<ImageFormatDeclaration>;\n html5: WithCommonDeclaration<HTML5FormatDeclaration>;\n display_tag: WithCommonDeclaration<DisplayTagFormatDeclaration>;\n image_carousel: WithCommonDeclaration<ImageCarouselFormatDeclaration>;\n video_hosted: WithCommonDeclaration<HostedVideoFormatDeclaration>;\n video_vast: WithCommonDeclaration<VASTVideoFormatDeclaration>;\n audio_hosted: WithCommonDeclaration<HostedAudioFormatDeclaration>;\n audio_daast: WithCommonDeclaration<DAASTAudioFormatDeclaration>;\n sponsored_placement: WithCommonDeclaration<SponsoredPlacementFormatDeclaration>;\n native_in_feed: WithCommonDeclaration<NativeInFeedFormatDeclaration>;\n responsive_creative: WithCommonDeclaration<ResponsiveCreativeFormatDeclaration>;\n agent_placement: WithCommonDeclaration<AgentPlacementFormatDeclaration>;\n custom: WithCommonDeclaration<CustomFormatDeclaration>;\n}\n\nexport type CanonicalFormatKind = keyof CanonicalFormatDeclarationMap;\nexport type CanonicalFormatDeclaration<K extends CanonicalFormatKind = CanonicalFormatKind> =\n CanonicalFormatDeclarationMap[K];\nexport type CanonicalFormatParams<K extends CanonicalFormatKind> = CanonicalFormatDeclaration<K>['params'];\nexport type CanonicalFormatDeclarationFields<K extends CanonicalFormatKind = CanonicalFormatKind> = Omit<\n CanonicalFormatDeclaration<K>,\n 'format_kind' | 'params'\n>;\n\nexport type FormatReferenceInput = FormatReferenceStructuredObject & Record<string, unknown>;\n\nexport interface ProductCardFields {\n image?: ImageAsset;\n title?: string;\n description?: string;\n price_label?: string;\n cta_label?: string;\n}\n\nexport interface ProductCardDetailedFields {\n hero_image?: ImageAsset;\n carousel_images?: ImageAsset[];\n title?: string;\n description?: string;\n specifications?: Array<{ label: string; value: string }>;\n price_label?: string;\n cta_label?: string;\n}\n\n/**\n * Build the structured v1 format_id reference shape. Use this instead of a\n * bare string when populating Product.format_ids, ProductFormatDeclaration\n * v1_format_ref, or list_creative_formats filters.\n */\nexport function legacyFormatRef(\n agent_url: string,\n id: string,\n fields: Omit<Partial<FormatReferenceStructuredObject>, 'agent_url' | 'id'> & Record<string, unknown> = {}\n): FormatReferenceStructuredObject {\n return { ...fields, agent_url, id };\n}\n\nexport function legacyFormatRefs(...refs: FormatReferenceInput[]): FormatReferenceStructuredObject[] {\n return refs.map(ref => ({ ...ref }));\n}\n\n/**\n * Generic canonical-format declaration builder. It sets the format_kind\n * discriminator and keeps common declaration metadata in the third argument.\n */\nexport function canonicalFormatDeclaration<K extends CanonicalFormatKind>(\n format_kind: K,\n params: CanonicalFormatParams<K>,\n fields: CanonicalFormatDeclarationFields<K> = {} as CanonicalFormatDeclarationFields<K>\n): CanonicalFormatDeclaration<K> {\n if (Reflect.has(fields as object, 'v1_format_ref')) {\n throw new Error(\n 'canonicalFormatDeclaration does not accept legacy routing references; use explicitly named legacy migration helpers outside the canonical surface'\n );\n }\n return { ...fields, format_kind, params } as CanonicalFormatDeclaration<K>;\n}\n\nexport function imageFormatDeclaration(\n params: CanonicalFormatParams<'image'>,\n fields: CanonicalFormatDeclarationFields<'image'> = {}\n): CanonicalFormatDeclaration<'image'> {\n return canonicalFormatDeclaration('image', params, fields);\n}\n\nexport function html5FormatDeclaration(\n params: CanonicalFormatParams<'html5'>,\n fields: CanonicalFormatDeclarationFields<'html5'> = {}\n): CanonicalFormatDeclaration<'html5'> {\n return canonicalFormatDeclaration('html5', params, fields);\n}\n\nexport function displayTagFormatDeclaration(\n params: CanonicalFormatParams<'display_tag'>,\n fields: CanonicalFormatDeclarationFields<'display_tag'> = {}\n): CanonicalFormatDeclaration<'display_tag'> {\n return canonicalFormatDeclaration('display_tag', params, fields);\n}\n\nexport function imageCarouselFormatDeclaration(\n params: CanonicalFormatParams<'image_carousel'>,\n fields: CanonicalFormatDeclarationFields<'image_carousel'> = {}\n): CanonicalFormatDeclaration<'image_carousel'> {\n return canonicalFormatDeclaration('image_carousel', params, fields);\n}\n\nexport function videoHostedFormatDeclaration(\n params: CanonicalFormatParams<'video_hosted'>,\n fields: CanonicalFormatDeclarationFields<'video_hosted'> = {}\n): CanonicalFormatDeclaration<'video_hosted'> {\n return canonicalFormatDeclaration('video_hosted', params, fields);\n}\n\nexport function videoVastFormatDeclaration(\n params: CanonicalFormatParams<'video_vast'>,\n fields: CanonicalFormatDeclarationFields<'video_vast'> = {}\n): CanonicalFormatDeclaration<'video_vast'> {\n return canonicalFormatDeclaration('video_vast', params, fields);\n}\n\nexport function audioHostedFormatDeclaration(\n params: CanonicalFormatParams<'audio_hosted'>,\n fields: CanonicalFormatDeclarationFields<'audio_hosted'> = {}\n): CanonicalFormatDeclaration<'audio_hosted'> {\n return canonicalFormatDeclaration('audio_hosted', params, fields);\n}\n\nexport function audioDaastFormatDeclaration(\n params: CanonicalFormatParams<'audio_daast'>,\n fields: CanonicalFormatDeclarationFields<'audio_daast'> = {}\n): CanonicalFormatDeclaration<'audio_daast'> {\n return canonicalFormatDeclaration('audio_daast', params, fields);\n}\n\nexport function sponsoredPlacementFormatDeclaration(\n params: CanonicalFormatParams<'sponsored_placement'>,\n fields: CanonicalFormatDeclarationFields<'sponsored_placement'> = {}\n): CanonicalFormatDeclaration<'sponsored_placement'> {\n return canonicalFormatDeclaration('sponsored_placement', params, fields);\n}\n\nexport function nativeInFeedFormatDeclaration(\n params: CanonicalFormatParams<'native_in_feed'>,\n fields: CanonicalFormatDeclarationFields<'native_in_feed'> = {}\n): CanonicalFormatDeclaration<'native_in_feed'> {\n return canonicalFormatDeclaration('native_in_feed', params, fields);\n}\n\nexport function responsiveCreativeFormatDeclaration(\n params: CanonicalFormatParams<'responsive_creative'>,\n fields: CanonicalFormatDeclarationFields<'responsive_creative'> = {}\n): CanonicalFormatDeclaration<'responsive_creative'> {\n return canonicalFormatDeclaration('responsive_creative', params, fields);\n}\n\nexport function agentPlacementFormatDeclaration(\n params: CanonicalFormatParams<'agent_placement'>,\n fields: CanonicalFormatDeclarationFields<'agent_placement'> = {}\n): CanonicalFormatDeclaration<'agent_placement'> {\n return canonicalFormatDeclaration('agent_placement', params, fields);\n}\n\nexport function customFormatDeclaration(\n format_shape: string,\n format_schema: NonNullable<CanonicalFormatDeclarationFields<'custom'>['format_schema']>,\n params: CanonicalFormatParams<'custom'>,\n fields: Omit<CanonicalFormatDeclarationFields<'custom'>, 'format_shape' | 'format_schema'> = {}\n): CanonicalFormatDeclaration<'custom'> {\n return canonicalFormatDeclaration('custom', params, { ...fields, format_shape, format_schema });\n}\n\n/**\n * Product cards describe the merchandising UI for a product. They do not carry\n * format_id and are intentionally separate from creative format declarations.\n */\nexport function productCard(fields: ProductCardFields): ProductCardFields {\n return { ...fields };\n}\n\nexport function productCardDetailed(fields: ProductCardDetailedFields): ProductCardDetailedFields {\n return {\n ...fields,\n carousel_images: fields.carousel_images?.map(image => ({ ...image })),\n specifications: fields.specifications?.map(spec => ({ ...spec })),\n };\n}\n\nexport const CanonicalFormat = {\n declaration: canonicalFormatDeclaration,\n image: imageFormatDeclaration,\n html5: html5FormatDeclaration,\n displayTag: displayTagFormatDeclaration,\n imageCarousel: imageCarouselFormatDeclaration,\n videoHosted: videoHostedFormatDeclaration,\n videoVast: videoVastFormatDeclaration,\n audioHosted: audioHostedFormatDeclaration,\n audioDaast: audioDaastFormatDeclaration,\n sponsoredPlacement: sponsoredPlacementFormatDeclaration,\n nativeInFeed: nativeInFeedFormatDeclaration,\n responsiveCreative: responsiveCreativeFormatDeclaration,\n agentPlacement: agentPlacementFormatDeclaration,\n custom: customFormatDeclaration,\n productCard,\n productCardDetailed,\n} as const;\n"],"mappings":"AA0EO,SAAS,gBACd,WACA,IACA,SAAuG,CAAC,GACvE;AACjC,SAAO,EAAE,GAAG,QAAQ,WAAW,GAAG;AACpC;AAEO,SAAS,oBAAoB,MAAiE;AACnG,SAAO,KAAK,IAAI,UAAQ,EAAE,GAAG,IAAI,EAAE;AACrC;AAMO,SAAS,2BACd,aACA,QACA,SAA8C,CAAC,GAChB;AAC/B,MAAI,QAAQ,IAAI,QAAkB,eAAe,GAAG;AAClD,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO,EAAE,GAAG,QAAQ,aAAa,OAAO;AAC1C;AAEO,SAAS,uBACd,QACA,SAAoD,CAAC,GAChB;AACrC,SAAO,2BAA2B,SAAS,QAAQ,MAAM;AAC3D;AAEO,SAAS,uBACd,QACA,SAAoD,CAAC,GAChB;AACrC,SAAO,2BAA2B,SAAS,QAAQ,MAAM;AAC3D;AAEO,SAAS,4BACd,QACA,SAA0D,CAAC,GAChB;AAC3C,SAAO,2BAA2B,eAAe,QAAQ,MAAM;AACjE;AAEO,SAAS,+BACd,Q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B,aAAa;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR;AAAA,EACA;AACF;","names":[]}
@@ -0,0 +1,47 @@
1
+ import type { LegacyFormatConverter } from './v1-to-v2.mjs';
2
+ import type { V2ProductFormatDeclaration } from './types.mjs';
3
+ import type { CanonicalFormatLegacyResolver } from './v2-to-v1.mjs';
4
+ /** Provenance tier for a pre-resolved immutable format catalog snapshot. */
5
+ export type ProjectionCatalogSource = 'publisher' | 'aao_mirror' | 'agent_derived' | 'configured';
6
+ /**
7
+ * Canonical catalog data resolved outside the pure projector.
8
+ *
9
+ * Network discovery deliberately does not happen inside projection. Callers
10
+ * may resolve publisher/community catalogs asynchronously, then inject the
11
+ * immutable result here for synchronous reads, writes, continuations, and
12
+ * webhook handling. Array order is precedence order (most specific first).
13
+ */
14
+ export interface ProjectionCatalogSnapshot {
15
+ source: ProjectionCatalogSource;
16
+ /** Canonical publisher scope applied when declarations omit it. */
17
+ publisher_domain?: string;
18
+ formats: readonly V2ProductFormatDeclaration[];
19
+ }
20
+ /**
21
+ * Convert exact, catalog-authored `v1_format_ref` aliases into the existing
22
+ * converter seam. Canonical-only declarations never become legacy aliases,
23
+ * and matching is always owner + id + dimensional discriminators—never ID
24
+ * alone. Duplicate aliases at the same precedence tier fail closed.
25
+ */
26
+ export declare function legacyFormatConverterFromCatalogSnapshots(snapshots: readonly ProjectionCatalogSnapshot[] | undefined, fallback?: LegacyFormatConverter): LegacyFormatConverter | undefined;
27
+ /**
28
+ * Build the canonical → legacy half of an exact catalog-authored adapter.
29
+ *
30
+ * Only stable `format_option_id` references participate. Snapshot precedence
31
+ * mirrors the forward projector, duplicate declarations at one tier fail
32
+ * closed, and a multi-option selector is returned only when every option has
33
+ * an exact mapping. This makes the resolver safe to use after canonical
34
+ * objects have crossed a process or persistence boundary and lost the SDK's
35
+ * private in-memory route metadata.
36
+ */
37
+ export declare function canonicalFormatLegacyResolverFromCatalogSnapshots(snapshots: readonly ProjectionCatalogSnapshot[] | undefined, fallback?: CanonicalFormatLegacyResolver): CanonicalFormatLegacyResolver | undefined;
38
+ /** Client configuration generated from one bidirectional, owner-scoped catalog. */
39
+ export interface ProjectionCatalogAdapters {
40
+ projectionCatalogs: readonly ProjectionCatalogSnapshot[];
41
+ canonicalFormatLegacyResolver: CanonicalFormatLegacyResolver;
42
+ }
43
+ /**
44
+ * Configure both discovery upgrade and legacy delivery downgrade from one
45
+ * immutable catalog. Spread the result into `AgentClient` configuration.
46
+ */
47
+ export declare function projectionAdaptersFromCatalogSnapshots(snapshots: readonly ProjectionCatalogSnapshot[], fallbackCanonicalResolver?: CanonicalFormatLegacyResolver): ProjectionCatalogAdapters;
@@ -0,0 +1,48 @@
1
+ import type { LegacyFormatConverter } from './v1-to-v2';
2
+ import type { V2ProductFormatDeclaration } from './types';
3
+ import type { CanonicalFormatLegacyResolver } from './v2-to-v1';
4
+ /** Provenance tier for a pre-resolved immutable format catalog snapshot. */
5
+ export type ProjectionCatalogSource = 'publisher' | 'aao_mirror' | 'agent_derived' | 'configured';
6
+ /**
7
+ * Canonical catalog data resolved outside the pure projector.
8
+ *
9
+ * Network discovery deliberately does not happen inside projection. Callers
10
+ * may resolve publisher/community catalogs asynchronously, then inject the
11
+ * immutable result here for synchronous reads, writes, continuations, and
12
+ * webhook handling. Array order is precedence order (most specific first).
13
+ */
14
+ export interface ProjectionCatalogSnapshot {
15
+ source: ProjectionCatalogSource;
16
+ /** Canonical publisher scope applied when declarations omit it. */
17
+ publisher_domain?: string;
18
+ formats: readonly V2ProductFormatDeclaration[];
19
+ }
20
+ /**
21
+ * Convert exact, catalog-authored `v1_format_ref` aliases into the existing
22
+ * converter seam. Canonical-only declarations never become legacy aliases,
23
+ * and matching is always owner + id + dimensional discriminators—never ID
24
+ * alone. Duplicate aliases at the same precedence tier fail closed.
25
+ */
26
+ export declare function legacyFormatConverterFromCatalogSnapshots(snapshots: readonly ProjectionCatalogSnapshot[] | undefined, fallback?: LegacyFormatConverter): LegacyFormatConverter | undefined;
27
+ /**
28
+ * Build the canonical → legacy half of an exact catalog-authored adapter.
29
+ *
30
+ * Only stable `format_option_id` references participate. Snapshot precedence
31
+ * mirrors the forward projector, duplicate declarations at one tier fail
32
+ * closed, and a multi-option selector is returned only when every option has
33
+ * an exact mapping. This makes the resolver safe to use after canonical
34
+ * objects have crossed a process or persistence boundary and lost the SDK's
35
+ * private in-memory route metadata.
36
+ */
37
+ export declare function canonicalFormatLegacyResolverFromCatalogSnapshots(snapshots: readonly ProjectionCatalogSnapshot[] | undefined, fallback?: CanonicalFormatLegacyResolver): CanonicalFormatLegacyResolver | undefined;
38
+ /** Client configuration generated from one bidirectional, owner-scoped catalog. */
39
+ export interface ProjectionCatalogAdapters {
40
+ projectionCatalogs: readonly ProjectionCatalogSnapshot[];
41
+ canonicalFormatLegacyResolver: CanonicalFormatLegacyResolver;
42
+ }
43
+ /**
44
+ * Configure both discovery upgrade and legacy delivery downgrade from one
45
+ * immutable catalog. Spread the result into `AgentClient` configuration.
46
+ */
47
+ export declare function projectionAdaptersFromCatalogSnapshots(snapshots: readonly ProjectionCatalogSnapshot[], fallbackCanonicalResolver?: CanonicalFormatLegacyResolver): ProjectionCatalogAdapters;
48
+ //# sourceMappingURL=catalog-snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-snapshot.d.ts","sourceRoot":"","sources":["../../../../src/lib/v2/projection/catalog-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EAAc,0BAA0B,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,KAAK,EAA0C,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAIxG,4EAA4E;AAC5E,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,GAAG,YAAY,CAAC;AAElG;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,uBAAuB,CAAC;IAChC,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,SAAS,0BAA0B,EAAE,CAAC;CAChD;AA8OD;;;;;GAKG;AACH,wBAAgB,yCAAyC,CACvD,SAAS,EAAE,SAAS,yBAAyB,EAAE,GAAG,SAAS,EAC3D,QAAQ,CAAC,EAAE,qBAAqB,GAC/B,qBAAqB,GAAG,SAAS,CAgBnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,iDAAiD,CAC/D,SAAS,EAAE,SAAS,yBAAyB,EAAE,GAAG,SAAS,EAC3D,QAAQ,CAAC,EAAE,6BAA6B,GACvC,6BAA6B,GAAG,SAAS,CA4B3C;AAED,mFAAmF;AACnF,MAAM,WAAW,yBAAyB;IACxC,kBAAkB,EAAE,SAAS,yBAAyB,EAAE,CAAC;IACzD,6BAA6B,EAAE,6BAA6B,CAAC;CAC9D;AAoDD;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,SAAS,EAAE,SAAS,yBAAyB,EAAE,EAC/C,yBAAyB,CAAC,EAAE,6BAA6B,GACxD,yBAAyB,CAU3B"}
@@ -0,0 +1,291 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var catalog_snapshot_exports = {};
20
+ __export(catalog_snapshot_exports, {
21
+ canonicalFormatLegacyResolverFromCatalogSnapshots: () => canonicalFormatLegacyResolverFromCatalogSnapshots,
22
+ legacyFormatConverterFromCatalogSnapshots: () => legacyFormatConverterFromCatalogSnapshots,
23
+ projectionAdaptersFromCatalogSnapshots: () => projectionAdaptersFromCatalogSnapshots
24
+ });
25
+ module.exports = __toCommonJS(catalog_snapshot_exports);
26
+ var import_resolve_agent_properties = require('../../discovery/resolve-agent-properties.js');
27
+ var import_canonical_properties = require('./canonical-properties.js');
28
+ const compiledSnapshotCache = /* @__PURE__ */ new WeakMap();
29
+ function normalizedAgentUrl(value) {
30
+ return (0, import_resolve_agent_properties.canonicalizeAgentUrl)(value) ?? value;
31
+ }
32
+ function legacyRefKey(ref) {
33
+ return JSON.stringify([
34
+ normalizedAgentUrl(ref.agent_url),
35
+ ref.id,
36
+ ref.width ?? null,
37
+ ref.height ?? null,
38
+ ref.duration_ms ?? null
39
+ ]);
40
+ }
41
+ function normalizedPublisherDomain(value) {
42
+ return (value ?? "").trim().toLowerCase().replace(/\.$/, "");
43
+ }
44
+ function formatOptionRefKey(formatOptionId, publisherDomain) {
45
+ return JSON.stringify([normalizedPublisherDomain(publisherDomain), formatOptionId]);
46
+ }
47
+ function formatOptionRefFromValue(value) {
48
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return void 0;
49
+ const record = value;
50
+ if (typeof record.format_option_id !== "string" || record.format_option_id.length === 0) return void 0;
51
+ if (record.scope === "publisher" || record.scope === void 0 && typeof record.publisher_domain === "string") {
52
+ if (typeof record.publisher_domain !== "string" || record.publisher_domain.length === 0) return void 0;
53
+ return { format_option_id: record.format_option_id, publisher_domain: record.publisher_domain };
54
+ }
55
+ return { format_option_id: record.format_option_id };
56
+ }
57
+ function semanticFields(value) {
58
+ return {
59
+ ...typeof value.format_kind === "string" ? { format_kind: value.format_kind } : {},
60
+ ...value.params !== null && typeof value.params === "object" && !Array.isArray(value.params) ? { params: value.params } : {}
61
+ };
62
+ }
63
+ function collectFormatOptionRefs(value, seen = /* @__PURE__ */ new WeakSet()) {
64
+ if (value === null || typeof value !== "object" || seen.has(value)) return [];
65
+ seen.add(value);
66
+ const record = value;
67
+ const refs = [];
68
+ const direct = formatOptionRefFromValue(record.format_option_ref);
69
+ if (direct) refs.push({ ...direct, ...semanticFields(record) });
70
+ for (const key of ["format_option_refs", "format_options"]) {
71
+ if (!Array.isArray(record[key])) continue;
72
+ for (const item of record[key]) {
73
+ const ref = formatOptionRefFromValue(item);
74
+ const itemRecord = item !== null && typeof item === "object" && !Array.isArray(item) ? item : record;
75
+ if (ref) refs.push({ ...ref, ...semanticFields(itemRecord) });
76
+ }
77
+ }
78
+ if (Array.isArray(record.selector_containers)) {
79
+ for (const container of record.selector_containers) refs.push(...collectFormatOptionRefs(container, seen));
80
+ }
81
+ return refs;
82
+ }
83
+ function resolutionContextFormatOptionRefs(context) {
84
+ if (context.source === "product") {
85
+ const declaration = context.declaration;
86
+ if (typeof declaration.format_option_id !== "string" || declaration.format_option_id.length === 0) return [];
87
+ return [
88
+ {
89
+ format_option_id: declaration.format_option_id,
90
+ ...typeof declaration.publisher_domain === "string" ? { publisher_domain: declaration.publisher_domain } : {},
91
+ format_kind: declaration.format_kind,
92
+ params: declaration.params
93
+ }
94
+ ];
95
+ }
96
+ if (context.source === "creative") {
97
+ const creativeRefs = collectFormatOptionRefs(context.creative);
98
+ return creativeRefs.length > 0 ? creativeRefs : collectFormatOptionRefs(context.selector);
99
+ }
100
+ return collectFormatOptionRefs(context.selector);
101
+ }
102
+ function dataValuesEqual(left, right) {
103
+ if (Object.is(left, right)) return true;
104
+ if (Array.isArray(left) || Array.isArray(right)) {
105
+ return Array.isArray(left) && Array.isArray(right) && left.length === right.length && left.every((item, index) => dataValuesEqual(item, right[index]));
106
+ }
107
+ if (left === null || right === null || typeof left !== "object" || typeof right !== "object") return false;
108
+ const leftRecord = left;
109
+ const rightRecord = right;
110
+ const leftKeys = Object.keys(leftRecord).sort();
111
+ const rightKeys = Object.keys(rightRecord).sort();
112
+ return leftKeys.length === rightKeys.length && leftKeys.every((key, index) => key === rightKeys[index] && dataValuesEqual(leftRecord[key], rightRecord[key]));
113
+ }
114
+ function sharedParamsAgree(declarationParams, contextParams) {
115
+ if (!contextParams) return true;
116
+ return Object.keys(contextParams).every(
117
+ (key) => !(key in declarationParams) || dataValuesEqual(declarationParams[key], contextParams[key])
118
+ );
119
+ }
120
+ function routeMatchesContext(route, ref, context) {
121
+ if (ref.format_kind !== void 0 && ref.format_kind !== route.declaration.format_kind) return false;
122
+ if (!sharedParamsAgree(route.declaration.params, ref.params)) return false;
123
+ const records = context.source === "creative" ? [context.creative, context.selector] : context.source === "selector" ? [context.selector] : [];
124
+ return records.every((record) => {
125
+ const fields = semanticFields(record);
126
+ return (fields.format_kind === void 0 || fields.format_kind === route.declaration.format_kind) && sharedParamsAgree(route.declaration.params, fields.params);
127
+ });
128
+ }
129
+ function immutableClone(value) {
130
+ const clone = structuredClone(value);
131
+ const freeze = (candidate, seen = /* @__PURE__ */ new WeakSet()) => {
132
+ if (candidate === null || typeof candidate !== "object" || seen.has(candidate)) return;
133
+ seen.add(candidate);
134
+ for (const child of Object.values(candidate)) freeze(child, seen);
135
+ Object.freeze(candidate);
136
+ };
137
+ freeze(clone);
138
+ return clone;
139
+ }
140
+ function declarationWithoutLegacyIdentity(declaration, publisherDomain) {
141
+ const { v1_format_ref: _dropRefs, canonical_formats_only: _dropCanonicalOnly, ...canonical } = declaration;
142
+ void _dropRefs;
143
+ void _dropCanonicalOnly;
144
+ return {
145
+ ...canonical,
146
+ ...canonical.publisher_domain === void 0 && publisherDomain ? { publisher_domain: publisherDomain } : {}
147
+ };
148
+ }
149
+ function compileProjectionCatalogSnapshots(snapshots) {
150
+ const cached = compiledSnapshotCache.get(snapshots);
151
+ if (cached) return cached;
152
+ const compiled = snapshots.map((snapshot) => {
153
+ const byLegacyRef = /* @__PURE__ */ new Map();
154
+ const byFormatOptionRef = /* @__PURE__ */ new Map();
155
+ for (const sourceDeclaration of snapshot.formats) {
156
+ const declaration = immutableClone(sourceDeclaration);
157
+ if (declaration.canonical_formats_only === true || !(0, import_canonical_properties.isCanonicalV1Translatable)(declaration.format_kind) || !Array.isArray(declaration.v1_format_ref) || declaration.v1_format_ref.length === 0) {
158
+ continue;
159
+ }
160
+ const canonical = immutableClone(declarationWithoutLegacyIdentity(declaration, snapshot.publisher_domain));
161
+ const legacyRefs = immutableClone([
162
+ ...new Map(declaration.v1_format_ref.map((ref) => [legacyRefKey(ref), { ...ref }])).values()
163
+ ]);
164
+ const declarationKeys = new Set(declaration.v1_format_ref.map(legacyRefKey));
165
+ for (const key of declarationKeys) {
166
+ const matches = byLegacyRef.get(key) ?? [];
167
+ matches.push(canonical);
168
+ byLegacyRef.set(key, matches);
169
+ }
170
+ if (typeof canonical.format_option_id === "string" && canonical.format_option_id.length > 0 && typeof canonical.publisher_domain === "string" && canonical.publisher_domain.length > 0) {
171
+ const key = formatOptionRefKey(canonical.format_option_id, canonical.publisher_domain);
172
+ const matches = byFormatOptionRef.get(key) ?? [];
173
+ matches.push(Object.freeze({ declaration: canonical, legacyRefs }));
174
+ byFormatOptionRef.set(key, matches);
175
+ }
176
+ }
177
+ for (const matches of byLegacyRef.values()) Object.freeze(matches);
178
+ for (const matches of byFormatOptionRef.values()) Object.freeze(matches);
179
+ return Object.freeze({ byLegacyRef, byFormatOptionRef });
180
+ });
181
+ Object.freeze(compiled);
182
+ compiledSnapshotCache.set(snapshots, compiled);
183
+ return compiled;
184
+ }
185
+ function legacyFormatConverterFromCatalogSnapshots(snapshots, fallback) {
186
+ if (!snapshots || snapshots.length === 0) return fallback;
187
+ const compiled = compileProjectionCatalogSnapshots(snapshots);
188
+ return (context) => {
189
+ const key = legacyRefKey(context.formatId);
190
+ for (const snapshot of compiled) {
191
+ const matches = snapshot.byLegacyRef.get(key) ?? [];
192
+ if (matches.length > 1) {
193
+ throw new Error("projection catalog contains ambiguous legacy aliases");
194
+ }
195
+ if (matches.length === 1) {
196
+ return matches[0];
197
+ }
198
+ }
199
+ return fallback?.(context);
200
+ };
201
+ }
202
+ function canonicalFormatLegacyResolverFromCatalogSnapshots(snapshots, fallback) {
203
+ if (!snapshots || snapshots.length === 0) return fallback;
204
+ const compiled = compileProjectionCatalogSnapshots(snapshots);
205
+ return (context) => {
206
+ const refs = resolutionContextFormatOptionRefs(context);
207
+ if (refs.length === 0) return fallback?.(context);
208
+ const resolved = [];
209
+ for (const ref of refs) {
210
+ const key = formatOptionRefKey(ref.format_option_id, ref.publisher_domain);
211
+ let matched;
212
+ for (const snapshot of compiled) {
213
+ const matches = snapshot.byFormatOptionRef.get(key) ?? [];
214
+ if (matches.length > 1) {
215
+ throw new Error("projection catalog contains ambiguous canonical format option aliases");
216
+ }
217
+ if (matches.length === 1) {
218
+ matched = matches[0];
219
+ break;
220
+ }
221
+ }
222
+ if (!matched) return fallback?.(context);
223
+ if (!routeMatchesContext(matched, ref, context)) return fallback?.(context);
224
+ resolved.push(...matched.legacyRefs.map((item) => ({ ...item })));
225
+ }
226
+ return [...new Map(resolved.map((ref) => [legacyRefKey(ref), ref])).values()];
227
+ };
228
+ }
229
+ function assertBidirectionalProjectionCatalogs(snapshots) {
230
+ const routeByCanonicalOption = /* @__PURE__ */ new Map();
231
+ const canonicalOptionByLegacyRoute = /* @__PURE__ */ new Map();
232
+ for (const snapshot of snapshots) {
233
+ const declarationsAtThisTier = /* @__PURE__ */ new Set();
234
+ for (const declaration of snapshot.formats) {
235
+ if (declaration.canonical_formats_only === true || !Array.isArray(declaration.v1_format_ref) || declaration.v1_format_ref.length === 0) {
236
+ continue;
237
+ }
238
+ if (!(0, import_canonical_properties.isCanonicalV1Translatable)(declaration.format_kind)) {
239
+ throw new Error("bidirectional projection adapters cannot downgrade a canonical-only format kind");
240
+ }
241
+ const canonical = declarationWithoutLegacyIdentity(declaration, snapshot.publisher_domain);
242
+ if (typeof canonical.format_option_id !== "string" || canonical.format_option_id.length === 0) {
243
+ throw new Error("bidirectional projection adapters require a stable format_option_id");
244
+ }
245
+ if (typeof canonical.publisher_domain !== "string" || canonical.publisher_domain.length === 0) {
246
+ throw new Error("bidirectional projection adapters require publisher-scoped format options");
247
+ }
248
+ const uniqueLegacyKeys = new Set(declaration.v1_format_ref.map(legacyRefKey));
249
+ if (uniqueLegacyKeys.size !== 1) {
250
+ throw new Error(
251
+ "bidirectional projection adapters require exactly one legacy route per canonical format option"
252
+ );
253
+ }
254
+ const canonicalKey = formatOptionRefKey(canonical.format_option_id, canonical.publisher_domain);
255
+ const legacyKey = [...uniqueLegacyKeys][0];
256
+ const declarationKey = JSON.stringify([canonicalKey, legacyKey]);
257
+ if (declarationsAtThisTier.has(declarationKey)) {
258
+ throw new Error("bidirectional projection adapters contain duplicate declarations at one precedence tier");
259
+ }
260
+ declarationsAtThisTier.add(declarationKey);
261
+ const existing = routeByCanonicalOption.get(canonicalKey);
262
+ if (existing !== void 0 && existing !== legacyKey) {
263
+ throw new Error("bidirectional projection adapters contain conflicting reverse routes");
264
+ }
265
+ const existingCanonical = canonicalOptionByLegacyRoute.get(legacyKey);
266
+ if (existingCanonical !== void 0 && existingCanonical !== canonicalKey) {
267
+ throw new Error("bidirectional projection adapters contain conflicting forward routes");
268
+ }
269
+ routeByCanonicalOption.set(canonicalKey, legacyKey);
270
+ canonicalOptionByLegacyRoute.set(legacyKey, canonicalKey);
271
+ }
272
+ }
273
+ }
274
+ function projectionAdaptersFromCatalogSnapshots(snapshots, fallbackCanonicalResolver) {
275
+ assertBidirectionalProjectionCatalogs(snapshots);
276
+ const canonicalFormatLegacyResolver = canonicalFormatLegacyResolverFromCatalogSnapshots(
277
+ snapshots,
278
+ fallbackCanonicalResolver
279
+ );
280
+ if (!canonicalFormatLegacyResolver) {
281
+ throw new Error("projection adapters require at least one catalog snapshot or a fallback resolver");
282
+ }
283
+ return { projectionCatalogs: snapshots, canonicalFormatLegacyResolver };
284
+ }
285
+ // Annotate the CommonJS export names for ESM import in node:
286
+ 0 && (module.exports = {
287
+ canonicalFormatLegacyResolverFromCatalogSnapshots,
288
+ legacyFormatConverterFromCatalogSnapshots,
289
+ projectionAdaptersFromCatalogSnapshots
290
+ });
291
+ //# sourceMappingURL=catalog-snapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/v2/projection/catalog-snapshot.ts"],"sourcesContent":["import type { LegacyFormatConverter } from './v1-to-v2';\nimport type { V1FormatId, V2ProductFormatDeclaration } from './types';\nimport type { CanonicalFormatLegacyResolutionContext, CanonicalFormatLegacyResolver } from './v2-to-v1';\nimport { canonicalizeAgentUrl } from '../../discovery/resolve-agent-properties';\nimport { isCanonicalV1Translatable } from './canonical-properties';\n\n/** Provenance tier for a pre-resolved immutable format catalog snapshot. */\nexport type ProjectionCatalogSource = 'publisher' | 'aao_mirror' | 'agent_derived' | 'configured';\n\n/**\n * Canonical catalog data resolved outside the pure projector.\n *\n * Network discovery deliberately does not happen inside projection. Callers\n * may resolve publisher/community catalogs asynchronously, then inject the\n * immutable result here for synchronous reads, writes, continuations, and\n * webhook handling. Array order is precedence order (most specific first).\n */\nexport interface ProjectionCatalogSnapshot {\n source: ProjectionCatalogSource;\n /** Canonical publisher scope applied when declarations omit it. */\n publisher_domain?: string;\n formats: readonly V2ProductFormatDeclaration[];\n}\n\ninterface CompiledProjectionCatalogSnapshot {\n byLegacyRef: ReadonlyMap<string, readonly V2ProductFormatDeclaration[]>;\n byFormatOptionRef: ReadonlyMap<string, readonly CompiledReverseRoute[]>;\n}\n\ninterface CompiledReverseRoute {\n declaration: Readonly<V2ProductFormatDeclaration>;\n legacyRefs: readonly V1FormatId[];\n}\n\ninterface ContextFormatOptionRef {\n format_option_id: string;\n publisher_domain?: string;\n format_kind?: string;\n params?: Readonly<Record<string, unknown>>;\n}\n\nconst compiledSnapshotCache = new WeakMap<object, readonly CompiledProjectionCatalogSnapshot[]>();\n\n/** Preserve protocol URL identity, including a distinct terminal slash. */\nfunction normalizedAgentUrl(value: string): string {\n return canonicalizeAgentUrl(value) ?? value;\n}\n\nfunction legacyRefKey(ref: V1FormatId): string {\n return JSON.stringify([\n normalizedAgentUrl(ref.agent_url),\n ref.id,\n ref.width ?? null,\n ref.height ?? null,\n ref.duration_ms ?? null,\n ]);\n}\n\nfunction normalizedPublisherDomain(value: string | undefined): string {\n return (value ?? '').trim().toLowerCase().replace(/\\.$/, '');\n}\n\nfunction formatOptionRefKey(formatOptionId: string, publisherDomain?: string): string {\n return JSON.stringify([normalizedPublisherDomain(publisherDomain), formatOptionId]);\n}\n\nfunction formatOptionRefFromValue(value: unknown): { format_option_id: string; publisher_domain?: string } | undefined {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return undefined;\n const record = value as Record<string, unknown>;\n if (typeof record.format_option_id !== 'string' || record.format_option_id.length === 0) return undefined;\n if (record.scope === 'publisher' || (record.scope === undefined && typeof record.publisher_domain === 'string')) {\n if (typeof record.publisher_domain !== 'string' || record.publisher_domain.length === 0) return undefined;\n return { format_option_id: record.format_option_id, publisher_domain: record.publisher_domain };\n }\n return { format_option_id: record.format_option_id };\n}\n\nfunction semanticFields(value: Record<string, unknown>): Pick<ContextFormatOptionRef, 'format_kind' | 'params'> {\n return {\n ...(typeof value.format_kind === 'string' ? { format_kind: value.format_kind } : {}),\n ...(value.params !== null && typeof value.params === 'object' && !Array.isArray(value.params)\n ? { params: value.params as Record<string, unknown> }\n : {}),\n };\n}\n\nfunction collectFormatOptionRefs(value: unknown, seen = new WeakSet<object>()): ContextFormatOptionRef[] {\n if (value === null || typeof value !== 'object' || seen.has(value as object)) return [];\n seen.add(value as object);\n const record = value as Record<string, unknown>;\n const refs: ContextFormatOptionRef[] = [];\n const direct = formatOptionRefFromValue(record.format_option_ref);\n if (direct) refs.push({ ...direct, ...semanticFields(record) });\n for (const key of ['format_option_refs', 'format_options'] as const) {\n if (!Array.isArray(record[key])) continue;\n for (const item of record[key]) {\n const ref = formatOptionRefFromValue(item);\n const itemRecord = item !== null && typeof item === 'object' && !Array.isArray(item) ? item : record;\n if (ref) refs.push({ ...ref, ...semanticFields(itemRecord as Record<string, unknown>) });\n }\n }\n if (Array.isArray(record.selector_containers)) {\n for (const container of record.selector_containers) refs.push(...collectFormatOptionRefs(container, seen));\n }\n return refs;\n}\n\nfunction resolutionContextFormatOptionRefs(context: CanonicalFormatLegacyResolutionContext): ContextFormatOptionRef[] {\n if (context.source === 'product') {\n const declaration = context.declaration;\n if (typeof declaration.format_option_id !== 'string' || declaration.format_option_id.length === 0) return [];\n return [\n {\n format_option_id: declaration.format_option_id,\n ...(typeof declaration.publisher_domain === 'string' ? { publisher_domain: declaration.publisher_domain } : {}),\n format_kind: declaration.format_kind,\n params: declaration.params,\n },\n ];\n }\n if (context.source === 'creative') {\n const creativeRefs = collectFormatOptionRefs(context.creative);\n return creativeRefs.length > 0 ? creativeRefs : collectFormatOptionRefs(context.selector);\n }\n return collectFormatOptionRefs(context.selector);\n}\n\nfunction dataValuesEqual(left: unknown, right: unknown): boolean {\n if (Object.is(left, right)) return true;\n if (Array.isArray(left) || Array.isArray(right)) {\n return (\n Array.isArray(left) &&\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((item, index) => dataValuesEqual(item, right[index]))\n );\n }\n if (left === null || right === null || typeof left !== 'object' || typeof right !== 'object') return false;\n const leftRecord = left as Record<string, unknown>;\n const rightRecord = right as Record<string, unknown>;\n const leftKeys = Object.keys(leftRecord).sort();\n const rightKeys = Object.keys(rightRecord).sort();\n return (\n leftKeys.length === rightKeys.length &&\n leftKeys.every((key, index) => key === rightKeys[index] && dataValuesEqual(leftRecord[key], rightRecord[key]))\n );\n}\n\nfunction sharedParamsAgree(\n declarationParams: Readonly<Record<string, unknown>>,\n contextParams: Readonly<Record<string, unknown>> | undefined\n): boolean {\n if (!contextParams) return true;\n return Object.keys(contextParams).every(\n key => !(key in declarationParams) || dataValuesEqual(declarationParams[key], contextParams[key])\n );\n}\n\nfunction routeMatchesContext(\n route: CompiledReverseRoute,\n ref: ContextFormatOptionRef,\n context: CanonicalFormatLegacyResolutionContext\n): boolean {\n if (ref.format_kind !== undefined && ref.format_kind !== route.declaration.format_kind) return false;\n if (!sharedParamsAgree(route.declaration.params, ref.params)) return false;\n\n const records =\n context.source === 'creative'\n ? [context.creative, context.selector]\n : context.source === 'selector'\n ? [context.selector]\n : [];\n return records.every(record => {\n const fields = semanticFields(record as Record<string, unknown>);\n return (\n (fields.format_kind === undefined || fields.format_kind === route.declaration.format_kind) &&\n sharedParamsAgree(route.declaration.params, fields.params)\n );\n });\n}\n\nfunction immutableClone<T>(value: T): T {\n const clone = structuredClone(value);\n const freeze = (candidate: unknown, seen = new WeakSet<object>()): void => {\n if (candidate === null || typeof candidate !== 'object' || seen.has(candidate)) return;\n seen.add(candidate);\n for (const child of Object.values(candidate)) freeze(child, seen);\n Object.freeze(candidate);\n };\n freeze(clone);\n return clone;\n}\n\nfunction declarationWithoutLegacyIdentity(\n declaration: V2ProductFormatDeclaration,\n publisherDomain?: string\n): V2ProductFormatDeclaration {\n const { v1_format_ref: _dropRefs, canonical_formats_only: _dropCanonicalOnly, ...canonical } = declaration;\n void _dropRefs;\n void _dropCanonicalOnly;\n return {\n ...canonical,\n ...(canonical.publisher_domain === undefined && publisherDomain ? { publisher_domain: publisherDomain } : {}),\n };\n}\n\nfunction compileProjectionCatalogSnapshots(\n snapshots: readonly ProjectionCatalogSnapshot[]\n): readonly CompiledProjectionCatalogSnapshot[] {\n const cached = compiledSnapshotCache.get(snapshots);\n if (cached) return cached;\n\n const compiled = snapshots.map(snapshot => {\n const byLegacyRef = new Map<string, V2ProductFormatDeclaration[]>();\n const byFormatOptionRef = new Map<string, CompiledReverseRoute[]>();\n for (const sourceDeclaration of snapshot.formats) {\n const declaration = immutableClone(sourceDeclaration);\n if (\n declaration.canonical_formats_only === true ||\n !isCanonicalV1Translatable(declaration.format_kind) ||\n !Array.isArray(declaration.v1_format_ref) ||\n declaration.v1_format_ref.length === 0\n ) {\n continue;\n }\n\n const canonical = immutableClone(declarationWithoutLegacyIdentity(declaration, snapshot.publisher_domain));\n const legacyRefs = immutableClone([\n ...new Map(declaration.v1_format_ref.map(ref => [legacyRefKey(ref), { ...ref }])).values(),\n ]);\n // Repeating one alias on a declaration does not make it ambiguous. Two\n // distinct declarations at the same precedence tier still do.\n const declarationKeys = new Set(declaration.v1_format_ref.map(legacyRefKey));\n for (const key of declarationKeys) {\n const matches = byLegacyRef.get(key) ?? [];\n matches.push(canonical);\n byLegacyRef.set(key, matches);\n }\n if (\n typeof canonical.format_option_id === 'string' &&\n canonical.format_option_id.length > 0 &&\n typeof canonical.publisher_domain === 'string' &&\n canonical.publisher_domain.length > 0\n ) {\n const key = formatOptionRefKey(canonical.format_option_id, canonical.publisher_domain);\n const matches = byFormatOptionRef.get(key) ?? [];\n matches.push(Object.freeze({ declaration: canonical, legacyRefs }));\n byFormatOptionRef.set(key, matches);\n }\n }\n for (const matches of byLegacyRef.values()) Object.freeze(matches);\n for (const matches of byFormatOptionRef.values()) Object.freeze(matches);\n return Object.freeze({ byLegacyRef, byFormatOptionRef });\n });\n\n Object.freeze(compiled);\n compiledSnapshotCache.set(snapshots, compiled);\n return compiled;\n}\n\n/**\n * Convert exact, catalog-authored `v1_format_ref` aliases into the existing\n * converter seam. Canonical-only declarations never become legacy aliases,\n * and matching is always owner + id + dimensional discriminators—never ID\n * alone. Duplicate aliases at the same precedence tier fail closed.\n */\nexport function legacyFormatConverterFromCatalogSnapshots(\n snapshots: readonly ProjectionCatalogSnapshot[] | undefined,\n fallback?: LegacyFormatConverter\n): LegacyFormatConverter | undefined {\n if (!snapshots || snapshots.length === 0) return fallback;\n const compiled = compileProjectionCatalogSnapshots(snapshots);\n return context => {\n const key = legacyRefKey(context.formatId);\n for (const snapshot of compiled) {\n const matches = snapshot.byLegacyRef.get(key) ?? [];\n if (matches.length > 1) {\n throw new Error('projection catalog contains ambiguous legacy aliases');\n }\n if (matches.length === 1) {\n return matches[0];\n }\n }\n return fallback?.(context);\n };\n}\n\n/**\n * Build the canonical → legacy half of an exact catalog-authored adapter.\n *\n * Only stable `format_option_id` references participate. Snapshot precedence\n * mirrors the forward projector, duplicate declarations at one tier fail\n * closed, and a multi-option selector is returned only when every option has\n * an exact mapping. This makes the resolver safe to use after canonical\n * objects have crossed a process or persistence boundary and lost the SDK's\n * private in-memory route metadata.\n */\nexport function canonicalFormatLegacyResolverFromCatalogSnapshots(\n snapshots: readonly ProjectionCatalogSnapshot[] | undefined,\n fallback?: CanonicalFormatLegacyResolver\n): CanonicalFormatLegacyResolver | undefined {\n if (!snapshots || snapshots.length === 0) return fallback;\n const compiled = compileProjectionCatalogSnapshots(snapshots);\n return context => {\n const refs = resolutionContextFormatOptionRefs(context);\n if (refs.length === 0) return fallback?.(context);\n\n const resolved: V1FormatId[] = [];\n for (const ref of refs) {\n const key = formatOptionRefKey(ref.format_option_id, ref.publisher_domain);\n let matched: CompiledReverseRoute | undefined;\n for (const snapshot of compiled) {\n const matches = snapshot.byFormatOptionRef.get(key) ?? [];\n if (matches.length > 1) {\n throw new Error('projection catalog contains ambiguous canonical format option aliases');\n }\n if (matches.length === 1) {\n matched = matches[0];\n break;\n }\n }\n if (!matched) return fallback?.(context);\n if (!routeMatchesContext(matched, ref, context)) return fallback?.(context);\n resolved.push(...matched.legacyRefs.map(item => ({ ...item })));\n }\n\n return [...new Map(resolved.map(ref => [legacyRefKey(ref), ref])).values()];\n };\n}\n\n/** Client configuration generated from one bidirectional, owner-scoped catalog. */\nexport interface ProjectionCatalogAdapters {\n projectionCatalogs: readonly ProjectionCatalogSnapshot[];\n canonicalFormatLegacyResolver: CanonicalFormatLegacyResolver;\n}\n\nfunction assertBidirectionalProjectionCatalogs(snapshots: readonly ProjectionCatalogSnapshot[]): void {\n const routeByCanonicalOption = new Map<string, string>();\n const canonicalOptionByLegacyRoute = new Map<string, string>();\n for (const snapshot of snapshots) {\n const declarationsAtThisTier = new Set<string>();\n for (const declaration of snapshot.formats) {\n if (\n declaration.canonical_formats_only === true ||\n !Array.isArray(declaration.v1_format_ref) ||\n declaration.v1_format_ref.length === 0\n ) {\n continue;\n }\n if (!isCanonicalV1Translatable(declaration.format_kind)) {\n throw new Error('bidirectional projection adapters cannot downgrade a canonical-only format kind');\n }\n const canonical = declarationWithoutLegacyIdentity(declaration, snapshot.publisher_domain);\n if (typeof canonical.format_option_id !== 'string' || canonical.format_option_id.length === 0) {\n throw new Error('bidirectional projection adapters require a stable format_option_id');\n }\n if (typeof canonical.publisher_domain !== 'string' || canonical.publisher_domain.length === 0) {\n throw new Error('bidirectional projection adapters require publisher-scoped format options');\n }\n const uniqueLegacyKeys = new Set(declaration.v1_format_ref.map(legacyRefKey));\n if (uniqueLegacyKeys.size !== 1) {\n throw new Error(\n 'bidirectional projection adapters require exactly one legacy route per canonical format option'\n );\n }\n const canonicalKey = formatOptionRefKey(canonical.format_option_id, canonical.publisher_domain);\n const legacyKey = [...uniqueLegacyKeys][0]!;\n const declarationKey = JSON.stringify([canonicalKey, legacyKey]);\n if (declarationsAtThisTier.has(declarationKey)) {\n throw new Error('bidirectional projection adapters contain duplicate declarations at one precedence tier');\n }\n declarationsAtThisTier.add(declarationKey);\n const existing = routeByCanonicalOption.get(canonicalKey);\n if (existing !== undefined && existing !== legacyKey) {\n throw new Error('bidirectional projection adapters contain conflicting reverse routes');\n }\n const existingCanonical = canonicalOptionByLegacyRoute.get(legacyKey);\n if (existingCanonical !== undefined && existingCanonical !== canonicalKey) {\n throw new Error('bidirectional projection adapters contain conflicting forward routes');\n }\n routeByCanonicalOption.set(canonicalKey, legacyKey);\n canonicalOptionByLegacyRoute.set(legacyKey, canonicalKey);\n }\n }\n}\n\n/**\n * Configure both discovery upgrade and legacy delivery downgrade from one\n * immutable catalog. Spread the result into `AgentClient` configuration.\n */\nexport function projectionAdaptersFromCatalogSnapshots(\n snapshots: readonly ProjectionCatalogSnapshot[],\n fallbackCanonicalResolver?: CanonicalFormatLegacyResolver\n): ProjectionCatalogAdapters {\n assertBidirectionalProjectionCatalogs(snapshots);\n const canonicalFormatLegacyResolver = canonicalFormatLegacyResolverFromCatalogSnapshots(\n snapshots,\n fallbackCanonicalResolver\n );\n if (!canonicalFormatLegacyResolver) {\n throw new Error('projection adapters require at least one catalog snapshot or a fallback resolver');\n }\n return { projectionCatalogs: snapshots, canonicalFormatLegacyResolver };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sCAAqC;AACrC,kCAA0C;AAqC1C,MAAM,wBAAwB,oBAAI,QAA8D;AAGhG,SAAS,mBAAmB,OAAuB;AACjD,aAAO,sDAAqB,KAAK,KAAK;AACxC;AAEA,SAAS,aAAa,KAAyB;AAC7C,SAAO,KAAK,UAAU;AAAA,IACpB,mBAAmB,IAAI,SAAS;AAAA,IAChC,IAAI;AAAA,IACJ,IAAI,SAAS;AAAA,IACb,IAAI,UAAU;AAAA,IACd,IAAI,eAAe;AAAA,EACrB,CAAC;AACH;AAEA,SAAS,0BAA0B,OAAmC;AACpE,UAAQ,SAAS,IAAI,KAAK,EAAE,YAAY,EAAE,QAAQ,OAAO,EAAE;AAC7D;AAEA,SAAS,mBAAmB,gBAAwB,iBAAkC;AACpF,SAAO,KAAK,UAAU,CAAC,0BAA0B,eAAe,GAAG,cAAc,CAAC;AACpF;AAEA,SAAS,yBAAyB,OAAqF;AACrH,MAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,EAAG,QAAO;AAChF,QAAM,SAAS;AACf,MAAI,OAAO,OAAO,qBAAqB,YAAY,OAAO,iBAAiB,WAAW,EAAG,QAAO;AAChG,MAAI,OAAO,UAAU,eAAgB,OA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