@adcp/sdk 12.1.0 → 13.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (464) hide show
  1. package/README.md +19 -3
  2. package/bin/adcp-fuzz.js +3 -1
  3. package/dist/lib/adapters/content-standards-adapter.d.mts +9 -9
  4. package/dist/lib/adapters/content-standards-adapter.d.ts +9 -9
  5. package/dist/lib/adapters/content-standards-adapter.d.ts.map +1 -1
  6. package/dist/lib/adapters/content-standards-adapter.js +22 -22
  7. package/dist/lib/adapters/content-standards-adapter.js.map +1 -1
  8. package/dist/lib/adapters/content-standards-adapter.mjs +18 -18
  9. package/dist/lib/adapters/content-standards-adapter.mjs.map +1 -1
  10. package/dist/lib/adapters/index.d.mts +2 -2
  11. package/dist/lib/adapters/index.d.ts +2 -2
  12. package/dist/lib/adapters/index.d.ts.map +1 -1
  13. package/dist/lib/adapters/index.js +10 -10
  14. package/dist/lib/adapters/index.js.map +1 -1
  15. package/dist/lib/adapters/index.mjs +9 -9
  16. package/dist/lib/adapters/index.mjs.map +1 -1
  17. package/dist/lib/auth/oauth/authorization-required.d.mts +3 -0
  18. package/dist/lib/auth/oauth/authorization-required.d.ts +3 -0
  19. package/dist/lib/auth/oauth/authorization-required.d.ts.map +1 -1
  20. package/dist/lib/auth/oauth/authorization-required.js +12 -9
  21. package/dist/lib/auth/oauth/authorization-required.js.map +1 -1
  22. package/dist/lib/auth/oauth/authorization-required.mjs +12 -9
  23. package/dist/lib/auth/oauth/authorization-required.mjs.map +1 -1
  24. package/dist/lib/auth/oauth/provider-cache.d.mts +7 -0
  25. package/dist/lib/auth/oauth/provider-cache.d.ts +8 -0
  26. package/dist/lib/auth/oauth/provider-cache.d.ts.map +1 -0
  27. package/dist/lib/auth/oauth/provider-cache.js +44 -0
  28. package/dist/lib/auth/oauth/provider-cache.js.map +1 -0
  29. package/dist/lib/auth/oauth/provider-cache.mjs +19 -0
  30. package/dist/lib/auth/oauth/provider-cache.mjs.map +1 -0
  31. package/dist/lib/conformance/invariants/uniformError.js +1 -1
  32. package/dist/lib/conformance/invariants/uniformError.js.map +1 -1
  33. package/dist/lib/conformance/invariants/uniformError.mjs +1 -1
  34. package/dist/lib/conformance/invariants/uniformError.mjs.map +1 -1
  35. package/dist/lib/conformance/runners.js +1 -1
  36. package/dist/lib/conformance/runners.js.map +1 -1
  37. package/dist/lib/conformance/runners.mjs +1 -1
  38. package/dist/lib/conformance/runners.mjs.map +1 -1
  39. package/dist/lib/conformance/seeder.js +5 -5
  40. package/dist/lib/conformance/seeder.js.map +1 -1
  41. package/dist/lib/conformance/seeder.mjs +5 -5
  42. package/dist/lib/conformance/seeder.mjs.map +1 -1
  43. package/dist/lib/core/ADCPMultiAgentClient.d.mts +26 -29
  44. package/dist/lib/core/ADCPMultiAgentClient.d.ts +26 -29
  45. package/dist/lib/core/ADCPMultiAgentClient.d.ts.map +1 -1
  46. package/dist/lib/core/ADCPMultiAgentClient.js +27 -19
  47. package/dist/lib/core/ADCPMultiAgentClient.js.map +1 -1
  48. package/dist/lib/core/ADCPMultiAgentClient.mjs +27 -19
  49. package/dist/lib/core/ADCPMultiAgentClient.mjs.map +1 -1
  50. package/dist/lib/core/AgentClient.d.mts +148 -138
  51. package/dist/lib/core/AgentClient.d.ts +148 -138
  52. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  53. package/dist/lib/core/AgentClient.js +174 -85
  54. package/dist/lib/core/AgentClient.js.map +1 -1
  55. package/dist/lib/core/AgentClient.mjs +174 -85
  56. package/dist/lib/core/AgentClient.mjs.map +1 -1
  57. package/dist/lib/core/AsyncHandler.d.mts +18 -16
  58. package/dist/lib/core/AsyncHandler.d.ts +18 -16
  59. package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
  60. package/dist/lib/core/AsyncHandler.js +22 -1
  61. package/dist/lib/core/AsyncHandler.js.map +1 -1
  62. package/dist/lib/core/AsyncHandler.mjs +22 -1
  63. package/dist/lib/core/AsyncHandler.mjs.map +1 -1
  64. package/dist/lib/core/ConversationTypes.d.mts +6 -2
  65. package/dist/lib/core/ConversationTypes.d.ts +6 -2
  66. package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
  67. package/dist/lib/core/ConversationTypes.js.map +1 -1
  68. package/dist/lib/core/CreativeAgentClient.d.mts +41 -17
  69. package/dist/lib/core/CreativeAgentClient.d.ts +41 -17
  70. package/dist/lib/core/CreativeAgentClient.d.ts.map +1 -1
  71. package/dist/lib/core/CreativeAgentClient.js +39 -12
  72. package/dist/lib/core/CreativeAgentClient.js.map +1 -1
  73. package/dist/lib/core/CreativeAgentClient.mjs +39 -12
  74. package/dist/lib/core/CreativeAgentClient.mjs.map +1 -1
  75. package/dist/lib/core/SingleAgentClient.d.mts +129 -52
  76. package/dist/lib/core/SingleAgentClient.d.ts +129 -52
  77. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  78. package/dist/lib/core/SingleAgentClient.js +1748 -218
  79. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  80. package/dist/lib/core/SingleAgentClient.mjs +1758 -218
  81. package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
  82. package/dist/lib/core/TaskExecutor.d.mts +9 -0
  83. package/dist/lib/core/TaskExecutor.d.ts +9 -0
  84. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  85. package/dist/lib/core/TaskExecutor.js +137 -44
  86. package/dist/lib/core/TaskExecutor.js.map +1 -1
  87. package/dist/lib/core/TaskExecutor.mjs +137 -44
  88. package/dist/lib/core/TaskExecutor.mjs.map +1 -1
  89. package/dist/lib/index.d.mts +111 -17
  90. package/dist/lib/index.d.ts +111 -17
  91. package/dist/lib/index.d.ts.map +1 -1
  92. package/dist/lib/index.js +94 -94
  93. package/dist/lib/index.js.map +1 -1
  94. package/dist/lib/index.mjs +93 -94
  95. package/dist/lib/index.mjs.map +1 -1
  96. package/dist/lib/net/ssrf-fetch.d.mts +13 -1
  97. package/dist/lib/net/ssrf-fetch.d.ts +13 -1
  98. package/dist/lib/net/ssrf-fetch.d.ts.map +1 -1
  99. package/dist/lib/net/ssrf-fetch.js +14 -7
  100. package/dist/lib/net/ssrf-fetch.js.map +1 -1
  101. package/dist/lib/net/ssrf-fetch.mjs +14 -7
  102. package/dist/lib/net/ssrf-fetch.mjs.map +1 -1
  103. package/dist/lib/protocols/a2a.d.mts +2 -2
  104. package/dist/lib/protocols/a2a.d.ts +2 -2
  105. package/dist/lib/protocols/a2a.d.ts.map +1 -1
  106. package/dist/lib/protocols/a2a.js +14 -9
  107. package/dist/lib/protocols/a2a.js.map +1 -1
  108. package/dist/lib/protocols/a2a.mjs +14 -9
  109. package/dist/lib/protocols/a2a.mjs.map +1 -1
  110. package/dist/lib/protocols/index.d.mts +20 -3
  111. package/dist/lib/protocols/index.d.ts +20 -3
  112. package/dist/lib/protocols/index.d.ts.map +1 -1
  113. package/dist/lib/protocols/index.js +44 -31
  114. package/dist/lib/protocols/index.js.map +1 -1
  115. package/dist/lib/protocols/index.mjs +44 -32
  116. package/dist/lib/protocols/index.mjs.map +1 -1
  117. package/dist/lib/protocols/mcp-modern.d.ts.map +1 -1
  118. package/dist/lib/protocols/mcp-modern.js +87 -12
  119. package/dist/lib/protocols/mcp-modern.js.map +1 -1
  120. package/dist/lib/protocols/mcp-modern.mjs +89 -12
  121. package/dist/lib/protocols/mcp-modern.mjs.map +1 -1
  122. package/dist/lib/protocols/mcp-tasks.d.mts +3 -0
  123. package/dist/lib/protocols/mcp-tasks.d.ts +3 -0
  124. package/dist/lib/protocols/mcp-tasks.d.ts.map +1 -1
  125. package/dist/lib/protocols/mcp-tasks.js +21 -11
  126. package/dist/lib/protocols/mcp-tasks.js.map +1 -1
  127. package/dist/lib/protocols/mcp-tasks.mjs +21 -11
  128. package/dist/lib/protocols/mcp-tasks.mjs.map +1 -1
  129. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  130. package/dist/lib/server/create-adcp-server.d.mts +6 -0
  131. package/dist/lib/server/create-adcp-server.d.ts +6 -0
  132. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  133. package/dist/lib/server/create-adcp-server.js +295 -48
  134. package/dist/lib/server/create-adcp-server.js.map +1 -1
  135. package/dist/lib/server/create-adcp-server.mjs +301 -50
  136. package/dist/lib/server/create-adcp-server.mjs.map +1 -1
  137. package/dist/lib/server/decisioning/assembly-helpers.d.mts +27 -13
  138. package/dist/lib/server/decisioning/assembly-helpers.d.ts +27 -13
  139. package/dist/lib/server/decisioning/assembly-helpers.d.ts.map +1 -1
  140. package/dist/lib/server/decisioning/assembly-helpers.js +136 -14
  141. package/dist/lib/server/decisioning/assembly-helpers.js.map +1 -1
  142. package/dist/lib/server/decisioning/assembly-helpers.mjs +134 -13
  143. package/dist/lib/server/decisioning/assembly-helpers.mjs.map +1 -1
  144. package/dist/lib/server/decisioning/index.d.mts +13 -12
  145. package/dist/lib/server/decisioning/index.d.ts +13 -12
  146. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  147. package/dist/lib/server/decisioning/index.js +6 -0
  148. package/dist/lib/server/decisioning/index.js.map +1 -1
  149. package/dist/lib/server/decisioning/index.mjs +9 -3
  150. package/dist/lib/server/decisioning/index.mjs.map +1 -1
  151. package/dist/lib/server/decisioning/list-helpers.d.mts +13 -3
  152. package/dist/lib/server/decisioning/list-helpers.d.ts +13 -3
  153. package/dist/lib/server/decisioning/list-helpers.d.ts.map +1 -1
  154. package/dist/lib/server/decisioning/list-helpers.js +13 -3
  155. package/dist/lib/server/decisioning/list-helpers.js.map +1 -1
  156. package/dist/lib/server/decisioning/list-helpers.mjs +11 -2
  157. package/dist/lib/server/decisioning/list-helpers.mjs.map +1 -1
  158. package/dist/lib/server/decisioning/manifest-helpers.d.mts +5 -3
  159. package/dist/lib/server/decisioning/manifest-helpers.d.ts +5 -3
  160. package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -1
  161. package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -1
  162. package/dist/lib/server/decisioning/manifest-helpers.mjs.map +1 -1
  163. package/dist/lib/server/decisioning/proposal/dispatch.d.mts +2 -2
  164. package/dist/lib/server/decisioning/proposal/dispatch.d.ts +2 -2
  165. package/dist/lib/server/decisioning/proposal/dispatch.d.ts.map +1 -1
  166. package/dist/lib/server/decisioning/proposal/dispatch.js.map +1 -1
  167. package/dist/lib/server/decisioning/proposal/dispatch.mjs.map +1 -1
  168. package/dist/lib/server/decisioning/proposal/index.d.mts +1 -1
  169. package/dist/lib/server/decisioning/proposal/index.d.ts +1 -1
  170. package/dist/lib/server/decisioning/proposal/index.d.ts.map +1 -1
  171. package/dist/lib/server/decisioning/proposal/index.js.map +1 -1
  172. package/dist/lib/server/decisioning/proposal/index.mjs.map +1 -1
  173. package/dist/lib/server/decisioning/proposal/lifecycle.d.mts +3 -2
  174. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts +3 -2
  175. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts.map +1 -1
  176. package/dist/lib/server/decisioning/proposal/lifecycle.js.map +1 -1
  177. package/dist/lib/server/decisioning/proposal/lifecycle.mjs.map +1 -1
  178. package/dist/lib/server/decisioning/proposal/mock-manager.d.mts +3 -3
  179. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts +3 -3
  180. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts.map +1 -1
  181. package/dist/lib/server/decisioning/proposal/mock-manager.js.map +1 -1
  182. package/dist/lib/server/decisioning/proposal/mock-manager.mjs.map +1 -1
  183. package/dist/lib/server/decisioning/proposal/types.d.mts +10 -6
  184. package/dist/lib/server/decisioning/proposal/types.d.ts +10 -6
  185. package/dist/lib/server/decisioning/proposal/types.d.ts.map +1 -1
  186. package/dist/lib/server/decisioning/proposal/types.js.map +1 -1
  187. package/dist/lib/server/decisioning/proposal/types.mjs.map +1 -1
  188. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +21 -2
  189. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +21 -2
  190. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  191. package/dist/lib/server/decisioning/runtime/from-platform.js +754 -81
  192. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  193. package/dist/lib/server/decisioning/runtime/from-platform.mjs +763 -81
  194. package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
  195. package/dist/lib/server/decisioning/specialisms/brand-rights.d.mts +9 -9
  196. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +9 -9
  197. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
  198. package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -1
  199. package/dist/lib/server/decisioning/specialisms/content-standards.d.mts +16 -16
  200. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts +16 -16
  201. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts.map +1 -1
  202. package/dist/lib/server/decisioning/specialisms/content-standards.js.map +1 -1
  203. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.mts +15 -13
  204. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +15 -13
  205. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
  206. package/dist/lib/server/decisioning/specialisms/creative-ad-server.js.map +1 -1
  207. package/dist/lib/server/decisioning/specialisms/creative.d.mts +12 -11
  208. package/dist/lib/server/decisioning/specialisms/creative.d.ts +12 -11
  209. package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
  210. package/dist/lib/server/decisioning/specialisms/creative.js.map +1 -1
  211. package/dist/lib/server/decisioning/specialisms/sales.d.mts +25 -15
  212. package/dist/lib/server/decisioning/specialisms/sales.d.ts +25 -15
  213. package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
  214. package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
  215. package/dist/lib/server/index.d.mts +3 -3
  216. package/dist/lib/server/index.d.ts +3 -3
  217. package/dist/lib/server/index.d.ts.map +1 -1
  218. package/dist/lib/server/index.js +72 -72
  219. package/dist/lib/server/index.js.map +1 -1
  220. package/dist/lib/server/index.mjs +36 -36
  221. package/dist/lib/server/index.mjs.map +1 -1
  222. package/dist/lib/server/legacy/v5/index.d.mts +1 -0
  223. package/dist/lib/server/legacy/v5/index.d.ts +1 -0
  224. package/dist/lib/server/legacy/v5/index.d.ts.map +1 -1
  225. package/dist/lib/server/legacy/v5/index.js +74 -1
  226. package/dist/lib/server/legacy/v5/index.js.map +1 -1
  227. package/dist/lib/server/legacy/v5/index.mjs +75 -1
  228. package/dist/lib/server/legacy/v5/index.mjs.map +1 -1
  229. package/dist/lib/server/responses.d.mts +2 -2
  230. package/dist/lib/server/responses.d.ts +2 -2
  231. package/dist/lib/server/responses.js.map +1 -1
  232. package/dist/lib/server/responses.mjs.map +1 -1
  233. package/dist/lib/testing/client.d.ts.map +1 -1
  234. package/dist/lib/testing/client.js +13 -5
  235. package/dist/lib/testing/client.js.map +1 -1
  236. package/dist/lib/testing/client.mjs +13 -5
  237. package/dist/lib/testing/client.mjs.map +1 -1
  238. package/dist/lib/testing/compliance/comply.d.mts +1 -1
  239. package/dist/lib/testing/compliance/comply.d.ts +1 -1
  240. package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
  241. package/dist/lib/testing/compliance/comply.js +16 -6
  242. package/dist/lib/testing/compliance/comply.js.map +1 -1
  243. package/dist/lib/testing/compliance/comply.mjs +16 -6
  244. package/dist/lib/testing/compliance/comply.mjs.map +1 -1
  245. package/dist/lib/testing/scenarios/brand-rights.js +6 -6
  246. package/dist/lib/testing/scenarios/brand-rights.js.map +1 -1
  247. package/dist/lib/testing/scenarios/brand-rights.mjs +6 -6
  248. package/dist/lib/testing/scenarios/brand-rights.mjs.map +1 -1
  249. package/dist/lib/testing/scenarios/creative.js +7 -7
  250. package/dist/lib/testing/scenarios/creative.js.map +1 -1
  251. package/dist/lib/testing/scenarios/creative.mjs +7 -7
  252. package/dist/lib/testing/scenarios/creative.mjs.map +1 -1
  253. package/dist/lib/testing/scenarios/discovery.js +2 -2
  254. package/dist/lib/testing/scenarios/discovery.js.map +1 -1
  255. package/dist/lib/testing/scenarios/discovery.mjs +2 -2
  256. package/dist/lib/testing/scenarios/discovery.mjs.map +1 -1
  257. package/dist/lib/testing/scenarios/edge-cases.js +11 -11
  258. package/dist/lib/testing/scenarios/edge-cases.js.map +1 -1
  259. package/dist/lib/testing/scenarios/edge-cases.mjs +11 -11
  260. package/dist/lib/testing/scenarios/edge-cases.mjs.map +1 -1
  261. package/dist/lib/testing/scenarios/governance.d.ts.map +1 -1
  262. package/dist/lib/testing/scenarios/governance.js +16 -22
  263. package/dist/lib/testing/scenarios/governance.js.map +1 -1
  264. package/dist/lib/testing/scenarios/governance.mjs +16 -22
  265. package/dist/lib/testing/scenarios/governance.mjs.map +1 -1
  266. package/dist/lib/testing/scenarios/media-buy.js +5 -5
  267. package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
  268. package/dist/lib/testing/scenarios/media-buy.mjs +5 -5
  269. package/dist/lib/testing/scenarios/media-buy.mjs.map +1 -1
  270. package/dist/lib/testing/scenarios/schema-compliance.js +1 -1
  271. package/dist/lib/testing/scenarios/schema-compliance.js.map +1 -1
  272. package/dist/lib/testing/scenarios/schema-compliance.mjs +1 -1
  273. package/dist/lib/testing/scenarios/schema-compliance.mjs.map +1 -1
  274. package/dist/lib/testing/scenarios/trusted-match.d.ts.map +1 -1
  275. package/dist/lib/testing/scenarios/trusted-match.js +4 -3
  276. package/dist/lib/testing/scenarios/trusted-match.js.map +1 -1
  277. package/dist/lib/testing/scenarios/trusted-match.mjs +4 -3
  278. package/dist/lib/testing/scenarios/trusted-match.mjs.map +1 -1
  279. package/dist/lib/testing/storyboard/probes.d.mts +6 -0
  280. package/dist/lib/testing/storyboard/probes.d.ts +6 -0
  281. package/dist/lib/testing/storyboard/probes.d.ts.map +1 -1
  282. package/dist/lib/testing/storyboard/probes.js +16 -5
  283. package/dist/lib/testing/storyboard/probes.js.map +1 -1
  284. package/dist/lib/testing/storyboard/probes.mjs +16 -5
  285. package/dist/lib/testing/storyboard/probes.mjs.map +1 -1
  286. package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
  287. package/dist/lib/testing/storyboard/runner.js +6 -2
  288. package/dist/lib/testing/storyboard/runner.js.map +1 -1
  289. package/dist/lib/testing/storyboard/runner.mjs +6 -2
  290. package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
  291. package/dist/lib/testing/storyboard/shape-drift-hints.d.mts +3 -4
  292. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts +3 -4
  293. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts.map +1 -1
  294. package/dist/lib/testing/storyboard/shape-drift-hints.js +27 -27
  295. package/dist/lib/testing/storyboard/shape-drift-hints.js.map +1 -1
  296. package/dist/lib/testing/storyboard/shape-drift-hints.mjs +27 -27
  297. package/dist/lib/testing/storyboard/shape-drift-hints.mjs.map +1 -1
  298. package/dist/lib/testing/storyboard/task-map.d.ts.map +1 -1
  299. package/dist/lib/testing/storyboard/task-map.js +43 -5
  300. package/dist/lib/testing/storyboard/task-map.js.map +1 -1
  301. package/dist/lib/testing/storyboard/task-map.mjs +43 -5
  302. package/dist/lib/testing/storyboard/task-map.mjs.map +1 -1
  303. package/dist/lib/testing/test-helpers.d.mts +2 -2
  304. package/dist/lib/testing/test-helpers.d.ts +2 -2
  305. package/dist/lib/testing/test-helpers.js.map +1 -1
  306. package/dist/lib/testing/test-helpers.mjs.map +1 -1
  307. package/dist/lib/testing/types.d.mts +7 -1
  308. package/dist/lib/testing/types.d.ts +7 -1
  309. package/dist/lib/testing/types.d.ts.map +1 -1
  310. package/dist/lib/testing/types.js.map +1 -1
  311. package/dist/lib/types/adcp.d.mts +14 -14
  312. package/dist/lib/types/adcp.d.ts +14 -14
  313. package/dist/lib/types/adcp.d.ts.map +1 -1
  314. package/dist/lib/types/adcp.js.map +1 -1
  315. package/dist/lib/types/adcp.mjs.map +1 -1
  316. package/dist/lib/types/index.d.mts +2 -2
  317. package/dist/lib/types/index.d.ts +2 -2
  318. package/dist/lib/types/index.d.ts.map +1 -1
  319. package/dist/lib/types/index.js.map +1 -1
  320. package/dist/lib/types/index.mjs.map +1 -1
  321. package/dist/lib/utils/capabilities.d.mts +6 -0
  322. package/dist/lib/utils/capabilities.d.ts +6 -0
  323. package/dist/lib/utils/capabilities.d.ts.map +1 -1
  324. package/dist/lib/utils/capabilities.js +4 -0
  325. package/dist/lib/utils/capabilities.js.map +1 -1
  326. package/dist/lib/utils/capabilities.mjs +4 -0
  327. package/dist/lib/utils/capabilities.mjs.map +1 -1
  328. package/dist/lib/utils/creative-delivery.d.mts +52 -10
  329. package/dist/lib/utils/creative-delivery.d.ts +52 -10
  330. package/dist/lib/utils/creative-delivery.d.ts.map +1 -1
  331. package/dist/lib/utils/creative-delivery.js +104 -9
  332. package/dist/lib/utils/creative-delivery.js.map +1 -1
  333. package/dist/lib/utils/creative-delivery.mjs +104 -8
  334. package/dist/lib/utils/creative-delivery.mjs.map +1 -1
  335. package/dist/lib/utils/format-assets.d.mts +41 -38
  336. package/dist/lib/utils/format-assets.d.ts +41 -38
  337. package/dist/lib/utils/format-assets.d.ts.map +1 -1
  338. package/dist/lib/utils/format-assets.js +3 -1
  339. package/dist/lib/utils/format-assets.js.map +1 -1
  340. package/dist/lib/utils/format-assets.mjs +3 -1
  341. package/dist/lib/utils/format-assets.mjs.map +1 -1
  342. package/dist/lib/utils/index.d.mts +8 -8
  343. package/dist/lib/utils/index.d.ts +8 -8
  344. package/dist/lib/utils/index.d.ts.map +1 -1
  345. package/dist/lib/utils/index.js +11 -9
  346. package/dist/lib/utils/index.js.map +1 -1
  347. package/dist/lib/utils/index.mjs +9 -8
  348. package/dist/lib/utils/index.mjs.map +1 -1
  349. package/dist/lib/utils/preview-utils.d.mts +11 -8
  350. package/dist/lib/utils/preview-utils.d.ts +11 -8
  351. package/dist/lib/utils/preview-utils.d.ts.map +1 -1
  352. package/dist/lib/utils/preview-utils.js +4 -4
  353. package/dist/lib/utils/preview-utils.js.map +1 -1
  354. package/dist/lib/utils/preview-utils.mjs +3 -3
  355. package/dist/lib/utils/preview-utils.mjs.map +1 -1
  356. package/dist/lib/utils/tool-request-schemas.d.mts +2 -2
  357. package/dist/lib/utils/tool-request-schemas.d.ts +2 -2
  358. package/dist/lib/v2/projection/aao-reference-formats.json +492 -0
  359. package/dist/lib/v2/projection/augment-response.d.mts +31 -11
  360. package/dist/lib/v2/projection/augment-response.d.ts +31 -11
  361. package/dist/lib/v2/projection/augment-response.d.ts.map +1 -1
  362. package/dist/lib/v2/projection/augment-response.js +233 -27
  363. package/dist/lib/v2/projection/augment-response.js.map +1 -1
  364. package/dist/lib/v2/projection/augment-response.mjs +232 -27
  365. package/dist/lib/v2/projection/augment-response.mjs.map +1 -1
  366. package/dist/lib/v2/projection/builders.d.mts +7 -6
  367. package/dist/lib/v2/projection/builders.d.ts +7 -6
  368. package/dist/lib/v2/projection/builders.d.ts.map +1 -1
  369. package/dist/lib/v2/projection/builders.js +11 -8
  370. package/dist/lib/v2/projection/builders.js.map +1 -1
  371. package/dist/lib/v2/projection/builders.mjs +9 -6
  372. package/dist/lib/v2/projection/builders.mjs.map +1 -1
  373. package/dist/lib/v2/projection/catalog-snapshot.d.mts +47 -0
  374. package/dist/lib/v2/projection/catalog-snapshot.d.ts +48 -0
  375. package/dist/lib/v2/projection/catalog-snapshot.d.ts.map +1 -0
  376. package/dist/lib/v2/projection/catalog-snapshot.js +291 -0
  377. package/dist/lib/v2/projection/catalog-snapshot.js.map +1 -0
  378. package/dist/lib/v2/projection/catalog-snapshot.mjs +265 -0
  379. package/dist/lib/v2/projection/catalog-snapshot.mjs.map +1 -0
  380. package/dist/lib/v2/projection/catalog.d.mts +23 -2
  381. package/dist/lib/v2/projection/catalog.d.ts +23 -2
  382. package/dist/lib/v2/projection/catalog.d.ts.map +1 -1
  383. package/dist/lib/v2/projection/catalog.js +34 -10
  384. package/dist/lib/v2/projection/catalog.js.map +1 -1
  385. package/dist/lib/v2/projection/catalog.mjs +33 -10
  386. package/dist/lib/v2/projection/catalog.mjs.map +1 -1
  387. package/dist/lib/v2/projection/creative-delivery.d.mts +157 -0
  388. package/dist/lib/v2/projection/creative-delivery.d.ts +158 -0
  389. package/dist/lib/v2/projection/creative-delivery.d.ts.map +1 -0
  390. package/dist/lib/v2/projection/creative-delivery.js +967 -0
  391. package/dist/lib/v2/projection/creative-delivery.js.map +1 -0
  392. package/dist/lib/v2/projection/creative-delivery.mjs +941 -0
  393. package/dist/lib/v2/projection/creative-delivery.mjs.map +1 -0
  394. package/dist/lib/v2/projection/index.d.mts +8 -6
  395. package/dist/lib/v2/projection/index.d.ts +8 -6
  396. package/dist/lib/v2/projection/index.d.ts.map +1 -1
  397. package/dist/lib/v2/projection/index.js +26 -4
  398. package/dist/lib/v2/projection/index.js.map +1 -1
  399. package/dist/lib/v2/projection/index.mjs +28 -4
  400. package/dist/lib/v2/projection/index.mjs.map +1 -1
  401. package/dist/lib/v2/projection/legacy-metadata.d.mts +21 -0
  402. package/dist/lib/v2/projection/legacy-metadata.d.ts +22 -0
  403. package/dist/lib/v2/projection/legacy-metadata.d.ts.map +1 -0
  404. package/dist/lib/v2/projection/legacy-metadata.js +73 -0
  405. package/dist/lib/v2/projection/legacy-metadata.js.map +1 -0
  406. package/dist/lib/v2/projection/legacy-metadata.mjs +45 -0
  407. package/dist/lib/v2/projection/legacy-metadata.mjs.map +1 -0
  408. package/dist/lib/v2/projection/types.d.mts +29 -23
  409. package/dist/lib/v2/projection/types.d.ts +29 -23
  410. package/dist/lib/v2/projection/types.d.ts.map +1 -1
  411. package/dist/lib/v2/projection/types.js.map +1 -1
  412. package/dist/lib/v2/projection/v1-to-v2.d.mts +29 -6
  413. package/dist/lib/v2/projection/v1-to-v2.d.ts +29 -6
  414. package/dist/lib/v2/projection/v1-to-v2.d.ts.map +1 -1
  415. package/dist/lib/v2/projection/v1-to-v2.js +218 -9
  416. package/dist/lib/v2/projection/v1-to-v2.js.map +1 -1
  417. package/dist/lib/v2/projection/v1-to-v2.mjs +219 -10
  418. package/dist/lib/v2/projection/v1-to-v2.mjs.map +1 -1
  419. package/dist/lib/v2/projection/v2-to-v1.d.mts +31 -2
  420. package/dist/lib/v2/projection/v2-to-v1.d.ts +31 -2
  421. package/dist/lib/v2/projection/v2-to-v1.d.ts.map +1 -1
  422. package/dist/lib/v2/projection/v2-to-v1.js +138 -7
  423. package/dist/lib/v2/projection/v2-to-v1.js.map +1 -1
  424. package/dist/lib/v2/projection/v2-to-v1.mjs +135 -6
  425. package/dist/lib/v2/projection/v2-to-v1.mjs.map +1 -1
  426. package/dist/lib/v2/projection/write-side.d.mts +12 -13
  427. package/dist/lib/v2/projection/write-side.d.ts +12 -13
  428. package/dist/lib/v2/projection/write-side.d.ts.map +1 -1
  429. package/dist/lib/v2/projection/write-side.js +16 -12
  430. package/dist/lib/v2/projection/write-side.js.map +1 -1
  431. package/dist/lib/v2/projection/write-side.mjs +16 -12
  432. package/dist/lib/v2/projection/write-side.mjs.map +1 -1
  433. package/dist/lib/version.d.mts +3 -3
  434. package/dist/lib/version.d.ts +3 -3
  435. package/dist/lib/version.d.ts.map +1 -1
  436. package/dist/lib/version.js +3 -3
  437. package/dist/lib/version.js.map +1 -1
  438. package/dist/lib/version.mjs +3 -3
  439. package/dist/lib/version.mjs.map +1 -1
  440. package/docs/guides/BUILD-AN-AGENT.md +7 -2
  441. package/docs/guides/PREVIEW-ASSET-DURABILITY.md +6 -2
  442. package/docs/llms.txt +1 -0
  443. package/examples/README.md +1 -1
  444. package/examples/batch-preview-test.ts +3 -3
  445. package/examples/conversation-client.ts +2 -2
  446. package/examples/debug-preview-response.ts +1 -1
  447. package/examples/decisioning-platform-broadcast-tv.ts +10 -4
  448. package/examples/decisioning-platform-mock-seller.ts +16 -9
  449. package/examples/decisioning-platform-programmatic.ts +18 -7
  450. package/examples/error-compliant-server.ts +26 -16
  451. package/examples/generative-creative-demo.ts +7 -19
  452. package/examples/hello_creative_adapter_ad_server.ts +37 -16
  453. package/examples/hello_creative_adapter_template.ts +12 -10
  454. package/examples/hello_seller_adapter_guaranteed.ts +52 -23
  455. package/examples/hello_seller_adapter_multi_tenant.ts +6 -3
  456. package/examples/hello_seller_adapter_non_guaranteed.ts +54 -26
  457. package/examples/hello_seller_adapter_proposal_mode.ts +40 -14
  458. package/examples/hello_seller_adapter_social.ts +2 -7
  459. package/examples/inspect-card-formats.ts +1 -1
  460. package/examples/simple-getting-started.ts +1 -1
  461. package/examples/test-helpers-demo.ts +1 -1
  462. package/package.json +2 -2
  463. package/skills/build-decisioning-creative-template/SKILL.md +11 -11
  464. package/skills/build-decisioning-platform/advanced/REFERENCE.md +8 -2
