@adcp/sdk 12.1.0 → 13.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (464) hide show
  1. package/README.md +19 -3
  2. package/bin/adcp-fuzz.js +3 -1
  3. package/dist/lib/adapters/content-standards-adapter.d.mts +9 -9
  4. package/dist/lib/adapters/content-standards-adapter.d.ts +9 -9
  5. package/dist/lib/adapters/content-standards-adapter.d.ts.map +1 -1
  6. package/dist/lib/adapters/content-standards-adapter.js +22 -22
  7. package/dist/lib/adapters/content-standards-adapter.js.map +1 -1
  8. package/dist/lib/adapters/content-standards-adapter.mjs +18 -18
  9. package/dist/lib/adapters/content-standards-adapter.mjs.map +1 -1
  10. package/dist/lib/adapters/index.d.mts +2 -2
  11. package/dist/lib/adapters/index.d.ts +2 -2
  12. package/dist/lib/adapters/index.d.ts.map +1 -1
  13. package/dist/lib/adapters/index.js +10 -10
  14. package/dist/lib/adapters/index.js.map +1 -1
  15. package/dist/lib/adapters/index.mjs +9 -9
  16. package/dist/lib/adapters/index.mjs.map +1 -1
  17. package/dist/lib/auth/oauth/authorization-required.d.mts +3 -0
  18. package/dist/lib/auth/oauth/authorization-required.d.ts +3 -0
  19. package/dist/lib/auth/oauth/authorization-required.d.ts.map +1 -1
  20. package/dist/lib/auth/oauth/authorization-required.js +12 -9
  21. package/dist/lib/auth/oauth/authorization-required.js.map +1 -1
  22. package/dist/lib/auth/oauth/authorization-required.mjs +12 -9
  23. package/dist/lib/auth/oauth/authorization-required.mjs.map +1 -1
  24. package/dist/lib/auth/oauth/provider-cache.d.mts +7 -0
  25. package/dist/lib/auth/oauth/provider-cache.d.ts +8 -0
  26. package/dist/lib/auth/oauth/provider-cache.d.ts.map +1 -0
  27. package/dist/lib/auth/oauth/provider-cache.js +44 -0
  28. package/dist/lib/auth/oauth/provider-cache.js.map +1 -0
  29. package/dist/lib/auth/oauth/provider-cache.mjs +19 -0
  30. package/dist/lib/auth/oauth/provider-cache.mjs.map +1 -0
  31. package/dist/lib/conformance/invariants/uniformError.js +1 -1
  32. package/dist/lib/conformance/invariants/uniformError.js.map +1 -1
  33. package/dist/lib/conformance/invariants/uniformError.mjs +1 -1
  34. package/dist/lib/conformance/invariants/uniformError.mjs.map +1 -1
  35. package/dist/lib/conformance/runners.js +1 -1
  36. package/dist/lib/conformance/runners.js.map +1 -1
  37. package/dist/lib/conformance/runners.mjs +1 -1
  38. package/dist/lib/conformance/runners.mjs.map +1 -1
  39. package/dist/lib/conformance/seeder.js +5 -5
  40. package/dist/lib/conformance/seeder.js.map +1 -1
  41. package/dist/lib/conformance/seeder.mjs +5 -5
  42. package/dist/lib/conformance/seeder.mjs.map +1 -1
  43. package/dist/lib/core/ADCPMultiAgentClient.d.mts +26 -29
  44. package/dist/lib/core/ADCPMultiAgentClient.d.ts +26 -29
  45. package/dist/lib/core/ADCPMultiAgentClient.d.ts.map +1 -1
  46. package/dist/lib/core/ADCPMultiAgentClient.js +27 -19
  47. package/dist/lib/core/ADCPMultiAgentClient.js.map +1 -1
  48. package/dist/lib/core/ADCPMultiAgentClient.mjs +27 -19
  49. package/dist/lib/core/ADCPMultiAgentClient.mjs.map +1 -1
  50. package/dist/lib/core/AgentClient.d.mts +148 -138
  51. package/dist/lib/core/AgentClient.d.ts +148 -138
  52. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  53. package/dist/lib/core/AgentClient.js +174 -85
  54. package/dist/lib/core/AgentClient.js.map +1 -1
  55. package/dist/lib/core/AgentClient.mjs +174 -85
  56. package/dist/lib/core/AgentClient.mjs.map +1 -1
  57. package/dist/lib/core/AsyncHandler.d.mts +18 -16
  58. package/dist/lib/core/AsyncHandler.d.ts +18 -16
  59. package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
  60. package/dist/lib/core/AsyncHandler.js +22 -1
  61. package/dist/lib/core/AsyncHandler.js.map +1 -1
  62. package/dist/lib/core/AsyncHandler.mjs +22 -1
  63. package/dist/lib/core/AsyncHandler.mjs.map +1 -1
  64. package/dist/lib/core/ConversationTypes.d.mts +6 -2
  65. package/dist/lib/core/ConversationTypes.d.ts +6 -2
  66. package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
  67. package/dist/lib/core/ConversationTypes.js.map +1 -1
  68. package/dist/lib/core/CreativeAgentClient.d.mts +41 -17
  69. package/dist/lib/core/CreativeAgentClient.d.ts +41 -17
  70. package/dist/lib/core/CreativeAgentClient.d.ts.map +1 -1
  71. package/dist/lib/core/CreativeAgentClient.js +39 -12
  72. package/dist/lib/core/CreativeAgentClient.js.map +1 -1
  73. package/dist/lib/core/CreativeAgentClient.mjs +39 -12
  74. package/dist/lib/core/CreativeAgentClient.mjs.map +1 -1
  75. package/dist/lib/core/SingleAgentClient.d.mts +129 -52
  76. package/dist/lib/core/SingleAgentClient.d.ts +129 -52
  77. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  78. package/dist/lib/core/SingleAgentClient.js +1748 -218
  79. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  80. package/dist/lib/core/SingleAgentClient.mjs +1758 -218
  81. package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
  82. package/dist/lib/core/TaskExecutor.d.mts +9 -0
  83. package/dist/lib/core/TaskExecutor.d.ts +9 -0
  84. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  85. package/dist/lib/core/TaskExecutor.js +137 -44
  86. package/dist/lib/core/TaskExecutor.js.map +1 -1
  87. package/dist/lib/core/TaskExecutor.mjs +137 -44
  88. package/dist/lib/core/TaskExecutor.mjs.map +1 -1
  89. package/dist/lib/index.d.mts +111 -17
  90. package/dist/lib/index.d.ts +111 -17
  91. package/dist/lib/index.d.ts.map +1 -1
  92. package/dist/lib/index.js +94 -94
  93. package/dist/lib/index.js.map +1 -1
  94. package/dist/lib/index.mjs +93 -94
  95. package/dist/lib/index.mjs.map +1 -1
  96. package/dist/lib/net/ssrf-fetch.d.mts +13 -1
  97. package/dist/lib/net/ssrf-fetch.d.ts +13 -1
  98. package/dist/lib/net/ssrf-fetch.d.ts.map +1 -1
  99. package/dist/lib/net/ssrf-fetch.js +14 -7
  100. package/dist/lib/net/ssrf-fetch.js.map +1 -1
  101. package/dist/lib/net/ssrf-fetch.mjs +14 -7
  102. package/dist/lib/net/ssrf-fetch.mjs.map +1 -1
  103. package/dist/lib/protocols/a2a.d.mts +2 -2
  104. package/dist/lib/protocols/a2a.d.ts +2 -2
  105. package/dist/lib/protocols/a2a.d.ts.map +1 -1
  106. package/dist/lib/protocols/a2a.js +14 -9
  107. package/dist/lib/protocols/a2a.js.map +1 -1
  108. package/dist/lib/protocols/a2a.mjs +14 -9
  109. package/dist/lib/protocols/a2a.mjs.map +1 -1
  110. package/dist/lib/protocols/index.d.mts +20 -3
  111. package/dist/lib/protocols/index.d.ts +20 -3
  112. package/dist/lib/protocols/index.d.ts.map +1 -1
  113. package/dist/lib/protocols/index.js +44 -31
  114. package/dist/lib/protocols/index.js.map +1 -1
  115. package/dist/lib/protocols/index.mjs +44 -32
  116. package/dist/lib/protocols/index.mjs.map +1 -1
  117. package/dist/lib/protocols/mcp-modern.d.ts.map +1 -1
  118. package/dist/lib/protocols/mcp-modern.js +87 -12
  119. package/dist/lib/protocols/mcp-modern.js.map +1 -1
  120. package/dist/lib/protocols/mcp-modern.mjs +89 -12
  121. package/dist/lib/protocols/mcp-modern.mjs.map +1 -1
  122. package/dist/lib/protocols/mcp-tasks.d.mts +3 -0
  123. package/dist/lib/protocols/mcp-tasks.d.ts +3 -0
  124. package/dist/lib/protocols/mcp-tasks.d.ts.map +1 -1
  125. package/dist/lib/protocols/mcp-tasks.js +21 -11
  126. package/dist/lib/protocols/mcp-tasks.js.map +1 -1
  127. package/dist/lib/protocols/mcp-tasks.mjs +21 -11
  128. package/dist/lib/protocols/mcp-tasks.mjs.map +1 -1
  129. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  130. package/dist/lib/server/create-adcp-server.d.mts +6 -0
  131. package/dist/lib/server/create-adcp-server.d.ts +6 -0
  132. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  133. package/dist/lib/server/create-adcp-server.js +295 -48
  134. package/dist/lib/server/create-adcp-server.js.map +1 -1
  135. package/dist/lib/server/create-adcp-server.mjs +301 -50
  136. package/dist/lib/server/create-adcp-server.mjs.map +1 -1
  137. package/dist/lib/server/decisioning/assembly-helpers.d.mts +27 -13
  138. package/dist/lib/server/decisioning/assembly-helpers.d.ts +27 -13
  139. package/dist/lib/server/decisioning/assembly-helpers.d.ts.map +1 -1
  140. package/dist/lib/server/decisioning/assembly-helpers.js +136 -14
  141. package/dist/lib/server/decisioning/assembly-helpers.js.map +1 -1
  142. package/dist/lib/server/decisioning/assembly-helpers.mjs +134 -13
  143. package/dist/lib/server/decisioning/assembly-helpers.mjs.map +1 -1
  144. package/dist/lib/server/decisioning/index.d.mts +13 -12
  145. package/dist/lib/server/decisioning/index.d.ts +13 -12
  146. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  147. package/dist/lib/server/decisioning/index.js +6 -0
  148. package/dist/lib/server/decisioning/index.js.map +1 -1
  149. package/dist/lib/server/decisioning/index.mjs +9 -3
  150. package/dist/lib/server/decisioning/index.mjs.map +1 -1
  151. package/dist/lib/server/decisioning/list-helpers.d.mts +13 -3
  152. package/dist/lib/server/decisioning/list-helpers.d.ts +13 -3
  153. package/dist/lib/server/decisioning/list-helpers.d.ts.map +1 -1
  154. package/dist/lib/server/decisioning/list-helpers.js +13 -3
  155. package/dist/lib/server/decisioning/list-helpers.js.map +1 -1
  156. package/dist/lib/server/decisioning/list-helpers.mjs +11 -2
  157. package/dist/lib/server/decisioning/list-helpers.mjs.map +1 -1
  158. package/dist/lib/server/decisioning/manifest-helpers.d.mts +5 -3
  159. package/dist/lib/server/decisioning/manifest-helpers.d.ts +5 -3
  160. package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -1
  161. package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -1
  162. package/dist/lib/server/decisioning/manifest-helpers.mjs.map +1 -1
  163. package/dist/lib/server/decisioning/proposal/dispatch.d.mts +2 -2
  164. package/dist/lib/server/decisioning/proposal/dispatch.d.ts +2 -2
  165. package/dist/lib/server/decisioning/proposal/dispatch.d.ts.map +1 -1
  166. package/dist/lib/server/decisioning/proposal/dispatch.js.map +1 -1
  167. package/dist/lib/server/decisioning/proposal/dispatch.mjs.map +1 -1
  168. package/dist/lib/server/decisioning/proposal/index.d.mts +1 -1
  169. package/dist/lib/server/decisioning/proposal/index.d.ts +1 -1
  170. package/dist/lib/server/decisioning/proposal/index.d.ts.map +1 -1
  171. package/dist/lib/server/decisioning/proposal/index.js.map +1 -1
  172. package/dist/lib/server/decisioning/proposal/index.mjs.map +1 -1
  173. package/dist/lib/server/decisioning/proposal/lifecycle.d.mts +3 -2
  174. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts +3 -2
  175. package/dist/lib/server/decisioning/proposal/lifecycle.d.ts.map +1 -1
  176. package/dist/lib/server/decisioning/proposal/lifecycle.js.map +1 -1
  177. package/dist/lib/server/decisioning/proposal/lifecycle.mjs.map +1 -1
  178. package/dist/lib/server/decisioning/proposal/mock-manager.d.mts +3 -3
  179. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts +3 -3
  180. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts.map +1 -1
  181. package/dist/lib/server/decisioning/proposal/mock-manager.js.map +1 -1
  182. package/dist/lib/server/decisioning/proposal/mock-manager.mjs.map +1 -1
  183. package/dist/lib/server/decisioning/proposal/types.d.mts +10 -6
  184. package/dist/lib/server/decisioning/proposal/types.d.ts +10 -6
  185. package/dist/lib/server/decisioning/proposal/types.d.ts.map +1 -1
  186. package/dist/lib/server/decisioning/proposal/types.js.map +1 -1
  187. package/dist/lib/server/decisioning/proposal/types.mjs.map +1 -1
  188. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +21 -2
  189. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +21 -2
  190. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  191. package/dist/lib/server/decisioning/runtime/from-platform.js +754 -81
  192. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  193. package/dist/lib/server/decisioning/runtime/from-platform.mjs +763 -81
  194. package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
  195. package/dist/lib/server/decisioning/specialisms/brand-rights.d.mts +9 -9
  196. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +9 -9
  197. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
  198. package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -1
  199. package/dist/lib/server/decisioning/specialisms/content-standards.d.mts +16 -16
  200. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts +16 -16
  201. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts.map +1 -1
  202. package/dist/lib/server/decisioning/specialisms/content-standards.js.map +1 -1
  203. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.mts +15 -13
  204. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +15 -13
  205. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
  206. package/dist/lib/server/decisioning/specialisms/creative-ad-server.js.map +1 -1
  207. package/dist/lib/server/decisioning/specialisms/creative.d.mts +12 -11
  208. package/dist/lib/server/decisioning/specialisms/creative.d.ts +12 -11
  209. package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
  210. package/dist/lib/server/decisioning/specialisms/creative.js.map +1 -1
  211. package/dist/lib/server/decisioning/specialisms/sales.d.mts +25 -15
  212. package/dist/lib/server/decisioning/specialisms/sales.d.ts +25 -15
  213. package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
  214. package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
  215. package/dist/lib/server/index.d.mts +3 -3
  216. package/dist/lib/server/index.d.ts +3 -3
  217. package/dist/lib/server/index.d.ts.map +1 -1
  218. package/dist/lib/server/index.js +72 -72
  219. package/dist/lib/server/index.js.map +1 -1
  220. package/dist/lib/server/index.mjs +36 -36
  221. package/dist/lib/server/index.mjs.map +1 -1
  222. package/dist/lib/server/legacy/v5/index.d.mts +1 -0
  223. package/dist/lib/server/legacy/v5/index.d.ts +1 -0
  224. package/dist/lib/server/legacy/v5/index.d.ts.map +1 -1
  225. package/dist/lib/server/legacy/v5/index.js +74 -1
  226. package/dist/lib/server/legacy/v5/index.js.map +1 -1
  227. package/dist/lib/server/legacy/v5/index.mjs +75 -1
  228. package/dist/lib/server/legacy/v5/index.mjs.map +1 -1
  229. package/dist/lib/server/responses.d.mts +2 -2
  230. package/dist/lib/server/responses.d.ts +2 -2
  231. package/dist/lib/server/responses.js.map +1 -1
  232. package/dist/lib/server/responses.mjs.map +1 -1
  233. package/dist/lib/testing/client.d.ts.map +1 -1
  234. package/dist/lib/testing/client.js +13 -5
  235. package/dist/lib/testing/client.js.map +1 -1
  236. package/dist/lib/testing/client.mjs +13 -5
  237. package/dist/lib/testing/client.mjs.map +1 -1
  238. package/dist/lib/testing/compliance/comply.d.mts +1 -1
  239. package/dist/lib/testing/compliance/comply.d.ts +1 -1
  240. package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
  241. package/dist/lib/testing/compliance/comply.js +16 -6
  242. package/dist/lib/testing/compliance/comply.js.map +1 -1
  243. package/dist/lib/testing/compliance/comply.mjs +16 -6
  244. package/dist/lib/testing/compliance/comply.mjs.map +1 -1
  245. package/dist/lib/testing/scenarios/brand-rights.js +6 -6
  246. package/dist/lib/testing/scenarios/brand-rights.js.map +1 -1
  247. package/dist/lib/testing/scenarios/brand-rights.mjs +6 -6
  248. package/dist/lib/testing/scenarios/brand-rights.mjs.map +1 -1
  249. package/dist/lib/testing/scenarios/creative.js +7 -7
  250. package/dist/lib/testing/scenarios/creative.js.map +1 -1
  251. package/dist/lib/testing/scenarios/creative.mjs +7 -7
  252. package/dist/lib/testing/scenarios/creative.mjs.map +1 -1
  253. package/dist/lib/testing/scenarios/discovery.js +2 -2
  254. package/dist/lib/testing/scenarios/discovery.js.map +1 -1
  255. package/dist/lib/testing/scenarios/discovery.mjs +2 -2
  256. package/dist/lib/testing/scenarios/discovery.mjs.map +1 -1
  257. package/dist/lib/testing/scenarios/edge-cases.js +11 -11
  258. package/dist/lib/testing/scenarios/edge-cases.js.map +1 -1
  259. package/dist/lib/testing/scenarios/edge-cases.mjs +11 -11
  260. package/dist/lib/testing/scenarios/edge-cases.mjs.map +1 -1
  261. package/dist/lib/testing/scenarios/governance.d.ts.map +1 -1
  262. package/dist/lib/testing/scenarios/governance.js +16 -22
  263. package/dist/lib/testing/scenarios/governance.js.map +1 -1
  264. package/dist/lib/testing/scenarios/governance.mjs +16 -22
  265. package/dist/lib/testing/scenarios/governance.mjs.map +1 -1
  266. package/dist/lib/testing/scenarios/media-buy.js +5 -5
  267. package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
  268. package/dist/lib/testing/scenarios/media-buy.mjs +5 -5
  269. package/dist/lib/testing/scenarios/media-buy.mjs.map +1 -1
  270. package/dist/lib/testing/scenarios/schema-compliance.js +1 -1
  271. package/dist/lib/testing/scenarios/schema-compliance.js.map +1 -1
  272. package/dist/lib/testing/scenarios/schema-compliance.mjs +1 -1
  273. package/dist/lib/testing/scenarios/schema-compliance.mjs.map +1 -1
  274. package/dist/lib/testing/scenarios/trusted-match.d.ts.map +1 -1
  275. package/dist/lib/testing/scenarios/trusted-match.js +4 -3
  276. package/dist/lib/testing/scenarios/trusted-match.js.map +1 -1
  277. package/dist/lib/testing/scenarios/trusted-match.mjs +4 -3
  278. package/dist/lib/testing/scenarios/trusted-match.mjs.map +1 -1
  279. package/dist/lib/testing/storyboard/probes.d.mts +6 -0
  280. package/dist/lib/testing/storyboard/probes.d.ts +6 -0
  281. package/dist/lib/testing/storyboard/probes.d.ts.map +1 -1
  282. package/dist/lib/testing/storyboard/probes.js +16 -5
  283. package/dist/lib/testing/storyboard/probes.js.map +1 -1
  284. package/dist/lib/testing/storyboard/probes.mjs +16 -5
  285. package/dist/lib/testing/storyboard/probes.mjs.map +1 -1
  286. package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
  287. package/dist/lib/testing/storyboard/runner.js +6 -2
  288. package/dist/lib/testing/storyboard/runner.js.map +1 -1
  289. package/dist/lib/testing/storyboard/runner.mjs +6 -2
  290. package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
  291. package/dist/lib/testing/storyboard/shape-drift-hints.d.mts +3 -4
  292. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts +3 -4
  293. package/dist/lib/testing/storyboard/shape-drift-hints.d.ts.map +1 -1
  294. package/dist/lib/testing/storyboard/shape-drift-hints.js +27 -27
  295. package/dist/lib/testing/storyboard/shape-drift-hints.js.map +1 -1
  296. package/dist/lib/testing/storyboard/shape-drift-hints.mjs +27 -27
  297. package/dist/lib/testing/storyboard/shape-drift-hints.mjs.map +1 -1
  298. package/dist/lib/testing/storyboard/task-map.d.ts.map +1 -1
  299. package/dist/lib/testing/storyboard/task-map.js +43 -5
  300. package/dist/lib/testing/storyboard/task-map.js.map +1 -1
  301. package/dist/lib/testing/storyboard/task-map.mjs +43 -5
  302. package/dist/lib/testing/storyboard/task-map.mjs.map +1 -1
  303. package/dist/lib/testing/test-helpers.d.mts +2 -2
  304. package/dist/lib/testing/test-helpers.d.ts +2 -2
  305. package/dist/lib/testing/test-helpers.js.map +1 -1
  306. package/dist/lib/testing/test-helpers.mjs.map +1 -1
  307. package/dist/lib/testing/types.d.mts +7 -1
  308. package/dist/lib/testing/types.d.ts +7 -1
  309. package/dist/lib/testing/types.d.ts.map +1 -1
  310. package/dist/lib/testing/types.js.map +1 -1
  311. package/dist/lib/types/adcp.d.mts +14 -14
  312. package/dist/lib/types/adcp.d.ts +14 -14
  313. package/dist/lib/types/adcp.d.ts.map +1 -1
  314. package/dist/lib/types/adcp.js.map +1 -1
  315. package/dist/lib/types/adcp.mjs.map +1 -1
  316. package/dist/lib/types/index.d.mts +2 -2
  317. package/dist/lib/types/index.d.ts +2 -2
  318. package/dist/lib/types/index.d.ts.map +1 -1
  319. package/dist/lib/types/index.js.map +1 -1
  320. package/dist/lib/types/index.mjs.map +1 -1
  321. package/dist/lib/utils/capabilities.d.mts +6 -0
  322. package/dist/lib/utils/capabilities.d.ts +6 -0
  323. package/dist/lib/utils/capabilities.d.ts.map +1 -1
  324. package/dist/lib/utils/capabilities.js +4 -0
  325. package/dist/lib/utils/capabilities.js.map +1 -1
  326. package/dist/lib/utils/capabilities.mjs +4 -0
  327. package/dist/lib/utils/capabilities.mjs.map +1 -1
  328. package/dist/lib/utils/creative-delivery.d.mts +52 -10
  329. package/dist/lib/utils/creative-delivery.d.ts +52 -10
  330. package/dist/lib/utils/creative-delivery.d.ts.map +1 -1
  331. package/dist/lib/utils/creative-delivery.js +104 -9
  332. package/dist/lib/utils/creative-delivery.js.map +1 -1
  333. package/dist/lib/utils/creative-delivery.mjs +104 -8
  334. package/dist/lib/utils/creative-delivery.mjs.map +1 -1
  335. package/dist/lib/utils/format-assets.d.mts +41 -38
  336. package/dist/lib/utils/format-assets.d.ts +41 -38
  337. package/dist/lib/utils/format-assets.d.ts.map +1 -1
  338. package/dist/lib/utils/format-assets.js +3 -1
  339. package/dist/lib/utils/format-assets.js.map +1 -1
  340. package/dist/lib/utils/format-assets.mjs +3 -1
  341. package/dist/lib/utils/format-assets.mjs.map +1 -1
  342. package/dist/lib/utils/index.d.mts +8 -8
  343. package/dist/lib/utils/index.d.ts +8 -8
  344. package/dist/lib/utils/index.d.ts.map +1 -1
  345. package/dist/lib/utils/index.js +11 -9
  346. package/dist/lib/utils/index.js.map +1 -1
  347. package/dist/lib/utils/index.mjs +9 -8
  348. package/dist/lib/utils/index.mjs.map +1 -1
  349. package/dist/lib/utils/preview-utils.d.mts +11 -8
  350. package/dist/lib/utils/preview-utils.d.ts +11 -8
  351. package/dist/lib/utils/preview-utils.d.ts.map +1 -1
  352. package/dist/lib/utils/preview-utils.js +4 -4
  353. package/dist/lib/utils/preview-utils.js.map +1 -1
  354. package/dist/lib/utils/preview-utils.mjs +3 -3
  355. package/dist/lib/utils/preview-utils.mjs.map +1 -1
  356. package/dist/lib/utils/tool-request-schemas.d.mts +2 -2
  357. package/dist/lib/utils/tool-request-schemas.d.ts +2 -2
  358. package/dist/lib/v2/projection/aao-reference-formats.json +492 -0
  359. package/dist/lib/v2/projection/augment-response.d.mts +31 -11
  360. package/dist/lib/v2/projection/augment-response.d.ts +31 -11
  361. package/dist/lib/v2/projection/augment-response.d.ts.map +1 -1
  362. package/dist/lib/v2/projection/augment-response.js +233 -27
  363. package/dist/lib/v2/projection/augment-response.js.map +1 -1
  364. package/dist/lib/v2/projection/augment-response.mjs +232 -27
  365. package/dist/lib/v2/projection/augment-response.mjs.map +1 -1
  366. package/dist/lib/v2/projection/builders.d.mts +7 -6
  367. package/dist/lib/v2/projection/builders.d.ts +7 -6
  368. package/dist/lib/v2/projection/builders.d.ts.map +1 -1
  369. package/dist/lib/v2/projection/builders.js +11 -8
  370. package/dist/lib/v2/projection/builders.js.map +1 -1
  371. package/dist/lib/v2/projection/builders.mjs +9 -6
  372. package/dist/lib/v2/projection/builders.mjs.map +1 -1
  373. package/dist/lib/v2/projection/catalog-snapshot.d.mts +47 -0
  374. package/dist/lib/v2/projection/catalog-snapshot.d.ts +48 -0
  375. package/dist/lib/v2/projection/catalog-snapshot.d.ts.map +1 -0
  376. package/dist/lib/v2/projection/catalog-snapshot.js +291 -0
  377. package/dist/lib/v2/projection/catalog-snapshot.js.map +1 -0
  378. package/dist/lib/v2/projection/catalog-snapshot.mjs +265 -0
  379. package/dist/lib/v2/projection/catalog-snapshot.mjs.map +1 -0
  380. package/dist/lib/v2/projection/catalog.d.mts +23 -2
  381. package/dist/lib/v2/projection/catalog.d.ts +23 -2
  382. package/dist/lib/v2/projection/catalog.d.ts.map +1 -1
  383. package/dist/lib/v2/projection/catalog.js +34 -10
  384. package/dist/lib/v2/projection/catalog.js.map +1 -1
  385. package/dist/lib/v2/projection/catalog.mjs +33 -10
  386. package/dist/lib/v2/projection/catalog.mjs.map +1 -1
  387. package/dist/lib/v2/projection/creative-delivery.d.mts +157 -0
  388. package/dist/lib/v2/projection/creative-delivery.d.ts +158 -0
  389. package/dist/lib/v2/projection/creative-delivery.d.ts.map +1 -0
  390. package/dist/lib/v2/projection/creative-delivery.js +967 -0
  391. package/dist/lib/v2/projection/creative-delivery.js.map +1 -0
  392. package/dist/lib/v2/projection/creative-delivery.mjs +941 -0
  393. package/dist/lib/v2/projection/creative-delivery.mjs.map +1 -0
  394. package/dist/lib/v2/projection/index.d.mts +8 -6
  395. package/dist/lib/v2/projection/index.d.ts +8 -6
  396. package/dist/lib/v2/projection/index.d.ts.map +1 -1
  397. package/dist/lib/v2/projection/index.js +26 -4
  398. package/dist/lib/v2/projection/index.js.map +1 -1
  399. package/dist/lib/v2/projection/index.mjs +28 -4
  400. package/dist/lib/v2/projection/index.mjs.map +1 -1
  401. package/dist/lib/v2/projection/legacy-metadata.d.mts +21 -0
  402. package/dist/lib/v2/projection/legacy-metadata.d.ts +22 -0
  403. package/dist/lib/v2/projection/legacy-metadata.d.ts.map +1 -0
  404. package/dist/lib/v2/projection/legacy-metadata.js +73 -0
  405. package/dist/lib/v2/projection/legacy-metadata.js.map +1 -0
  406. package/dist/lib/v2/projection/legacy-metadata.mjs +45 -0
  407. package/dist/lib/v2/projection/legacy-metadata.mjs.map +1 -0
  408. package/dist/lib/v2/projection/types.d.mts +29 -23
  409. package/dist/lib/v2/projection/types.d.ts +29 -23
  410. package/dist/lib/v2/projection/types.d.ts.map +1 -1
  411. package/dist/lib/v2/projection/types.js.map +1 -1
  412. package/dist/lib/v2/projection/v1-to-v2.d.mts +29 -6
  413. package/dist/lib/v2/projection/v1-to-v2.d.ts +29 -6
  414. package/dist/lib/v2/projection/v1-to-v2.d.ts.map +1 -1
  415. package/dist/lib/v2/projection/v1-to-v2.js +218 -9
  416. package/dist/lib/v2/projection/v1-to-v2.js.map +1 -1
  417. package/dist/lib/v2/projection/v1-to-v2.mjs +219 -10
  418. package/dist/lib/v2/projection/v1-to-v2.mjs.map +1 -1
  419. package/dist/lib/v2/projection/v2-to-v1.d.mts +31 -2
  420. package/dist/lib/v2/projection/v2-to-v1.d.ts +31 -2
  421. package/dist/lib/v2/projection/v2-to-v1.d.ts.map +1 -1
  422. package/dist/lib/v2/projection/v2-to-v1.js +138 -7
  423. package/dist/lib/v2/projection/v2-to-v1.js.map +1 -1
  424. package/dist/lib/v2/projection/v2-to-v1.mjs +135 -6
  425. package/dist/lib/v2/projection/v2-to-v1.mjs.map +1 -1
  426. package/dist/lib/v2/projection/write-side.d.mts +12 -13
  427. package/dist/lib/v2/projection/write-side.d.ts +12 -13
  428. package/dist/lib/v2/projection/write-side.d.ts.map +1 -1
  429. package/dist/lib/v2/projection/write-side.js +16 -12
  430. package/dist/lib/v2/projection/write-side.js.map +1 -1
  431. package/dist/lib/v2/projection/write-side.mjs +16 -12
  432. package/dist/lib/v2/projection/write-side.mjs.map +1 -1
  433. package/dist/lib/version.d.mts +3 -3
  434. package/dist/lib/version.d.ts +3 -3
  435. package/dist/lib/version.d.ts.map +1 -1
  436. package/dist/lib/version.js +3 -3
  437. package/dist/lib/version.js.map +1 -1
  438. package/dist/lib/version.mjs +3 -3
  439. package/dist/lib/version.mjs.map +1 -1
  440. package/docs/guides/BUILD-AN-AGENT.md +7 -2
  441. package/docs/guides/PREVIEW-ASSET-DURABILITY.md +6 -2
  442. package/docs/llms.txt +1 -0
  443. package/examples/README.md +1 -1
  444. package/examples/batch-preview-test.ts +3 -3
  445. package/examples/conversation-client.ts +2 -2
  446. package/examples/debug-preview-response.ts +1 -1
  447. package/examples/decisioning-platform-broadcast-tv.ts +10 -4
  448. package/examples/decisioning-platform-mock-seller.ts +16 -9
  449. package/examples/decisioning-platform-programmatic.ts +18 -7
  450. package/examples/error-compliant-server.ts +26 -16
  451. package/examples/generative-creative-demo.ts +7 -19
  452. package/examples/hello_creative_adapter_ad_server.ts +37 -16
  453. package/examples/hello_creative_adapter_template.ts +12 -10
  454. package/examples/hello_seller_adapter_guaranteed.ts +52 -23
  455. package/examples/hello_seller_adapter_multi_tenant.ts +6 -3
  456. package/examples/hello_seller_adapter_non_guaranteed.ts +54 -26
  457. package/examples/hello_seller_adapter_proposal_mode.ts +40 -14
  458. package/examples/hello_seller_adapter_social.ts +2 -7
  459. package/examples/inspect-card-formats.ts +1 -1
  460. package/examples/simple-getting-started.ts +1 -1
  461. package/examples/test-helpers-demo.ts +1 -1
  462. package/package.json +2 -2
  463. package/skills/build-decisioning-creative-template/SKILL.md +11 -11
  464. package/skills/build-decisioning-platform/advanced/REFERENCE.md +8 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils/format-assets.ts"],"sourcesContent":["// Format Asset Utilities\n// Provides access to format assets from the v3 `assets` field\n\nimport type { Format } from '../types/tools.generated';\n\n// Internal types - derived from Format['assets'] since schema doesn't export standalone types\ntype FormatAsset = NonNullable<Format['assets']>[number];\ntype IndividualAsset = Extract<FormatAsset, { item_type: 'individual' }>;\ntype RepeatableAssetGroup = Extract<FormatAsset, { item_type: 'repeatable_group' }>;\n\n// Legacy support: v2 responses may still include assets_required (deprecated in v3)\n// This internal type allows runtime backward compatibility without exposing it in public API\ninterface LegacyFormat extends Format {\n assets_required?: unknown[];\n}\n\n/**\n * Get assets from a Format\n *\n * Returns the assets from the v3 `assets` field. For backward compatibility with v2 servers,\n * this function also handles the deprecated `assets_required` field if present.\n *\n * @param format - The Format object from list_creative_formats response\n * @returns Array of assets\n *\n * @example\n * ```typescript\n * const formats = await agent.listCreativeFormats({});\n * for (const format of formats.formats) {\n * const assets = getFormatAssets(format);\n * console.log(`${format.name} has ${assets.length} assets`);\n * }\n * ```\n */\nexport function getFormatAssets(format: Format): FormatAsset[] {\n // Use v3 `assets` field\n if (format.assets && format.assets.length > 0) {\n return format.assets;\n }\n\n // Runtime backward compatibility: handle v2 responses with deprecated assets_required\n const legacyFormat = format as LegacyFormat;\n if (\n legacyFormat.assets_required &&\n Array.isArray(legacyFormat.assets_required) &&\n legacyFormat.assets_required.length > 0\n ) {\n return normalizeAssetsRequired(legacyFormat.assets_required);\n }\n\n return [];\n}\n\n/**\n * Convert deprecated assets_required to new assets format (internal use)\n *\n * All assets in assets_required are required by definition (that's why they were in that array).\n * The new `assets` field has an explicit `required: boolean` to allow both required AND optional assets.\n *\n * @param assetsRequired - The deprecated assets_required array\n * @returns Normalized assets array with explicit required: true\n * @internal\n */\nfunction normalizeAssetsRequired(assetsRequired: unknown[]): FormatAsset[] {\n return assetsRequired.map(asset => ({\n ...(asset as Record<string, unknown>),\n required: true, // assets_required only contained required assets\n })) as FormatAsset[];\n}\n\n/**\n * Get only required assets from a Format\n *\n * @param format - The Format object\n * @returns Array of required assets only\n *\n * @example\n * ```typescript\n * const requiredAssets = getRequiredAssets(format);\n * console.log(`Must provide ${requiredAssets.length} assets`);\n * ```\n */\nexport function getRequiredAssets(format: Format): FormatAsset[] {\n return getFormatAssets(format).filter(asset => asset.required);\n}\n\n/**\n * Get only optional assets from a Format\n *\n * Note: When using deprecated `assets_required`, this will always return empty\n * since assets_required only contained required assets.\n *\n * @param format - The Format object\n * @returns Array of optional assets only\n *\n * @example\n * ```typescript\n * const optionalAssets = getOptionalAssets(format);\n * console.log(`Can optionally provide ${optionalAssets.length} additional assets`);\n * ```\n */\nexport function getOptionalAssets(format: Format): FormatAsset[] {\n return getFormatAssets(format).filter(asset => !asset.required);\n}\n\n/**\n * Get individual assets (not repeatable groups) from a Format\n *\n * @param format - The Format object\n * @returns Array of individual assets\n */\nexport function getIndividualAssets(format: Format): IndividualAsset[] {\n return getFormatAssets(format).filter((asset): asset is IndividualAsset => asset.item_type === 'individual');\n}\n\n/**\n * Get repeatable asset groups from a Format\n *\n * @param format - The Format object\n * @returns Array of repeatable asset groups\n */\nexport function getRepeatableGroups(format: Format): RepeatableAssetGroup[] {\n return getFormatAssets(format).filter(\n (asset): asset is RepeatableAssetGroup => asset.item_type === 'repeatable_group'\n );\n}\n\n/**\n * Check if format uses deprecated assets_required field (for migration warnings)\n *\n * @param format - The Format object\n * @returns true if using deprecated field, false if using new field or neither\n *\n * @example\n * ```typescript\n * if (usesDeprecatedAssetsField(format)) {\n * console.warn(`Format ${format.name} uses deprecated assets_required field`);\n * }\n * ```\n */\nexport function usesDeprecatedAssetsField(format: Format): boolean {\n const legacyFormat = format as LegacyFormat;\n return !format.assets && !!(legacyFormat.assets_required && Array.isArray(legacyFormat.assets_required));\n}\n\n/**\n * Get the count of assets in a format (for display purposes)\n *\n * @param format - The Format object\n * @returns Number of assets, or 0 if none defined\n */\nexport function getAssetCount(format: Format): number {\n return getFormatAssets(format).length;\n}\n\n/**\n * Check if a format has any assets defined\n *\n * @param format - The Format object\n * @returns true if format has assets, false otherwise\n */\nexport function hasAssets(format: Format): boolean {\n return getAssetCount(format) > 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCO,SAAS,gBAAgB,QAA+B;AAE7D,MAAI,OAAO,UAAU,OAAO,OAAO,SAAS,GAAG;AAC7C,WAAO,OAAO;AAAA,EAChB;AAGA,QAAM,eAAe;AACrB,MACE,aAAa,mBACb,MAAM,QAAQ,aAAa,eAAe,KAC1C,aAAa,gBAAgB,SAAS,GACtC;AACA,WAAO,wBAAwB,aAAa,eAAe;AAAA,EAC7D;AAEA,SAAO,CAAC;AACV;AAYA,SAAS,wBAAwB,gBAA0C;AACzE,SAAO,eAAe,IAAI,YAAU;AAAA,IAClC,GAAI;AAAA,IACJ,UAAU;AAAA;AAAA,EACZ,EAAE;AACJ;AAcO,SAAS,kBAAkB,QAA+B;AAC/D,SAAO,gBAAgB,MAAM,EAAE,OAAO,WAAS,MAAM,QAAQ;AAC/D;AAiBO,SAAS,kBAAkB,QAA+B;AAC/D,SAAO,gBAAgB,MAAM,EAAE,OAAO,WAAS,CAAC,MAAM,QAAQ;AAChE;AAQO,SAAS,oBAAoB,QAAmC;AACrE,SAAO,gBAAgB,MAAM,EAAE,OAAO,CAAC,UAAoC,MAAM,cAAc,YAAY;AAC7G;AAQO,SAAS,oBAAoB,QAAwC;AAC1E,SAAO,gBAAgB,MAAM,EAAE;AAAA,IAC7B,CAAC,UAAyC,MAAM,cAAc;AAAA,EAChE;AACF;AAeO,SAAS,0BAA0B,QAAyB;AACjE,QAAM,eAAe;AACrB,SAAO,CAAC,OAAO,UAAU,CAAC,EAAE,aAAa,mBAAmB,MAAM,QAAQ,aAAa,eAAe;AACxG;AAQO,SAAS,cAAc,QAAwB;AACpD,SAAO,gBAAgB,MAAM,EAAE;AACjC;AAQO,SAAS,UAAU,QAAyB;AACjD,SAAO,cAAc,MAAM,IAAI;AACjC;","names":[]}