@@ -0,0 +1,73 @@
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 legacy_metadata_exports = {};
20
+ __export(legacy_metadata_exports, {
21
+ concealLegacyFormatRefs: () => concealLegacyFormatRefs,
22
+ concealSelectedFormatOptions: () => concealSelectedFormatOptions,
23
+ legacyFormatRefsForDeclaration: () => legacyFormatRefsForDeclaration,
24
+ selectedFormatOptions: () => selectedFormatOptions,
25
+ transferLegacyCreativeMetadata: () => transferLegacyCreativeMetadata
26
+ });
27
+ module.exports = __toCommonJS(legacy_metadata_exports);
28
+ const legacyRefsByDeclaration = /* @__PURE__ */ new WeakMap();
29
+ const selectedOptionsByRefs = /* @__PURE__ */ new WeakMap();
30
+ function concealLegacyFormatRefs(declaration) {
31
+ const { v1_format_ref: refs, ...canonical } = declaration;
32
+ const existingHidden = legacyRefsByDeclaration.get(declaration);
33
+ const refsToConceal = Array.isArray(existingHidden) && existingHidden.length > 0 ? existingHidden : refs;
34
+ if (Array.isArray(refsToConceal) && refsToConceal.length > 0) {
35
+ legacyRefsByDeclaration.set(
36
+ canonical,
37
+ refsToConceal.map((ref) => ({ ...ref }))
38
+ );
39
+ }
40
+ return canonical;
41
+ }
42
+ function legacyFormatRefsForDeclaration(value) {
43
+ if (!value || typeof value !== "object" || Array.isArray(value)) return [];
44
+ const declaration = value;
45
+ const hidden = legacyRefsByDeclaration.get(declaration);
46
+ if (Array.isArray(hidden)) return hidden;
47
+ return Array.isArray(declaration.v1_format_ref) ? declaration.v1_format_ref : [];
48
+ }
49
+ function selectedFormatOptions(value) {
50
+ if (!value || typeof value !== "object" || Array.isArray(value)) return [];
51
+ const refs = value.format_option_refs;
52
+ if (!Array.isArray(refs)) return [];
53
+ const selected = selectedOptionsByRefs.get(refs);
54
+ return Array.isArray(selected) ? selected : [];
55
+ }
56
+ function concealSelectedFormatOptions(refs, declarations) {
57
+ selectedOptionsByRefs.set(refs, declarations);
58
+ }
59
+ function transferLegacyCreativeMetadata(source, target) {
60
+ const refs = legacyRefsByDeclaration.get(source);
61
+ if (refs) legacyRefsByDeclaration.set(target, refs);
62
+ const selected = selectedOptionsByRefs.get(source);
63
+ if (selected) selectedOptionsByRefs.set(target, selected);
64
+ }
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ concealLegacyFormatRefs,
68
+ concealSelectedFormatOptions,
69
+ legacyFormatRefsForDeclaration,
70
+ selectedFormatOptions,
71
+ transferLegacyCreativeMetadata
72
+ });
73
+ //# sourceMappingURL=legacy-metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/v2/projection/legacy-metadata.ts"],"sourcesContent":["import type { ProductFormatDeclaration } from '../../types/tools.generated';\nimport type { V1FormatId, V2ProductFormatDeclaration } from './types';\n\n/**\n * SDK-private downgrade metadata held out-of-band. WeakMaps keep legacy\n * routing identifiers absent from canonical objects even under reflective\n * inspection while still allowing object-spread package authoring.\n */\n\nexport type CanonicalFormatDeclaration = Omit<V2ProductFormatDeclaration, 'v1_format_ref'> & {\n v1_format_ref?: never;\n};\n\ntype DeclarationWithMetadata = CanonicalFormatDeclaration;\n\nexport type PackageSelectionMetadata = {\n format_option_refs?: readonly unknown[];\n};\n\nconst legacyRefsByDeclaration = new WeakMap<object, readonly V1FormatId[]>();\nconst selectedOptionsByRefs = new WeakMap<object, readonly DeclarationWithMetadata[]>();\n\nexport function concealLegacyFormatRefs(\n declaration: ProductFormatDeclaration | V2ProductFormatDeclaration | CanonicalFormatDeclaration\n): DeclarationWithMetadata {\n const { v1_format_ref: refs, ...canonical } = declaration as ProductFormatDeclaration;\n const existingHidden = legacyRefsByDeclaration.get(declaration as object);\n const refsToConceal = Array.isArray(existingHidden) && existingHidden.length > 0 ? existingHidden : refs;\n if (Array.isArray(refsToConceal) && refsToConceal.length > 0) {\n legacyRefsByDeclaration.set(\n canonical,\n refsToConceal.map(ref => ({ ...ref }))\n );\n }\n return canonical as DeclarationWithMetadata;\n}\n\nexport function legacyFormatRefsForDeclaration(value: unknown): readonly V1FormatId[] {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return [];\n const declaration = value as ProductFormatDeclaration & DeclarationWithMetadata;\n const hidden = legacyRefsByDeclaration.get(declaration);\n if (Array.isArray(hidden)) return hidden;\n return Array.isArray(declaration.v1_format_ref) ? declaration.v1_format_ref : [];\n}\n\nexport function selectedFormatOptions(value: unknown): readonly DeclarationWithMetadata[] {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return [];\n const refs = (value as PackageSelectionMetadata).format_option_refs;\n if (!Array.isArray(refs)) return [];\n const selected = selectedOptionsByRefs.get(refs);\n return Array.isArray(selected) ? selected : [];\n}\n\nexport function concealSelectedFormatOptions(\n refs: readonly unknown[],\n declarations: readonly DeclarationWithMetadata[]\n): void {\n selectedOptionsByRefs.set(refs, declarations);\n}\n\n/** Preserve out-of-band downgrade metadata when a canonical sanitizer clones a value. */\nexport function transferLegacyCreativeMetadata(source: object, target: object): void {\n const refs = legacyRefsByDeclaration.get(source);\n if (refs) legacyRefsByDeclaration.set(target, refs);\n const selected = selectedOptionsByRefs.get(source);\n if (selected) selectedOptionsByRefs.set(target, selected);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA,MAAM,0BAA0B,oBAAI,QAAuC;AAC3E,MAAM,wBAAwB,oBAAI,QAAoD;AAE/E,SAAS,wBACd,aACyB;AACzB,QAAM,EAAE,eAAe,MAAM,GAAG,UAAU,IAAI;AAC9C,QAAM,iBAAiB,wBAAwB,IAAI,WAAqB;AACxE,QAAM,gBAAgB,MAAM,QAAQ,cAAc,KAAK,eAAe,SAAS,IAAI,iBAAiB;AACpG,MAAI,MAAM,QAAQ,aAAa,KAAK,cAAc,SAAS,GAAG;AAC5D,4BAAwB;AAAA,MACtB;AAAA,MACA,cAAc,IAAI,UAAQ,EAAE,GAAG,IAAI,EAAE;AAAA,IACvC;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,+BAA+B,OAAuC;AACpF,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,EAAG,QAAO,CAAC;AACzE,QAAM,cAAc;AACpB,QAAM,SAAS,wBAAwB,IAAI,WAAW;AACtD,MAAI,MAAM,QAAQ,MAAM,EAAG,QAAO;AAClC,SAAO,MAAM,QAAQ,YAAY,aAAa,IAAI,YAAY,gBAAgB,CAAC;AACjF;AAEO,SAAS,sBAAsB,OAAoD;AACxF,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,EAAG,QAAO,CAAC;AACzE,QAAM,OAAQ,MAAmC;AACjD,MAAI,CAAC,MAAM,QAAQ,IAAI,EAAG,QAAO,CAAC;AAClC,QAAM,WAAW,sBAAsB,IAAI,IAAI;AAC/C,SAAO,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC;AAC/C;AAEO,SAAS,6BACd,MACA,cACM;AACN,wBAAsB,IAAI,MAAM,YAAY;AAC9C;AAGO,SAAS,+BAA+B,QAAgB,QAAsB;AACnF,QAAM,OAAO,wBAAwB,IAAI,MAAM;AAC/C,MAAI,KAAM,yBAAwB,IAAI,QAAQ,IAAI;AAClD,QAAM,WAAW,sBAAsB,IAAI,MAAM;AACjD,MAAI,SAAU,uBAAsB,IAAI,QAAQ,QAAQ;AAC1D;","names":[]}
@@ -0,0 +1,45 @@
1
+ const legacyRefsByDeclaration = /* @__PURE__ */ new WeakMap();
2
+ const selectedOptionsByRefs = /* @__PURE__ */ new WeakMap();
3
+ function concealLegacyFormatRefs(declaration) {
4
+ const { v1_format_ref: refs, ...canonical } = declaration;
5
+ const existingHidden = legacyRefsByDeclaration.get(declaration);
6
+ const refsToConceal = Array.isArray(existingHidden) && existingHidden.length > 0 ? existingHidden : refs;
7
+ if (Array.isArray(refsToConceal) && refsToConceal.length > 0) {
8
+ legacyRefsByDeclaration.set(
9
+ canonical,
10
+ refsToConceal.map((ref) => ({ ...ref }))
11
+ );
12
+ }
13
+ return canonical;
14
+ }
15
+ function legacyFormatRefsForDeclaration(value) {
16
+ if (!value || typeof value !== "object" || Array.isArray(value)) return [];
17
+ const declaration = value;
18
+ const hidden = legacyRefsByDeclaration.get(declaration);
19
+ if (Array.isArray(hidden)) return hidden;
20
+ return Array.isArray(declaration.v1_format_ref) ? declaration.v1_format_ref : [];
21
+ }
22
+ function selectedFormatOptions(value) {
23
+ if (!value || typeof value !== "object" || Array.isArray(value)) return [];
24
+ const refs = value.format_option_refs;
25
+ if (!Array.isArray(refs)) return [];
26
+ const selected = selectedOptionsByRefs.get(refs);
27
+ return Array.isArray(selected) ? selected : [];
28
+ }
29
+ function concealSelectedFormatOptions(refs, declarations) {
30
+ selectedOptionsByRefs.set(refs, declarations);
31
+ }
32
+ function transferLegacyCreativeMetadata(source, target) {
33
+ const refs = legacyRefsByDeclaration.get(source);
34
+ if (refs) legacyRefsByDeclaration.set(target, refs);
35
+ const selected = selectedOptionsByRefs.get(source);
36
+ if (selected) selectedOptionsByRefs.set(target, selected);
37
+ }
38
+ export {
39
+ concealLegacyFormatRefs,
40
+ concealSelectedFormatOptions,
41
+ legacyFormatRefsForDeclaration,
42
+ selectedFormatOptions,
43
+ transferLegacyCreativeMetadata
44
+ };
45
+ //# sourceMappingURL=legacy-metadata.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/v2/projection/legacy-metadata.ts"],"sourcesContent":["import type { ProductFormatDeclaration } from '../../types/tools.generated';\nimport type { V1FormatId, V2ProductFormatDeclaration } from './types';\n\n/**\n * SDK-private downgrade metadata held out-of-band. WeakMaps keep legacy\n * routing identifiers absent from canonical objects even under reflective\n * inspection while still allowing object-spread package authoring.\n */\n\nexport type CanonicalFormatDeclaration = Omit<V2ProductFormatDeclaration, 'v1_format_ref'> & {\n v1_format_ref?: never;\n};\n\ntype DeclarationWithMetadata = CanonicalFormatDeclaration;\n\nexport type PackageSelectionMetadata = {\n format_option_refs?: readonly unknown[];\n};\n\nconst legacyRefsByDeclaration = new WeakMap<object, readonly V1FormatId[]>();\nconst selectedOptionsByRefs = new WeakMap<object, readonly DeclarationWithMetadata[]>();\n\nexport function concealLegacyFormatRefs(\n declaration: ProductFormatDeclaration | V2ProductFormatDeclaration | CanonicalFormatDeclaration\n): DeclarationWithMetadata {\n const { v1_format_ref: refs, ...canonical } = declaration as ProductFormatDeclaration;\n const existingHidden = legacyRefsByDeclaration.get(declaration as object);\n const refsToConceal = Array.isArray(existingHidden) && existingHidden.length > 0 ? existingHidden : refs;\n if (Array.isArray(refsToConceal) && refsToConceal.length > 0) {\n legacyRefsByDeclaration.set(\n canonical,\n refsToConceal.map(ref => ({ ...ref }))\n );\n }\n return canonical as DeclarationWithMetadata;\n}\n\nexport function legacyFormatRefsForDeclaration(value: unknown): readonly V1FormatId[] {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return [];\n const declaration = value as ProductFormatDeclaration & DeclarationWithMetadata;\n const hidden = legacyRefsByDeclaration.get(declaration);\n if (Array.isArray(hidden)) return hidden;\n return Array.isArray(declaration.v1_format_ref) ? declaration.v1_format_ref : [];\n}\n\nexport function selectedFormatOptions(value: unknown): readonly DeclarationWithMetadata[] {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return [];\n const refs = (value as PackageSelectionMetadata).format_option_refs;\n if (!Array.isArray(refs)) return [];\n const selected = selectedOptionsByRefs.get(refs);\n return Array.isArray(selected) ? selected : [];\n}\n\nexport function concealSelectedFormatOptions(\n refs: readonly unknown[],\n declarations: readonly DeclarationWithMetadata[]\n): void {\n selectedOptionsByRefs.set(refs, declarations);\n}\n\n/** Preserve out-of-band downgrade metadata when a canonical sanitizer clones a value. */\nexport function transferLegacyCreativeMetadata(source: object, target: object): void {\n const refs = legacyRefsByDeclaration.get(source);\n if (refs) legacyRefsByDeclaration.set(target, refs);\n const selected = selectedOptionsByRefs.get(source);\n if (selected) selectedOptionsByRefs.set(target, selected);\n}\n"],"mappings":"AAmBA,MAAM,0BAA0B,oBAAI,QAAuC;AAC3E,MAAM,wBAAwB,oBAAI,QAAoD;AAE/E,SAAS,wBACd,aACyB;AACzB,QAAM,EAAE,eAAe,MAAM,GAAG,UAAU,IAAI;AAC9C,QAAM,iBAAiB,wBAAwB,IAAI,WAAqB;AACxE,QAAM,gBAAgB,MAAM,QAAQ,cAAc,KAAK,eAAe,SAAS,IAAI,iBAAiB;AACpG,MAAI,MAAM,QAAQ,aAAa,KAAK,cAAc,SAAS,GAAG;AAC5D,4BAAwB;AAAA,MACtB;AAAA,MACA,cAAc,IAAI,UAAQ,EAAE,GAAG,IAAI,EAAE;AAAA,IACvC;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,+BAA+B,OAAuC;AACpF,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,EAAG,QAAO,CAAC;AACzE,QAAM,cAAc;AACpB,QAAM,SAAS,wBAAwB,IAAI,WAAW;AACtD,MAAI,MAAM,QAAQ,MAAM,EAAG,QAAO;AAClC,SAAO,MAAM,QAAQ,YAAY,aAAa,IAAI,YAAY,gBAAgB,CAAC;AACjF;AAEO,SAAS,sBAAsB,OAAoD;AACxF,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,EAAG,QAAO,CAAC;AACzE,QAAM,OAAQ,MAAmC;AACjD,MAAI,CAAC,MAAM,QAAQ,IAAI,EAAG,QAAO,CAAC;AAClC,QAAM,WAAW,sBAAsB,IAAI,IAAI;AAC/C,SAAO,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC;AAC/C;AAEO,SAAS,6BACd,MACA,cACM;AACN,wBAAsB,IAAI,MAAM,YAAY;AAC9C;AAGO,SAAS,+BAA+B,QAAgB,QAAsB;AACnF,QAAM,OAAO,wBAAwB,IAAI,MAAM;AAC/C,MAAI,KAAM,yBAAwB,IAAI,QAAQ,IAAI;AAClD,QAAM,WAAW,sBAAsB,IAAI,MAAM;AACjD,MAAI,SAAU,uBAAsB,IAAI,QAAQ,QAAQ;AAC1D;","names":[]}
@@ -79,8 +79,9 @@ export interface V1Product {
79
79
  [k: string]: unknown;
80
80
  }
81
81
  /**
82
- * Structured diagnostic shape matching the spec's `errors[]` augmentation
83
- * contract (`source: "sdk"`, `sdk_id`, `code`, `field`, `error.details`).
82
+ * Internal structured diagnostic produced by the pure projection algorithms.
83
+ * `toCanonicalOnlyResponse()` flattens this into the protocol `Error` shape
84
+ * (`message` plus top-level `details`) before augmenting `errors[]`.
84
85
  * Spec codes — `FORMAT_PROJECTION_FAILED` and `FORMAT_DECLARATION_V1_AMBIGUOUS`
85
86
  * — come straight from `enums/error-code.json`. The two SDK-local codes
86
87
  * (`*_NOT_APPLICABLE`, `CANONICAL_NOT_V1_TRANSLATABLE`) cover cases the
@@ -88,10 +89,9 @@ export interface V1Product {
88
89
  * skip silently") but where buyer-side transparency is more useful
89
90
  * than silent product drops.
90
91
  *
91
- * **Never logger-only**, per the resolution-order amendment emitted
92
- * on the response envelope's `errors[]` array and surfaced on the
93
- * SDK's `TaskResult` for caller-side handling without re-walking
94
- * `errors[]`.
92
+ * **Never logger-only**, per the resolution-order amendment. The internal
93
+ * nesting keeps projection code strongly discriminated; it is not itself a
94
+ * wire/protocol Error and must be normalized before public response emission.
95
95
  */