1
+ {"version":3,"sources":["../../../src/lib/utils/format-assets.ts"],"sourcesContent":["// Format Asset Utilities\n// Provides access to asset-slot declarations without requiring a raw\n// list_creative_formats `Format` or its legacy format identity.\n\nimport type {\n IndividualAudioAsset,\n IndividualBriefAsset,\n IndividualCatalogAsset,\n IndividualCssAsset,\n IndividualDaastAsset,\n IndividualHtmlAsset,\n IndividualImageAsset,\n IndividualJavaScriptAsset,\n IndividualMarkdownAsset,\n IndividualTextAsset,\n IndividualUrlAsset,\n IndividualVastAsset,\n IndividualVideoAsset,\n IndividualWebhookAsset,\n RepeatableGroupAsset,\n} from '../types/tools.generated';\n\n/** Canonical structural union for the slots declared in an `assets` array. */\nexport type CanonicalFormatAssetSlot =\n | IndividualAudioAsset\n | IndividualBriefAsset\n | IndividualCatalogAsset\n | IndividualCssAsset\n | IndividualDaastAsset\n | IndividualHtmlAsset\n | IndividualImageAsset\n | IndividualJavaScriptAsset\n | IndividualMarkdownAsset\n | IndividualTextAsset\n | IndividualUrlAsset\n | IndividualVastAsset\n | IndividualVideoAsset\n | IndividualWebhookAsset\n | RepeatableGroupAsset;\n\nexport type IndividualFormatAssetSlot = Exclude<CanonicalFormatAssetSlot, RepeatableGroupAsset>;\nexport type RepeatableFormatAssetGroup = RepeatableGroupAsset;\n\n/**\n * Minimal structural input for asset inspection. It deliberately has no\n * `format_id`, `agent_url`, name, or other legacy catalog identity.\n */\nexport interface FormatAssetsInput {\n assets?: CanonicalFormatAssetSlot[];\n /** Deprecated v2 compatibility field; values are normalized as required slots. */\n assets_required?: unknown[];\n}\n\n// Legacy support: v2 responses may still include assets_required (deprecated in v3)\n// This internal type allows runtime backward compatibility without exposing it in public API\ntype LegacyFormatAssetsInput = FormatAssetsInput;\n\n/**\n * Get asset slots from any structural asset container.\n *\n * Returns the assets from the v3 `assets` field. For backward compatibility with v2 servers,\n * this function also handles the deprecated `assets_required` field if present.\n *\n * @param format - An object containing canonical `assets` slots\n * @returns Array of assets\n *\n * @example\n * ```typescript\n * const assets = getFormatAssets({\n * assets: [FormatAsset.image({ asset_id: 'hero', required: true })]\n * });\n * ```\n */\nexport function getFormatAssets(format: FormatAssetsInput): CanonicalFormatAssetSlot[] {\n // Use v3 `assets` field\n if (format.assets && format.assets.length > 0) {\n return format.assets;\n }\n\n // Runtime backward compatibility: handle v2 responses with deprecated assets_required\n const legacyFormat = format as LegacyFormatAssetsInput;\n if (\n legacyFormat.assets_required &&\n Array.isArray(legacyFormat.assets_required) &&\n legacyFormat.assets_required.length > 0\n ) {\n return normalizeAssetsRequired(legacyFormat.assets_required);\n }\n\n return [];\n}\n\n/**\n * Convert deprecated assets_required to new assets format (internal use)\n *\n * All assets in assets_required are required by definition (that's why they were in that array).\n * The new `assets` field has an explicit `required: boolean` to allow both required AND optional assets.\n *\n * @param assetsRequired - The deprecated assets_required array\n * @returns Normalized assets array with explicit required: true\n * @internal\n */\nfunction normalizeAssetsRequired(assetsRequired: unknown[]): CanonicalFormatAssetSlot[] {\n return assetsRequired.map(asset => ({\n ...(asset as Record<string, unknown>),\n required: true, // assets_required only contained required assets\n })) as CanonicalFormatAssetSlot[];\n}\n\n/**\n * Get only required slots from an asset container.\n *\n * @param format - A structural asset container\n * @returns Array of required assets only\n *\n * @example\n * ```typescript\n * const requiredAssets = getRequiredAssets(format);\n * console.log(`Must provide ${requiredAssets.length} assets`);\n * ```\n */\nexport function getRequiredAssets(format: FormatAssetsInput): CanonicalFormatAssetSlot[] {\n return getFormatAssets(format).filter(asset => asset.required);\n}\n\n/**\n * Get only optional slots from an asset container.\n *\n * Note: When using deprecated `assets_required`, this will always return empty\n * since assets_required only contained required assets.\n *\n * @param format - A structural asset container\n * @returns Array of optional assets only\n *\n * @example\n * ```typescript\n * const optionalAssets = getOptionalAssets(format);\n * console.log(`Can optionally provide ${optionalAssets.length} additional assets`);\n * ```\n */\nexport function getOptionalAssets(format: FormatAssetsInput): CanonicalFormatAssetSlot[] {\n return getFormatAssets(format).filter(asset => !asset.required);\n}\n\n/**\n * Get individual slots (not repeatable groups) from an asset container.\n *\n * @param format - A structural asset container\n * @returns Array of individual assets\n */\nexport function getIndividualAssets(format: FormatAssetsInput): IndividualFormatAssetSlot[] {\n return getFormatAssets(format).filter(\n (asset): asset is IndividualFormatAssetSlot => asset.item_type === 'individual'\n );\n}\n\n/**\n * Get repeatable asset groups from an asset container.\n *\n * @param format - A structural asset container\n * @returns Array of repeatable asset groups\n */\nexport function getRepeatableGroups(format: FormatAssetsInput): RepeatableFormatAssetGroup[] {\n return getFormatAssets(format).filter(\n (asset): asset is RepeatableFormatAssetGroup => asset.item_type === 'repeatable_group'\n );\n}\n\n/**\n * Check if format uses deprecated assets_required field (for migration warnings)\n *\n * @param format - A structural asset container\n * @returns true if using deprecated field, false if using new field or neither\n *\n * @example\n * ```typescript\n * if (usesDeprecatedAssetsField(format)) {\n * console.warn('Asset container uses deprecated assets_required field');\n * }\n * ```\n */\nexport function usesDeprecatedAssetsField(format: FormatAssetsInput): boolean {\n const legacyFormat = format as LegacyFormatAssetsInput;\n return !format.assets && !!(legacyFormat.assets_required && Array.isArray(legacyFormat.assets_required));\n}\n\n/**\n * Get the count of slots in an asset container.\n *\n * @param format - A structural asset container\n * @returns Number of assets, or 0 if none defined\n */\nexport function getAssetCount(format: FormatAssetsInput): number {\n return getFormatAssets(format).length;\n}\n\n/**\n * Check if an asset container has any slots defined.\n *\n * @param format - A structural asset container\n * @returns true if format has assets, false otherwise\n */\nexport function hasAssets(format: FormatAssetsInput): boolean {\n return getAssetCount(format) > 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEO,SAAS,gBAAgB,QAAuD;AAErF,MAAI,OAAO,UAAU,OAAO,OAAO,SAAS,GAAG;AAC7C,WAAO,OAAO;AAAA,EAChB;AAGA,QAAM,eAAe;AACrB,MACE,aAAa,mBACb,MAAM,QAAQ,aAAa,eAAe,KAC1C,aAAa,gBAAgB,SAAS,GACtC;AACA,WAAO,wBAAwB,aAAa,eAAe;AAAA,EAC7D;AAEA,SAAO,CAAC;AACV;AAYA,SAAS,wBAAwB,gBAAuD;AACtF,SAAO,eAAe,IAAI,YAAU;AAAA,IAClC,GAAI;AAAA,IACJ,UAAU;AAAA;AAAA,EACZ,EAAE;AACJ;AAcO,SAAS,kBAAkB,QAAuD;AACvF,SAAO,gBAAgB,MAAM,EAAE,OAAO,WAAS,MAAM,QAAQ;AAC/D;AAiBO,SAAS,kBAAkB,QAAuD;AACvF,SAAO,gBAAgB,MAAM,EAAE,OAAO,WAAS,CAAC,MAAM,QAAQ;AAChE;AAQO,SAAS,oBAAoB,QAAwD;AAC1F,SAAO,gBAAgB,MAAM,EAAE;AAAA,IAC7B,CAAC,UAA8C,MAAM,cAAc;AAAA,EACrE;AACF;AAQO,SAAS,oBAAoB,QAAyD;AAC3F,SAAO,gBAAgB,MAAM,EAAE;AAAA,IAC7B,CAAC,UAA+C,MAAM,cAAc;AAAA,EACtE;AACF;AAeO,SAAS,0BAA0B,QAAoC;AAC5E,QAAM,eAAe;AACrB,SAAO,CAAC,OAAO,UAAU,CAAC,EAAE,aAAa,mBAAmB,MAAM,QAAQ,aAAa,eAAe;AACxG;AAQO,SAAS,cAAc,QAAmC;AAC/D,SAAO,gBAAgB,MAAM,EAAE;AACjC;AAQO,SAAS,UAAU,QAAoC;AAC5D,SAAO,cAAc,MAAM,IAAI;AACjC;","names":[]}
@@ -22,7 +22,9 @@ function getOptionalAssets(format) {
22
22
  return getFormatAssets(format).filter((asset) => !asset.required);
23
23
  }
24
24
  function getIndividualAssets(format) {
25
- return getFormatAssets(format).filter((asset) => asset.item_type === "individual");
25
+ return getFormatAssets(format).filter(
26
+ (asset) => asset.item_type === "individual"
27
+ );
26
28
  }
27
29
  function getRepeatableGroups(format) {
28
30
  return getFormatAssets(format).filter(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils/format-assets.ts"],"sourcesContent":["// Format Asset Utilities\n// Provides access to format assets from the v3 `assets` field\n\nimport type { Format } from '../types/tools.generated';\n\n// Internal types - derived from Format['assets'] since schema doesn't export standalone types\ntype FormatAsset = NonNullable<Format['assets']>[number];\ntype IndividualAsset = Extract<FormatAsset, { item_type: 'individual' }>;\ntype RepeatableAssetGroup = Extract<FormatAsset, { item_type: 'repeatable_group' }>;\n\n// Legacy support: v2 responses may still include assets_required (deprecated in v3)\n// This internal type allows runtime backward compatibility without exposing it in public API\ninterface LegacyFormat extends Format {\n assets_required?: unknown[];\n}\n\n/**\n * Get assets from a Format\n *\n * Returns the assets from the v3 `assets` field. For backward compatibility with v2 servers,\n * this function also handles the deprecated `assets_required` field if present.\n *\n * @param format - The Format object from list_creative_formats response\n * @returns Array of assets\n *\n * @example\n * ```typescript\n * const formats = await agent.listCreativeFormats({});\n * for (const format of formats.formats) {\n * const assets = getFormatAssets(format);\n * console.log(`${format.name} has ${assets.length} assets`);\n * }\n * ```\n */\nexport function getFormatAssets(format: Format): FormatAsset[] {\n // Use v3 `assets` field\n if (format.assets && format.assets.length > 0) {\n return format.assets;\n }\n\n // Runtime backward compatibility: handle v2 responses with deprecated assets_required\n const legacyFormat = format as LegacyFormat;\n if (\n legacyFormat.assets_required &&\n Array.isArray(legacyFormat.assets_required) &&\n legacyFormat.assets_required.length > 0\n ) {\n return normalizeAssetsRequired(legacyFormat.assets_required);\n }\n\n return [];\n}\n\n/**\n * Convert deprecated assets_required to new assets format (internal use)\n *\n * All assets in assets_required are required by definition (that's why they were in that array).\n * The new `assets` field has an explicit `required: boolean` to allow both required AND optional assets.\n *\n * @param assetsRequired - The deprecated assets_required array\n * @returns Normalized assets array with explicit required: true\n * @internal\n */\nfunction normalizeAssetsRequired(assetsRequired: unknown[]): FormatAsset[] {\n return assetsRequired.map(asset => ({\n ...(asset as Record<string, unknown>),\n required: true, // assets_required only contained required assets\n })) as FormatAsset[];\n}\n\n/**\n * Get only required assets from a Format\n *\n * @param format - The Format object\n * @returns Array of required assets only\n *\n * @example\n * ```typescript\n * const requiredAssets = getRequiredAssets(format);\n * console.log(`Must provide ${requiredAssets.length} assets`);\n * ```\n */\nexport function getRequiredAssets(format: Format): FormatAsset[] {\n return getFormatAssets(format).filter(asset => asset.required);\n}\n\n/**\n * Get only optional assets from a Format\n *\n * Note: When using deprecated `assets_required`, this will always return empty\n * since assets_required only contained required assets.\n *\n * @param format - The Format object\n * @returns Array of optional assets only\n *\n * @example\n * ```typescript\n * const optionalAssets = getOptionalAssets(format);\n * console.log(`Can optionally provide ${optionalAssets.length} additional assets`);\n * ```\n */\nexport function getOptionalAssets(format: Format): FormatAsset[] {\n return getFormatAssets(format).filter(asset => !asset.required);\n}\n\n/**\n * Get individual assets (not repeatable groups) from a Format\n *\n * @param format - The Format object\n * @returns Array of individual assets\n */\nexport function getIndividualAssets(format: Format): IndividualAsset[] {\n return getFormatAssets(format).filter((asset): asset is IndividualAsset => asset.item_type === 'individual');\n}\n\n/**\n * Get repeatable asset groups from a Format\n *\n * @param format - The Format object\n * @returns Array of repeatable asset groups\n */\nexport function getRepeatableGroups(format: Format): RepeatableAssetGroup[] {\n return getFormatAssets(format).filter(\n (asset): asset is RepeatableAssetGroup => asset.item_type === 'repeatable_group'\n );\n}\n\n/**\n * Check if format uses deprecated assets_required field (for migration warnings)\n *\n * @param format - The Format object\n * @returns true if using deprecated field, false if using new field or neither\n *\n * @example\n * ```typescript\n * if (usesDeprecatedAssetsField(format)) {\n * console.warn(`Format ${format.name} uses deprecated assets_required field`);\n * }\n * ```\n */\nexport function usesDeprecatedAssetsField(format: Format): boolean {\n const legacyFormat = format as LegacyFormat;\n return !format.assets && !!(legacyFormat.assets_required && Array.isArray(legacyFormat.assets_required));\n}\n\n/**\n * Get the count of assets in a format (for display purposes)\n *\n * @param format - The Format object\n * @returns Number of assets, or 0 if none defined\n */\nexport function getAssetCount(format: Format): number {\n return getFormatAssets(format).length;\n}\n\n/**\n * Check if a format has any assets defined\n *\n * @param format - The Format object\n * @returns true if format has assets, false otherwise\n */\nexport function hasAssets(format: Format): boolean {\n return getAssetCount(format) > 0;\n}\n"],"mappings":"AAkCO,SAAS,gBAAgB,QAA+B;AAE7D,MAAI,OAAO,UAAU,OAAO,OAAO,SAAS,GAAG;AAC7C,WAAO,OAAO;AAAA,EAChB;AAGA,QAAM,eAAe;AACrB,MACE,aAAa,mBACb,MAAM,QAAQ,aAAa,eAAe,KAC1C,aAAa,gBAAgB,SAAS,GACtC;AACA,WAAO,wBAAwB,aAAa,eAAe;AAAA,EAC7D;AAEA,SAAO,CAAC;AACV;AAYA,SAAS,wBAAwB,gBAA0C;AACzE,SAAO,eAAe,IAAI,YAAU;AAAA,IAClC,GAAI;AAAA,IACJ,UAAU;AAAA;AAAA,EACZ,EAAE;AACJ;AAcO,SAAS,kBAAkB,QAA+B;AAC/D,SAAO,gBAAgB,MAAM,EAAE,OAAO,WAAS,MAAM,QAAQ;AAC/D;AAiBO,SAAS,kBAAkB,QAA+B;AAC/D,SAAO,gBAAgB,MAAM,EAAE,OAAO,WAAS,CAAC,MAAM,QAAQ;AAChE;AAQO,SAAS,oBAAoB,QAAmC;AACrE,SAAO,gBAAgB,MAAM,EAAE,OAAO,CAAC,UAAoC,MAAM,cAAc,YAAY;AAC7G;AAQO,SAAS,oBAAoB,QAAwC;AAC1E,SAAO,gBAAgB,MAAM,EAAE;AAAA,IAC7B,CAAC,UAAyC,MAAM,cAAc;AAAA,EAChE;AACF;AAeO,SAAS,0BAA0B,QAAyB;AACjE,QAAM,eAAe;AACrB,SAAO,CAAC,OAAO,UAAU,CAAC,EAAE,aAAa,mBAAmB,MAAM,QAAQ,aAAa,eAAe;AACxG;AAQO,SAAS,cAAc,QAAwB;AACpD,SAAO,gBAAgB,MAAM,EAAE;AACjC;AAQO,SAAS,UAAU,QAAyB;AACjD,SAAO,cAAc,MAAM,IAAI;AACjC;","names":[]}
1
+ {"version":3,"sources":["../../../src/lib/utils/format-assets.ts"],"sourcesContent":["// Format Asset Utilities\n// Provides access to asset-slot declarations without requiring a raw\n// list_creative_formats `Format` or its legacy format identity.\n\nimport type {\n IndividualAudioAsset,\n IndividualBriefAsset,\n IndividualCatalogAsset,\n IndividualCssAsset,\n IndividualDaastAsset,\n IndividualHtmlAsset,\n IndividualImageAsset,\n IndividualJavaScriptAsset,\n IndividualMarkdownAsset,\n IndividualTextAsset,\n IndividualUrlAsset,\n IndividualVastAsset,\n IndividualVideoAsset,\n IndividualWebhookAsset,\n RepeatableGroupAsset,\n} from '../types/tools.generated';\n\n/** Canonical structural union for the slots declared in an `assets` array. */\nexport type CanonicalFormatAssetSlot =\n | IndividualAudioAsset\n | IndividualBriefAsset\n | IndividualCatalogAsset\n | IndividualCssAsset\n | IndividualDaastAsset\n | IndividualHtmlAsset\n | IndividualImageAsset\n | IndividualJavaScriptAsset\n | IndividualMarkdownAsset\n | IndividualTextAsset\n | IndividualUrlAsset\n | IndividualVastAsset\n | IndividualVideoAsset\n | IndividualWebhookAsset\n | RepeatableGroupAsset;\n\nexport type IndividualFormatAssetSlot = Exclude<CanonicalFormatAssetSlot, RepeatableGroupAsset>;\nexport type RepeatableFormatAssetGroup = RepeatableGroupAsset;\n\n/**\n * Minimal structural input for asset inspection. It deliberately has no\n * `format_id`, `agent_url`, name, or other legacy catalog identity.\n */\nexport interface FormatAssetsInput {\n assets?: CanonicalFormatAssetSlot[];\n /** Deprecated v2 compatibility field; values are normalized as required slots. */\n assets_required?: unknown[];\n}\n\n// Legacy support: v2 responses may still include assets_required (deprecated in v3)\n// This internal type allows runtime backward compatibility without exposing it in public API\ntype LegacyFormatAssetsInput = FormatAssetsInput;\n\n/**\n * Get asset slots from any structural asset container.\n *\n * Returns the assets from the v3 `assets` field. For backward compatibility with v2 servers,\n * this function also handles the deprecated `assets_required` field if present.\n *\n * @param format - An object containing canonical `assets` slots\n * @returns Array of assets\n *\n * @example\n * ```typescript\n * const assets = getFormatAssets({\n * assets: [FormatAsset.image({ asset_id: 'hero', required: true })]\n * });\n * ```\n */\nexport function getFormatAssets(format: FormatAssetsInput): CanonicalFormatAssetSlot[] {\n // Use v3 `assets` field\n if (format.assets && format.assets.length > 0) {\n return format.assets;\n }\n\n // Runtime backward compatibility: handle v2 responses with deprecated assets_required\n const legacyFormat = format as LegacyFormatAssetsInput;\n if (\n legacyFormat.assets_required &&\n Array.isArray(legacyFormat.assets_required) &&\n legacyFormat.assets_required.length > 0\n ) {\n return normalizeAssetsRequired(legacyFormat.assets_required);\n }\n\n return [];\n}\n\n/**\n * Convert deprecated assets_required to new assets format (internal use)\n *\n * All assets in assets_required are required by definition (that's why they were in that array).\n * The new `assets` field has an explicit `required: boolean` to allow both required AND optional assets.\n *\n * @param assetsRequired - The deprecated assets_required array\n * @returns Normalized assets array with explicit required: true\n * @internal\n */\nfunction normalizeAssetsRequired(assetsRequired: unknown[]): CanonicalFormatAssetSlot[] {\n return assetsRequired.map(asset => ({\n ...(asset as Record<string, unknown>),\n required: true, // assets_required only contained required assets\n })) as CanonicalFormatAssetSlot[];\n}\n\n/**\n * Get only required slots from an asset container.\n *\n * @param format - A structural asset container\n * @returns Array of required assets only\n *\n * @example\n * ```typescript\n * const requiredAssets = getRequiredAssets(format);\n * console.log(`Must provide ${requiredAssets.length} assets`);\n * ```\n */\nexport function getRequiredAssets(format: FormatAssetsInput): CanonicalFormatAssetSlot[] {\n return getFormatAssets(format).filter(asset => asset.required);\n}\n\n/**\n * Get only optional slots from an asset container.\n *\n * Note: When using deprecated `assets_required`, this will always return empty\n * since assets_required only contained required assets.\n *\n * @param format - A structural asset container\n * @returns Array of optional assets only\n *\n * @example\n * ```typescript\n * const optionalAssets = getOptionalAssets(format);\n * console.log(`Can optionally provide ${optionalAssets.length} additional assets`);\n * ```\n */\nexport function getOptionalAssets(format: FormatAssetsInput): CanonicalFormatAssetSlot[] {\n return getFormatAssets(format).filter(asset => !asset.required);\n}\n\n/**\n * Get individual slots (not repeatable groups) from an asset container.\n *\n * @param format - A structural asset container\n * @returns Array of individual assets\n */\nexport function getIndividualAssets(format: FormatAssetsInput): IndividualFormatAssetSlot[] {\n return getFormatAssets(format).filter(\n (asset): asset is IndividualFormatAssetSlot => asset.item_type === 'individual'\n );\n}\n\n/**\n * Get repeatable asset groups from an asset container.\n *\n * @param format - A structural asset container\n * @returns Array of repeatable asset groups\n */\nexport function getRepeatableGroups(format: FormatAssetsInput): RepeatableFormatAssetGroup[] {\n return getFormatAssets(format).filter(\n (asset): asset is RepeatableFormatAssetGroup => asset.item_type === 'repeatable_group'\n );\n}\n\n/**\n * Check if format uses deprecated assets_required field (for migration warnings)\n *\n * @param format - A structural asset container\n * @returns true if using deprecated field, false if using new field or neither\n *\n * @example\n * ```typescript\n * if (usesDeprecatedAssetsField(format)) {\n * console.warn('Asset container uses deprecated assets_required field');\n * }\n * ```\n */\nexport function usesDeprecatedAssetsField(format: FormatAssetsInput): boolean {\n const legacyFormat = format as LegacyFormatAssetsInput;\n return !format.assets && !!(legacyFormat.assets_required && Array.isArray(legacyFormat.assets_required));\n}\n\n/**\n * Get the count of slots in an asset container.\n *\n * @param format - A structural asset container\n * @returns Number of assets, or 0 if none defined\n */\nexport function getAssetCount(format: FormatAssetsInput): number {\n return getFormatAssets(format).length;\n}\n\n/**\n * Check if an asset container has any slots defined.\n *\n * @param format - A structural asset container\n * @returns true if format has assets, false otherwise\n */\nexport function hasAssets(format: FormatAssetsInput): boolean {\n return getAssetCount(format) > 0;\n}\n"],"mappings":"AAyEO,SAAS,gBAAgB,QAAuD;AAErF,MAAI,OAAO,UAAU,OAAO,OAAO,SAAS,GAAG;AAC7C,WAAO,OAAO;AAAA,EAChB;AAGA,QAAM,eAAe;AACrB,MACE,aAAa,mBACb,MAAM,QAAQ,aAAa,eAAe,KAC1C,aAAa,gBAAgB,SAAS,GACtC;AACA,WAAO,wBAAwB,aAAa,eAAe;AAAA,EAC7D;AAEA,SAAO,CAAC;AACV;AAYA,SAAS,wBAAwB,gBAAuD;AACtF,SAAO,eAAe,IAAI,YAAU;AAAA,IAClC,GAAI;AAAA,IACJ,UAAU;AAAA;AAAA,EACZ,EAAE;AACJ;AAcO,SAAS,kBAAkB,QAAuD;AACvF,SAAO,gBAAgB,MAAM,EAAE,OAAO,WAAS,MAAM,QAAQ;AAC/D;AAiBO,SAAS,kBAAkB,QAAuD;AACvF,SAAO,gBAAgB,MAAM,EAAE,OAAO,WAAS,CAAC,MAAM,QAAQ;AAChE;AAQO,SAAS,oBAAoB,QAAwD;AAC1F,SAAO,gBAAgB,MAAM,EAAE;AAAA,IAC7B,CAAC,UAA8C,MAAM,cAAc;AAAA,EACrE;AACF;AAQO,SAAS,oBAAoB,QAAyD;AAC3F,SAAO,gBAAgB,MAAM,EAAE;AAAA,IAC7B,CAAC,UAA+C,MAAM,cAAc;AAAA,EACtE;AACF;AAeO,SAAS,0BAA0B,QAAoC;AAC5E,QAAM,eAAe;AACrB,SAAO,CAAC,OAAO,UAAU,CAAC,EAAE,aAAa,mBAAmB,MAAM,QAAQ,aAAa,eAAe;AACxG;AAQO,SAAS,cAAc,QAAmC;AAC/D,SAAO,gBAAgB,MAAM,EAAE;AACjC;AAQO,SAAS,UAAU,QAAoC;AAC5D,SAAO,cAAc,MAAM,IAAI;AACjC;","names":[]}
@@ -1,9 +1,9 @@
1
- import type { CreativeFormat } from '../types/index.mjs';
1
+ import type { LegacyCreativeFormatSummary } from '../types/index.mjs';
2
2
  export { logger, createLogger, type LogLevel, type LoggerConfig } from './logger.mjs';
3
- export { batchPreviewProducts, batchPreviewFormats, clearPreviewCache, type PreviewResult, type BatchPreviewOptions, type PreviewCacheBackend, type PreviewCacheEntry, } from './preview-utils.mjs';
3
+ export { batchPreviewProducts, batchPreviewFormatsLegacy, clearPreviewCache, type PreviewResult, type LegacyPreviewResult, type BatchPreviewOptions, type PreviewCacheBackend, type PreviewCacheEntry, } from './preview-utils.mjs';
4
4
  export declare const REQUEST_TIMEOUT: number;
5
5
  export declare const MAX_CONCURRENT: number;
6
- export declare const STANDARD_FORMATS: CreativeFormat[];
6
+ export declare const LEGACY_STANDARD_FORMATS: LegacyCreativeFormatSummary[];
7
7
  /**
8
8
  * Circuit Breaker for handling agent failures
9
9
  */
@@ -21,9 +21,9 @@ export declare class CircuitBreaker {
21
21
  }
22
22
  export declare function getCircuitBreaker(agentId: string): CircuitBreaker;
23
23
  /**
24
- * Get standard creative formats
24
+ * Get legacy named creative formats for migration tooling.
25
25
  */
26
- export declare function getStandardFormats(): CreativeFormat[];
26
+ export declare function getStandardFormatsLegacy(): LegacyCreativeFormatSummary[];
27
27
  export { unwrapProtocolResponse, isAdcpError, isAdcpSuccess, isTerminalAdcpError, hasAdvisorySuccessPayload, } from './response-unwrapper.mjs';
28
28
  export type { AdCPResponse } from './response-unwrapper.mjs';
29
29
  export { ensureGetProductsCacheScope, validateGetProductsCacheScope, type EnsureGetProductsCacheScopeOptions, type GetProductsCacheScope, type GetProductsResponseWithCacheScope, type GetProductsCacheScopeValidation, } from './get-products-cache-scope.mjs';
@@ -35,9 +35,9 @@ export { extractAdcpErrorFromMcp, extractAdcpErrorFromTransport, extractAdcpErro
35
35
  export type { ExtractedAdcpError } from './error-extraction.mjs';
36
36
  export { detectProtocol, detectProtocolWithTimeout } from './protocol-detection.mjs';
37
37
  export { A2A_CARD_PATHS, TRANSPORT_SUFFIX_REGEX, isAgentCardPath, isWellKnownAgentCardUrl, buildCardUrls, stripAgentCardPath, stripTransportSuffix, } from './a2a-discovery.mjs';
38
- export { getFormatAssets, getRequiredAssets, getOptionalAssets, getIndividualAssets, getRepeatableGroups, usesDeprecatedAssetsField, getAssetCount, hasAssets, } from './format-assets.mjs';
38
+ export { getFormatAssets, getRequiredAssets, getOptionalAssets, getIndividualAssets, getRepeatableGroups, usesDeprecatedAssetsField, getAssetCount, hasAssets, type CanonicalFormatAssetSlot, type FormatAssetsInput, type IndividualFormatAssetSlot, type RepeatableFormatAssetGroup, } from './format-assets.mjs';
39
39
  export { adaptGetProductsRequestForV2, normalizeProductChannels, adaptPricingOptionForV2, normalizePricingOption, normalizeProductPricing, normalizeGetProductsResponse, usesV2PricingFields, usesV3PricingFields, isFixedPricing, isCPAPricing, getPrice, getFloorPrice, type PricingOptionV2, type PricingOptionV3, type PriceGuidanceV2, type PriceGuidanceV3, } from './pricing-adapter.mjs';
40
40
  export { adaptSyncCreativesRequestForV2 } from './sync-creatives-adapter.mjs';
41
- export { inlineCreativesForPackages } from './creative-delivery.mjs';
42
- export type { InlineCreativeAssignment, InlineCreativePackage, InlineCreativePackagePatch, InlineCreativesForPackagesOptions, } from './creative-delivery.mjs';
41
+ export { inlineCreativesForPackages, inlineCreativesForPackagesLegacy } from './creative-delivery.mjs';
42
+ export type { InlineCreativeAssignment, InlineCreativePackage, InlineCreativePackagePatch, InlineCreativesForPackagesOptions, InlineCreativesForPackagesLegacyOptions, LegacyInlineCreativePackage, } from './creative-delivery.mjs';
43
43
  export { paginate, paginatePages, type PaginateOptions } from './pagination.mjs';
@@ -1,9 +1,9 @@
1
- import type { CreativeFormat } from '../types';
1
+ import type { LegacyCreativeFormatSummary } from '../types';
2
2
  export { logger, createLogger, type LogLevel, type LoggerConfig } from './logger';
3
- export { batchPreviewProducts, batchPreviewFormats, clearPreviewCache, type PreviewResult, type BatchPreviewOptions, type PreviewCacheBackend, type PreviewCacheEntry, } from './preview-utils';
3
+ export { batchPreviewProducts, batchPreviewFormatsLegacy, clearPreviewCache, type PreviewResult, type LegacyPreviewResult, type BatchPreviewOptions, type PreviewCacheBackend, type PreviewCacheEntry, } from './preview-utils';
4
4
  export declare const REQUEST_TIMEOUT: number;
5
5
  export declare const MAX_CONCURRENT: number;
6
- export declare const STANDARD_FORMATS: CreativeFormat[];
6
+ export declare const LEGACY_STANDARD_FORMATS: LegacyCreativeFormatSummary[];
7
7
  /**
8
8
  * Circuit Breaker for handling agent failures
9
9
  */
@@ -21,9 +21,9 @@ export declare class CircuitBreaker {
21
21
  }
22
22
  export declare function getCircuitBreaker(agentId: string): CircuitBreaker;
23
23
  /**
24
- * Get standard creative formats
24
+ * Get legacy named creative formats for migration tooling.
25
25
  */
26
- export declare function getStandardFormats(): CreativeFormat[];
26
+ export declare function getStandardFormatsLegacy(): LegacyCreativeFormatSummary[];
27
27
  export { unwrapProtocolResponse, isAdcpError, isAdcpSuccess, isTerminalAdcpError, hasAdvisorySuccessPayload, } from './response-unwrapper';
28
28
  export type { AdCPResponse } from './response-unwrapper';
29
29
  export { ensureGetProductsCacheScope, validateGetProductsCacheScope, type EnsureGetProductsCacheScopeOptions, type GetProductsCacheScope, type GetProductsResponseWithCacheScope, type GetProductsCacheScopeValidation, } from './get-products-cache-scope';
@@ -35,10 +35,10 @@ export { extractAdcpErrorFromMcp, extractAdcpErrorFromTransport, extractAdcpErro
35
35
  export type { ExtractedAdcpError } from './error-extraction';
36
36
  export { detectProtocol, detectProtocolWithTimeout } from './protocol-detection';
37
37
  export { A2A_CARD_PATHS, TRANSPORT_SUFFIX_REGEX, isAgentCardPath, isWellKnownAgentCardUrl, buildCardUrls, stripAgentCardPath, stripTransportSuffix, } from './a2a-discovery';
38
- export { getFormatAssets, getRequiredAssets, getOptionalAssets, getIndividualAssets, getRepeatableGroups, usesDeprecatedAssetsField, getAssetCount, hasAssets, } from './format-assets';
38
+ export { getFormatAssets, getRequiredAssets, getOptionalAssets, getIndividualAssets, getRepeatableGroups, usesDeprecatedAssetsField, getAssetCount, hasAssets, type CanonicalFormatAssetSlot, type FormatAssetsInput, type IndividualFormatAssetSlot, type RepeatableFormatAssetGroup, } from './format-assets';
39
39
  export { adaptGetProductsRequestForV2, normalizeProductChannels, adaptPricingOptionForV2, normalizePricingOption, normalizeProductPricing, normalizeGetProductsResponse, usesV2PricingFields, usesV3PricingFields, isFixedPricing, isCPAPricing, getPrice, getFloorPrice, type PricingOptionV2, type PricingOptionV3, type PriceGuidanceV2, type PriceGuidanceV3, } from './pricing-adapter';
40
40
  export { adaptSyncCreativesRequestForV2 } from './sync-creatives-adapter';
41
- export { inlineCreativesForPackages } from './creative-delivery';
42
- export type { InlineCreativeAssignment, InlineCreativePackage, InlineCreativePackagePatch, InlineCreativesForPackagesOptions, } from './creative-delivery';
41
+ export { inlineCreativesForPackages, inlineCreativesForPackagesLegacy } from './creative-delivery';
42
+ export type { InlineCreativeAssignment, InlineCreativePackage, InlineCreativePackagePatch, InlineCreativesForPackagesOptions, InlineCreativesForPackagesLegacyOptions, LegacyInlineCreativePackage, } from './creative-delivery';
43
43
  export { paginate, paginatePages, type PaginateOptions } from './pagination';
44
44
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAIlF,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC;AAGzB,eAAO,MAAM,eAAe,QAAmD,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AAC;AAG3B,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAG1E,OAAO,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACnG,YAAY,EACV,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,iCAAiC,EACjC,uCAAuC,EACvC,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC"}
@@ -20,14 +20,14 @@ var utils_exports = {};
20
20
  __export(utils_exports, {
21
21
  A2A_CARD_PATHS: () => import_a2a_discovery.A2A_CARD_PATHS,
22
22
  CircuitBreaker: () => CircuitBreaker,
23
+ LEGACY_STANDARD_FORMATS: () => LEGACY_STANDARD_FORMATS,
23
24
  MAX_CONCURRENT: () => MAX_CONCURRENT,
24
25
  REQUEST_TIMEOUT: () => REQUEST_TIMEOUT,
25
- STANDARD_FORMATS: () => STANDARD_FORMATS,
26
26
  TRANSPORT_SUFFIX_REGEX: () => import_a2a_discovery.TRANSPORT_SUFFIX_REGEX,
27
27
  adaptGetProductsRequestForV2: () => import_pricing_adapter.adaptGetProductsRequestForV2,
28
28
  adaptPricingOptionForV2: () => import_pricing_adapter.adaptPricingOptionForV2,
29
29
  adaptSyncCreativesRequestForV2: () => import_sync_creatives_adapter.adaptSyncCreativesRequestForV2,
30
- batchPreviewFormats: () => import_preview_utils.batchPreviewFormats,
30
+ batchPreviewFormatsLegacy: () => import_preview_utils.batchPreviewFormatsLegacy,
31
31
  batchPreviewProducts: () => import_preview_utils.batchPreviewProducts,
32
32
  buildCardUrls: () => import_a2a_discovery.buildCardUrls,
33
33
  clearPreviewCache: () => import_preview_utils.clearPreviewCache,
@@ -52,10 +52,11 @@ __export(utils_exports, {
52
52
  getRepeatableGroups: () => import_format_assets.getRepeatableGroups,
53
53
  getRequiredAssets: () => import_format_assets.getRequiredAssets,
54
54
  getRetryDelay: () => import_retry.getRetryDelay,
55
- getStandardFormats: () => getStandardFormats,
55
+ getStandardFormatsLegacy: () => getStandardFormatsLegacy,
56
56
  hasAdvisorySuccessPayload: () => import_response_unwrapper.hasAdvisorySuccessPayload,
57
57
  hasAssets: () => import_format_assets.hasAssets,
58
58
  inlineCreativesForPackages: () => import_creative_delivery.inlineCreativesForPackages,
59
+ inlineCreativesForPackagesLegacy: () => import_creative_delivery.inlineCreativesForPackagesLegacy,
59
60
  isAdcpError: () => import_response_unwrapper.isAdcpError,
60
61
  isAdcpSuccess: () => import_response_unwrapper.isAdcpSuccess,
61
62
  isAgentCardPath: () => import_a2a_discovery.isAgentCardPath,
@@ -102,7 +103,7 @@ var import_creative_delivery = require('./creative-delivery.js');
102
103
  var import_pagination = require('./pagination.js');
103
104
  const REQUEST_TIMEOUT = parseInt(process.env.REQUEST_TIMEOUT || "30000");
104
105
  const MAX_CONCURRENT = parseInt(process.env.MAX_CONCURRENT || "5");
105
- const STANDARD_FORMATS = [
106
+ const LEGACY_STANDARD_FORMATS = [
106
107
  {
107
108
  format_id: {
108
109
  agent_url: "https://creatives.adcontextprotocol.org",
@@ -201,21 +202,21 @@ function getCircuitBreaker(agentId) {
201
202
  }
202
203
  return circuitBreakers.get(agentId);
203
204
  }
204
- function getStandardFormats() {
205
- return STANDARD_FORMATS;
205
+ function getStandardFormatsLegacy() {
206
+ return LEGACY_STANDARD_FORMATS;
206
207
  }
207
208
  // Annotate the CommonJS export names for ESM import in node:
208
209
  0 && (module.exports = {
209
210
  A2A_CARD_PATHS,
210
211
  CircuitBreaker,
212
+ LEGACY_STANDARD_FORMATS,
211
213
  MAX_CONCURRENT,
212
214
  REQUEST_TIMEOUT,
213
- STANDARD_FORMATS,
214
215
  TRANSPORT_SUFFIX_REGEX,
215
216
  adaptGetProductsRequestForV2,
216
217
  adaptPricingOptionForV2,
217
218
  adaptSyncCreativesRequestForV2,
218
- batchPreviewFormats,
219
+ batchPreviewFormatsLegacy,
219
220
  batchPreviewProducts,
220
221
  buildCardUrls,
221
222
  clearPreviewCache,
@@ -240,10 +241,11 @@ function getStandardFormats() {
240
241
  getRepeatableGroups,
241
242
  getRequiredAssets,
242
243
  getRetryDelay,
243
- getStandardFormats,
244
+ getStandardFormatsLegacy,
244
245
  hasAdvisorySuccessPayload,
245
246
  hasAssets,
246
247
  inlineCreativesForPackages,
248
+ inlineCreativesForPackagesLegacy,
247
249
  isAdcpError,
248
250
  isAdcpSuccess,
249
251
  isAgentCardPath,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils/index.ts"],"sourcesContent":["import type { CreativeFormat } from '../types';\n\n// Re-export logger utilities\nexport { logger, createLogger, type LogLevel, type LoggerConfig } from './logger';\nimport { logger } from './logger';\n\n// Re-export preview utilities\nexport {\n batchPreviewProducts,\n batchPreviewFormats,\n clearPreviewCache,\n type PreviewResult,\n type BatchPreviewOptions,\n type PreviewCacheBackend,\n type PreviewCacheEntry,\n} from './preview-utils';\n\n// Configuration constants\nexport const REQUEST_TIMEOUT = parseInt(process.env.REQUEST_TIMEOUT || '30000'); // 30 seconds\nexport const MAX_CONCURRENT = parseInt(process.env.MAX_CONCURRENT || '5');\n\n// Standard creative formats (hardcoded for now)\nexport const STANDARD_FORMATS: CreativeFormat[] = [\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_728x90',\n },\n name: 'Leaderboard',\n dimensions: { width: 728, height: 90 },\n aspect_ratio: '8:1',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 150000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_300x250',\n },\n name: 'Medium Rectangle',\n dimensions: { width: 300, height: 250 },\n aspect_ratio: '6:5',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 150000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_320x50',\n },\n name: 'Mobile Banner',\n dimensions: { width: 320, height: 50 },\n aspect_ratio: '32:5',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 40000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'video_1920x1080',\n },\n name: 'Full HD Video',\n dimensions: { width: 1920, height: 1080 },\n aspect_ratio: '16:9',\n file_types: ['mp4', 'webm'],\n max_file_size: 10000000,\n duration_range: { min: 6, max: 30 },\n },\n];\n\n/**\n * Circuit Breaker for handling agent failures\n */\nexport class CircuitBreaker {\n private failures = 0;\n private lastFailTime = 0;\n private state: 'closed' | 'open' | 'half-open' = 'closed';\n private readonly failureThreshold = 5;\n private readonly resetTimeout = 60000; // 1 minute\n\n constructor(private agentId: string) {}\n\n async call<T>(fn: () => Promise<T>): Promise<T> {\n if (this.state === 'open') {\n if (Date.now() - this.lastFailTime > this.resetTimeout) {\n this.state = 'half-open';\n logger.info(`🔄 Circuit breaker for ${this.agentId} attempting to close...`);\n } else {\n throw new Error(`Circuit breaker is open for agent ${this.agentId}`);\n }\n }\n\n try {\n const result = await fn();\n this.onSuccess();\n return result;\n } catch (error) {\n this.onFailure();\n throw error;\n }\n }\n\n private onSuccess(): void {\n this.failures = 0;\n if (this.state === 'half-open') {\n this.state = 'closed';\n logger.info(`✅ Circuit breaker for ${this.agentId} closed successfully`);\n }\n }\n\n private onFailure(): void {\n this.failures++;\n this.lastFailTime = Date.now();\n\n if (this.failures >= this.failureThreshold) {\n this.state = 'open';\n logger.warn(`🚨 Circuit breaker opened for agent ${this.agentId} after ${this.failures} failures`);\n }\n }\n}\n\n// Circuit breaker instances for each agent\nconst circuitBreakers = new Map<string, CircuitBreaker>();\n\nexport function getCircuitBreaker(agentId: string): CircuitBreaker {\n if (!circuitBreakers.has(agentId)) {\n circuitBreakers.set(agentId, new CircuitBreaker(agentId));\n }\n return circuitBreakers.get(agentId)!;\n}\n\n/**\n * Get standard creative formats\n */\nexport function getStandardFormats(): CreativeFormat[] {\n return STANDARD_FORMATS;\n}\n\n// Re-export response unwrapping utilities\nexport {\n unwrapProtocolResponse,\n isAdcpError,\n isAdcpSuccess,\n isTerminalAdcpError,\n hasAdvisorySuccessPayload,\n} from './response-unwrapper';\nexport type { AdCPResponse } from './response-unwrapper';\nexport {\n ensureGetProductsCacheScope,\n validateGetProductsCacheScope,\n type EnsureGetProductsCacheScopeOptions,\n type GetProductsCacheScope,\n type GetProductsResponseWithCacheScope,\n type GetProductsCacheScopeValidation,\n} from './get-products-cache-scope';\nexport { getAuthoritativeMediaBuyStatus, isMediaBuyStatus } from './media-buy-status';\nexport {\n resolveTaskState,\n type EffectiveTaskState,\n type ResolvedTaskState,\n type ResolveTaskStateOptions,\n} from './task-state';\n\n// Lightweight MCP CallToolResult extractor (prefers structuredContent, falls back to JSON text).\nexport { extractResult, type ToolCallResultLike } from './extract-result';\n\n// Re-export retry utilities\nexport { isRetryable, getRetryDelay } from './retry';\n\n// Re-export error extraction utilities\nexport {\n extractAdcpErrorFromMcp,\n extractAdcpErrorFromTransport,\n extractAdcpErrorInfo,\n extractCorrelationId,\n resolveRecovery,\n getExpectedAction,\n} from './error-extraction';\nexport type { ExtractedAdcpError } from './error-extraction';\n\n// Re-export protocol detection utilities\nexport { detectProtocol, detectProtocolWithTimeout } from './protocol-detection';\n\n// Re-export A2A discovery utilities\nexport {\n A2A_CARD_PATHS,\n TRANSPORT_SUFFIX_REGEX,\n isAgentCardPath,\n isWellKnownAgentCardUrl,\n buildCardUrls,\n stripAgentCardPath,\n stripTransportSuffix,\n} from './a2a-discovery';\n\n// Re-export format asset utilities\nexport {\n getFormatAssets,\n getRequiredAssets,\n getOptionalAssets,\n getIndividualAssets,\n getRepeatableGroups,\n usesDeprecatedAssetsField,\n getAssetCount,\n hasAssets,\n} from './format-assets';\n\n// Re-export pricing adapter utilities (v3 pricing field compatibility)\nexport {\n adaptGetProductsRequestForV2,\n normalizeProductChannels,\n adaptPricingOptionForV2,\n normalizePricingOption,\n normalizeProductPricing,\n normalizeGetProductsResponse,\n usesV2PricingFields,\n usesV3PricingFields,\n isFixedPricing,\n isCPAPricing,\n getPrice,\n getFloorPrice,\n type PricingOptionV2,\n type PricingOptionV3,\n type PriceGuidanceV2,\n type PriceGuidanceV3,\n} from './pricing-adapter';\n\n// Re-export sync creatives adapter (v2/v3 compatibility)\nexport { adaptSyncCreativesRequestForV2 } from './sync-creatives-adapter';\n\n// Re-export creative delivery helpers for package-scoped inline creatives\nexport { inlineCreativesForPackages } from './creative-delivery';\nexport type {\n InlineCreativeAssignment,\n InlineCreativePackage,\n InlineCreativePackagePatch,\n InlineCreativesForPackagesOptions,\n} from './creative-delivery';\n\n// Re-export pagination utilities\nexport { paginate, paginatePages, type PaginateOptions } from './pagination';\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAuE;AACvE,IAAAA,iBAAuB;AAGvB,2BAQO;AA4HP,gCAMO;AAEP,sCAOO;AACP,8BAAiE;AACjE,wBAKO;AAGP,4BAAuD;AAGvD,mBAA2C;AAG3C,8BAOO;AAIP,gCAA0D;AAG1D,2BAQO;AAGP,2BASO;AAGP,6BAiBO;AAGP,oCAA+C;AAG/C,+BAA2C;AAS3C,wBAA8D;AA7NvD,MAAM,kBAAkB,SAAS,QAAQ,IAAI,mBAAmB,OAAO;AACvE,MAAM,iBAAiB,SAAS,QAAQ,IAAI,kBAAkB,GAA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AAU,QAAQ;AACzB,UAAI,KAAK,IAAI,IAAI,KAAK,eAAe,KAAK,cAAc;AACtD,aAAK,QAAQ;AACb,8BAAO,KAAK,iCAA0B,KAAK,OAAO,yBAAyB;AAAA,MAC7E,OAAO;AACL,cAAM,IAAI,MAAM,qCAAqC,KAAK,OAAO,EAAE;AAAA,MACrE;AAAA,IACF;AAEA,QAAI;AACF,YAAM,SAAS,MAAM,GAAG;AACxB,WAAK,UAAU;AACf,aAAO;AAAA,IACT,SAAS,OAAO;AACd,WAAK,UAAU;AACf,YAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEQ,YAAkB;AACxB,SAAK,WAAW;AAChB,QAAI,KAAK,UAAU,aAAa;AAC9B,WAAK,QAAQ;AACb,4BAAO,KAAK,8BAAyB,KAAK,OAAO,sBAAsB;AAAA,IACzE;AAAA,EACF;AAAA,EAEQ,YAAkB;AACxB,SAAK;AACL,SAAK,eAAe,KAAK,IAAI;AAE7B,QAAI,KAAK,YAAY,KAAK,kBAAkB;AAC1C,WAAK,QAAQ;AACb,4BAAO,KAAK,8CAAuC,KAAK,OAAO,UAAU,KAAK,QAAQ,WAAW;AAAA,IACnG;AAAA,EACF;AACF;AAGA,MAAM,kBAAkB,oBAAI,IAA4B;AAEjD,SAAS,kBAAkB,SAAiC;AACjE,MAAI,CAAC,gBAAgB,IAAI,OAAO,GAAG;AACjC,oBAAgB,IAAI,SAAS,IAAI,eAAe,OAAO,CAAC;AAAA,EAC1D;AACA,SAAO,gBAAgB,IAAI,OAAO;AACpC;AAKO,SAAS,qBAAuC;AACrD,SAAO;AACT;","names":["import_logger"]}
1
+ {"version":3,"sources":["../../../src/lib/utils/index.ts"],"sourcesContent":["import type { LegacyCreativeFormatSummary } from '../types';\n\n// Re-export logger utilities\nexport { logger, createLogger, type LogLevel, type LoggerConfig } from './logger';\nimport { logger } from './logger';\n\n// Re-export preview utilities\nexport {\n batchPreviewProducts,\n batchPreviewFormatsLegacy,\n clearPreviewCache,\n type PreviewResult,\n type LegacyPreviewResult,\n type BatchPreviewOptions,\n type PreviewCacheBackend,\n type PreviewCacheEntry,\n} from './preview-utils';\n\n// Configuration constants\nexport const REQUEST_TIMEOUT = parseInt(process.env.REQUEST_TIMEOUT || '30000'); // 30 seconds\nexport const MAX_CONCURRENT = parseInt(process.env.MAX_CONCURRENT || '5');\n\n// Legacy named creative formats (hardcoded migration fixtures)\nexport const LEGACY_STANDARD_FORMATS: LegacyCreativeFormatSummary[] = [\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_728x90',\n },\n name: 'Leaderboard',\n dimensions: { width: 728, height: 90 },\n aspect_ratio: '8:1',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 150000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_300x250',\n },\n name: 'Medium Rectangle',\n dimensions: { width: 300, height: 250 },\n aspect_ratio: '6:5',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 150000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_320x50',\n },\n name: 'Mobile Banner',\n dimensions: { width: 320, height: 50 },\n aspect_ratio: '32:5',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 40000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'video_1920x1080',\n },\n name: 'Full HD Video',\n dimensions: { width: 1920, height: 1080 },\n aspect_ratio: '16:9',\n file_types: ['mp4', 'webm'],\n max_file_size: 10000000,\n duration_range: { min: 6, max: 30 },\n },\n];\n\n/**\n * Circuit Breaker for handling agent failures\n */\nexport class CircuitBreaker {\n private failures = 0;\n private lastFailTime = 0;\n private state: 'closed' | 'open' | 'half-open' = 'closed';\n private readonly failureThreshold = 5;\n private readonly resetTimeout = 60000; // 1 minute\n\n constructor(private agentId: string) {}\n\n async call<T>(fn: () => Promise<T>): Promise<T> {\n if (this.state === 'open') {\n if (Date.now() - this.lastFailTime > this.resetTimeout) {\n this.state = 'half-open';\n logger.info(`🔄 Circuit breaker for ${this.agentId} attempting to close...`);\n } else {\n throw new Error(`Circuit breaker is open for agent ${this.agentId}`);\n }\n }\n\n try {\n const result = await fn();\n this.onSuccess();\n return result;\n } catch (error) {\n this.onFailure();\n throw error;\n }\n }\n\n private onSuccess(): void {\n this.failures = 0;\n if (this.state === 'half-open') {\n this.state = 'closed';\n logger.info(`✅ Circuit breaker for ${this.agentId} closed successfully`);\n }\n }\n\n private onFailure(): void {\n this.failures++;\n this.lastFailTime = Date.now();\n\n if (this.failures >= this.failureThreshold) {\n this.state = 'open';\n logger.warn(`🚨 Circuit breaker opened for agent ${this.agentId} after ${this.failures} failures`);\n }\n }\n}\n\n// Circuit breaker instances for each agent\nconst circuitBreakers = new Map<string, CircuitBreaker>();\n\nexport function getCircuitBreaker(agentId: string): CircuitBreaker {\n if (!circuitBreakers.has(agentId)) {\n circuitBreakers.set(agentId, new CircuitBreaker(agentId));\n }\n return circuitBreakers.get(agentId)!;\n}\n\n/**\n * Get legacy named creative formats for migration tooling.\n */\nexport function getStandardFormatsLegacy(): LegacyCreativeFormatSummary[] {\n return LEGACY_STANDARD_FORMATS;\n}\n\n// Re-export response unwrapping utilities\nexport {\n unwrapProtocolResponse,\n isAdcpError,\n isAdcpSuccess,\n isTerminalAdcpError,\n hasAdvisorySuccessPayload,\n} from './response-unwrapper';\nexport type { AdCPResponse } from './response-unwrapper';\nexport {\n ensureGetProductsCacheScope,\n validateGetProductsCacheScope,\n type EnsureGetProductsCacheScopeOptions,\n type GetProductsCacheScope,\n type GetProductsResponseWithCacheScope,\n type GetProductsCacheScopeValidation,\n} from './get-products-cache-scope';\nexport { getAuthoritativeMediaBuyStatus, isMediaBuyStatus } from './media-buy-status';\nexport {\n resolveTaskState,\n type EffectiveTaskState,\n type ResolvedTaskState,\n type ResolveTaskStateOptions,\n} from './task-state';\n\n// Lightweight MCP CallToolResult extractor (prefers structuredContent, falls back to JSON text).\nexport { extractResult, type ToolCallResultLike } from './extract-result';\n\n// Re-export retry utilities\nexport { isRetryable, getRetryDelay } from './retry';\n\n// Re-export error extraction utilities\nexport {\n extractAdcpErrorFromMcp,\n extractAdcpErrorFromTransport,\n extractAdcpErrorInfo,\n extractCorrelationId,\n resolveRecovery,\n getExpectedAction,\n} from './error-extraction';\nexport type { ExtractedAdcpError } from './error-extraction';\n\n// Re-export protocol detection utilities\nexport { detectProtocol, detectProtocolWithTimeout } from './protocol-detection';\n\n// Re-export A2A discovery utilities\nexport {\n A2A_CARD_PATHS,\n TRANSPORT_SUFFIX_REGEX,\n isAgentCardPath,\n isWellKnownAgentCardUrl,\n buildCardUrls,\n stripAgentCardPath,\n stripTransportSuffix,\n} from './a2a-discovery';\n\n// Re-export format asset utilities\nexport {\n getFormatAssets,\n getRequiredAssets,\n getOptionalAssets,\n getIndividualAssets,\n getRepeatableGroups,\n usesDeprecatedAssetsField,\n getAssetCount,\n hasAssets,\n type CanonicalFormatAssetSlot,\n type FormatAssetsInput,\n type IndividualFormatAssetSlot,\n type RepeatableFormatAssetGroup,\n} from './format-assets';\n\n// Re-export pricing adapter utilities (v3 pricing field compatibility)\nexport {\n adaptGetProductsRequestForV2,\n normalizeProductChannels,\n adaptPricingOptionForV2,\n normalizePricingOption,\n normalizeProductPricing,\n normalizeGetProductsResponse,\n usesV2PricingFields,\n usesV3PricingFields,\n isFixedPricing,\n isCPAPricing,\n getPrice,\n getFloorPrice,\n type PricingOptionV2,\n type PricingOptionV3,\n type PriceGuidanceV2,\n type PriceGuidanceV3,\n} from './pricing-adapter';\n\n// Re-export sync creatives adapter (v2/v3 compatibility)\nexport { adaptSyncCreativesRequestForV2 } from './sync-creatives-adapter';\n\n// Re-export creative delivery helpers for package-scoped inline creatives\nexport { inlineCreativesForPackages, inlineCreativesForPackagesLegacy } from './creative-delivery';\nexport type {\n InlineCreativeAssignment,\n InlineCreativePackage,\n InlineCreativePackagePatch,\n InlineCreativesForPackagesOptions,\n InlineCreativesForPackagesLegacyOptions,\n LegacyInlineCreativePackage,\n} from './creative-delivery';\n\n// Re-export pagination utilities\nexport { paginate, paginatePages, type PaginateOptions } from './pagination';\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAuE;AACvE,IAAAA,iBAAuB;AAGvB,2BASO;AA4HP,gCAMO;AAEP,sCAOO;AACP,8BAAiE;AACjE,wBAKO;AAGP,4BAAuD;AAGvD,mBAA2C;AAG3C,8BAOO;AAIP,gCAA0D;AAG1D,2BAQO;AAGP,2BAaO;AAGP,6BAiBO;AAGP,oCAA+C;AAG/C,+BAA6E;AAW7E,wBAA8D;AAnOvD,MAAM,kBAAkB,SAAS,QAAQ,IAAI,mBAAmB,OAAO;AACvE,MAAM,iBAAiB,SAAS,QAAQ,IAAI,kBAAkB,GAAG;AAGjE,MAAM,0BAAyD;AAAA,EACpE;AAAA,IACE,WAAW;AAAA,MACT,WAAW;AAAA,MACX,IAAI;AAAA,IACN;AAAA,IACA,MAAM;AAAA,IACN,YAAY,EAAE,OAAO,KAAK,QAAQ,GAAG;AAAA,IACrC,cAAc;AAAA,IACd,YAAY,CAAC,OAAO,QAAQ,OAAO,KAAK;AAAA,IACxC,eAAe;AAAA,EACjB;AAAA,EACA;AAAA,IACE,WAAW;AAAA,MACT,WAAW;AAAA,MACX,IAA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ACd,WAAK,UAAU;AACf,YAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEQ,YAAkB;AACxB,SAAK,WAAW;AAChB,QAAI,KAAK,UAAU,aAAa;AAC9B,WAAK,QAAQ;AACb,4BAAO,KAAK,8BAAyB,KAAK,OAAO,sBAAsB;AAAA,IACzE;AAAA,EACF;AAAA,EAEQ,YAAkB;AACxB,SAAK;AACL,SAAK,eAAe,KAAK,IAAI;AAE7B,QAAI,KAAK,YAAY,KAAK,kBAAkB;AAC1C,WAAK,QAAQ;AACb,4BAAO,KAAK,8CAAuC,KAAK,OAAO,UAAU,KAAK,QAAQ,WAAW;AAAA,IACnG;AAAA,EACF;AACF;AAGA,MAAM,kBAAkB,oBAAI,IAA4B;AAEjD,SAAS,kBAAkB,SAAiC;AACjE,MAAI,CAAC,gBAAgB,IAAI,OAAO,GAAG;AACjC,oBAAgB,IAAI,SAAS,IAAI,eAAe,OAAO,CAAC;AAAA,EAC1D;AACA,SAAO,gBAAgB,IAAI,OAAO;AACpC;AAKO,SAAS,2BAA0D;AACxE,SAAO;AACT;","names":["import_logger"]}
@@ -2,12 +2,12 @@ import { logger, createLogger } from "./logger.mjs";
2
2
  import { logger as logger2 } from "./logger.mjs";
3
3
  import {
4
4
  batchPreviewProducts,
5
- batchPreviewFormats,
5
+ batchPreviewFormatsLegacy,
6
6
  clearPreviewCache
7
7
  } from "./preview-utils.mjs";
8
8
  const REQUEST_TIMEOUT = parseInt(process.env.REQUEST_TIMEOUT || "30000");
9
9
  const MAX_CONCURRENT = parseInt(process.env.MAX_CONCURRENT || "5");
10
- const STANDARD_FORMATS = [
10
+ const LEGACY_STANDARD_FORMATS = [
11
11
  {
12
12
  format_id: {
13
13
  agent_url: "https://creatives.adcontextprotocol.org",
@@ -106,8 +106,8 @@ function getCircuitBreaker(agentId) {
106
106
  }
107
107
  return circuitBreakers.get(agentId);
108
108
  }
109
- function getStandardFormats() {
110
- return STANDARD_FORMATS;
109
+ function getStandardFormatsLegacy() {
110
+ return LEGACY_STANDARD_FORMATS;
111
111
  }
112
112
  import {
113
113
  unwrapProtocolResponse,
@@ -169,19 +169,19 @@ import {
169
169
  getFloorPrice
170
170
  } from "./pricing-adapter.mjs";
171
171
  import { adaptSyncCreativesRequestForV2 } from "./sync-creatives-adapter.mjs";
172
- import { inlineCreativesForPackages } from "./creative-delivery.mjs";
172
+ import { inlineCreativesForPackages, inlineCreativesForPackagesLegacy } from "./creative-delivery.mjs";
173
173
  import { paginate, paginatePages } from "./pagination.mjs";
174
174
  export {
175
175
  A2A_CARD_PATHS,
176
176
  CircuitBreaker,
177
+ LEGACY_STANDARD_FORMATS,
177
178
  MAX_CONCURRENT,
178
179
  REQUEST_TIMEOUT,
179
- STANDARD_FORMATS,
180
180
  TRANSPORT_SUFFIX_REGEX,
181
181
  adaptGetProductsRequestForV2,
182
182
  adaptPricingOptionForV2,
183
183
  adaptSyncCreativesRequestForV2,
184
- batchPreviewFormats,
184
+ batchPreviewFormatsLegacy,
185
185
  batchPreviewProducts,
186
186
  buildCardUrls,
187
187
  clearPreviewCache,
@@ -206,10 +206,11 @@ export {
206
206
  getRepeatableGroups,
207
207
  getRequiredAssets,
208
208
  getRetryDelay,
209
- getStandardFormats,
209
+ getStandardFormatsLegacy,
210
210
  hasAdvisorySuccessPayload,
211
211
  hasAssets,
212
212
  inlineCreativesForPackages,
213
+ inlineCreativesForPackagesLegacy,
213
214
  isAdcpError,
214
215
  isAdcpSuccess,
215
216
  isAgentCardPath,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils/index.ts"],"sourcesContent":["import type { CreativeFormat } from '../types';\n\n// Re-export logger utilities\nexport { logger, createLogger, type LogLevel, type LoggerConfig } from './logger';\nimport { logger } from './logger';\n\n// Re-export preview utilities\nexport {\n batchPreviewProducts,\n batchPreviewFormats,\n clearPreviewCache,\n type PreviewResult,\n type BatchPreviewOptions,\n type PreviewCacheBackend,\n type PreviewCacheEntry,\n} from './preview-utils';\n\n// Configuration constants\nexport const REQUEST_TIMEOUT = parseInt(process.env.REQUEST_TIMEOUT || '30000'); // 30 seconds\nexport const MAX_CONCURRENT = parseInt(process.env.MAX_CONCURRENT || '5');\n\n// Standard creative formats (hardcoded for now)\nexport const STANDARD_FORMATS: CreativeFormat[] = [\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_728x90',\n },\n name: 'Leaderboard',\n dimensions: { width: 728, height: 90 },\n aspect_ratio: '8:1',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 150000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_300x250',\n },\n name: 'Medium Rectangle',\n dimensions: { width: 300, height: 250 },\n aspect_ratio: '6:5',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 150000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_320x50',\n },\n name: 'Mobile Banner',\n dimensions: { width: 320, height: 50 },\n aspect_ratio: '32:5',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 40000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'video_1920x1080',\n },\n name: 'Full HD Video',\n dimensions: { width: 1920, height: 1080 },\n aspect_ratio: '16:9',\n file_types: ['mp4', 'webm'],\n max_file_size: 10000000,\n duration_range: { min: 6, max: 30 },\n },\n];\n\n/**\n * Circuit Breaker for handling agent failures\n */\nexport class CircuitBreaker {\n private failures = 0;\n private lastFailTime = 0;\n private state: 'closed' | 'open' | 'half-open' = 'closed';\n private readonly failureThreshold = 5;\n private readonly resetTimeout = 60000; // 1 minute\n\n constructor(private agentId: string) {}\n\n async call<T>(fn: () => Promise<T>): Promise<T> {\n if (this.state === 'open') {\n if (Date.now() - this.lastFailTime > this.resetTimeout) {\n this.state = 'half-open';\n logger.info(`🔄 Circuit breaker for ${this.agentId} attempting to close...`);\n } else {\n throw new Error(`Circuit breaker is open for agent ${this.agentId}`);\n }\n }\n\n try {\n const result = await fn();\n this.onSuccess();\n return result;\n } catch (error) {\n this.onFailure();\n throw error;\n }\n }\n\n private onSuccess(): void {\n this.failures = 0;\n if (this.state === 'half-open') {\n this.state = 'closed';\n logger.info(`✅ Circuit breaker for ${this.agentId} closed successfully`);\n }\n }\n\n private onFailure(): void {\n this.failures++;\n this.lastFailTime = Date.now();\n\n if (this.failures >= this.failureThreshold) {\n this.state = 'open';\n logger.warn(`🚨 Circuit breaker opened for agent ${this.agentId} after ${this.failures} failures`);\n }\n }\n}\n\n// Circuit breaker instances for each agent\nconst circuitBreakers = new Map<string, CircuitBreaker>();\n\nexport function getCircuitBreaker(agentId: string): CircuitBreaker {\n if (!circuitBreakers.has(agentId)) {\n circuitBreakers.set(agentId, new CircuitBreaker(agentId));\n }\n return circuitBreakers.get(agentId)!;\n}\n\n/**\n * Get standard creative formats\n */\nexport function getStandardFormats(): CreativeFormat[] {\n return STANDARD_FORMATS;\n}\n\n// Re-export response unwrapping utilities\nexport {\n unwrapProtocolResponse,\n isAdcpError,\n isAdcpSuccess,\n isTerminalAdcpError,\n hasAdvisorySuccessPayload,\n} from './response-unwrapper';\nexport type { AdCPResponse } from './response-unwrapper';\nexport {\n ensureGetProductsCacheScope,\n validateGetProductsCacheScope,\n type EnsureGetProductsCacheScopeOptions,\n type GetProductsCacheScope,\n type GetProductsResponseWithCacheScope,\n type GetProductsCacheScopeValidation,\n} from './get-products-cache-scope';\nexport { getAuthoritativeMediaBuyStatus, isMediaBuyStatus } from './media-buy-status';\nexport {\n resolveTaskState,\n type EffectiveTaskState,\n type ResolvedTaskState,\n type ResolveTaskStateOptions,\n} from './task-state';\n\n// Lightweight MCP CallToolResult extractor (prefers structuredContent, falls back to JSON text).\nexport { extractResult, type ToolCallResultLike } from './extract-result';\n\n// Re-export retry utilities\nexport { isRetryable, getRetryDelay } from './retry';\n\n// Re-export error extraction utilities\nexport {\n extractAdcpErrorFromMcp,\n extractAdcpErrorFromTransport,\n extractAdcpErrorInfo,\n extractCorrelationId,\n resolveRecovery,\n getExpectedAction,\n} from './error-extraction';\nexport type { ExtractedAdcpError } from './error-extraction';\n\n// Re-export protocol detection utilities\nexport { detectProtocol, detectProtocolWithTimeout } from './protocol-detection';\n\n// Re-export A2A discovery utilities\nexport {\n A2A_CARD_PATHS,\n TRANSPORT_SUFFIX_REGEX,\n isAgentCardPath,\n isWellKnownAgentCardUrl,\n buildCardUrls,\n stripAgentCardPath,\n stripTransportSuffix,\n} from './a2a-discovery';\n\n// Re-export format asset utilities\nexport {\n getFormatAssets,\n getRequiredAssets,\n getOptionalAssets,\n getIndividualAssets,\n getRepeatableGroups,\n usesDeprecatedAssetsField,\n getAssetCount,\n hasAssets,\n} from './format-assets';\n\n// Re-export pricing adapter utilities (v3 pricing field compatibility)\nexport {\n adaptGetProductsRequestForV2,\n normalizeProductChannels,\n adaptPricingOptionForV2,\n normalizePricingOption,\n normalizeProductPricing,\n normalizeGetProductsResponse,\n usesV2PricingFields,\n usesV3PricingFields,\n isFixedPricing,\n isCPAPricing,\n getPrice,\n getFloorPrice,\n type PricingOptionV2,\n type PricingOptionV3,\n type PriceGuidanceV2,\n type PriceGuidanceV3,\n} from './pricing-adapter';\n\n// Re-export sync creatives adapter (v2/v3 compatibility)\nexport { adaptSyncCreativesRequestForV2 } from './sync-creatives-adapter';\n\n// Re-export creative delivery helpers for package-scoped inline creatives\nexport { inlineCreativesForPackages } from './creative-delivery';\nexport type {\n InlineCreativeAssignment,\n InlineCreativePackage,\n InlineCreativePackagePatch,\n InlineCreativesForPackagesOptions,\n} from './creative-delivery';\n\n// Re-export pagination utilities\nexport { paginate, paginatePages, type PaginateOptions } from './pagination';\n"],"mappings":"AAGA,SAAS,QAAQ,oBAAsD;AACvE,SAAS,UAAAA,eAAc;AAGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAGA,MAAM,kBAAkB,SAAS,QAAQ,IAAI,mBAAmB,OAAO;AACvE,MAAM,iBAA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SAAS,aAAa,qBAAqB;AAG3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,gBAAgB,iCAAiC;AAG1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAGP,SAAS,sCAAsC;AAG/C,SAAS,kCAAkC;AAS3C,SAAS,UAAU,qBAA2C;","names":["logger"]}
1
+ {"version":3,"sources":["../../../src/lib/utils/index.ts"],"sourcesContent":["import type { LegacyCreativeFormatSummary } from '../types';\n\n// Re-export logger utilities\nexport { logger, createLogger, type LogLevel, type LoggerConfig } from './logger';\nimport { logger } from './logger';\n\n// Re-export preview utilities\nexport {\n batchPreviewProducts,\n batchPreviewFormatsLegacy,\n clearPreviewCache,\n type PreviewResult,\n type LegacyPreviewResult,\n type BatchPreviewOptions,\n type PreviewCacheBackend,\n type PreviewCacheEntry,\n} from './preview-utils';\n\n// Configuration constants\nexport const REQUEST_TIMEOUT = parseInt(process.env.REQUEST_TIMEOUT || '30000'); // 30 seconds\nexport const MAX_CONCURRENT = parseInt(process.env.MAX_CONCURRENT || '5');\n\n// Legacy named creative formats (hardcoded migration fixtures)\nexport const LEGACY_STANDARD_FORMATS: LegacyCreativeFormatSummary[] = [\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_728x90',\n },\n name: 'Leaderboard',\n dimensions: { width: 728, height: 90 },\n aspect_ratio: '8:1',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 150000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_300x250',\n },\n name: 'Medium Rectangle',\n dimensions: { width: 300, height: 250 },\n aspect_ratio: '6:5',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 150000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'banner_320x50',\n },\n name: 'Mobile Banner',\n dimensions: { width: 320, height: 50 },\n aspect_ratio: '32:5',\n file_types: ['jpg', 'jpeg', 'png', 'gif'],\n max_file_size: 40000,\n },\n {\n format_id: {\n agent_url: 'https://creatives.adcontextprotocol.org',\n id: 'video_1920x1080',\n },\n name: 'Full HD Video',\n dimensions: { width: 1920, height: 1080 },\n aspect_ratio: '16:9',\n file_types: ['mp4', 'webm'],\n max_file_size: 10000000,\n duration_range: { min: 6, max: 30 },\n },\n];\n\n/**\n * Circuit Breaker for handling agent failures\n */\nexport class CircuitBreaker {\n private failures = 0;\n private lastFailTime = 0;\n private state: 'closed' | 'open' | 'half-open' = 'closed';\n private readonly failureThreshold = 5;\n private readonly resetTimeout = 60000; // 1 minute\n\n constructor(private agentId: string) {}\n\n async call<T>(fn: () => Promise<T>): Promise<T> {\n if (this.state === 'open') {\n if (Date.now() - this.lastFailTime > this.resetTimeout) {\n this.state = 'half-open';\n logger.info(`🔄 Circuit breaker for ${this.agentId} attempting to close...`);\n } else {\n throw new Error(`Circuit breaker is open for agent ${this.agentId}`);\n }\n }\n\n try {\n const result = await fn();\n this.onSuccess();\n return result;\n } catch (error) {\n this.onFailure();\n throw error;\n }\n }\n\n private onSuccess(): void {\n this.failures = 0;\n if (this.state === 'half-open') {\n this.state = 'closed';\n logger.info(`✅ Circuit breaker for ${this.agentId} closed successfully`);\n }\n }\n\n private onFailure(): void {\n this.failures++;\n this.lastFailTime = Date.now();\n\n if (this.failures >= this.failureThreshold) {\n this.state = 'open';\n logger.warn(`🚨 Circuit breaker opened for agent ${this.agentId} after ${this.failures} failures`);\n }\n }\n}\n\n// Circuit breaker instances for each agent\nconst circuitBreakers = new Map<string, CircuitBreaker>();\n\nexport function getCircuitBreaker(agentId: string): CircuitBreaker {\n if (!circuitBreakers.has(agentId)) {\n circuitBreakers.set(agentId, new CircuitBreaker(agentId));\n }\n return circuitBreakers.get(agentId)!;\n}\n\n/**\n * Get legacy named creative formats for migration tooling.\n */\nexport function getStandardFormatsLegacy(): LegacyCreativeFormatSummary[] {\n return LEGACY_STANDARD_FORMATS;\n}\n\n// Re-export response unwrapping utilities\nexport {\n unwrapProtocolResponse,\n isAdcpError,\n isAdcpSuccess,\n isTerminalAdcpError,\n hasAdvisorySuccessPayload,\n} from './response-unwrapper';\nexport type { AdCPResponse } from './response-unwrapper';\nexport {\n ensureGetProductsCacheScope,\n validateGetProductsCacheScope,\n type EnsureGetProductsCacheScopeOptions,\n type GetProductsCacheScope,\n type GetProductsResponseWithCacheScope,\n type GetProductsCacheScopeValidation,\n} from './get-products-cache-scope';\nexport { getAuthoritativeMediaBuyStatus, isMediaBuyStatus } from './media-buy-status';\nexport {\n resolveTaskState,\n type EffectiveTaskState,\n type ResolvedTaskState,\n type ResolveTaskStateOptions,\n} from './task-state';\n\n// Lightweight MCP CallToolResult extractor (prefers structuredContent, falls back to JSON text).\nexport { extractResult, type ToolCallResultLike } from './extract-result';\n\n// Re-export retry utilities\nexport { isRetryable, getRetryDelay } from './retry';\n\n// Re-export error extraction utilities\nexport {\n extractAdcpErrorFromMcp,\n extractAdcpErrorFromTransport,\n extractAdcpErrorInfo,\n extractCorrelationId,\n resolveRecovery,\n getExpectedAction,\n} from './error-extraction';\nexport type { ExtractedAdcpError } from './error-extraction';\n\n// Re-export protocol detection utilities\nexport { detectProtocol, detectProtocolWithTimeout } from './protocol-detection';\n\n// Re-export A2A discovery utilities\nexport {\n A2A_CARD_PATHS,\n TRANSPORT_SUFFIX_REGEX,\n isAgentCardPath,\n isWellKnownAgentCardUrl,\n buildCardUrls,\n stripAgentCardPath,\n stripTransportSuffix,\n} from './a2a-discovery';\n\n// Re-export format asset utilities\nexport {\n getFormatAssets,\n getRequiredAssets,\n getOptionalAssets,\n getIndividualAssets,\n getRepeatableGroups,\n usesDeprecatedAssetsField,\n getAssetCount,\n hasAssets,\n type CanonicalFormatAssetSlot,\n type FormatAssetsInput,\n type IndividualFormatAssetSlot,\n type RepeatableFormatAssetGroup,\n} from './format-assets';\n\n// Re-export pricing adapter utilities (v3 pricing field compatibility)\nexport {\n adaptGetProductsRequestForV2,\n normalizeProductChannels,\n adaptPricingOptionForV2,\n normalizePricingOption,\n normalizeProductPricing,\n normalizeGetProductsResponse,\n usesV2PricingFields,\n usesV3PricingFields,\n isFixedPricing,\n isCPAPricing,\n getPrice,\n getFloorPrice,\n type PricingOptionV2,\n type PricingOptionV3,\n type PriceGuidanceV2,\n type PriceGuidanceV3,\n} from './pricing-adapter';\n\n// Re-export sync creatives adapter (v2/v3 compatibility)\nexport { adaptSyncCreativesRequestForV2 } from './sync-creatives-adapter';\n\n// Re-export creative delivery helpers for package-scoped inline creatives\nexport { inlineCreativesForPackages, inlineCreativesForPackagesLegacy } from './creative-delivery';\nexport type {\n InlineCreativeAssignment,\n InlineCreativePackage,\n InlineCreativePackagePatch,\n InlineCreativesForPackagesOptions,\n InlineCreativesForPackagesLegacyOptions,\n LegacyInlineCreativePackage,\n} from './creative-delivery';\n\n// Re-export pagination utilities\nexport { paginate, paginatePages, type PaginateOptions } from './pagination';\n"],"mappings":"AAGA,SAAS,QAAQ,oBAAsD;AACvE,SAAS,UAAAA,eAAc;AAGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAGA,MAAM,kBAAkB,SAAS,QAAQ,IAAI,mBAAmB,OAAO;AACvE,MAAM,iBAAiB,SAAS,QAAQ,IAAI,kBAAkB,GAAG;AAGjE,MAAM,0BAAyD;AAAA,EACpE;AAAA,IACE,WAAW;AAAA,MACT,WAAW;AAAA,MACX,IAAI;AAAA,IACN;AAAA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D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAGP,SAAS,sCAAsC;AAG/C,SAAS,4BAA4B,wCAAwC;AAW7E,SAAS,UAAU,qBAA2C;","names":["logger"]}
@@ -1,11 +1,12 @@
1
1
  import type { SingleAgentClient } from '../core/SingleAgentClient.mjs';
2
2
  import type { Format, Product } from '../types/tools.generated.mjs';
3
+ import type { CanonicalProduct } from '../v2/projection/creative-delivery.mjs';
3
4
  /**
4
- * Preview result for a single item (product or format)
5
+ * Preview result for a single canonical item.
5
6
  */
6
- export interface PreviewResult {
7
- /** The item being previewed (Product or Format) */
8
- item: Product | Format;
7
+ export interface PreviewResult<TItem = CanonicalProduct> {
8
+ /** The item being previewed. */
9
+ item: TItem;
9
10
  /** Preview URL for the rendered card */
10
11
  previewUrl?: string;
11
12
  /** Preview ID from the creative agent */
@@ -13,6 +14,8 @@ export interface PreviewResult {
13
14
  /** Error message if preview failed */
14
15
  error?: string;
15
16
  }
17
+ /** Raw named-format preview result for explicit migration tooling. */
18
+ export type LegacyPreviewResult = PreviewResult<Product | Format>;
16
19
  /**
17
20
  * Options for batch preview generation
18
21
  */
@@ -98,9 +101,9 @@ export declare function clearPreviewCache(): void;
98
101
  * @deprecated Use `product.product_card?.image?.url` directly. This wrapper
99
102
  * only exists for 8.0-beta migration ergonomics and will be removed.
100
103
  */
101
- export declare function batchPreviewProducts(products: Product[], _creativeAgentClient: SingleAgentClient, _options?: BatchPreviewOptions): Promise<PreviewResult[]>;
104
+ export declare function batchPreviewProducts(products: CanonicalProduct[], _creativeAgentClient: SingleAgentClient, _options?: BatchPreviewOptions): Promise<PreviewResult[]>;
102
105
  /**
103
- * Generate batch previews for formats with format_card manifests
106
+ * Generate batch previews for legacy named formats with format_card manifests.
104
107
  *
105
108
  * Formats with format_card fields will have their cards rendered via the creative agent.
106
109
  * Formats without format_card will be returned with no preview.
@@ -119,7 +122,7 @@ export declare function batchPreviewProducts(products: Product[], _creativeAgent
119
122
  * protocol: 'mcp'
120
123
  * });
121
124
  *
122
- * const previews = await batchPreviewFormats(formats, creativeAgent);
125
+ * const previews = await batchPreviewFormatsLegacy(formats, creativeAgent);
123
126
  * previews.forEach(p => {
124
127
  * if (p.previewUrl) {
125
128
  * console.log(`${(p.item as Format).name}: ${p.previewUrl}`);
@@ -127,4 +130,4 @@ export declare function batchPreviewProducts(products: Product[], _creativeAgent
127
130
  * });
128
131
  * ```
129
132
  */
130
- export declare function batchPreviewFormats(formats: Format[], creativeAgentClient: SingleAgentClient, options?: BatchPreviewOptions): Promise<PreviewResult[]>;
133
+ export declare function batchPreviewFormatsLegacy(formats: Format[], creativeAgentClient: SingleAgentClient, options?: BatchPreviewOptions): Promise<LegacyPreviewResult[]>;
@@ -1,11 +1,12 @@
1
1
  import type { SingleAgentClient } from '../core/SingleAgentClient';
2
2
  import type { Format, Product } from '../types/tools.generated';
3
+ import type { CanonicalProduct } from '../v2/projection/creative-delivery';
3
4
  /**
4
- * Preview result for a single item (product or format)
5
+ * Preview result for a single canonical item.
5
6
  */
6
- export interface PreviewResult {
7
- /** The item being previewed (Product or Format) */
8
- item: Product | Format;
7
+ export interface PreviewResult<TItem = CanonicalProduct> {
8
+ /** The item being previewed. */
9
+ item: TItem;
9
10
  /** Preview URL for the rendered card */
10
11
  previewUrl?: string;
11
12
  /** Preview ID from the creative agent */
@@ -13,6 +14,8 @@ export interface PreviewResult {
13
14
  /** Error message if preview failed */
14
15
  error?: string;
15
16
  }
17
+ /** Raw named-format preview result for explicit migration tooling. */
18
+ export type LegacyPreviewResult = PreviewResult<Product | Format>;
16
19
  /**
17
20
  * Options for batch preview generation
18
21
  */
@@ -98,9 +101,9 @@ export declare function clearPreviewCache(): void;
98
101
  * @deprecated Use `product.product_card?.image?.url` directly. This wrapper
99
102
  * only exists for 8.0-beta migration ergonomics and will be removed.
100
103
  */
101
- export declare function batchPreviewProducts(products: Product[], _creativeAgentClient: SingleAgentClient, _options?: BatchPreviewOptions): Promise<PreviewResult[]>;
104
+ export declare function batchPreviewProducts(products: CanonicalProduct[], _creativeAgentClient: SingleAgentClient, _options?: BatchPreviewOptions): Promise<PreviewResult[]>;
102
105
  /**
103
- * Generate batch previews for formats with format_card manifests
106
+ * Generate batch previews for legacy named formats with format_card manifests.
104
107
  *
105
108
  * Formats with format_card fields will have their cards rendered via the creative agent.
106
109
  * Formats without format_card will be returned with no preview.
@@ -119,7 +122,7 @@ export declare function batchPreviewProducts(products: Product[], _creativeAgent
119
122
  * protocol: 'mcp'
120
123
  * });
121
124
  *
122
- * const previews = await batchPreviewFormats(formats, creativeAgent);
125
+ * const previews = await batchPreviewFormatsLegacy(formats, creativeAgent);
123
126
  * previews.forEach(p => {
124
127
  * if (p.previewUrl) {
125
128
  * console.log(`${(p.item as Format).name}: ${p.previewUrl}`);
@@ -127,5 +130,5 @@ export declare function batchPreviewProducts(products: Product[], _creativeAgent
127
130
  * });
128
131
  * ```
129
132
  */
130
- export declare function batchPreviewFormats(formats: Format[], creativeAgentClient: SingleAgentClient, options?: BatchPreviewOptions): Promise<PreviewResult[]>;
133
+ export declare function batchPreviewFormatsLegacy(formats: Format[], creativeAgentClient: SingleAgentClient, options?: BatchPreviewOptions): Promise<LegacyPreviewResult[]>;
131
134
  //# sourceMappingURL=preview-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"preview-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/preview-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA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;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAC5G,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,KAAK,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC;AAqFD;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,oBAAoB,EAAE,iBAAiB,EACvC,QAAQ,GAAE,mBAAwB,GACjC,OAAO,CAAC,aAAa,EAAE,CAAC,CAQ1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,MAAM,EAAE,EACjB,mBAAmB,EAAE,iBAAiB,EACtC,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA2IhC"}
@@ -18,7 +18,7 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var preview_utils_exports = {};
20
20
  __export(preview_utils_exports, {
21
- batchPreviewFormats: () => batchPreviewFormats,
21
+ batchPreviewFormatsLegacy: () => batchPreviewFormatsLegacy,
22
22
  batchPreviewProducts: () => batchPreviewProducts,
23
23
  clearPreviewCache: () => clearPreviewCache
24
24
  });
@@ -78,7 +78,7 @@ async function batchPreviewProducts(products, _creativeAgentClient, _options = {
78
78
  return { item: product };
79
79
  });
80
80
  }
81
- async function batchPreviewFormats(formats, creativeAgentClient, options = {}) {
81
+ async function batchPreviewFormatsLegacy(formats, creativeAgentClient, options = {}) {
82
82
  const cacheTtl = options.cacheTtl ?? 36e5;
83
83
  const skipCache = options.skipCache ?? false;
84
84
  const cacheBackend = options.cacheBackend ?? defaultPreviewCacheBackend;
@@ -138,7 +138,7 @@ async function batchPreviewFormats(formats, creativeAgentClient, options = {}) {
138
138
  // manifest contains the asset map (format, etc)
139
139
  }
140
140
  };
141
- const response = await creativeAgentClient.previewCreative(previewRequest);
141
+ const response = await creativeAgentClient.previewCreativeLegacy(previewRequest);
142
142
  const responseData = response.data;
143
143
  if (responseData && "previews" in responseData && responseData.previews && responseData.previews.length > 0) {
144
144
  const preview = responseData.previews[0];
@@ -185,7 +185,7 @@ async function batchPreviewFormats(formats, creativeAgentClient, options = {}) {
185
185
  }
186
186
  // Annotate the CommonJS export names for ESM import in node:
187
187
  0 && (module.exports = {
188
- batchPreviewFormats,
188
+ batchPreviewFormatsLegacy,
189
189
  batchPreviewProducts,
190
190
  clearPreviewCache
191
191
  });