96
96
  export interface ProjectionDiagnosticBase {
97
97
  /** Spec-mandated origin marker for SDK-augmented diagnostics. */
@@ -102,6 +102,19 @@ export interface ProjectionDiagnosticBase {
102
102
  field: string;
103
103
  }
104
104
  export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
105
+ /**
106
+ * SDK-local code: a valid seller product cannot be represented on the
107
+ * canonical-only public surface because it has no canonical option.
108
+ * Legacy `format_ids: []` is format-agnostic, not a failed lookup.
109
+ */
110
+ code: 'CANONICAL_PRODUCT_FORMATS_UNAVAILABLE';
111
+ error: {
112
+ details: {
113
+ product_id: string;
114
+ reason: 'legacy_format_list_empty' | 'canonical_format_list_empty' | 'missing_format_declaration' | 'nested_placement_format_list_empty';
115
+ };
116
+ };
117
+ }) | (ProjectionDiagnosticBase & {
105
118
  /**
106
119
  * Spec code (`enums/error-code.json`): registry-coverage gap or
107
120
  * v1-catalog-coverage gap depending on `resolution_failure`:
@@ -119,6 +132,10 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
119
132
  * possible"; this signals "no v2 form yet."
120
133
  * - `no_match` — v1→v2 direction, format not in catalog or
121
134
  * registry, no structural match.
135
+ * - `invalid_format_id_parameters` — the legacy ref carries
136
+ * malformed dimensional or duration discriminators.
137
+ * - `catalog_requirement_conflict` — catalog-authored fixed
138
+ * requirements are internally ambiguous or contradict the ref.
122
139
  */
123
140
  code: 'FORMAT_PROJECTION_FAILED';
124
141
  error: {
@@ -126,7 +143,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
126
143
  format_kind: CanonicalFormatKind;
127
144
  product_id: string;
128
145
  format_option_id?: string;
129
- resolution_failure: 'no_registry_match' | 'catalog_lacks_canonical_annotation' | 'no_match';
146
+ resolution_failure: 'no_registry_match' | 'catalog_lacks_canonical_annotation' | 'no_match' | 'custom_converter_failed' | 'invalid_format_id_parameters' | 'catalog_requirement_conflict';
147
+ converter_error?: string;
130
148
  };
131
149
  };
132
150
  }) | (ProjectionDiagnosticBase & {
@@ -226,8 +244,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
226
244
  }) | (ProjectionDiagnosticBase & {
227
245
  /**
228
246
  * SDK-local code: canonical-only projection (`toCanonicalOnlyProduct`
229
- * / `toCanonicalOnlyResponse`) dropped a legacy `format_id` that no
230
- * `format_options[].v1_format_ref` covers. Emitted only on the
247
+ * / `toCanonicalOnlyResponse`) found legacy routing metadata that no
248
+ * canonical format option covers. Emitted only on the
231
249
  * v2-native pass-through path — a seller that sent `format_options[]`
232
250
  * directly but also carried a `format_ids[]` entry with no canonical
233
251
  * representation. Without it, canonical-only mode would silently
@@ -243,20 +261,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
243
261
  error: {
244
262
  details: {
245
263
  product_id: string;
246
- /**
247
- * The full ref that was dropped, including the dimensional
248
- * discriminators (`width` / `height` / `duration_ms`) when the
249
- * input carried them — so a buyer can tell which variant of a
250
- * multi-size/multi-duration family was lost and re-acquire it on
251
- * the v1 path. Omitted keys mean the input ref carried no value.
252
- */
253
- dropped_format_id: {
254
- agent_url: string;
255
- id: string;
256
- width?: number;
257
- height?: number;
258
- duration_ms?: number;
259
- };
264
+ /** Stable category only; canonical diagnostics never echo routing identifiers. */
265
+ resolution_failure: 'unmapped_legacy_format';
260
266
  };
261
267
  };
262
268
  });
@@ -79,8 +79,9 @@ export interface V1Product {
79
79
  [k: string]: unknown;
80
80
  }
81
81
  /**
82
- * Structured diagnostic shape matching the spec's `errors[]` augmentation
83
- * contract (`source: "sdk"`, `sdk_id`, `code`, `field`, `error.details`).
82
+ * Internal structured diagnostic produced by the pure projection algorithms.
83
+ * `toCanonicalOnlyResponse()` flattens this into the protocol `Error` shape
84
+ * (`message` plus top-level `details`) before augmenting `errors[]`.
84
85
  * Spec codes — `FORMAT_PROJECTION_FAILED` and `FORMAT_DECLARATION_V1_AMBIGUOUS`
85
86
  * — come straight from `enums/error-code.json`. The two SDK-local codes
86
87
  * (`*_NOT_APPLICABLE`, `CANONICAL_NOT_V1_TRANSLATABLE`) cover cases the
@@ -88,10 +89,9 @@ export interface V1Product {
88
89
  * skip silently") but where buyer-side transparency is more useful
89
90
  * than silent product drops.
90
91
  *
91
- * **Never logger-only**, per the resolution-order amendment emitted
92
- * on the response envelope's `errors[]` array and surfaced on the
93
- * SDK's `TaskResult` for caller-side handling without re-walking
94
- * `errors[]`.
92
+ * **Never logger-only**, per the resolution-order amendment. The internal
93
+ * nesting keeps projection code strongly discriminated; it is not itself a
94
+ * wire/protocol Error and must be normalized before public response emission.
95
95
  */
96
96
  export interface ProjectionDiagnosticBase {
97
97
  /** Spec-mandated origin marker for SDK-augmented diagnostics. */
@@ -102,6 +102,19 @@ export interface ProjectionDiagnosticBase {
102
102
  field: string;
103
103
  }
104
104
  export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
105
+ /**
106
+ * SDK-local code: a valid seller product cannot be represented on the
107
+ * canonical-only public surface because it has no canonical option.
108
+ * Legacy `format_ids: []` is format-agnostic, not a failed lookup.
109
+ */
110
+ code: 'CANONICAL_PRODUCT_FORMATS_UNAVAILABLE';
111
+ error: {
112
+ details: {
113
+ product_id: string;
114
+ reason: 'legacy_format_list_empty' | 'canonical_format_list_empty' | 'missing_format_declaration' | 'nested_placement_format_list_empty';
115
+ };
116
+ };
117
+ }) | (ProjectionDiagnosticBase & {
105
118
  /**
106
119
  * Spec code (`enums/error-code.json`): registry-coverage gap or
107
120
  * v1-catalog-coverage gap depending on `resolution_failure`:
@@ -119,6 +132,10 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
119
132
  * possible"; this signals "no v2 form yet."
120
133
  * - `no_match` — v1→v2 direction, format not in catalog or
121
134
  * registry, no structural match.
135
+ * - `invalid_format_id_parameters` — the legacy ref carries
136
+ * malformed dimensional or duration discriminators.
137
+ * - `catalog_requirement_conflict` — catalog-authored fixed
138
+ * requirements are internally ambiguous or contradict the ref.
122
139
  */
123
140
  code: 'FORMAT_PROJECTION_FAILED';
124
141
  error: {
@@ -126,7 +143,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
126
143
  format_kind: CanonicalFormatKind;
127
144
  product_id: string;
128
145
  format_option_id?: string;
129
- resolution_failure: 'no_registry_match' | 'catalog_lacks_canonical_annotation' | 'no_match';
146
+ resolution_failure: 'no_registry_match' | 'catalog_lacks_canonical_annotation' | 'no_match' | 'custom_converter_failed' | 'invalid_format_id_parameters' | 'catalog_requirement_conflict';
147
+ converter_error?: string;
130
148
  };
131
149
  };
132
150
  }) | (ProjectionDiagnosticBase & {
@@ -226,8 +244,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
226
244
  }) | (ProjectionDiagnosticBase & {
227
245
  /**
228
246
  * SDK-local code: canonical-only projection (`toCanonicalOnlyProduct`
229
- * / `toCanonicalOnlyResponse`) dropped a legacy `format_id` that no
230
- * `format_options[].v1_format_ref` covers. Emitted only on the
247
+ * / `toCanonicalOnlyResponse`) found legacy routing metadata that no
248
+ * canonical format option covers. Emitted only on the
231
249
  * v2-native pass-through path — a seller that sent `format_options[]`
232
250
  * directly but also carried a `format_ids[]` entry with no canonical
233
251
  * representation. Without it, canonical-only mode would silently
@@ -243,20 +261,8 @@ export type ProjectionDiagnostic = (ProjectionDiagnosticBase & {
243
261
  error: {
244
262
  details: {
245
263
  product_id: string;
246
- /**
247
- * The full ref that was dropped, including the dimensional
248
- * discriminators (`width` / `height` / `duration_ms`) when the
249
- * input carried them — so a buyer can tell which variant of a
250
- * multi-size/multi-duration family was lost and re-acquire it on
251
- * the v1 path. Omitted keys mean the input ref carried no value.
252
- */
253
- dropped_format_id: {
254
- agent_url: string;
255
- id: string;
256
- width?: number;
257
- height?: number;
258
- duration_ms?: number;
259
- };
264
+ /** Stable category only; canonical diagnostics never echo routing identifiers. */
265
+ resolution_failure: 'unmapped_legacy_format';
260
266
  };
261
267
  };
262
268
  });
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/v2/projection/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC3B,OAAO,GACP,OAAO,GACP,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,aAAa,GACb,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,iBAAiB,GACjB,QAAQ,CAAC;AAEb;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,mBAAmB,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,WAAW,GAAG,UAAU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IACH,IAAI,EAAE,+BAA+B,CAAC;IACtC,KAAK,EAAE;QACL,OAAO,EAAE;YACP,WAAW,EAAE,mBAAmB,CAAC;YACjC,UAAU,EAAE,MAAM,CAAC;YACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;SAC3B,CAAC;KACH,CAAC;CACH,CAAC,GACF,CAAC,wBAAwB,GAAG;IAC1B;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,EAAE,wCAAwC,CAAC;IAC/C,KAAK,EAAE;QACL,OAAO,EAAE;YACP,WAAW,EAAE,mBAAmB,CAAC;YACjC,UAAU,EAAE,MAAM,CAAC;YACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAC1B,SAAS,EAAE,OAAO,GAAG,kBAAkB,CAAC;YACxC,oBAAoB,CAAC,EAAE,MAAM,CAAC;YAC9B;;;;;;eAMG;YACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;YAC7B,uBAAuB,CAAC,EAAE;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAC;gBAAC,MAAM,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;SAC/D,CAAC;KACH,CAAC;CACH,CAAC,GACF,CAAC,wBAAwB,GAAG;IAC1B;;;;;;;;;;;;;;OAcG;IACH,IAAI,EAAE,mCAAmC,CAAC;IAC1C,KAAK,EAAE;QACL,OAAO,EAAE;YACP,UAAU,EAAE,MAAM,CAAC;YACnB,kFAAkF;YAClF,kBAAkB,EAAE,wBAAwB,CAAC;SAC9C,CAAC;KACH,CAAC;CACH,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/v2/projection/types.ts"],"sourcesContent":["/**\n * Hand-rolled type surface for the v2 → v1 projection layer.\n *\n * These shadow `schemas/cache/3.1.0-beta.0/core/{product,product-format-declaration,format-id}.json`\n * at the precision the projection layer cares about — slot-level fields\n * like `slots[]`, `platform_extensions[]`, and per-canonical params blocks\n * are kept loose (`Record<string, unknown>`) because the projection\n * algorithm doesn't read them. Root-level canonical format builders use the\n * generated `ProductFormatDeclaration` types; these projection-local shapes\n * remain for legacy projection APIs and diagnostics.\n */\n\n/** v1 format_id (`{ agent_url, id }`). Same shape in 3.0 and 3.1. */\nexport interface V1FormatId {\n agent_url: string;\n id: string;\n width?: number;\n height?: number;\n duration_ms?: number;\n}\n\n/**\n * 12 canonical `format_kind` values from\n * `static/schemas/source/formats/canonical/` plus the `custom` escape\n * hatch. Kept as a literal union so a future canonical gets surfaced at\n * the projection's switch statement (exhaustive-check).\n */\nexport type CanonicalFormatKind =\n | 'image'\n | 'html5'\n | 'display_tag'\n | 'image_carousel'\n | 'video_hosted'\n | 'video_vast'\n | 'audio_hosted'\n | 'audio_daast'\n | 'sponsored_placement'\n | 'native_in_feed'\n | 'responsive_creative'\n | 'agent_placement'\n | 'custom';\n\n/**\n * v2 `ProductFormatDeclaration`. The `params` object is canonical-specific\n * and stays loose at this layer — the projection algorithm reads only\n * `format_kind`, `v1_format_ref`, and `canonical_formats_only`. Width /\n * height (for image canonicals) are surfaced as optional top-level fields\n * the registry reverse-lookup can read without unwrapping params.\n */\nexport interface V2ProductFormatDeclaration {\n format_kind: CanonicalFormatKind;\n params: Record<string, unknown>;\n capability_id?: string;\n format_option_id?: string;\n publisher_domain?: string;\n display_name?: string;\n seller_preference?: 'preferred' | 'accepted' | 'discouraged';\n applies_to_channels?: string[];\n canonical_formats_only?: boolean;\n experimental?: boolean;\n format_shape?: string;\n /**\n * Authoritative v2 → v1 link. Always an array (3.1-beta normative): single-ref\n * is `[{...}]`, multi-size carries one entry per size. v1-only buyers see\n * every entry via `format_ids[]` dual-emission. When `v1_format_ref.length <\n * params.sizes.length`, SDKs emit `FORMAT_DECLARATION_V1_LOSSY_MULTI_SIZE`\n * to signal incomplete coverage.\n */\n v1_format_ref?: V1FormatId[];\n format_schema?: { uri: string; digest: string };\n}\n\n/**\n * Public-surface Product (V2-shaped per the 8.0 design at\n * `docs/development/v3.1-sdk-design.md`). All other fields are passthrough.\n */\nexport interface V2Product {\n product_id: string;\n name: string;\n description: string;\n format_options: V2ProductFormatDeclaration[];\n [k: string]: unknown;\n}\n\n/**\n * Wire-level v1 Product. Carries `format_ids` (the v1 path). Other fields\n * are passthrough; we don't model them at the projection layer.\n */\nexport interface V1Product {\n product_id: string;\n name: string;\n description: string;\n format_ids: V1FormatId[];\n [k: string]: unknown;\n}\n\n/**\n * Structured diagnostic shape matching the spec's `errors[]` augmentation\n * contract (`source: \"sdk\"`, `sdk_id`, `code`, `field`, `error.details`).\n * Spec codes — `FORMAT_PROJECTION_FAILED` and `FORMAT_DECLARATION_V1_AMBIGUOUS`\n * — come straight from `enums/error-code.json`. The two SDK-local codes\n * (`*_NOT_APPLICABLE`, `CANONICAL_NOT_V1_TRANSLATABLE`) cover cases the\n * spec leaves to SDK discretion (\"surface as a different diagnostic or\n * skip silently\") but where buyer-side transparency is more useful\n * than silent product drops.\n *\n * **Never logger-only**, per the resolution-order amendment — emitted\n * on the response envelope's `errors[]` array and surfaced on the\n * SDK's `TaskResult` for caller-side handling without re-walking\n * `errors[]`.\n */\nexport interface ProjectionDiagnosticBase {\n /** Spec-mandated origin marker for SDK-augmented diagnostics. */\n source: 'sdk';\n /** Spec-mandated SDK identity for multi-hop deduplication. */\n sdk_id: string;\n /** Field path into the offending declaration. */\n field: string;\n}\n\nexport type ProjectionDiagnostic =\n | (ProjectionDiagnosticBase & {\n /**\n * Spec code (`enums/error-code.json`): registry-coverage gap or\n * v1-catalog-coverage gap depending on `resolution_failure`:\n *\n * - `no_registry_match` — v2→v1 direction. Registry has no\n * entries for this canonical (and v1_translatable is true).\n * - `catalog_lacks_canonical_annotation` — v1→v2 direction.\n * The AAO catalog has this v1 format but hasn't annotated\n * it with a `canonical:` field. Native, DOOH, broadcast,\n * and card-scaffolding categories sit in this bucket at\n * 3.1 GA. Distinct from a generic registry gap — the\n * catalog DOES know the format, it just hasn't blessed a\n * v2 canonical mapping yet. Symmetric counterpart to\n * CANONICAL_NOT_V1_TRANSLATABLE: that signals \"no v1 form\n * possible\"; this signals \"no v2 form yet.\"\n * - `no_match` — v1→v2 direction, format not in catalog or\n * registry, no structural match.\n */\n code: 'FORMAT_PROJECTION_FAILED';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n resolution_failure: 'no_registry_match' | 'catalog_lacks_canonical_annotation' | 'no_match';\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * Spec code (`enums/error-code.json`): registry has family-level\n * structural entries for this canonical (e.g., the VAST entries\n * for `video_vast`), but none are invertible to a specific v1\n * named format. Family is known, specific format isn't pickable.\n * Correctable by the seller adding `v1_format_ref` to the\n * declaration.\n */\n code: 'FORMAT_DECLARATION_V1_AMBIGUOUS';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n registry_matches: number;\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: declaration has `canonical_formats_only: true`.\n * Seller explicitly opted out of v1 emission. Not a registry-\n * coverage gap; not ambiguous. Informational so buyers can see\n * why a product disappeared from a v1-only catalog.\n */\n code: 'FORMAT_DECLARATION_V1_NOT_APPLICABLE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n reason: 'canonical_formats_only';\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: canonical declares `v1_translatable: false`.\n * Structural v1-unreachability — no v1 form is possible for this\n * canonical regardless of registry coverage. The 4 inherently-v2\n * canonicals at 3.1 GA: `image_carousel`, `sponsored_placement`,\n * `responsive_creative`, `agent_placement`. Spec is explicit:\n * **SDKs MUST NOT emit `FORMAT_PROJECTION_FAILED`** for these\n * (they're not coverage gaps).\n */\n code: 'CANONICAL_NOT_V1_TRANSLATABLE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: v2 declaration uses multi-size (`sizes: [...]`)\n * or responsive (`min_width`/`max_width`/`min_height`/`max_height`)\n * params, but `v1_format_ref` is a single catalog entry that can\n * only carry ONE fixed (width, height). The v1 wire emit\n * represents only the seller-chosen representative size; the\n * remaining sizes are **silently dropped on the v1 wire**.\n *\n * This diagnostic is emitted **alongside** the v1 format_id —\n * not instead of it — so the v1 buyer still sees the product\n * but the buyer code is told what coverage was lost. Different\n * from FORMAT_DECLARATION_V1_AMBIGUOUS (no v1 emit) and\n * FORMAT_DECLARATION_V1_NOT_APPLICABLE (seller opt-out).\n *\n * Surface follow-up: an SDK MAY (non-normative) expand multi-\n * size to N v1 format_ids by looking up the catalog for each\n * size. Today's prototype emits only the seller-asserted\n * representative; multi-emit is a follow-up.\n */\n code: 'FORMAT_DECLARATION_V1_LOSSY_MULTI_SIZE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n size_mode: 'sizes' | 'responsive_range';\n declared_sizes_count?: number;\n /**\n * How many v1 format_ids the SDK actually emitted. <\n * `declared_sizes_count` when the catalog doesn't cover every\n * declared size; equal when the catalog has full coverage.\n * The fan-out is non-normative — when this equals 1, only the\n * seller-asserted rep was emitted; v1 buyers lose the rest.\n */\n emitted_sizes_count?: number;\n v1_emit_represents_size?: { width?: number; height?: number };\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: canonical-only projection (`toCanonicalOnlyProduct`\n * / `toCanonicalOnlyResponse`) dropped a legacy `format_id` that no\n * `format_options[].v1_format_ref` covers. Emitted only on the\n * v2-native pass-through path — a seller that sent `format_options[]`\n * directly but also carried a `format_ids[]` entry with no canonical\n * representation. Without it, canonical-only mode would silently\n * discard a format the buyer could still have acted on via the v1\n * path.\n *\n * On the v1 → v2 projection path an unmappable ref is already\n * surfaced as `FORMAT_PROJECTION_FAILED`; this code covers the gap\n * the projection path can't see (no projection runs when the seller\n * is already v2-native).\n */\n code: 'LEGACY_FORMAT_ID_DROPPED_UNMAPPED';\n error: {\n details: {\n product_id: string;\n /**\n * The full ref that was dropped, including the dimensional\n * discriminators (`width` / `height` / `duration_ms`) when the\n * input carried them — so a buyer can tell which variant of a\n * multi-size/multi-duration family was lost and re-acquire it on\n * the v1 path. Omitted keys mean the input ref carried no value.\n */\n dropped_format_id: { agent_url: string; id: string; width?: number; height?: number; duration_ms?: number };\n };\n };\n });\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/v2/projection/types.ts"],"sourcesContent":["/**\n * Hand-rolled type surface for the v2 → v1 projection layer.\n *\n * These shadow `schemas/cache/3.1.0-beta.0/core/{product,product-format-declaration,format-id}.json`\n * at the precision the projection layer cares about — slot-level fields\n * like `slots[]`, `platform_extensions[]`, and per-canonical params blocks\n * are kept loose (`Record<string, unknown>`) because the projection\n * algorithm doesn't read them. Root-level canonical format builders use the\n * generated `ProductFormatDeclaration` types; these projection-local shapes\n * remain for legacy projection APIs and diagnostics.\n */\n\n/** v1 format_id (`{ agent_url, id }`). Same shape in 3.0 and 3.1. */\nexport interface V1FormatId {\n agent_url: string;\n id: string;\n width?: number;\n height?: number;\n duration_ms?: number;\n}\n\n/**\n * 12 canonical `format_kind` values from\n * `static/schemas/source/formats/canonical/` plus the `custom` escape\n * hatch. Kept as a literal union so a future canonical gets surfaced at\n * the projection's switch statement (exhaustive-check).\n */\nexport type CanonicalFormatKind =\n | 'image'\n | 'html5'\n | 'display_tag'\n | 'image_carousel'\n | 'video_hosted'\n | 'video_vast'\n | 'audio_hosted'\n | 'audio_daast'\n | 'sponsored_placement'\n | 'native_in_feed'\n | 'responsive_creative'\n | 'agent_placement'\n | 'custom';\n\n/**\n * v2 `ProductFormatDeclaration`. The `params` object is canonical-specific\n * and stays loose at this layer — the projection algorithm reads only\n * `format_kind`, `v1_format_ref`, and `canonical_formats_only`. Width /\n * height (for image canonicals) are surfaced as optional top-level fields\n * the registry reverse-lookup can read without unwrapping params.\n */\nexport interface V2ProductFormatDeclaration {\n format_kind: CanonicalFormatKind;\n params: Record<string, unknown>;\n capability_id?: string;\n format_option_id?: string;\n publisher_domain?: string;\n display_name?: string;\n seller_preference?: 'preferred' | 'accepted' | 'discouraged';\n applies_to_channels?: string[];\n canonical_formats_only?: boolean;\n experimental?: boolean;\n format_shape?: string;\n /**\n * Authoritative v2 → v1 link. Always an array (3.1-beta normative): single-ref\n * is `[{...}]`, multi-size carries one entry per size. v1-only buyers see\n * every entry via `format_ids[]` dual-emission. When `v1_format_ref.length <\n * params.sizes.length`, SDKs emit `FORMAT_DECLARATION_V1_LOSSY_MULTI_SIZE`\n * to signal incomplete coverage.\n */\n v1_format_ref?: V1FormatId[];\n format_schema?: { uri: string; digest: string };\n}\n\n/**\n * Public-surface Product (V2-shaped per the 8.0 design at\n * `docs/development/v3.1-sdk-design.md`). All other fields are passthrough.\n */\nexport interface V2Product {\n product_id: string;\n name: string;\n description: string;\n format_options: V2ProductFormatDeclaration[];\n [k: string]: unknown;\n}\n\n/**\n * Wire-level v1 Product. Carries `format_ids` (the v1 path). Other fields\n * are passthrough; we don't model them at the projection layer.\n */\nexport interface V1Product {\n product_id: string;\n name: string;\n description: string;\n format_ids: V1FormatId[];\n [k: string]: unknown;\n}\n\n/**\n * Internal structured diagnostic produced by the pure projection algorithms.\n * `toCanonicalOnlyResponse()` flattens this into the protocol `Error` shape\n * (`message` plus top-level `details`) before augmenting `errors[]`.\n * Spec codes — `FORMAT_PROJECTION_FAILED` and `FORMAT_DECLARATION_V1_AMBIGUOUS`\n * — come straight from `enums/error-code.json`. The two SDK-local codes\n * (`*_NOT_APPLICABLE`, `CANONICAL_NOT_V1_TRANSLATABLE`) cover cases the\n * spec leaves to SDK discretion (\"surface as a different diagnostic or\n * skip silently\") but where buyer-side transparency is more useful\n * than silent product drops.\n *\n * **Never logger-only**, per the resolution-order amendment. The internal\n * nesting keeps projection code strongly discriminated; it is not itself a\n * wire/protocol Error and must be normalized before public response emission.\n */\nexport interface ProjectionDiagnosticBase {\n /** Spec-mandated origin marker for SDK-augmented diagnostics. */\n source: 'sdk';\n /** Spec-mandated SDK identity for multi-hop deduplication. */\n sdk_id: string;\n /** Field path into the offending declaration. */\n field: string;\n}\n\nexport type ProjectionDiagnostic =\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: a valid seller product cannot be represented on the\n * canonical-only public surface because it has no canonical option.\n * Legacy `format_ids: []` is format-agnostic, not a failed lookup.\n */\n code: 'CANONICAL_PRODUCT_FORMATS_UNAVAILABLE';\n error: {\n details: {\n product_id: string;\n reason:\n | 'legacy_format_list_empty'\n | 'canonical_format_list_empty'\n | 'missing_format_declaration'\n | 'nested_placement_format_list_empty';\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * Spec code (`enums/error-code.json`): registry-coverage gap or\n * v1-catalog-coverage gap depending on `resolution_failure`:\n *\n * - `no_registry_match` — v2→v1 direction. Registry has no\n * entries for this canonical (and v1_translatable is true).\n * - `catalog_lacks_canonical_annotation` — v1→v2 direction.\n * The AAO catalog has this v1 format but hasn't annotated\n * it with a `canonical:` field. Native, DOOH, broadcast,\n * and card-scaffolding categories sit in this bucket at\n * 3.1 GA. Distinct from a generic registry gap — the\n * catalog DOES know the format, it just hasn't blessed a\n * v2 canonical mapping yet. Symmetric counterpart to\n * CANONICAL_NOT_V1_TRANSLATABLE: that signals \"no v1 form\n * possible\"; this signals \"no v2 form yet.\"\n * - `no_match` — v1→v2 direction, format not in catalog or\n * registry, no structural match.\n * - `invalid_format_id_parameters` — the legacy ref carries\n * malformed dimensional or duration discriminators.\n * - `catalog_requirement_conflict` — catalog-authored fixed\n * requirements are internally ambiguous or contradict the ref.\n */\n code: 'FORMAT_PROJECTION_FAILED';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n resolution_failure:\n | 'no_registry_match'\n | 'catalog_lacks_canonical_annotation'\n | 'no_match'\n | 'custom_converter_failed'\n | 'invalid_format_id_parameters'\n | 'catalog_requirement_conflict';\n converter_error?: string;\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * Spec code (`enums/error-code.json`): registry has family-level\n * structural entries for this canonical (e.g., the VAST entries\n * for `video_vast`), but none are invertible to a specific v1\n * named format. Family is known, specific format isn't pickable.\n * Correctable by the seller adding `v1_format_ref` to the\n * declaration.\n */\n code: 'FORMAT_DECLARATION_V1_AMBIGUOUS';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n registry_matches: number;\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: declaration has `canonical_formats_only: true`.\n * Seller explicitly opted out of v1 emission. Not a registry-\n * coverage gap; not ambiguous. Informational so buyers can see\n * why a product disappeared from a v1-only catalog.\n */\n code: 'FORMAT_DECLARATION_V1_NOT_APPLICABLE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n reason: 'canonical_formats_only';\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: canonical declares `v1_translatable: false`.\n * Structural v1-unreachability — no v1 form is possible for this\n * canonical regardless of registry coverage. The 4 inherently-v2\n * canonicals at 3.1 GA: `image_carousel`, `sponsored_placement`,\n * `responsive_creative`, `agent_placement`. Spec is explicit:\n * **SDKs MUST NOT emit `FORMAT_PROJECTION_FAILED`** for these\n * (they're not coverage gaps).\n */\n code: 'CANONICAL_NOT_V1_TRANSLATABLE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: v2 declaration uses multi-size (`sizes: [...]`)\n * or responsive (`min_width`/`max_width`/`min_height`/`max_height`)\n * params, but `v1_format_ref` is a single catalog entry that can\n * only carry ONE fixed (width, height). The v1 wire emit\n * represents only the seller-chosen representative size; the\n * remaining sizes are **silently dropped on the v1 wire**.\n *\n * This diagnostic is emitted **alongside** the v1 format_id —\n * not instead of it — so the v1 buyer still sees the product\n * but the buyer code is told what coverage was lost. Different\n * from FORMAT_DECLARATION_V1_AMBIGUOUS (no v1 emit) and\n * FORMAT_DECLARATION_V1_NOT_APPLICABLE (seller opt-out).\n *\n * Surface follow-up: an SDK MAY (non-normative) expand multi-\n * size to N v1 format_ids by looking up the catalog for each\n * size. Today's prototype emits only the seller-asserted\n * representative; multi-emit is a follow-up.\n */\n code: 'FORMAT_DECLARATION_V1_LOSSY_MULTI_SIZE';\n error: {\n details: {\n format_kind: CanonicalFormatKind;\n product_id: string;\n format_option_id?: string;\n size_mode: 'sizes' | 'responsive_range';\n declared_sizes_count?: number;\n /**\n * How many v1 format_ids the SDK actually emitted. <\n * `declared_sizes_count` when the catalog doesn't cover every\n * declared size; equal when the catalog has full coverage.\n * The fan-out is non-normative — when this equals 1, only the\n * seller-asserted rep was emitted; v1 buyers lose the rest.\n */\n emitted_sizes_count?: number;\n v1_emit_represents_size?: { width?: number; height?: number };\n };\n };\n })\n | (ProjectionDiagnosticBase & {\n /**\n * SDK-local code: canonical-only projection (`toCanonicalOnlyProduct`\n * / `toCanonicalOnlyResponse`) found legacy routing metadata that no\n * canonical format option covers. Emitted only on the\n * v2-native pass-through path — a seller that sent `format_options[]`\n * directly but also carried a `format_ids[]` entry with no canonical\n * representation. Without it, canonical-only mode would silently\n * discard a format the buyer could still have acted on via the v1\n * path.\n *\n * On the v1 → v2 projection path an unmappable ref is already\n * surfaced as `FORMAT_PROJECTION_FAILED`; this code covers the gap\n * the projection path can't see (no projection runs when the seller\n * is already v2-native).\n */\n code: 'LEGACY_FORMAT_ID_DROPPED_UNMAPPED';\n error: {\n details: {\n product_id: string;\n /** Stable category only; canonical diagnostics never echo routing identifiers. */\n resolution_failure: 'unmapped_legacy_format';\n };\n };\n });\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -45,11 +45,34 @@
45
45
  * is the most adopter-relevant piece for actual creative
46
46
  * submission flows and lands in a follow-up.
47
47
  */
48
- import type { V1Product, V2Product, V2ProductFormatDeclaration, ProjectionDiagnostic, CanonicalFormatKind } from './types.mjs';
48
+ import type { V1Product, V1FormatId, V2Product, V2ProductFormatDeclaration, ProjectionDiagnostic, CanonicalFormatKind } from './types.mjs';
49
+ import { type ProjectionCatalogSnapshot } from './catalog-snapshot.mjs';
49
50
  export interface V1ToV2Result {
50
51
  v2: V2Product;
51
52
  diagnostics: ProjectionDiagnostic[];
52
53
  }
54
+ /** Context passed to an adopter's seller-specific legacy format converter. */
55
+ export interface LegacyFormatConversionContext {
56
+ formatId: Readonly<V1FormatId>;
57
+ productId: string;
58
+ field: string;
59
+ }
60
+ /**
61
+ * Escape hatch for legacy formats owned by a custom creative agent. The
62
+ * converter returns the canonical product declaration that the legacy ref
63
+ * represents. For bespoke shapes, return `format_kind: 'custom'` with both
64
+ * `format_shape` and an immutable `format_schema` reference.
65
+ *
66
+ * The SDK adds the source `formatId` as `v1_format_ref`; converters must not
67
+ * set `canonical_formats_only: true` because a legacy source is, by
68
+ * definition, round-trippable to that ref.
69
+ */
70
+ export type LegacyFormatConverter = (context: LegacyFormatConversionContext) => V2ProductFormatDeclaration | null | undefined;
71
+ export interface V1ToV2ProjectionOptions {
72
+ legacyFormatConverter?: LegacyFormatConverter;
73
+ /** Pre-resolved exact-owner publisher/community catalogs, highest precedence first. */
74
+ projectionCatalogs?: readonly ProjectionCatalogSnapshot[];
75
+ }
53
76
  /**
54
77
  * Project a v1 Product to a v2 Product. Drops `format_ids` from the
55
78
  * public output and rebuilds `format_options` per the resolution order.
@@ -63,17 +86,17 @@ export interface V1ToV2Result {
63
86
  * @see canonicalDeclarationFromBareId — resolve a single bare format-id
64
87
  * string (no surrounding Product) to a declaration or `format_kind`.
65
88
  */
66
- export declare function projectV1ProductToV2(v1: V1Product): V1ToV2Result;
89
+ export declare function projectV1ProductToV2(v1: V1Product, options?: V1ToV2ProjectionOptions): V1ToV2Result;
67
90
  export interface BareFormatIdResolveOptions {
68
91
  /**
69
92
  * `agent_url` to attach when lifting the bare `id` to a structured
70
93
  * {@link V1FormatId} for resolution. Defaults to the canonical AAO host
71
94
  * (`https://creative.adcontextprotocol.org/`) — the publisher of every
72
95
  * AAO catalog id, and the source of essentially all bare ids persisted
73
- * before the `{ agent_url, id }` convention. Override only when the bare
74
- * id was minted under a different agent's catalog for an AAO catalog id,
75
- * leave this unset; passing a non-AAO `agentUrl` won't match the AAO-keyed
76
- * catalog and resolves to `null`.
96
+ * before the `{ agent_url, id }` convention. When an exact ID has one
97
+ * unique AAO-published meaning, a valid non-AAO `agentUrl` is accepted as
98
+ * a legacy owner alias and is preserved in `v1_format_ref`. Unknown or
99
+ * colliding IDs still resolve to `null`.
77
100
  */
78
101
  agentUrl?: string;
79
102
  /**
@@ -45,11 +45,34 @@
45
45
  * is the most adopter-relevant piece for actual creative
46
46
  * submission flows and lands in a follow-up.
47
47
  */
48
- import type { V1Product, V2Product, V2ProductFormatDeclaration, ProjectionDiagnostic, CanonicalFormatKind } from './types';
48
+ import type { V1Product, V1FormatId, V2Product, V2ProductFormatDeclaration, ProjectionDiagnostic, CanonicalFormatKind } from './types';
49
+ import { type ProjectionCatalogSnapshot } from './catalog-snapshot';
49
50
  export interface V1ToV2Result {
50
51
  v2: V2Product;
51
52
  diagnostics: ProjectionDiagnostic[];
52
53
  }
54
+ /** Context passed to an adopter's seller-specific legacy format converter. */
55
+ export interface LegacyFormatConversionContext {
56
+ formatId: Readonly<V1FormatId>;
57
+ productId: string;
58
+ field: string;
59
+ }
60
+ /**
61
+ * Escape hatch for legacy formats owned by a custom creative agent. The
62
+ * converter returns the canonical product declaration that the legacy ref
63
+ * represents. For bespoke shapes, return `format_kind: 'custom'` with both
64
+ * `format_shape` and an immutable `format_schema` reference.
65
+ *
66
+ * The SDK adds the source `formatId` as `v1_format_ref`; converters must not
67
+ * set `canonical_formats_only: true` because a legacy source is, by
68
+ * definition, round-trippable to that ref.
69
+ */
70
+ export type LegacyFormatConverter = (context: LegacyFormatConversionContext) => V2ProductFormatDeclaration | null | undefined;
71
+ export interface V1ToV2ProjectionOptions {
72
+ legacyFormatConverter?: LegacyFormatConverter;
73
+ /** Pre-resolved exact-owner publisher/community catalogs, highest precedence first. */
74
+ projectionCatalogs?: readonly ProjectionCatalogSnapshot[];
75
+ }
53
76
  /**
54
77
  * Project a v1 Product to a v2 Product. Drops `format_ids` from the
55
78
  * public output and rebuilds `format_options` per the resolution order.
@@ -63,17 +86,17 @@ export interface V1ToV2Result {
63
86
  * @see canonicalDeclarationFromBareId — resolve a single bare format-id
64
87
  * string (no surrounding Product) to a declaration or `format_kind`.
65
88
  */
66
- export declare function projectV1ProductToV2(v1: V1Product): V1ToV2Result;
89
+ export declare function projectV1ProductToV2(v1: V1Product, options?: V1ToV2ProjectionOptions): V1ToV2Result;
67
90
  export interface BareFormatIdResolveOptions {
68
91
  /**
69
92
  * `agent_url` to attach when lifting the bare `id` to a structured
70
93
  * {@link V1FormatId} for resolution. Defaults to the canonical AAO host
71
94
  * (`https://creative.adcontextprotocol.org/`) — the publisher of every
72
95
  * AAO catalog id, and the source of essentially all bare ids persisted
73
- * before the `{ agent_url, id }` convention. Override only when the bare
74
- * id was minted under a different agent's catalog for an AAO catalog id,
75
- * leave this unset; passing a non-AAO `agentUrl` won't match the AAO-keyed
76
- * catalog and resolves to `null`.
96
+ * before the `{ agent_url, id }` convention. When an exact ID has one
97
+ * unique AAO-published meaning, a valid non-AAO `agentUrl` is accepted as
98
+ * a legacy owner alias and is preserved in `v1_format_ref`. Unknown or
99
+ * colliding IDs still resolve to `null`.
77
100
  */
78
101
  agentUrl?: string;
79
102
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"v1-to-v2.d.ts","sourceRoot":"","sources":["../../../../src/lib/v2/projection/v1-to-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,KAAK,EACV,SAAS,EAET,SAAS,EACT,0BAA0B,EAC1B,oBAAoB,E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