@adcp/sdk 6.6.0 → 6.7.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 (1156) hide show
  1. package/ADCP_VERSION +1 -1
  2. package/AGENTS.md +4 -0
  3. package/README.md +29 -16
  4. package/bin/adcp-resolve.js +166 -0
  5. package/bin/adcp.js +450 -11
  6. package/compliance/cache/{3.0.1 → 3.0.5}/index.json +2 -2
  7. package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/audience-sync/index.yaml +1 -1
  8. package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/brand-rights/index.yaml +3 -3
  9. package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-social/index.yaml +7 -0
  10. package/compliance/cache/{3.0.1 → 3.0.5}/universal/runner-output-contract.yaml +23 -4
  11. package/compliance/cache/{3.0.1 → 3.0.5}/universal/storyboard-schema.yaml +106 -1
  12. package/compliance/cache/{3.0.1 → 3.0.5}/universal/v3-envelope-integrity.yaml +4 -2
  13. package/dist/lib/adapters/implicit-account-store.d.ts +170 -0
  14. package/dist/lib/adapters/implicit-account-store.d.ts.map +1 -0
  15. package/dist/lib/adapters/implicit-account-store.js +313 -0
  16. package/dist/lib/adapters/implicit-account-store.js.map +1 -0
  17. package/dist/lib/adapters/index.d.ts +4 -0
  18. package/dist/lib/adapters/index.d.ts.map +1 -1
  19. package/dist/lib/adapters/index.js +19 -1
  20. package/dist/lib/adapters/index.js.map +1 -1
  21. package/dist/lib/adapters/oauth-passthrough-resolver.d.ts +191 -0
  22. package/dist/lib/adapters/oauth-passthrough-resolver.d.ts.map +1 -0
  23. package/dist/lib/adapters/oauth-passthrough-resolver.js +178 -0
  24. package/dist/lib/adapters/oauth-passthrough-resolver.js.map +1 -0
  25. package/dist/lib/adapters/roster-account-store.d.ts +221 -0
  26. package/dist/lib/adapters/roster-account-store.d.ts.map +1 -0
  27. package/dist/lib/adapters/roster-account-store.js +194 -0
  28. package/dist/lib/adapters/roster-account-store.js.map +1 -0
  29. package/dist/lib/auth/oauth/ClientCredentialsFlow.d.ts.map +1 -1
  30. package/dist/lib/auth/oauth/ClientCredentialsFlow.js +5 -1
  31. package/dist/lib/auth/oauth/ClientCredentialsFlow.js.map +1 -1
  32. package/dist/lib/auth/oauth/discovery.d.ts.map +1 -1
  33. package/dist/lib/auth/oauth/discovery.js +6 -1
  34. package/dist/lib/auth/oauth/discovery.js.map +1 -1
  35. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  36. package/dist/lib/core/SingleAgentClient.d.ts +22 -0
  37. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  38. package/dist/lib/core/SingleAgentClient.js +86 -23
  39. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  40. package/dist/lib/index.d.ts +3 -3
  41. package/dist/lib/index.d.ts.map +1 -1
  42. package/dist/lib/index.js +22 -7
  43. package/dist/lib/index.js.map +1 -1
  44. package/dist/lib/mock-server/creative-template/server.d.ts.map +1 -1
  45. package/dist/lib/mock-server/creative-template/server.js +54 -9
  46. package/dist/lib/mock-server/creative-template/server.js.map +1 -1
  47. package/dist/lib/mock-server/index.d.ts +27 -1
  48. package/dist/lib/mock-server/index.d.ts.map +1 -1
  49. package/dist/lib/mock-server/index.js +127 -9
  50. package/dist/lib/mock-server/index.js.map +1 -1
  51. package/dist/lib/mock-server/sales-guaranteed/seed-data.d.ts +46 -0
  52. package/dist/lib/mock-server/sales-guaranteed/seed-data.d.ts.map +1 -0
  53. package/dist/lib/mock-server/sales-guaranteed/seed-data.js +167 -0
  54. package/dist/lib/mock-server/sales-guaranteed/seed-data.js.map +1 -0
  55. package/dist/lib/mock-server/sales-guaranteed/server.d.ts +14 -0
  56. package/dist/lib/mock-server/sales-guaranteed/server.d.ts.map +1 -0
  57. package/dist/lib/mock-server/sales-guaranteed/server.js +893 -0
  58. package/dist/lib/mock-server/sales-guaranteed/server.js.map +1 -0
  59. package/dist/lib/mock-server/sales-social/seed-data.d.ts +34 -0
  60. package/dist/lib/mock-server/sales-social/seed-data.d.ts.map +1 -0
  61. package/dist/lib/mock-server/sales-social/seed-data.js +42 -0
  62. package/dist/lib/mock-server/sales-social/seed-data.js.map +1 -0
  63. package/dist/lib/mock-server/sales-social/server.d.ts +17 -0
  64. package/dist/lib/mock-server/sales-social/server.d.ts.map +1 -0
  65. package/dist/lib/mock-server/sales-social/server.js +1219 -0
  66. package/dist/lib/mock-server/sales-social/server.js.map +1 -0
  67. package/dist/lib/mock-server/signal-marketplace/server.d.ts.map +1 -1
  68. package/dist/lib/mock-server/signal-marketplace/server.js +58 -9
  69. package/dist/lib/mock-server/signal-marketplace/server.js.map +1 -1
  70. package/dist/lib/protocols/mcp.d.ts +4 -4
  71. package/dist/lib/protocols/mcp.d.ts.map +1 -1
  72. package/dist/lib/protocols/mcp.js +19 -13
  73. package/dist/lib/protocols/mcp.js.map +1 -1
  74. package/dist/lib/schemas-data/3.0/a2ui/bound-value.json +1 -1
  75. package/dist/lib/schemas-data/3.0/a2ui/component.json +1 -1
  76. package/dist/lib/schemas-data/3.0/a2ui/si-catalog.json +25 -25
  77. package/dist/lib/schemas-data/3.0/a2ui/surface.json +2 -2
  78. package/dist/lib/schemas-data/3.0/a2ui/user-action.json +1 -1
  79. package/dist/lib/schemas-data/3.0/account/get-account-financials-request.json +5 -5
  80. package/dist/lib/schemas-data/3.0/account/get-account-financials-response.json +10 -10
  81. package/dist/lib/schemas-data/3.0/account/list-accounts-request.json +4 -4
  82. package/dist/lib/schemas-data/3.0/account/list-accounts-response.json +6 -6
  83. package/dist/lib/schemas-data/3.0/account/report-usage-request.json +5 -5
  84. package/dist/lib/schemas-data/3.0/account/report-usage-response.json +4 -4
  85. package/dist/lib/schemas-data/3.0/account/sync-accounts-request.json +9 -9
  86. package/dist/lib/schemas-data/3.0/account/sync-accounts-response.json +12 -12
  87. package/dist/lib/schemas-data/3.0/account/sync-governance-request.json +5 -5
  88. package/dist/lib/schemas-data/3.0/account/sync-governance-response.json +8 -8
  89. package/dist/lib/schemas-data/3.0/adagents.json +32 -32
  90. package/dist/lib/schemas-data/3.0/brand/acquire-rights-request.json +8 -8
  91. package/dist/lib/schemas-data/3.0/brand/acquire-rights-response.json +14 -14
  92. package/dist/lib/schemas-data/3.0/brand/creative-approval-request.json +4 -4
  93. package/dist/lib/schemas-data/3.0/brand/creative-approval-response.json +10 -10
  94. package/dist/lib/schemas-data/3.0/brand/get-brand-identity-request.json +3 -3
  95. package/dist/lib/schemas-data/3.0/brand/get-brand-identity-response.json +8 -8
  96. package/dist/lib/schemas-data/3.0/brand/get-rights-request.json +7 -7
  97. package/dist/lib/schemas-data/3.0/brand/get-rights-response.json +9 -9
  98. package/dist/lib/schemas-data/3.0/brand/revocation-notification.json +4 -4
  99. package/dist/lib/schemas-data/3.0/brand/rights-pricing-option.json +5 -5
  100. package/dist/lib/schemas-data/3.0/brand/rights-terms.json +3 -3
  101. package/dist/lib/schemas-data/3.0/brand/update-rights-request.json +4 -4
  102. package/dist/lib/schemas-data/3.0/brand/update-rights-response.json +9 -9
  103. package/dist/lib/schemas-data/3.0/brand.json +14 -14
  104. package/dist/lib/schemas-data/3.0/bundled/content-standards/calibrate-content-request.json +2 -2
  105. package/dist/lib/schemas-data/3.0/bundled/content-standards/calibrate-content-response.json +35 -4
  106. package/dist/lib/schemas-data/3.0/bundled/content-standards/create-content-standards-request.json +2 -2
  107. package/dist/lib/schemas-data/3.0/bundled/content-standards/create-content-standards-response.json +35 -4
  108. package/dist/lib/schemas-data/3.0/bundled/content-standards/get-content-standards-request.json +2 -2
  109. package/dist/lib/schemas-data/3.0/bundled/content-standards/get-content-standards-response.json +35 -4
  110. package/dist/lib/schemas-data/3.0/bundled/content-standards/get-media-buy-artifacts-request.json +2 -2
  111. package/dist/lib/schemas-data/3.0/bundled/content-standards/get-media-buy-artifacts-response.json +35 -4
  112. package/dist/lib/schemas-data/3.0/bundled/content-standards/list-content-standards-request.json +2 -2
  113. package/dist/lib/schemas-data/3.0/bundled/content-standards/list-content-standards-response.json +35 -4
  114. package/dist/lib/schemas-data/3.0/bundled/content-standards/update-content-standards-request.json +2 -2
  115. package/dist/lib/schemas-data/3.0/bundled/content-standards/update-content-standards-response.json +35 -4
  116. package/dist/lib/schemas-data/3.0/bundled/content-standards/validate-content-delivery-request.json +2 -2
  117. package/dist/lib/schemas-data/3.0/bundled/content-standards/validate-content-delivery-response.json +35 -4
  118. package/dist/lib/schemas-data/3.0/bundled/core/tasks-get-request.json +2 -2
  119. package/dist/lib/schemas-data/3.0/bundled/core/tasks-get-response.json +2 -2
  120. package/dist/lib/schemas-data/3.0/bundled/core/tasks-list-request.json +2 -2
  121. package/dist/lib/schemas-data/3.0/bundled/core/tasks-list-response.json +2 -2
  122. package/dist/lib/schemas-data/3.0/bundled/creative/get-creative-delivery-request.json +2 -2
  123. package/dist/lib/schemas-data/3.0/bundled/creative/get-creative-delivery-response.json +40 -6
  124. package/dist/lib/schemas-data/3.0/bundled/creative/get-creative-features-request.json +7 -4
  125. package/dist/lib/schemas-data/3.0/bundled/creative/get-creative-features-response.json +35 -4
  126. package/dist/lib/schemas-data/3.0/bundled/creative/list-creative-formats-request.json +2 -2
  127. package/dist/lib/schemas-data/3.0/bundled/creative/list-creative-formats-response.json +38 -7
  128. package/dist/lib/schemas-data/3.0/bundled/creative/list-creatives-request.json +2 -2
  129. package/dist/lib/schemas-data/3.0/bundled/creative/list-creatives-response.json +40 -6
  130. package/dist/lib/schemas-data/3.0/bundled/creative/preview-creative-request.json +11 -5
  131. package/dist/lib/schemas-data/3.0/bundled/creative/preview-creative-response.json +40 -6
  132. package/dist/lib/schemas-data/3.0/bundled/creative/sync-creatives-request.json +7 -4
  133. package/dist/lib/schemas-data/3.0/bundled/creative/sync-creatives-response.json +101 -8
  134. package/dist/lib/schemas-data/3.0/bundled/media-buy/build-creative-request.json +7 -4
  135. package/dist/lib/schemas-data/3.0/bundled/media-buy/build-creative-response.json +110 -11
  136. package/dist/lib/schemas-data/3.0/bundled/media-buy/create-media-buy-request.json +7 -4
  137. package/dist/lib/schemas-data/3.0/bundled/media-buy/create-media-buy-response.json +68 -6
  138. package/dist/lib/schemas-data/3.0/bundled/media-buy/get-media-buy-delivery-request.json +2 -2
  139. package/dist/lib/schemas-data/3.0/bundled/media-buy/get-media-buy-delivery-response.json +35 -4
  140. package/dist/lib/schemas-data/3.0/bundled/media-buy/get-media-buys-request.json +2 -2
  141. package/dist/lib/schemas-data/3.0/bundled/media-buy/get-media-buys-response.json +35 -4
  142. package/dist/lib/schemas-data/3.0/bundled/media-buy/get-products-request.json +2 -2
  143. package/dist/lib/schemas-data/3.0/bundled/media-buy/get-products-response.json +35 -4
  144. package/dist/lib/schemas-data/3.0/bundled/media-buy/list-creative-formats-request.json +2 -2
  145. package/dist/lib/schemas-data/3.0/bundled/media-buy/list-creative-formats-response.json +38 -7
  146. package/dist/lib/schemas-data/3.0/bundled/media-buy/log-event-request.json +2 -2
  147. package/dist/lib/schemas-data/3.0/bundled/media-buy/log-event-response.json +35 -4
  148. package/dist/lib/schemas-data/3.0/bundled/media-buy/package-request.json +7 -4
  149. package/dist/lib/schemas-data/3.0/bundled/media-buy/provide-performance-feedback-request.json +2 -2
  150. package/dist/lib/schemas-data/3.0/bundled/media-buy/provide-performance-feedback-response.json +35 -4
  151. package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-audiences-request.json +2 -2
  152. package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-audiences-response.json +68 -6
  153. package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-catalogs-request.json +2 -2
  154. package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-catalogs-response.json +68 -6
  155. package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-event-sources-request.json +2 -2
  156. package/dist/lib/schemas-data/3.0/bundled/media-buy/sync-event-sources-response.json +68 -6
  157. package/dist/lib/schemas-data/3.0/bundled/media-buy/update-media-buy-request.json +11 -5
  158. package/dist/lib/schemas-data/3.0/bundled/media-buy/update-media-buy-response.json +35 -4
  159. package/dist/lib/schemas-data/3.0/bundled/property/create-property-list-request.json +2 -2
  160. package/dist/lib/schemas-data/3.0/bundled/property/create-property-list-response.json +2 -2
  161. package/dist/lib/schemas-data/3.0/bundled/property/delete-property-list-request.json +2 -2
  162. package/dist/lib/schemas-data/3.0/bundled/property/delete-property-list-response.json +2 -2
  163. package/dist/lib/schemas-data/3.0/bundled/property/get-property-list-request.json +2 -2
  164. package/dist/lib/schemas-data/3.0/bundled/property/get-property-list-response.json +2 -2
  165. package/dist/lib/schemas-data/3.0/bundled/property/list-property-lists-request.json +2 -2
  166. package/dist/lib/schemas-data/3.0/bundled/property/list-property-lists-response.json +2 -2
  167. package/dist/lib/schemas-data/3.0/bundled/property/update-property-list-request.json +2 -2
  168. package/dist/lib/schemas-data/3.0/bundled/property/update-property-list-response.json +2 -2
  169. package/dist/lib/schemas-data/3.0/bundled/property/validate-property-delivery-request.json +2 -2
  170. package/dist/lib/schemas-data/3.0/bundled/property/validate-property-delivery-response.json +2 -2
  171. package/dist/lib/schemas-data/3.0/bundled/protocol/get-adcp-capabilities-request.json +2 -2
  172. package/dist/lib/schemas-data/3.0/bundled/protocol/get-adcp-capabilities-response.json +36 -5
  173. package/dist/lib/schemas-data/3.0/bundled/signals/activate-signal-request.json +2 -2
  174. package/dist/lib/schemas-data/3.0/bundled/signals/activate-signal-response.json +35 -4
  175. package/dist/lib/schemas-data/3.0/bundled/signals/get-signals-request.json +2 -2
  176. package/dist/lib/schemas-data/3.0/bundled/signals/get-signals-response.json +35 -4
  177. package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-get-offering-request.json +2 -2
  178. package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-get-offering-response.json +35 -4
  179. package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-initiate-session-request.json +2 -2
  180. package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-initiate-session-response.json +35 -4
  181. package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-send-message-request.json +2 -2
  182. package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-send-message-response.json +35 -4
  183. package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-terminate-session-request.json +2 -2
  184. package/dist/lib/schemas-data/3.0/bundled/sponsored-intelligence/si-terminate-session-response.json +35 -4
  185. package/dist/lib/schemas-data/3.0/collection/base-collection-source.json +3 -3
  186. package/dist/lib/schemas-data/3.0/collection/collection-list-changed-webhook.json +2 -2
  187. package/dist/lib/schemas-data/3.0/collection/collection-list-filters.json +7 -7
  188. package/dist/lib/schemas-data/3.0/collection/collection-list.json +5 -5
  189. package/dist/lib/schemas-data/3.0/collection/create-collection-list-request.json +7 -7
  190. package/dist/lib/schemas-data/3.0/collection/create-collection-list-response.json +4 -4
  191. package/dist/lib/schemas-data/3.0/collection/delete-collection-list-request.json +4 -4
  192. package/dist/lib/schemas-data/3.0/collection/delete-collection-list-response.json +3 -3
  193. package/dist/lib/schemas-data/3.0/collection/get-collection-list-request.json +4 -4
  194. package/dist/lib/schemas-data/3.0/collection/get-collection-list-response.json +10 -10
  195. package/dist/lib/schemas-data/3.0/collection/list-collection-lists-request.json +5 -5
  196. package/dist/lib/schemas-data/3.0/collection/list-collection-lists-response.json +5 -5
  197. package/dist/lib/schemas-data/3.0/collection/update-collection-list-request.json +7 -7
  198. package/dist/lib/schemas-data/3.0/collection/update-collection-list-response.json +4 -4
  199. package/dist/lib/schemas-data/3.0/content-standards/artifact-webhook-payload.json +3 -3
  200. package/dist/lib/schemas-data/3.0/content-standards/artifact.json +7 -7
  201. package/dist/lib/schemas-data/3.0/content-standards/calibrate-content-request.json +4 -4
  202. package/dist/lib/schemas-data/3.0/content-standards/calibrate-content-response.json +8 -8
  203. package/dist/lib/schemas-data/3.0/content-standards/content-standards.json +7 -7
  204. package/dist/lib/schemas-data/3.0/content-standards/create-content-standards-request.json +7 -7
  205. package/dist/lib/schemas-data/3.0/content-standards/create-content-standards-response.json +6 -6
  206. package/dist/lib/schemas-data/3.0/content-standards/get-content-standards-request.json +3 -3
  207. package/dist/lib/schemas-data/3.0/content-standards/get-content-standards-response.json +7 -7
  208. package/dist/lib/schemas-data/3.0/content-standards/get-media-buy-artifacts-request.json +4 -4
  209. package/dist/lib/schemas-data/3.0/content-standards/get-media-buy-artifacts-response.json +8 -8
  210. package/dist/lib/schemas-data/3.0/content-standards/list-content-standards-request.json +5 -5
  211. package/dist/lib/schemas-data/3.0/content-standards/list-content-standards-response.json +8 -8
  212. package/dist/lib/schemas-data/3.0/content-standards/update-content-standards-request.json +7 -7
  213. package/dist/lib/schemas-data/3.0/content-standards/update-content-standards-response.json +6 -6
  214. package/dist/lib/schemas-data/3.0/content-standards/validate-content-delivery-request.json +4 -4
  215. package/dist/lib/schemas-data/3.0/content-standards/validate-content-delivery-response.json +8 -8
  216. package/dist/lib/schemas-data/3.0/core/account-ref.json +2 -2
  217. package/dist/lib/schemas-data/3.0/core/account.json +9 -9
  218. package/dist/lib/schemas-data/3.0/core/activation-key.json +1 -1
  219. package/dist/lib/schemas-data/3.0/core/ad-inventory-config.json +1 -1
  220. package/dist/lib/schemas-data/3.0/core/agent-encryption-key.json +1 -1
  221. package/dist/lib/schemas-data/3.0/core/agent-signing-key.json +1 -1
  222. package/dist/lib/schemas-data/3.0/core/app-item.json +4 -4
  223. package/dist/lib/schemas-data/3.0/core/assets/asset-union.json +53 -0
  224. package/dist/lib/schemas-data/3.0/core/assets/audio-asset.json +3 -3
  225. package/dist/lib/schemas-data/3.0/core/assets/brief-asset.json +2 -2
  226. package/dist/lib/schemas-data/3.0/core/assets/catalog-asset.json +2 -2
  227. package/dist/lib/schemas-data/3.0/core/assets/css-asset.json +2 -2
  228. package/dist/lib/schemas-data/3.0/core/assets/daast-asset.json +4 -4
  229. package/dist/lib/schemas-data/3.0/core/assets/html-asset.json +2 -2
  230. package/dist/lib/schemas-data/3.0/core/assets/image-asset.json +2 -2
  231. package/dist/lib/schemas-data/3.0/core/assets/javascript-asset.json +3 -3
  232. package/dist/lib/schemas-data/3.0/core/assets/markdown-asset.json +2 -2
  233. package/dist/lib/schemas-data/3.0/core/assets/text-asset.json +2 -2
  234. package/dist/lib/schemas-data/3.0/core/assets/url-asset.json +6 -5
  235. package/dist/lib/schemas-data/3.0/core/assets/vast-asset.json +4 -4
  236. package/dist/lib/schemas-data/3.0/core/assets/video-asset.json +7 -7
  237. package/dist/lib/schemas-data/3.0/core/assets/webhook-asset.json +7 -7
  238. package/dist/lib/schemas-data/3.0/core/async-response-data.json +25 -25
  239. package/dist/lib/schemas-data/3.0/core/attribution-window.json +4 -4
  240. package/dist/lib/schemas-data/3.0/core/audience-member.json +3 -3
  241. package/dist/lib/schemas-data/3.0/core/audience-selector.json +4 -4
  242. package/dist/lib/schemas-data/3.0/core/brand-id.json +1 -1
  243. package/dist/lib/schemas-data/3.0/core/brand-ref.json +2 -2
  244. package/dist/lib/schemas-data/3.0/core/business-entity.json +2 -2
  245. package/dist/lib/schemas-data/3.0/core/cancellation-policy.json +2 -2
  246. package/dist/lib/schemas-data/3.0/core/catalog-field-mapping.json +2 -2
  247. package/dist/lib/schemas-data/3.0/core/catalog.json +7 -7
  248. package/dist/lib/schemas-data/3.0/core/catchment.json +5 -5
  249. package/dist/lib/schemas-data/3.0/core/collection-distribution.json +2 -2
  250. package/dist/lib/schemas-data/3.0/core/collection-list-ref.json +1 -1
  251. package/dist/lib/schemas-data/3.0/core/collection-selector.json +1 -1
  252. package/dist/lib/schemas-data/3.0/core/collection.json +13 -13
  253. package/dist/lib/schemas-data/3.0/core/content-rating.json +2 -2
  254. package/dist/lib/schemas-data/3.0/core/context.json +1 -1
  255. package/dist/lib/schemas-data/3.0/core/creative-asset.json +6 -52
  256. package/dist/lib/schemas-data/3.0/core/creative-assignment.json +1 -1
  257. package/dist/lib/schemas-data/3.0/core/creative-brief.json +4 -4
  258. package/dist/lib/schemas-data/3.0/core/creative-consumption.json +1 -1
  259. package/dist/lib/schemas-data/3.0/core/creative-filters.json +4 -4
  260. package/dist/lib/schemas-data/3.0/core/creative-item.json +1 -1
  261. package/dist/lib/schemas-data/3.0/core/creative-manifest.json +7 -53
  262. package/dist/lib/schemas-data/3.0/core/creative-policy.json +3 -3
  263. package/dist/lib/schemas-data/3.0/core/creative-variable.json +1 -1
  264. package/dist/lib/schemas-data/3.0/core/creative-variant.json +5 -5
  265. package/dist/lib/schemas-data/3.0/core/data-provider-signal-selector.json +1 -1
  266. package/dist/lib/schemas-data/3.0/core/date-range.json +1 -1
  267. package/dist/lib/schemas-data/3.0/core/datetime-range.json +1 -1
  268. package/dist/lib/schemas-data/3.0/core/daypart-target.json +2 -2
  269. package/dist/lib/schemas-data/3.0/core/deadline-policy.json +1 -1
  270. package/dist/lib/schemas-data/3.0/core/delivery-forecast.json +7 -7
  271. package/dist/lib/schemas-data/3.0/core/delivery-metrics.json +5 -5
  272. package/dist/lib/schemas-data/3.0/core/deployment.json +3 -3
  273. package/dist/lib/schemas-data/3.0/core/destination-item.json +4 -4
  274. package/dist/lib/schemas-data/3.0/core/destination.json +1 -1
  275. package/dist/lib/schemas-data/3.0/core/diagnostic-issue.json +1 -1
  276. package/dist/lib/schemas-data/3.0/core/duration.json +1 -1
  277. package/dist/lib/schemas-data/3.0/core/education-item.json +4 -4
  278. package/dist/lib/schemas-data/3.0/core/error.json +34 -3
  279. package/dist/lib/schemas-data/3.0/core/event-custom-data.json +2 -2
  280. package/dist/lib/schemas-data/3.0/core/event-source-health.json +3 -3
  281. package/dist/lib/schemas-data/3.0/core/event.json +6 -6
  282. package/dist/lib/schemas-data/3.0/core/ext.json +1 -1
  283. package/dist/lib/schemas-data/3.0/core/feature-requirement.json +1 -1
  284. package/dist/lib/schemas-data/3.0/core/flight-item.json +4 -4
  285. package/dist/lib/schemas-data/3.0/core/forecast-point.json +18 -18
  286. package/dist/lib/schemas-data/3.0/core/forecast-range.json +1 -1
  287. package/dist/lib/schemas-data/3.0/core/format-id.json +1 -1
  288. package/dist/lib/schemas-data/3.0/core/format.json +42 -42
  289. package/dist/lib/schemas-data/3.0/core/frequency-cap.json +4 -4
  290. package/dist/lib/schemas-data/3.0/core/generation-credential.json +3 -3
  291. package/dist/lib/schemas-data/3.0/core/geo-breakdown-support.json +3 -3
  292. package/dist/lib/schemas-data/3.0/core/hotel-item.json +4 -4
  293. package/dist/lib/schemas-data/3.0/core/identifier.json +2 -2
  294. package/dist/lib/schemas-data/3.0/core/industry-identifier.json +2 -2
  295. package/dist/lib/schemas-data/3.0/core/insertion-order.json +1 -1
  296. package/dist/lib/schemas-data/3.0/core/installment-deadlines.json +2 -2
  297. package/dist/lib/schemas-data/3.0/core/installment.json +9 -9
  298. package/dist/lib/schemas-data/3.0/core/job-item.json +3 -3
  299. package/dist/lib/schemas-data/3.0/core/limited-series.json +1 -1
  300. package/dist/lib/schemas-data/3.0/core/material-deadline.json +1 -1
  301. package/dist/lib/schemas-data/3.0/core/mcp-webhook-payload.json +5 -5
  302. package/dist/lib/schemas-data/3.0/core/measurement-readiness.json +5 -5
  303. package/dist/lib/schemas-data/3.0/core/measurement-terms.json +3 -3
  304. package/dist/lib/schemas-data/3.0/core/measurement-window.json +1 -1
  305. package/dist/lib/schemas-data/3.0/core/media-buy-features.json +1 -1
  306. package/dist/lib/schemas-data/3.0/core/media-buy.json +7 -7
  307. package/dist/lib/schemas-data/3.0/core/offering-asset-group.json +16 -16
  308. package/dist/lib/schemas-data/3.0/core/offering.json +5 -5
  309. package/dist/lib/schemas-data/3.0/core/optimization-goal.json +6 -6
  310. package/dist/lib/schemas-data/3.0/core/outcome-measurement.json +2 -2
  311. package/dist/lib/schemas-data/3.0/core/overlay.json +1 -1
  312. package/dist/lib/schemas-data/3.0/core/package.json +14 -14
  313. package/dist/lib/schemas-data/3.0/core/pagination-request.json +1 -1
  314. package/dist/lib/schemas-data/3.0/core/pagination-response.json +1 -1
  315. package/dist/lib/schemas-data/3.0/core/performance-feedback.json +3 -3
  316. package/dist/lib/schemas-data/3.0/core/performance-standard.json +4 -4
  317. package/dist/lib/schemas-data/3.0/core/placement-definition.json +5 -5
  318. package/dist/lib/schemas-data/3.0/core/placement.json +2 -2
  319. package/dist/lib/schemas-data/3.0/core/planned-delivery.json +5 -5
  320. package/dist/lib/schemas-data/3.0/core/price.json +1 -1
  321. package/dist/lib/schemas-data/3.0/core/pricing-option.json +10 -10
  322. package/dist/lib/schemas-data/3.0/core/product-allocation.json +4 -4
  323. package/dist/lib/schemas-data/3.0/core/product-filters.json +16 -16
  324. package/dist/lib/schemas-data/3.0/core/product.json +28 -28
  325. package/dist/lib/schemas-data/3.0/core/property-id.json +1 -1
  326. package/dist/lib/schemas-data/3.0/core/property-list-ref.json +1 -1
  327. package/dist/lib/schemas-data/3.0/core/property-tag.json +1 -1
  328. package/dist/lib/schemas-data/3.0/core/property.json +6 -6
  329. package/dist/lib/schemas-data/3.0/core/proposal.json +6 -6
  330. package/dist/lib/schemas-data/3.0/core/protocol-envelope.json +3 -3
  331. package/dist/lib/schemas-data/3.0/core/provenance.json +6 -6
  332. package/dist/lib/schemas-data/3.0/core/publisher-property-selector.json +3 -3
  333. package/dist/lib/schemas-data/3.0/core/push-notification-config.json +2 -2
  334. package/dist/lib/schemas-data/3.0/core/real-estate-item.json +4 -4
  335. package/dist/lib/schemas-data/3.0/core/reference-asset.json +1 -1
  336. package/dist/lib/schemas-data/3.0/core/reporting-capabilities.json +5 -5
  337. package/dist/lib/schemas-data/3.0/core/reporting-webhook.json +3 -3
  338. package/dist/lib/schemas-data/3.0/core/requirements/asset-requirements.json +13 -13
  339. package/dist/lib/schemas-data/3.0/core/requirements/audio-asset-requirements.json +1 -1
  340. package/dist/lib/schemas-data/3.0/core/requirements/catalog-field-binding.json +4 -4
  341. package/dist/lib/schemas-data/3.0/core/requirements/catalog-requirements.json +5 -5
  342. package/dist/lib/schemas-data/3.0/core/requirements/css-asset-requirements.json +1 -1
  343. package/dist/lib/schemas-data/3.0/core/requirements/daast-asset-requirements.json +1 -1
  344. package/dist/lib/schemas-data/3.0/core/requirements/html-asset-requirements.json +1 -1
  345. package/dist/lib/schemas-data/3.0/core/requirements/image-asset-requirements.json +2 -2
  346. package/dist/lib/schemas-data/3.0/core/requirements/javascript-asset-requirements.json +1 -1
  347. package/dist/lib/schemas-data/3.0/core/requirements/markdown-asset-requirements.json +1 -1
  348. package/dist/lib/schemas-data/3.0/core/requirements/offering-asset-constraint.json +4 -4
  349. package/dist/lib/schemas-data/3.0/core/requirements/text-asset-requirements.json +1 -1
  350. package/dist/lib/schemas-data/3.0/core/requirements/url-asset-requirements.json +2 -2
  351. package/dist/lib/schemas-data/3.0/core/requirements/vast-asset-requirements.json +1 -1
  352. package/dist/lib/schemas-data/3.0/core/requirements/video-asset-requirements.json +6 -6
  353. package/dist/lib/schemas-data/3.0/core/requirements/webhook-asset-requirements.json +1 -1
  354. package/dist/lib/schemas-data/3.0/core/response.json +1 -1
  355. package/dist/lib/schemas-data/3.0/core/rights-constraint.json +4 -4
  356. package/dist/lib/schemas-data/3.0/core/seller-agent-ref.json +1 -1
  357. package/dist/lib/schemas-data/3.0/core/signal-definition.json +3 -3
  358. package/dist/lib/schemas-data/3.0/core/signal-filters.json +2 -2
  359. package/dist/lib/schemas-data/3.0/core/signal-id.json +1 -1
  360. package/dist/lib/schemas-data/3.0/core/signal-pricing-option.json +2 -2
  361. package/dist/lib/schemas-data/3.0/core/signal-pricing.json +6 -6
  362. package/dist/lib/schemas-data/3.0/core/signal-targeting.json +4 -4
  363. package/dist/lib/schemas-data/3.0/core/special.json +2 -2
  364. package/dist/lib/schemas-data/3.0/core/start-timing.json +1 -1
  365. package/dist/lib/schemas-data/3.0/core/store-item.json +3 -3
  366. package/dist/lib/schemas-data/3.0/core/talent.json +2 -2
  367. package/dist/lib/schemas-data/3.0/core/targeting.json +20 -20
  368. package/dist/lib/schemas-data/3.0/core/tasks-get-request.json +3 -3
  369. package/dist/lib/schemas-data/3.0/core/tasks-get-response.json +7 -7
  370. package/dist/lib/schemas-data/3.0/core/tasks-list-request.json +11 -11
  371. package/dist/lib/schemas-data/3.0/core/tasks-list-response.json +6 -6
  372. package/dist/lib/schemas-data/3.0/core/user-match.json +3 -3
  373. package/dist/lib/schemas-data/3.0/core/vehicle-item.json +4 -4
  374. package/dist/lib/schemas-data/3.0/core/vendor-pricing-option.json +2 -2
  375. package/dist/lib/schemas-data/3.0/core/x-entity-types.json +1 -1
  376. package/dist/lib/schemas-data/3.0/creative/asset-types/index.json +5 -5
  377. package/dist/lib/schemas-data/3.0/creative/creative-feature-result.json +2 -2
  378. package/dist/lib/schemas-data/3.0/creative/get-creative-delivery-request.json +5 -5
  379. package/dist/lib/schemas-data/3.0/creative/get-creative-delivery-response.json +7 -7
  380. package/dist/lib/schemas-data/3.0/creative/get-creative-features-request.json +5 -5
  381. package/dist/lib/schemas-data/3.0/creative/get-creative-features-response.json +8 -8
  382. package/dist/lib/schemas-data/3.0/creative/list-creative-formats-request.json +11 -11
  383. package/dist/lib/schemas-data/3.0/creative/list-creative-formats-response.json +7 -7
  384. package/dist/lib/schemas-data/3.0/creative/list-creatives-request.json +8 -8
  385. package/dist/lib/schemas-data/3.0/creative/list-creatives-response.json +14 -60
  386. package/dist/lib/schemas-data/3.0/creative/preview-creative-request.json +11 -11
  387. package/dist/lib/schemas-data/3.0/creative/preview-creative-response.json +12 -12
  388. package/dist/lib/schemas-data/3.0/creative/preview-render.json +1 -1
  389. package/dist/lib/schemas-data/3.0/creative/sync-creatives-async-response-input-required.json +3 -3
  390. package/dist/lib/schemas-data/3.0/creative/sync-creatives-async-response-submitted.json +3 -3
  391. package/dist/lib/schemas-data/3.0/creative/sync-creatives-async-response-working.json +3 -3
  392. package/dist/lib/schemas-data/3.0/creative/sync-creatives-request.json +7 -7
  393. package/dist/lib/schemas-data/3.0/creative/sync-creatives-response.json +13 -13
  394. package/dist/lib/schemas-data/3.0/enums/account-scope.json +1 -1
  395. package/dist/lib/schemas-data/3.0/enums/account-status.json +1 -1
  396. package/dist/lib/schemas-data/3.0/enums/action-source.json +1 -1
  397. package/dist/lib/schemas-data/3.0/enums/adcp-protocol.json +1 -1
  398. package/dist/lib/schemas-data/3.0/enums/adjustment-kind.json +1 -1
  399. package/dist/lib/schemas-data/3.0/enums/advertiser-industry.json +1 -1
  400. package/dist/lib/schemas-data/3.0/enums/age-verification-method.json +1 -1
  401. package/dist/lib/schemas-data/3.0/enums/assessment-status.json +1 -1
  402. package/dist/lib/schemas-data/3.0/enums/asset-content-type.json +1 -1
  403. package/dist/lib/schemas-data/3.0/enums/attribution-model.json +1 -1
  404. package/dist/lib/schemas-data/3.0/enums/audience-source.json +1 -1
  405. package/dist/lib/schemas-data/3.0/enums/audience-status.json +1 -1
  406. package/dist/lib/schemas-data/3.0/enums/audio-channel-layout.json +1 -1
  407. package/dist/lib/schemas-data/3.0/enums/auth-scheme.json +1 -1
  408. package/dist/lib/schemas-data/3.0/enums/available-metric.json +1 -1
  409. package/dist/lib/schemas-data/3.0/enums/billing-party.json +1 -1
  410. package/dist/lib/schemas-data/3.0/enums/binary-verdict.json +1 -1
  411. package/dist/lib/schemas-data/3.0/enums/brand-agent-type.json +1 -1
  412. package/dist/lib/schemas-data/3.0/enums/canceled-by.json +1 -1
  413. package/dist/lib/schemas-data/3.0/enums/catalog-action.json +1 -1
  414. package/dist/lib/schemas-data/3.0/enums/catalog-item-status.json +1 -1
  415. package/dist/lib/schemas-data/3.0/enums/catalog-type.json +1 -1
  416. package/dist/lib/schemas-data/3.0/enums/channels.json +1 -1
  417. package/dist/lib/schemas-data/3.0/enums/cloud-storage-protocol.json +1 -1
  418. package/dist/lib/schemas-data/3.0/enums/co-branding-requirement.json +1 -1
  419. package/dist/lib/schemas-data/3.0/enums/collection-cadence.json +1 -1
  420. package/dist/lib/schemas-data/3.0/enums/collection-kind.json +1 -1
  421. package/dist/lib/schemas-data/3.0/enums/collection-relationship.json +1 -1
  422. package/dist/lib/schemas-data/3.0/enums/collection-status.json +1 -1
  423. package/dist/lib/schemas-data/3.0/enums/consent-basis.json +1 -1
  424. package/dist/lib/schemas-data/3.0/enums/content-id-type.json +1 -1
  425. package/dist/lib/schemas-data/3.0/enums/content-rating-system.json +1 -1
  426. package/dist/lib/schemas-data/3.0/enums/creative-action.json +1 -1
  427. package/dist/lib/schemas-data/3.0/enums/creative-agent-capability.json +1 -1
  428. package/dist/lib/schemas-data/3.0/enums/creative-approval-status.json +1 -1
  429. package/dist/lib/schemas-data/3.0/enums/creative-identifier-type.json +1 -1
  430. package/dist/lib/schemas-data/3.0/enums/creative-quality.json +1 -1
  431. package/dist/lib/schemas-data/3.0/enums/creative-sort-field.json +1 -1
  432. package/dist/lib/schemas-data/3.0/enums/creative-status.json +1 -1
  433. package/dist/lib/schemas-data/3.0/enums/daast-tracking-event.json +1 -1
  434. package/dist/lib/schemas-data/3.0/enums/daast-version.json +1 -1
  435. package/dist/lib/schemas-data/3.0/enums/day-of-week.json +1 -1
  436. package/dist/lib/schemas-data/3.0/enums/delegation-authority.json +1 -1
  437. package/dist/lib/schemas-data/3.0/enums/delivery-type.json +1 -1
  438. package/dist/lib/schemas-data/3.0/enums/demographic-system.json +1 -1
  439. package/dist/lib/schemas-data/3.0/enums/derivative-type.json +1 -1
  440. package/dist/lib/schemas-data/3.0/enums/device-platform.json +1 -1
  441. package/dist/lib/schemas-data/3.0/enums/device-type.json +1 -1
  442. package/dist/lib/schemas-data/3.0/enums/digital-source-type.json +1 -1
  443. package/dist/lib/schemas-data/3.0/enums/dimension-unit.json +1 -1
  444. package/dist/lib/schemas-data/3.0/enums/disclosure-persistence.json +1 -1
  445. package/dist/lib/schemas-data/3.0/enums/disclosure-position.json +1 -1
  446. package/dist/lib/schemas-data/3.0/enums/distance-unit.json +1 -1
  447. package/dist/lib/schemas-data/3.0/enums/distribution-identifier-type.json +1 -1
  448. package/dist/lib/schemas-data/3.0/enums/error-code.json +185 -2
  449. package/dist/lib/schemas-data/3.0/enums/escalation-severity.json +1 -1
  450. package/dist/lib/schemas-data/3.0/enums/event-type.json +1 -1
  451. package/dist/lib/schemas-data/3.0/enums/exclusivity.json +1 -1
  452. package/dist/lib/schemas-data/3.0/enums/feature-check-status.json +1 -1
  453. package/dist/lib/schemas-data/3.0/enums/feed-format.json +1 -1
  454. package/dist/lib/schemas-data/3.0/enums/feedback-source.json +1 -1
  455. package/dist/lib/schemas-data/3.0/enums/forecast-method.json +1 -1
  456. package/dist/lib/schemas-data/3.0/enums/forecast-range-unit.json +1 -1
  457. package/dist/lib/schemas-data/3.0/enums/forecastable-metric.json +1 -1
  458. package/dist/lib/schemas-data/3.0/enums/format-id-parameter.json +1 -1
  459. package/dist/lib/schemas-data/3.0/enums/frame-rate-type.json +1 -1
  460. package/dist/lib/schemas-data/3.0/enums/frequency-cap-scope.json +1 -1
  461. package/dist/lib/schemas-data/3.0/enums/genre-taxonomy.json +1 -1
  462. package/dist/lib/schemas-data/3.0/enums/geo-level.json +1 -1
  463. package/dist/lib/schemas-data/3.0/enums/gop-type.json +1 -1
  464. package/dist/lib/schemas-data/3.0/enums/governance-decision.json +1 -1
  465. package/dist/lib/schemas-data/3.0/enums/governance-domain.json +1 -1
  466. package/dist/lib/schemas-data/3.0/enums/governance-mode.json +1 -1
  467. package/dist/lib/schemas-data/3.0/enums/governance-phase.json +1 -1
  468. package/dist/lib/schemas-data/3.0/enums/history-entry-type.json +1 -1
  469. package/dist/lib/schemas-data/3.0/enums/http-method.json +1 -1
  470. package/dist/lib/schemas-data/3.0/enums/identifier-types.json +1 -1
  471. package/dist/lib/schemas-data/3.0/enums/installment-status.json +1 -1
  472. package/dist/lib/schemas-data/3.0/enums/javascript-module-type.json +1 -1
  473. package/dist/lib/schemas-data/3.0/enums/landing-page-requirement.json +1 -1
  474. package/dist/lib/schemas-data/3.0/enums/makegood-remedy.json +1 -1
  475. package/dist/lib/schemas-data/3.0/enums/markdown-flavor.json +1 -1
  476. package/dist/lib/schemas-data/3.0/enums/match-id-type.json +1 -1
  477. package/dist/lib/schemas-data/3.0/enums/match-type.json +1 -1
  478. package/dist/lib/schemas-data/3.0/enums/media-buy-status.json +1 -1
  479. package/dist/lib/schemas-data/3.0/enums/media-buy-valid-action.json +1 -1
  480. package/dist/lib/schemas-data/3.0/enums/metric-type.json +1 -1
  481. package/dist/lib/schemas-data/3.0/enums/metro-system.json +1 -1
  482. package/dist/lib/schemas-data/3.0/enums/moov-atom-position.json +1 -1
  483. package/dist/lib/schemas-data/3.0/enums/notification-type.json +1 -1
  484. package/dist/lib/schemas-data/3.0/enums/outcome-type.json +1 -1
  485. package/dist/lib/schemas-data/3.0/enums/pacing.json +1 -1
  486. package/dist/lib/schemas-data/3.0/enums/payment-terms.json +1 -1
  487. package/dist/lib/schemas-data/3.0/enums/performance-standard-metric.json +1 -1
  488. package/dist/lib/schemas-data/3.0/enums/policy-category.json +1 -1
  489. package/dist/lib/schemas-data/3.0/enums/policy-enforcement.json +1 -1
  490. package/dist/lib/schemas-data/3.0/enums/postal-system.json +1 -1
  491. package/dist/lib/schemas-data/3.0/enums/preview-output-format.json +1 -1
  492. package/dist/lib/schemas-data/3.0/enums/pricing-model.json +1 -1
  493. package/dist/lib/schemas-data/3.0/enums/production-quality.json +1 -1
  494. package/dist/lib/schemas-data/3.0/enums/property-type.json +1 -1
  495. package/dist/lib/schemas-data/3.0/enums/proposal-status.json +1 -1
  496. package/dist/lib/schemas-data/3.0/enums/publisher-identifier-types.json +1 -1
  497. package/dist/lib/schemas-data/3.0/enums/purchase-type.json +1 -1
  498. package/dist/lib/schemas-data/3.0/enums/reach-unit.json +1 -1
  499. package/dist/lib/schemas-data/3.0/enums/reporting-frequency.json +1 -1
  500. package/dist/lib/schemas-data/3.0/enums/response-type.json +1 -1
  501. package/dist/lib/schemas-data/3.0/enums/restricted-attribute.json +1 -1
  502. package/dist/lib/schemas-data/3.0/enums/right-type.json +1 -1
  503. package/dist/lib/schemas-data/3.0/enums/right-use.json +1 -1
  504. package/dist/lib/schemas-data/3.0/enums/rights-billing-period.json +1 -1
  505. package/dist/lib/schemas-data/3.0/enums/scan-type.json +1 -1
  506. package/dist/lib/schemas-data/3.0/enums/si-session-status.json +1 -1
  507. package/dist/lib/schemas-data/3.0/enums/signal-catalog-type.json +1 -1
  508. package/dist/lib/schemas-data/3.0/enums/signal-source.json +1 -1
  509. package/dist/lib/schemas-data/3.0/enums/signal-value-type.json +1 -1
  510. package/dist/lib/schemas-data/3.0/enums/snapshot-unavailable-reason.json +1 -1
  511. package/dist/lib/schemas-data/3.0/enums/sort-direction.json +1 -1
  512. package/dist/lib/schemas-data/3.0/enums/sort-metric.json +1 -1
  513. package/dist/lib/schemas-data/3.0/enums/special-category.json +1 -1
  514. package/dist/lib/schemas-data/3.0/enums/specialism.json +1 -1
  515. package/dist/lib/schemas-data/3.0/enums/talent-role.json +1 -1
  516. package/dist/lib/schemas-data/3.0/enums/task-status.json +1 -1
  517. package/dist/lib/schemas-data/3.0/enums/task-type.json +1 -1
  518. package/dist/lib/schemas-data/3.0/enums/transport-mode.json +1 -1
  519. package/dist/lib/schemas-data/3.0/enums/travel-time-unit.json +1 -1
  520. package/dist/lib/schemas-data/3.0/enums/uid-type.json +1 -1
  521. package/dist/lib/schemas-data/3.0/enums/universal-macro.json +1 -1
  522. package/dist/lib/schemas-data/3.0/enums/update-frequency.json +1 -1
  523. package/dist/lib/schemas-data/3.0/enums/url-asset-type.json +1 -1
  524. package/dist/lib/schemas-data/3.0/enums/validation-mode.json +1 -1
  525. package/dist/lib/schemas-data/3.0/enums/vast-tracking-event.json +1 -1
  526. package/dist/lib/schemas-data/3.0/enums/vast-version.json +1 -1
  527. package/dist/lib/schemas-data/3.0/enums/viewability-standard.json +1 -1
  528. package/dist/lib/schemas-data/3.0/enums/wcag-level.json +1 -1
  529. package/dist/lib/schemas-data/3.0/enums/webhook-response-type.json +1 -1
  530. package/dist/lib/schemas-data/3.0/enums/webhook-security-method.json +1 -1
  531. package/dist/lib/schemas-data/3.0/error-details/account-setup-required.json +2 -2
  532. package/dist/lib/schemas-data/3.0/error-details/audience-too-small.json +2 -2
  533. package/dist/lib/schemas-data/3.0/error-details/budget-too-low.json +2 -2
  534. package/dist/lib/schemas-data/3.0/error-details/conflict.json +2 -2
  535. package/dist/lib/schemas-data/3.0/error-details/creative-rejected.json +2 -2
  536. package/dist/lib/schemas-data/3.0/error-details/policy-violation.json +2 -2
  537. package/dist/lib/schemas-data/3.0/error-details/rate-limited.json +1 -1
  538. package/dist/lib/schemas-data/3.0/error-details/vendor-error-codes.json +1 -1
  539. package/dist/lib/schemas-data/3.0/extensions/extension-meta.json +1 -1
  540. package/dist/lib/schemas-data/3.0/extensions/index.json +2 -2
  541. package/dist/lib/schemas-data/3.0/governance/attribute-definition.json +1 -1
  542. package/dist/lib/schemas-data/3.0/governance/audience-constraints.json +3 -3
  543. package/dist/lib/schemas-data/3.0/governance/check-governance-request.json +7 -7
  544. package/dist/lib/schemas-data/3.0/governance/check-governance-response.json +6 -6
  545. package/dist/lib/schemas-data/3.0/governance/get-plan-audit-logs-request.json +4 -4
  546. package/dist/lib/schemas-data/3.0/governance/get-plan-audit-logs-response.json +9 -9
  547. package/dist/lib/schemas-data/3.0/governance/policy-category-definition.json +2 -2
  548. package/dist/lib/schemas-data/3.0/governance/policy-entry.json +6 -6
  549. package/dist/lib/schemas-data/3.0/governance/policy-ref.json +1 -1
  550. package/dist/lib/schemas-data/3.0/governance/report-plan-outcome-request.json +6 -6
  551. package/dist/lib/schemas-data/3.0/governance/report-plan-outcome-response.json +4 -4
  552. package/dist/lib/schemas-data/3.0/governance/sync-plans-request.json +13 -13
  553. package/dist/lib/schemas-data/3.0/governance/sync-plans-response.json +4 -4
  554. package/dist/lib/schemas-data/3.0/index.json +364 -364
  555. package/dist/lib/schemas-data/3.0/manifest.json +1190 -0
  556. package/dist/lib/schemas-data/3.0/manifest.schema.json +202 -0
  557. package/dist/lib/schemas-data/3.0/media-buy/build-creative-async-response-input-required.json +4 -4
  558. package/dist/lib/schemas-data/3.0/media-buy/build-creative-async-response-submitted.json +3 -3
  559. package/dist/lib/schemas-data/3.0/media-buy/build-creative-async-response-working.json +3 -3
  560. package/dist/lib/schemas-data/3.0/media-buy/build-creative-request.json +11 -11
  561. package/dist/lib/schemas-data/3.0/media-buy/build-creative-response.json +17 -17
  562. package/dist/lib/schemas-data/3.0/media-buy/create-media-buy-async-response-input-required.json +4 -4
  563. package/dist/lib/schemas-data/3.0/media-buy/create-media-buy-async-response-submitted.json +3 -3
  564. package/dist/lib/schemas-data/3.0/media-buy/create-media-buy-async-response-working.json +3 -3
  565. package/dist/lib/schemas-data/3.0/media-buy/create-media-buy-request.json +12 -12
  566. package/dist/lib/schemas-data/3.0/media-buy/create-media-buy-response.json +15 -15
  567. package/dist/lib/schemas-data/3.0/media-buy/get-media-buy-delivery-request.json +17 -17
  568. package/dist/lib/schemas-data/3.0/media-buy/get-media-buy-delivery-response.json +24 -24
  569. package/dist/lib/schemas-data/3.0/media-buy/get-media-buys-request.json +7 -7
  570. package/dist/lib/schemas-data/3.0/media-buy/get-media-buys-response.json +19 -19
  571. package/dist/lib/schemas-data/3.0/media-buy/get-products-async-response-input-required.json +4 -4
  572. package/dist/lib/schemas-data/3.0/media-buy/get-products-async-response-submitted.json +3 -3
  573. package/dist/lib/schemas-data/3.0/media-buy/get-products-async-response-working.json +3 -3
  574. package/dist/lib/schemas-data/3.0/media-buy/get-products-request.json +11 -11
  575. package/dist/lib/schemas-data/3.0/media-buy/get-products-response.json +8 -8
  576. package/dist/lib/schemas-data/3.0/media-buy/list-creative-formats-request.json +11 -11
  577. package/dist/lib/schemas-data/3.0/media-buy/list-creative-formats-response.json +7 -7
  578. package/dist/lib/schemas-data/3.0/media-buy/log-event-request.json +4 -4
  579. package/dist/lib/schemas-data/3.0/media-buy/log-event-response.json +6 -6
  580. package/dist/lib/schemas-data/3.0/media-buy/package-request.json +12 -12
  581. package/dist/lib/schemas-data/3.0/media-buy/package-update.json +13 -13
  582. package/dist/lib/schemas-data/3.0/media-buy/provide-performance-feedback-request.json +6 -6
  583. package/dist/lib/schemas-data/3.0/media-buy/provide-performance-feedback-response.json +6 -6
  584. package/dist/lib/schemas-data/3.0/media-buy/sync-audiences-request.json +7 -7
  585. package/dist/lib/schemas-data/3.0/media-buy/sync-audiences-response.json +9 -9
  586. package/dist/lib/schemas-data/3.0/media-buy/sync-catalogs-async-response-input-required.json +3 -3
  587. package/dist/lib/schemas-data/3.0/media-buy/sync-catalogs-async-response-submitted.json +3 -3
  588. package/dist/lib/schemas-data/3.0/media-buy/sync-catalogs-async-response-working.json +3 -3
  589. package/dist/lib/schemas-data/3.0/media-buy/sync-catalogs-request.json +7 -7
  590. package/dist/lib/schemas-data/3.0/media-buy/sync-catalogs-response.json +9 -9
  591. package/dist/lib/schemas-data/3.0/media-buy/sync-event-sources-request.json +5 -5
  592. package/dist/lib/schemas-data/3.0/media-buy/sync-event-sources-response.json +10 -10
  593. package/dist/lib/schemas-data/3.0/media-buy/update-media-buy-async-response-input-required.json +3 -3
  594. package/dist/lib/schemas-data/3.0/media-buy/update-media-buy-async-response-submitted.json +3 -3
  595. package/dist/lib/schemas-data/3.0/media-buy/update-media-buy-async-response-working.json +3 -3
  596. package/dist/lib/schemas-data/3.0/media-buy/update-media-buy-request.json +10 -10
  597. package/dist/lib/schemas-data/3.0/media-buy/update-media-buy-response.json +10 -10
  598. package/dist/lib/schemas-data/3.0/pricing-options/cpa-option.json +4 -4
  599. package/dist/lib/schemas-data/3.0/pricing-options/cpc-option.json +4 -4
  600. package/dist/lib/schemas-data/3.0/pricing-options/cpcv-option.json +4 -4
  601. package/dist/lib/schemas-data/3.0/pricing-options/cpm-option.json +4 -4
  602. package/dist/lib/schemas-data/3.0/pricing-options/cpp-option.json +5 -5
  603. package/dist/lib/schemas-data/3.0/pricing-options/cpv-option.json +4 -4
  604. package/dist/lib/schemas-data/3.0/pricing-options/flat-rate-option.json +4 -4
  605. package/dist/lib/schemas-data/3.0/pricing-options/price-breakdown.json +2 -2
  606. package/dist/lib/schemas-data/3.0/pricing-options/price-guidance.json +1 -1
  607. package/dist/lib/schemas-data/3.0/pricing-options/time-option.json +4 -4
  608. package/dist/lib/schemas-data/3.0/pricing-options/vcpm-option.json +4 -4
  609. package/dist/lib/schemas-data/3.0/property/authorization-result.json +1 -1
  610. package/dist/lib/schemas-data/3.0/property/base-property-source.json +4 -4
  611. package/dist/lib/schemas-data/3.0/property/create-property-list-request.json +7 -7
  612. package/dist/lib/schemas-data/3.0/property/create-property-list-response.json +4 -4
  613. package/dist/lib/schemas-data/3.0/property/delete-property-list-request.json +4 -4
  614. package/dist/lib/schemas-data/3.0/property/delete-property-list-response.json +3 -3
  615. package/dist/lib/schemas-data/3.0/property/delivery-record.json +3 -3
  616. package/dist/lib/schemas-data/3.0/property/get-property-list-request.json +4 -4
  617. package/dist/lib/schemas-data/3.0/property/get-property-list-response.json +7 -7
  618. package/dist/lib/schemas-data/3.0/property/list-property-lists-request.json +5 -5
  619. package/dist/lib/schemas-data/3.0/property/list-property-lists-response.json +5 -5
  620. package/dist/lib/schemas-data/3.0/property/property-error.json +2 -2
  621. package/dist/lib/schemas-data/3.0/property/property-feature-definition.json +2 -2
  622. package/dist/lib/schemas-data/3.0/property/property-feature-result.json +4 -4
  623. package/dist/lib/schemas-data/3.0/property/property-feature-value.json +2 -2
  624. package/dist/lib/schemas-data/3.0/property/property-feature.json +1 -1
  625. package/dist/lib/schemas-data/3.0/property/property-list-changed-webhook.json +2 -2
  626. package/dist/lib/schemas-data/3.0/property/property-list-filters.json +5 -5
  627. package/dist/lib/schemas-data/3.0/property/property-list.json +6 -6
  628. package/dist/lib/schemas-data/3.0/property/update-property-list-request.json +7 -7
  629. package/dist/lib/schemas-data/3.0/property/update-property-list-response.json +4 -4
  630. package/dist/lib/schemas-data/3.0/property/validate-property-delivery-request.json +5 -5
  631. package/dist/lib/schemas-data/3.0/property/validate-property-delivery-response.json +4 -4
  632. package/dist/lib/schemas-data/3.0/property/validation-result.json +5 -5
  633. package/dist/lib/schemas-data/3.0/protocol/get-adcp-capabilities-request.json +3 -3
  634. package/dist/lib/schemas-data/3.0/protocol/get-adcp-capabilities-response.json +26 -26
  635. package/dist/lib/schemas-data/3.0/signals/activate-signal-request.json +5 -5
  636. package/dist/lib/schemas-data/3.0/signals/activate-signal-response.json +7 -7
  637. package/dist/lib/schemas-data/3.0/signals/get-signals-request.json +8 -8
  638. package/dist/lib/schemas-data/3.0/signals/get-signals-response.json +10 -10
  639. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-capabilities.json +1 -1
  640. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-get-offering-request.json +3 -3
  641. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-get-offering-response.json +4 -4
  642. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-identity.json +1 -1
  643. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-initiate-session-request.json +5 -5
  644. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-initiate-session-response.json +7 -7
  645. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-send-message-request.json +3 -3
  646. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-send-message-response.json +7 -7
  647. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-terminate-session-request.json +3 -3
  648. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-terminate-session-response.json +5 -5
  649. package/dist/lib/schemas-data/3.0/sponsored-intelligence/si-ui-element.json +1 -1
  650. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  651. package/dist/lib/server/adcp-server.d.ts +21 -0
  652. package/dist/lib/server/adcp-server.d.ts.map +1 -1
  653. package/dist/lib/server/adcp-server.js +22 -1
  654. package/dist/lib/server/adcp-server.js.map +1 -1
  655. package/dist/lib/server/auth-signature.d.ts.map +1 -1
  656. package/dist/lib/server/auth-signature.js +21 -0
  657. package/dist/lib/server/auth-signature.js.map +1 -1
  658. package/dist/lib/server/auth.d.ts +24 -0
  659. package/dist/lib/server/auth.d.ts.map +1 -1
  660. package/dist/lib/server/auth.js +71 -3
  661. package/dist/lib/server/auth.js.map +1 -1
  662. package/dist/lib/server/create-adcp-server.d.ts +203 -21
  663. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  664. package/dist/lib/server/create-adcp-server.js +322 -13
  665. package/dist/lib/server/create-adcp-server.js.map +1 -1
  666. package/dist/lib/server/decisioning/account.d.ts +340 -21
  667. package/dist/lib/server/decisioning/account.d.ts.map +1 -1
  668. package/dist/lib/server/decisioning/account.js +150 -4
  669. package/dist/lib/server/decisioning/account.js.map +1 -1
  670. package/dist/lib/server/decisioning/admin-router.d.ts.map +1 -1
  671. package/dist/lib/server/decisioning/admin-router.js +5 -1
  672. package/dist/lib/server/decisioning/admin-router.js.map +1 -1
  673. package/dist/lib/server/decisioning/buyer-agent.d.ts +465 -0
  674. package/dist/lib/server/decisioning/buyer-agent.d.ts.map +1 -0
  675. package/dist/lib/server/decisioning/buyer-agent.js +372 -0
  676. package/dist/lib/server/decisioning/buyer-agent.js.map +1 -0
  677. package/dist/lib/server/decisioning/capabilities.d.ts +32 -5
  678. package/dist/lib/server/decisioning/capabilities.d.ts.map +1 -1
  679. package/dist/lib/server/decisioning/compose.d.ts +93 -0
  680. package/dist/lib/server/decisioning/compose.d.ts.map +1 -0
  681. package/dist/lib/server/decisioning/compose.js +81 -0
  682. package/dist/lib/server/decisioning/compose.js.map +1 -0
  683. package/dist/lib/server/decisioning/context.d.ts +11 -0
  684. package/dist/lib/server/decisioning/context.d.ts.map +1 -1
  685. package/dist/lib/server/decisioning/index.d.ts +12 -3
  686. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  687. package/dist/lib/server/decisioning/index.js +45 -2
  688. package/dist/lib/server/decisioning/index.js.map +1 -1
  689. package/dist/lib/server/decisioning/platform-helpers.d.ts +269 -0
  690. package/dist/lib/server/decisioning/platform-helpers.d.ts.map +1 -0
  691. package/dist/lib/server/decisioning/platform-helpers.js +316 -0
  692. package/dist/lib/server/decisioning/platform-helpers.js.map +1 -0
  693. package/dist/lib/server/decisioning/platform.d.ts +127 -4
  694. package/dist/lib/server/decisioning/platform.d.ts.map +1 -1
  695. package/dist/lib/server/decisioning/platform.js.map +1 -1
  696. package/dist/lib/server/decisioning/resolve-presets.d.ts +129 -0
  697. package/dist/lib/server/decisioning/resolve-presets.d.ts.map +1 -0
  698. package/dist/lib/server/decisioning/resolve-presets.js +142 -0
  699. package/dist/lib/server/decisioning/resolve-presets.js.map +1 -0
  700. package/dist/lib/server/decisioning/runtime/entity-hydration.generated.d.ts +8 -0
  701. package/dist/lib/server/decisioning/runtime/entity-hydration.generated.d.ts.map +1 -0
  702. package/dist/lib/server/decisioning/runtime/entity-hydration.generated.js +101 -0
  703. package/dist/lib/server/decisioning/runtime/entity-hydration.generated.js.map +1 -0
  704. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +91 -8
  705. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  706. package/dist/lib/server/decisioning/runtime/from-platform.js +630 -138
  707. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  708. package/dist/lib/server/decisioning/runtime/to-context.d.ts.map +1 -1
  709. package/dist/lib/server/decisioning/runtime/to-context.js +1 -0
  710. package/dist/lib/server/decisioning/runtime/to-context.js.map +1 -1
  711. package/dist/lib/server/decisioning/runtime/validate-platform.d.ts.map +1 -1
  712. package/dist/lib/server/decisioning/runtime/validate-platform.js +31 -3
  713. package/dist/lib/server/decisioning/runtime/validate-platform.js.map +1 -1
  714. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +83 -6
  715. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
  716. package/dist/lib/server/decisioning/specialisms/brand-rights.js +12 -5
  717. package/dist/lib/server/decisioning/specialisms/brand-rights.js.map +1 -1
  718. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +41 -4
  719. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
  720. package/dist/lib/server/decisioning/specialisms/creative.d.ts +47 -3
  721. package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
  722. package/dist/lib/server/decisioning/specialisms/sales.d.ts +115 -9
  723. package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
  724. package/dist/lib/server/decisioning/tenant-registry.d.ts.map +1 -1
  725. package/dist/lib/server/decisioning/tenant-registry.js +8 -3
  726. package/dist/lib/server/decisioning/tenant-registry.js.map +1 -1
  727. package/dist/lib/server/decisioning/tenant-store.d.ts +200 -0
  728. package/dist/lib/server/decisioning/tenant-store.d.ts.map +1 -0
  729. package/dist/lib/server/decisioning/tenant-store.js +182 -0
  730. package/dist/lib/server/decisioning/tenant-store.js.map +1 -0
  731. package/dist/lib/server/decisioning/validate-specialisms.d.ts +66 -0
  732. package/dist/lib/server/decisioning/validate-specialisms.d.ts.map +1 -0
  733. package/dist/lib/server/decisioning/validate-specialisms.js +119 -0
  734. package/dist/lib/server/decisioning/validate-specialisms.js.map +1 -0
  735. package/dist/lib/server/index.d.ts +11 -2
  736. package/dist/lib/server/index.d.ts.map +1 -1
  737. package/dist/lib/server/index.js +35 -3
  738. package/dist/lib/server/index.js.map +1 -1
  739. package/dist/lib/server/media-buy-store.d.ts +126 -0
  740. package/dist/lib/server/media-buy-store.d.ts.map +1 -0
  741. package/dist/lib/server/media-buy-store.js +171 -0
  742. package/dist/lib/server/media-buy-store.js.map +1 -0
  743. package/dist/lib/server/redact.d.ts +52 -0
  744. package/dist/lib/server/redact.d.ts.map +1 -0
  745. package/dist/lib/server/redact.js +86 -0
  746. package/dist/lib/server/redact.js.map +1 -0
  747. package/dist/lib/server/responses.d.ts +60 -1
  748. package/dist/lib/server/responses.d.ts.map +1 -1
  749. package/dist/lib/server/responses.js +110 -1
  750. package/dist/lib/server/responses.js.map +1 -1
  751. package/dist/lib/server/serve.d.ts.map +1 -1
  752. package/dist/lib/server/serve.js +35 -1
  753. package/dist/lib/server/serve.js.map +1 -1
  754. package/dist/lib/server/state-machine.d.ts +80 -0
  755. package/dist/lib/server/state-machine.d.ts.map +1 -0
  756. package/dist/lib/server/state-machine.js +125 -0
  757. package/dist/lib/server/state-machine.js.map +1 -0
  758. package/dist/lib/server/test-controller.d.ts +48 -0
  759. package/dist/lib/server/test-controller.d.ts.map +1 -1
  760. package/dist/lib/server/test-controller.js +89 -10
  761. package/dist/lib/server/test-controller.js.map +1 -1
  762. package/dist/lib/server/upstream-helpers.d.ts +182 -0
  763. package/dist/lib/server/upstream-helpers.d.ts.map +1 -0
  764. package/dist/lib/server/upstream-helpers.js +140 -0
  765. package/dist/lib/server/upstream-helpers.js.map +1 -0
  766. package/dist/lib/signing/agent-resolver/canonicalize.d.ts +44 -0
  767. package/dist/lib/signing/agent-resolver/canonicalize.d.ts.map +1 -0
  768. package/dist/lib/signing/agent-resolver/canonicalize.js +85 -0
  769. package/dist/lib/signing/agent-resolver/canonicalize.js.map +1 -0
  770. package/dist/lib/signing/agent-resolver/capabilities-types.d.ts +54 -0
  771. package/dist/lib/signing/agent-resolver/capabilities-types.d.ts.map +1 -0
  772. package/dist/lib/signing/agent-resolver/capabilities-types.js +49 -0
  773. package/dist/lib/signing/agent-resolver/capabilities-types.js.map +1 -0
  774. package/dist/lib/signing/agent-resolver/consistency.d.ts +84 -0
  775. package/dist/lib/signing/agent-resolver/consistency.d.ts.map +1 -0
  776. package/dist/lib/signing/agent-resolver/consistency.js +121 -0
  777. package/dist/lib/signing/agent-resolver/consistency.js.map +1 -0
  778. package/dist/lib/signing/agent-resolver/errors.d.ts +68 -0
  779. package/dist/lib/signing/agent-resolver/errors.d.ts.map +1 -0
  780. package/dist/lib/signing/agent-resolver/errors.js +45 -0
  781. package/dist/lib/signing/agent-resolver/errors.js.map +1 -0
  782. package/dist/lib/signing/agent-resolver/etld.d.ts +25 -0
  783. package/dist/lib/signing/agent-resolver/etld.d.ts.map +1 -0
  784. package/dist/lib/signing/agent-resolver/etld.js +75 -0
  785. package/dist/lib/signing/agent-resolver/etld.js.map +1 -0
  786. package/dist/lib/signing/agent-resolver/fetch-helpers.d.ts +41 -0
  787. package/dist/lib/signing/agent-resolver/fetch-helpers.d.ts.map +1 -0
  788. package/dist/lib/signing/agent-resolver/fetch-helpers.js +85 -0
  789. package/dist/lib/signing/agent-resolver/fetch-helpers.js.map +1 -0
  790. package/dist/lib/signing/agent-resolver/index.d.ts +26 -0
  791. package/dist/lib/signing/agent-resolver/index.d.ts.map +1 -0
  792. package/dist/lib/signing/agent-resolver/index.js +33 -0
  793. package/dist/lib/signing/agent-resolver/index.js.map +1 -0
  794. package/dist/lib/signing/agent-resolver/jwks-set.d.ts +76 -0
  795. package/dist/lib/signing/agent-resolver/jwks-set.d.ts.map +1 -0
  796. package/dist/lib/signing/agent-resolver/jwks-set.js +124 -0
  797. package/dist/lib/signing/agent-resolver/jwks-set.js.map +1 -0
  798. package/dist/lib/signing/agent-resolver/resolve-agent.d.ts +123 -0
  799. package/dist/lib/signing/agent-resolver/resolve-agent.d.ts.map +1 -0
  800. package/dist/lib/signing/agent-resolver/resolve-agent.js +398 -0
  801. package/dist/lib/signing/agent-resolver/resolve-agent.js.map +1 -0
  802. package/dist/lib/signing/agent-resolver/select-agent.d.ts +54 -0
  803. package/dist/lib/signing/agent-resolver/select-agent.d.ts.map +1 -0
  804. package/dist/lib/signing/agent-resolver/select-agent.js +94 -0
  805. package/dist/lib/signing/agent-resolver/select-agent.js.map +1 -0
  806. package/dist/lib/signing/agent-resolver/strict-json.d.ts +44 -0
  807. package/dist/lib/signing/agent-resolver/strict-json.d.ts.map +1 -0
  808. package/dist/lib/signing/agent-resolver/strict-json.js +219 -0
  809. package/dist/lib/signing/agent-resolver/strict-json.js.map +1 -0
  810. package/dist/lib/signing/capability-priming.d.ts.map +1 -1
  811. package/dist/lib/signing/capability-priming.js +2 -55
  812. package/dist/lib/signing/capability-priming.js.map +1 -1
  813. package/dist/lib/signing/protocol-response.d.ts +18 -0
  814. package/dist/lib/signing/protocol-response.d.ts.map +1 -0
  815. package/dist/lib/signing/protocol-response.js +69 -0
  816. package/dist/lib/signing/protocol-response.js.map +1 -0
  817. package/dist/lib/signing/server.d.ts +1 -0
  818. package/dist/lib/signing/server.d.ts.map +1 -1
  819. package/dist/lib/signing/server.js +10 -1
  820. package/dist/lib/signing/server.js.map +1 -1
  821. package/dist/lib/signing/testing.d.ts +64 -0
  822. package/dist/lib/signing/testing.d.ts.map +1 -1
  823. package/dist/lib/signing/testing.js +100 -5
  824. package/dist/lib/signing/testing.js.map +1 -1
  825. package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
  826. package/dist/lib/testing/compliance/comply.js +2 -0
  827. package/dist/lib/testing/compliance/comply.js.map +1 -1
  828. package/dist/lib/testing/compliance/types.d.ts +8 -0
  829. package/dist/lib/testing/compliance/types.d.ts.map +1 -1
  830. package/dist/lib/testing/storyboard/agent-routing.d.ts +92 -0
  831. package/dist/lib/testing/storyboard/agent-routing.d.ts.map +1 -0
  832. package/dist/lib/testing/storyboard/agent-routing.js +291 -0
  833. package/dist/lib/testing/storyboard/agent-routing.js.map +1 -0
  834. package/dist/lib/testing/storyboard/context.d.ts +22 -0
  835. package/dist/lib/testing/storyboard/context.d.ts.map +1 -1
  836. package/dist/lib/testing/storyboard/context.js +35 -8
  837. package/dist/lib/testing/storyboard/context.js.map +1 -1
  838. package/dist/lib/testing/storyboard/default-invariants.js +6 -35
  839. package/dist/lib/testing/storyboard/default-invariants.js.map +1 -1
  840. package/dist/lib/testing/storyboard/index.d.ts +1 -1
  841. package/dist/lib/testing/storyboard/index.d.ts.map +1 -1
  842. package/dist/lib/testing/storyboard/index.js.map +1 -1
  843. package/dist/lib/testing/storyboard/loader.js +46 -12
  844. package/dist/lib/testing/storyboard/loader.js.map +1 -1
  845. package/dist/lib/testing/storyboard/request-builder.d.ts.map +1 -1
  846. package/dist/lib/testing/storyboard/request-builder.js +14 -1
  847. package/dist/lib/testing/storyboard/request-builder.js.map +1 -1
  848. package/dist/lib/testing/storyboard/runner.d.ts +17 -0
  849. package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
  850. package/dist/lib/testing/storyboard/runner.js +800 -92
  851. package/dist/lib/testing/storyboard/runner.js.map +1 -1
  852. package/dist/lib/testing/storyboard/types.d.ts +221 -12
  853. package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
  854. package/dist/lib/testing/storyboard/types.js.map +1 -1
  855. package/dist/lib/testing/storyboard/validations.d.ts +65 -0
  856. package/dist/lib/testing/storyboard/validations.d.ts.map +1 -1
  857. package/dist/lib/testing/storyboard/validations.js +529 -2
  858. package/dist/lib/testing/storyboard/validations.js.map +1 -1
  859. package/dist/lib/testing/test-controller.d.ts +59 -1
  860. package/dist/lib/testing/test-controller.d.ts.map +1 -1
  861. package/dist/lib/testing/test-controller.js +30 -0
  862. package/dist/lib/testing/test-controller.js.map +1 -1
  863. package/dist/lib/testing/types.d.ts +14 -0
  864. package/dist/lib/testing/types.d.ts.map +1 -1
  865. package/dist/lib/types/core.generated.d.ts +299 -141
  866. package/dist/lib/types/core.generated.d.ts.map +1 -1
  867. package/dist/lib/types/core.generated.js +2 -2
  868. package/dist/lib/types/error-codes.d.ts +168 -108
  869. package/dist/lib/types/error-codes.d.ts.map +1 -1
  870. package/dist/lib/types/error-codes.js +23 -190
  871. package/dist/lib/types/error-codes.js.map +1 -1
  872. package/dist/lib/types/error-details.aliases.d.ts +48 -0
  873. package/dist/lib/types/error-details.aliases.d.ts.map +1 -0
  874. package/dist/lib/types/error-details.aliases.js +41 -0
  875. package/dist/lib/types/error-details.aliases.js.map +1 -0
  876. package/dist/lib/types/index.d.ts +14 -1
  877. package/dist/lib/types/index.d.ts.map +1 -1
  878. package/dist/lib/types/index.js +4 -0
  879. package/dist/lib/types/index.js.map +1 -1
  880. package/dist/lib/types/inline-enums.generated.d.ts +2 -4
  881. package/dist/lib/types/inline-enums.generated.d.ts.map +1 -1
  882. package/dist/lib/types/inline-enums.generated.js +10 -7
  883. package/dist/lib/types/inline-enums.generated.js.map +1 -1
  884. package/dist/lib/types/manifest.generated.d.ts +280 -0
  885. package/dist/lib/types/manifest.generated.d.ts.map +1 -0
  886. package/dist/lib/types/manifest.generated.js +339 -0
  887. package/dist/lib/types/manifest.generated.js.map +1 -0
  888. package/dist/lib/types/schemas.generated.d.ts +27229 -25160
  889. package/dist/lib/types/schemas.generated.d.ts.map +1 -1
  890. package/dist/lib/types/schemas.generated.js +584 -533
  891. package/dist/lib/types/schemas.generated.js.map +1 -1
  892. package/dist/lib/types/tools.generated.d.ts +146 -21
  893. package/dist/lib/types/tools.generated.d.ts.map +1 -1
  894. package/dist/lib/types/v2-5/tools.generated.d.ts +48 -1
  895. package/dist/lib/types/v2-5/tools.generated.d.ts.map +1 -1
  896. package/dist/lib/upstream-recorder/index.d.ts +57 -0
  897. package/dist/lib/upstream-recorder/index.d.ts.map +1 -0
  898. package/dist/lib/upstream-recorder/index.js +62 -0
  899. package/dist/lib/upstream-recorder/index.js.map +1 -0
  900. package/dist/lib/upstream-recorder/recorder.d.ts +35 -0
  901. package/dist/lib/upstream-recorder/recorder.d.ts.map +1 -0
  902. package/dist/lib/upstream-recorder/recorder.js +507 -0
  903. package/dist/lib/upstream-recorder/recorder.js.map +1 -0
  904. package/dist/lib/upstream-recorder/types.d.ts +365 -0
  905. package/dist/lib/upstream-recorder/types.d.ts.map +1 -0
  906. package/dist/lib/upstream-recorder/types.js +30 -0
  907. package/dist/lib/upstream-recorder/types.js.map +1 -0
  908. package/dist/lib/utils/capabilities.d.ts +44 -3
  909. package/dist/lib/utils/capabilities.d.ts.map +1 -1
  910. package/dist/lib/utils/capabilities.js +67 -3
  911. package/dist/lib/utils/capabilities.js.map +1 -1
  912. package/dist/lib/utils/error-extraction.d.ts +24 -0
  913. package/dist/lib/utils/error-extraction.d.ts.map +1 -1
  914. package/dist/lib/utils/error-extraction.js +0 -2
  915. package/dist/lib/utils/error-extraction.js.map +1 -1
  916. package/dist/lib/utils/format-render-builders.d.ts +2 -1
  917. package/dist/lib/utils/format-render-builders.d.ts.map +1 -1
  918. package/dist/lib/utils/format-render-builders.js +0 -23
  919. package/dist/lib/utils/format-render-builders.js.map +1 -1
  920. package/dist/lib/utils/glob.d.ts +28 -0
  921. package/dist/lib/utils/glob.d.ts.map +1 -0
  922. package/dist/lib/utils/glob.js +37 -0
  923. package/dist/lib/utils/glob.js.map +1 -0
  924. package/dist/lib/utils/redact-secrets.d.ts +37 -0
  925. package/dist/lib/utils/redact-secrets.d.ts.map +1 -0
  926. package/dist/lib/utils/redact-secrets.js +65 -0
  927. package/dist/lib/utils/redact-secrets.js.map +1 -0
  928. package/dist/lib/utils/tool-request-schemas.d.ts.map +1 -1
  929. package/dist/lib/utils/tool-request-schemas.js +1 -0
  930. package/dist/lib/utils/tool-request-schemas.js.map +1 -1
  931. package/dist/lib/validation/hints.d.ts +50 -0
  932. package/dist/lib/validation/hints.d.ts.map +1 -0
  933. package/dist/lib/validation/hints.js +194 -0
  934. package/dist/lib/validation/hints.js.map +1 -0
  935. package/dist/lib/validation/schema-errors.d.ts +2 -1
  936. package/dist/lib/validation/schema-errors.d.ts.map +1 -1
  937. package/dist/lib/validation/schema-errors.js +39 -4
  938. package/dist/lib/validation/schema-errors.js.map +1 -1
  939. package/dist/lib/validation/schema-loader.d.ts +13 -0
  940. package/dist/lib/validation/schema-loader.d.ts.map +1 -1
  941. package/dist/lib/validation/schema-loader.js +20 -0
  942. package/dist/lib/validation/schema-loader.js.map +1 -1
  943. package/dist/lib/validation/schema-validator.d.ts +107 -2
  944. package/dist/lib/validation/schema-validator.d.ts.map +1 -1
  945. package/dist/lib/validation/schema-validator.js +205 -12
  946. package/dist/lib/validation/schema-validator.js.map +1 -1
  947. package/dist/lib/validation/sync-creatives.d.ts +30 -0
  948. package/dist/lib/validation/sync-creatives.d.ts.map +1 -1
  949. package/dist/lib/version.d.ts +7 -7
  950. package/dist/lib/version.d.ts.map +1 -1
  951. package/dist/lib/version.js +9 -5
  952. package/dist/lib/version.js.map +1 -1
  953. package/docs/guides/BUILD-AN-AGENT.md +267 -137
  954. package/docs/llms.txt +110 -55
  955. package/examples/CONTRIBUTING.md +173 -0
  956. package/examples/README.md +32 -0
  957. package/examples/comply-controller-seller.ts +9 -17
  958. package/examples/decisioning-platform-broadcast-tv.ts +3 -2
  959. package/examples/decisioning-platform-implicit-accounts.ts +168 -0
  960. package/examples/decisioning-platform-mock-seller.ts +3 -2
  961. package/examples/decisioning-platform-multi-tenant-db.ts +317 -0
  962. package/examples/decisioning-platform-programmatic.ts +3 -2
  963. package/examples/hello-cluster.ts +421 -0
  964. package/examples/hello_creative_adapter_template.ts +528 -0
  965. package/examples/hello_seller_adapter_guaranteed.ts +1080 -0
  966. package/examples/hello_seller_adapter_multi_tenant.ts +1046 -0
  967. package/examples/hello_seller_adapter_social.ts +829 -0
  968. package/examples/hello_signals_adapter_marketplace.ts +532 -0
  969. package/examples/seller-test-controller.ts +22 -28
  970. package/package.json +30 -3
  971. package/skills/SHAPE-GOTCHAS.md +233 -0
  972. package/skills/build-brand-rights-agent/SKILL.md +121 -16
  973. package/skills/build-creative-agent/SKILL.md +25 -1
  974. package/skills/build-decisioning-platform/advanced/MULTI-TENANT.md +104 -28
  975. package/skills/build-holdco-agent/SKILL.md +250 -0
  976. package/skills/build-seller-agent/SKILL.md +313 -49
  977. package/skills/build-seller-agent/specialisms/sales-broadcast-tv.md +2 -0
  978. package/skills/build-seller-agent/specialisms/sales-guaranteed.md +18 -0
  979. package/skills/build-seller-agent/specialisms/sales-non-guaranteed.md +2 -0
  980. package/skills/build-seller-agent/specialisms/sales-social.md +63 -2
  981. package/skills/build-signals-agent/SKILL.md +2 -0
  982. package/skills/call-adcp-agent.previous/SKILL.md +8 -86
  983. package/skills/run-by-experts/SKILL.md +116 -0
  984. package/skills/triage-storyboard-failure/SKILL.md +96 -0
  985. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/brand/index.yaml +0 -0
  986. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/creative/index.yaml +0 -0
  987. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/governance/index.yaml +0 -0
  988. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/creative-reception.yaml +0 -0
  989. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/index.yaml +0 -0
  990. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/create_media_buy_async.yaml +0 -0
  991. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -0
  992. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/delivery_reporting.yaml +0 -0
  993. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/governance_approved.yaml +0 -0
  994. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/governance_conditions.yaml +0 -0
  995. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/governance_denied.yaml +0 -0
  996. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/governance_denied_recovery.yaml +0 -0
  997. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/invalid_transitions.yaml +0 -0
  998. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/inventory_list_no_match.yaml +0 -0
  999. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/inventory_list_targeting.yaml +0 -0
  1000. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/measurement_terms_rejected.yaml +0 -0
  1001. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/pending_creatives_to_start.yaml +0 -0
  1002. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/proposal_finalize.yaml +0 -0
  1003. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/scenarios/refine_products.yaml +0 -0
  1004. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/media-buy/state-machine.yaml +0 -0
  1005. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/signals/index.yaml +0 -0
  1006. /package/compliance/cache/{3.0.1 → 3.0.5}/domains/sponsored-intelligence/index.yaml +0 -0
  1007. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/brand/index.yaml +0 -0
  1008. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/creative/index.yaml +0 -0
  1009. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/governance/index.yaml +0 -0
  1010. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/creative-reception.yaml +0 -0
  1011. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/index.yaml +0 -0
  1012. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/create_media_buy_async.yaml +0 -0
  1013. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -0
  1014. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/delivery_reporting.yaml +0 -0
  1015. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/governance_approved.yaml +0 -0
  1016. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/governance_conditions.yaml +0 -0
  1017. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/governance_denied.yaml +0 -0
  1018. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/governance_denied_recovery.yaml +0 -0
  1019. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/invalid_transitions.yaml +0 -0
  1020. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/inventory_list_no_match.yaml +0 -0
  1021. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/inventory_list_targeting.yaml +0 -0
  1022. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/measurement_terms_rejected.yaml +0 -0
  1023. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/pending_creatives_to_start.yaml +0 -0
  1024. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/proposal_finalize.yaml +0 -0
  1025. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/scenarios/refine_products.yaml +0 -0
  1026. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/media-buy/state-machine.yaml +0 -0
  1027. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/signals/index.yaml +0 -0
  1028. /package/compliance/cache/{3.0.1 → 3.0.5}/protocols/sponsored-intelligence/index.yaml +0 -0
  1029. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/brand-rights/scenarios/governance_denied.yaml +0 -0
  1030. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/collection-lists/index.yaml +0 -0
  1031. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/content-standards/index.yaml +0 -0
  1032. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/creative-ad-server/index.yaml +0 -0
  1033. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/creative-generative/generative-seller.yaml +0 -0
  1034. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/creative-generative/index.yaml +0 -0
  1035. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/creative-template/index.yaml +0 -0
  1036. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/governance-aware-seller/index.yaml +0 -0
  1037. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/governance-delivery-monitor/index.yaml +0 -0
  1038. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/governance-spend-authority/denied.yaml +0 -0
  1039. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/governance-spend-authority/index.yaml +0 -0
  1040. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/property-lists/index.yaml +0 -0
  1041. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-broadcast-tv/index.yaml +0 -0
  1042. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-catalog-driven/index.yaml +0 -0
  1043. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-guaranteed/index.yaml +0 -0
  1044. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-non-guaranteed/index.yaml +0 -0
  1045. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/sales-proposal-mode/index.yaml +0 -0
  1046. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/signal-marketplace/index.yaml +0 -0
  1047. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/signal-marketplace/scenarios/governance_denied.yaml +0 -0
  1048. /package/compliance/cache/{3.0.1 → 3.0.5}/specialisms/signal-owned/index.yaml +0 -0
  1049. /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/acme-outdoor.yaml +0 -0
  1050. /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/bistro-oranje.yaml +0 -0
  1051. /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/nova-motors.yaml +0 -0
  1052. /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/osei-natural.yaml +0 -0
  1053. /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/signed-requests-runner.yaml +0 -0
  1054. /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/substitution-observer-runner.yaml +0 -0
  1055. /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/summit-foods.yaml +0 -0
  1056. /package/compliance/cache/{3.0.1 → 3.0.5}/test-kits/webhook-receiver-runner.yaml +0 -0
  1057. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/001-minimal-plan.json +0 -0
  1058. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/002-full-plan.json +0 -0
  1059. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/003-bookkeeping-stripped.json +0 -0
  1060. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/004a-human-review-omitted.json +0 -0
  1061. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/004b-human-review-explicit-null.json +0 -0
  1062. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/005a-policy-categories-order-1.json +0 -0
  1063. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/005b-policy-categories-order-2.json +0 -0
  1064. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/006a-ext-trace-v1.json +0 -0
  1065. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/006b-ext-trace-v2.json +0 -0
  1066. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/007-unicode-objectives.json +0 -0
  1067. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/plan-hash/008-numeric-canonicalization.json +0 -0
  1068. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/README.md +0 -0
  1069. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/canonicalization.json +0 -0
  1070. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/keys.json +0 -0
  1071. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/001-no-signature-header.json +0 -0
  1072. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/002-wrong-tag.json +0 -0
  1073. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/003-expired-signature.json +0 -0
  1074. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/004-window-too-long.json +0 -0
  1075. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/005-alg-not-allowed.json +0 -0
  1076. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/006-missing-covered-component.json +0 -0
  1077. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/007-missing-content-digest.json +0 -0
  1078. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/008-unknown-keyid.json +0 -0
  1079. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/009-key-ops-missing-verify.json +0 -0
  1080. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/010-content-digest-mismatch.json +0 -0
  1081. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/011-malformed-header.json +0 -0
  1082. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/012-missing-expires-param.json +0 -0
  1083. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/013-expires-le-created.json +0 -0
  1084. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/014-missing-nonce-param.json +0 -0
  1085. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/015-signature-invalid.json +0 -0
  1086. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/016-replayed-nonce.json +0 -0
  1087. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/017-key-revoked.json +0 -0
  1088. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/018-digest-covered-when-forbidden.json +0 -0
  1089. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/019-signature-without-signature-input.json +0 -0
  1090. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/020-rate-abuse.json +0 -0
  1091. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/021-duplicate-signature-input-label.json +0 -0
  1092. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/022-multi-valued-content-type.json +0 -0
  1093. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/023-multi-valued-content-digest.json +0 -0
  1094. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/024-unquoted-string-param.json +0 -0
  1095. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/025-jwk-alg-crv-mismatch.json +0 -0
  1096. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/026-non-ascii-host.json +0 -0
  1097. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/negative/027-webhook-registration-authentication-unsigned.json +0 -0
  1098. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/001-basic-post.json +0 -0
  1099. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/002-post-with-content-digest.json +0 -0
  1100. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/003-es256-post.json +0 -0
  1101. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/004-multiple-signature-labels.json +0 -0
  1102. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/005-default-port-stripped.json +0 -0
  1103. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/006-dot-segment-path.json +0 -0
  1104. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/007-query-byte-preserved.json +0 -0
  1105. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/008-percent-encoded-path.json +0 -0
  1106. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/009-percent-encoded-unreserved-decoded.json +0 -0
  1107. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/010-percent-encoded-slash-preserved.json +0 -0
  1108. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/011-ipv6-authority.json +0 -0
  1109. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/request-signing/positive/012-ipv6-authority-default-port-stripped.json +0 -0
  1110. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/README.md +0 -0
  1111. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/keys.json +0 -0
  1112. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/001-wrong-tag.json +0 -0
  1113. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/002-expired-signature.json +0 -0
  1114. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/003-window-too-long.json +0 -0
  1115. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/004-alg-not-allowed.json +0 -0
  1116. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/005-missing-authority-component.json +0 -0
  1117. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/006-missing-content-digest.json +0 -0
  1118. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/007-unknown-keyid.json +0 -0
  1119. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/008-wrong-adcp-use.json +0 -0
  1120. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/009-content-digest-mismatch.json +0 -0
  1121. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/010-malformed-signature-input.json +0 -0
  1122. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/011-signature-without-input.json +0 -0
  1123. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/012-missing-expires-param.json +0 -0
  1124. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/013-expires-le-created.json +0 -0
  1125. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/014-missing-nonce-param.json +0 -0
  1126. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/015-signature-invalid.json +0 -0
  1127. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/016-replayed-nonce.json +0 -0
  1128. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/017-key-revoked.json +0 -0
  1129. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/018-rate-abuse.json +0 -0
  1130. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/019-revocation-stale.json +0 -0
  1131. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/020-key-ops-missing-verify.json +0 -0
  1132. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/negative/021-base64-alphabet-mixing.json +0 -0
  1133. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/001-basic-post.json +0 -0
  1134. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/002-es256-post.json +0 -0
  1135. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/003-multiple-signature-labels.json +0 -0
  1136. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/004-default-port-stripped.json +0 -0
  1137. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/005-percent-encoded-path.json +0 -0
  1138. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/006-query-byte-preserved.json +0 -0
  1139. /package/compliance/cache/{3.0.1 → 3.0.5}/test-vectors/webhook-signing/positive/007-body-without-idempotency-key.json +0 -0
  1140. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/capability-discovery.yaml +0 -0
  1141. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/collection-lists-pagination-integrity.yaml +0 -0
  1142. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/content-standards-pagination-integrity.yaml +0 -0
  1143. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/deterministic-testing.yaml +0 -0
  1144. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/error-compliance.yaml +0 -0
  1145. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/fictional-entities.yaml +0 -0
  1146. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/get-media-buys-pagination-integrity.yaml +0 -0
  1147. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/get-signals-pagination-integrity.yaml +0 -0
  1148. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/idempotency.yaml +0 -0
  1149. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/pagination-integrity-creative-formats.yaml +0 -0
  1150. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/pagination-integrity-list-accounts.yaml +0 -0
  1151. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/pagination-integrity.yaml +0 -0
  1152. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/property-lists-pagination-integrity.yaml +0 -0
  1153. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/schema-validation.yaml +0 -0
  1154. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/security.yaml +0 -0
  1155. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/signed-requests.yaml +0 -0
  1156. /package/compliance/cache/{3.0.1 → 3.0.5}/universal/webhook-emission.yaml +0 -0
@@ -0,0 +1,1080 @@
1
+ /**
2
+ * hello_seller_adapter_guaranteed — worked starting point for an
3
+ * AdCP guaranteed sales agent (specialism `sales-guaranteed`) that wraps
4
+ * an upstream GAM-style ad-server with HITL IO approval over static Bearer.
5
+ *
6
+ * The headline behavior: `create_media_buy` returns an A2A task envelope
7
+ * (`status: 'submitted'`), the upstream IO review runs in the background,
8
+ * and the buyer receives the final `media_buy_id` either by polling
9
+ * `tasks_get` or via the push_notification webhook. This is the
10
+ * `ctx.handoffToTask(fn)` pattern in v6 typed platforms.
11
+ *
12
+ * Fork this. Replace `upstream` with calls to your real backend. The
13
+ * AdCP-facing platform methods stay the same.
14
+ *
15
+ * FORK CHECKLIST
16
+ * 1. Replace every `// SWAP:` marker with calls to your backend.
17
+ * 2. Replace `KNOWN_PUBLISHERS` (line ~63) with your tenant directory
18
+ * (or remove and use your real `/networks/list` endpoint).
19
+ * 3. Replace `projectProduct()` defaults — `publisher_properties` selector,
20
+ * `pricing_options[]`, `reporting_capabilities` — with values your
21
+ * seller actually commits to.
22
+ * 4. Replace `aggressiveMeasurement` thresholds with your IO-team's
23
+ * committable maxima (viewability, completion-rate, etc.).
24
+ * 5. Replace `advertiserId = networkCode` collapse with a real lookup
25
+ * (production splits network and advertiser ids).
26
+ * 6. Replace the in-memory poll loop (`getTask`) with your IO-task
27
+ * backend; persist `(idempotency_key, lineitem_index) → upstream_lineitem_id`
28
+ * in your DB so a process restart can reconcile partial completion.
29
+ * 7. Validate: `node --test test/examples/hello-seller-adapter-guaranteed.test.js`
30
+ * 8. **DELETE the `// TEST-ONLY` blocks** before deploying:
31
+ * - sandbox-arm in `accounts.resolve` (resolves storyboard runner's
32
+ * synthetic `{brand, sandbox: true}` refs to a known network)
33
+ * - HITL bypass in `createMediaBuy` (the `if (isSandbox)` short-circuit)
34
+ * - `complyTest:` config block on `createAdcpServerFromPlatform`
35
+ * - in-memory `seededMediaBuys` / `simulatedDelivery` Maps
36
+ * These exist so the conformance harness can drive cascade scenarios
37
+ * deterministically. Production sellers ship without them.
38
+ *
39
+ * Demo:
40
+ * npx @adcp/sdk@latest mock-server sales-guaranteed --port 4450
41
+ * UPSTREAM_URL=http://127.0.0.1:4450 \
42
+ * npx tsx examples/hello_seller_adapter_guaranteed.ts
43
+ * adcp storyboard run http://127.0.0.1:3004/mcp sales_guaranteed \
44
+ * --auth sk_harness_do_not_use_in_prod
45
+ * curl http://127.0.0.1:4450/_debug/traffic
46
+ */
47
+
48
+ import {
49
+ createAdcpServerFromPlatform,
50
+ createMediaBuyStore,
51
+ InMemoryStateStore,
52
+ serve,
53
+ verifyApiKey,
54
+ createIdempotencyStore,
55
+ createUpstreamHttpClient,
56
+ memoryBackend,
57
+ AdcpError,
58
+ type DecisioningPlatform,
59
+ type SalesCorePlatform,
60
+ type SalesIngestionPlatform,
61
+ type AccountStore,
62
+ type Account,
63
+ type SyncCreativesRow,
64
+ type SyncAccountsResultRow,
65
+ } from '@adcp/sdk/server';
66
+ import type {
67
+ GetProductsRequest,
68
+ GetProductsResponse,
69
+ CreateMediaBuyRequest,
70
+ CreateMediaBuySuccess,
71
+ UpdateMediaBuyRequest,
72
+ UpdateMediaBuySuccess,
73
+ GetMediaBuysRequest,
74
+ GetMediaBuysResponse,
75
+ GetMediaBuyDeliveryRequest,
76
+ GetMediaBuyDeliveryResponse,
77
+ } from '@adcp/sdk/types';
78
+
79
+ // `Product` isn't re-exported from `@adcp/sdk/types` (#1254 in the rollup);
80
+ // derive the shape from the response array.
81
+ type Product = GetProductsResponse['products'][number];
82
+
83
+ const UPSTREAM_URL = process.env['UPSTREAM_URL'] ?? 'http://127.0.0.1:4450';
84
+ const UPSTREAM_API_KEY = process.env['UPSTREAM_API_KEY'] ?? 'mock_sales_guaranteed_key_do_not_use_in_prod';
85
+ const PORT = Number(process.env['PORT'] ?? 3004);
86
+ const ADCP_AUTH_TOKEN = process.env['ADCP_AUTH_TOKEN'] ?? 'sk_harness_do_not_use_in_prod';
87
+ const PUBLIC_AGENT_URL = process.env['PUBLIC_AGENT_URL'] ?? `http://127.0.0.1:${PORT}`;
88
+
89
+ const KNOWN_PUBLISHERS = ['acmeoutdoor.example', 'pinnacle-agency.example', 'premium-sports.example'];
90
+
91
+ // SWAP: the seller's minimum committable max_variance_percent — the
92
+ // buyer-vs-seller billing-count delta this seller will tolerate before
93
+ // triggering resolution. 5% is industry typical for premium guaranteed
94
+ // inventory; your IO desk owns the real number.
95
+ const MIN_VARIANCE_TOLERANCE = 5;
96
+
97
+ // TEST-ONLY: id-prefix used by the sandbox arm in `accounts.resolve` so
98
+ // `createMediaBuy` can detect cascade-storyboard requests and bypass the
99
+ // HITL handoff. Production sellers don't need this; remove the sandbox
100
+ // arm + this constant before deploying. See FORK CHECKLIST item 8.
101
+ const SANDBOX_ID_PREFIX = 'sandbox_';
102
+
103
+ // ---------------------------------------------------------------------------
104
+ // Upstream client — SWAP for production.
105
+ // Each method maps one AdCP tool concern to one upstream call. Per-request
106
+ // `X-Network-Code` is injected via the `headers` parameter on each call —
107
+ // the mock requires it on every request after auth. Real GAM uses the same
108
+ // pattern (X-API-Network), as do most ad-server APIs.
109
+ // ---------------------------------------------------------------------------
110
+
111
+ interface UpstreamNetwork {
112
+ network_code: string;
113
+ display_name: string;
114
+ adcp_publisher: string;
115
+ }
116
+
117
+ interface UpstreamProduct {
118
+ product_id: string;
119
+ name: string;
120
+ network_code: string;
121
+ delivery_type: 'guaranteed' | 'non_guaranteed';
122
+ channel: 'video' | 'ctv' | 'display' | 'audio';
123
+ format_ids: string[];
124
+ ad_unit_ids: string[];
125
+ pricing: { model: 'cpm' | 'cpv'; cpm: number; currency: string; min_spend?: number };
126
+ availability?: { start_date?: string; end_date?: string; available_impressions?: number };
127
+ /** Per-query forecast — present when GET /v1/products is called with
128
+ * `targeting`/`flight_start`/`flight_end`/`budget` query params. Mirrors
129
+ * AdCP `DeliveryForecast` field-for-field; pass through unchanged. */
130
+ forecast?: UpstreamForecast;
131
+ }
132
+
133
+ interface UpstreamForecastRange {
134
+ low?: number;
135
+ mid?: number;
136
+ high?: number;
137
+ [k: string]: unknown;
138
+ }
139
+ interface UpstreamForecastPoint {
140
+ label?: string;
141
+ budget?: number;
142
+ metrics: {
143
+ impressions?: UpstreamForecastRange;
144
+ reach?: UpstreamForecastRange;
145
+ frequency?: UpstreamForecastRange;
146
+ spend?: UpstreamForecastRange;
147
+ [k: string]: UpstreamForecastRange | undefined;
148
+ };
149
+ }
150
+ interface UpstreamForecast {
151
+ points: UpstreamForecastPoint[];
152
+ forecast_range_unit: 'spend' | 'availability';
153
+ method: 'modeled' | 'guaranteed' | 'estimate';
154
+ currency: string;
155
+ generated_at?: string;
156
+ }
157
+
158
+ interface UpstreamOrder {
159
+ order_id: string;
160
+ network_code: string;
161
+ name: string;
162
+ status: 'draft' | 'pending_approval' | 'approved' | 'delivering' | 'completed' | 'canceled' | 'rejected';
163
+ advertiser_id: string;
164
+ currency: string;
165
+ budget?: number;
166
+ approval_task_id?: string;
167
+ rejection_reason?: string;
168
+ /** Mock's GET /v1/orders/{id} omits line_items; fetch via
169
+ * GET /v1/orders/{id}/lineitems separately. Real GAM splits the same
170
+ * way (Order vs LineItem services). */
171
+ line_items?: Array<{
172
+ line_item_id: string;
173
+ order_id: string;
174
+ product_id: string;
175
+ status: 'pending_creatives' | 'ready' | 'paused' | 'delivering' | 'completed';
176
+ budget: number;
177
+ creative_ids: string[];
178
+ }>;
179
+ created_at: string;
180
+ updated_at: string;
181
+ }
182
+
183
+ interface UpstreamTask {
184
+ task_id: string;
185
+ order_id: string;
186
+ status: 'submitted' | 'working' | 'completed' | 'rejected';
187
+ result?: { outcome: 'approved' | 'rejected'; reviewer_note?: string };
188
+ }
189
+
190
+ interface UpstreamCreative {
191
+ creative_id: string;
192
+ network_code: string;
193
+ name: string;
194
+ format_id: string;
195
+ status: 'active' | 'paused' | 'archived';
196
+ }
197
+
198
+ interface UpstreamDelivery {
199
+ order_id: string;
200
+ currency: string;
201
+ reporting_period: { start: string; end: string };
202
+ totals: {
203
+ impressions: number;
204
+ clicks: number;
205
+ spend: number;
206
+ viewable_impressions: number;
207
+ video_completions: number;
208
+ conversions: number;
209
+ };
210
+ line_item_breakdown?: Array<{ line_item_id: string; impressions: number; spend: number }>;
211
+ }
212
+
213
+ const http = createUpstreamHttpClient({
214
+ baseUrl: UPSTREAM_URL,
215
+ auth: { kind: 'static_bearer', token: UPSTREAM_API_KEY },
216
+ });
217
+
218
+ const networkHeader = (networkCode: string) => ({ 'X-Network-Code': networkCode });
219
+
220
+ const upstream = {
221
+ // SWAP: tenant lookup. Mock exposes /_lookup; production typically a
222
+ // network registry / service-account scope endpoint.
223
+ async lookupNetwork(publisherDomain: string): Promise<UpstreamNetwork | null> {
224
+ const { body } = await http.get<UpstreamNetwork>('/_lookup/network', { adcp_publisher: publisherDomain });
225
+ return body;
226
+ },
227
+
228
+ // SWAP: product catalog. Mock filters by network_code via header + optional
229
+ // ?delivery_type. When `flight_start`/`flight_end`/`budget` are passed, the
230
+ // mock returns per-product `forecast` inline — single round-trip instead of
231
+ // N follow-up `/v1/forecast` calls. Real GAM exposes `/networks/{code}/products`
232
+ // for the catalog and `forecastService.getDeliveryForecast` for forecast;
233
+ // adopters whose backend doesn't fold forecast into the catalog response
234
+ // call `getForecast` per product (or in parallel) below.
235
+ async listProducts(
236
+ networkCode: string,
237
+ opts?: {
238
+ deliveryType?: 'guaranteed' | 'non_guaranteed';
239
+ flightStart?: string;
240
+ flightEnd?: string;
241
+ budget?: number;
242
+ }
243
+ ): Promise<UpstreamProduct[]> {
244
+ const params: Record<string, string> = {};
245
+ if (opts?.deliveryType) params['delivery_type'] = opts.deliveryType;
246
+ if (opts?.flightStart) params['flight_start'] = opts.flightStart;
247
+ if (opts?.flightEnd) params['flight_end'] = opts.flightEnd;
248
+ if (opts?.budget !== undefined) params['budget'] = String(opts.budget);
249
+ const { body } = await http.get<{ products: UpstreamProduct[] }>(
250
+ '/v1/products',
251
+ params,
252
+ networkHeader(networkCode)
253
+ );
254
+ return body?.products ?? [];
255
+ },
256
+
257
+ // SWAP: per-product forecast. Use this when your backend separates the
258
+ // catalog and forecast surfaces (typical for GAM's `forecastService` vs
259
+ // `inventoryService`). For the worked-mock case we fold forecast into
260
+ // `listProducts` above; this method shows the discrete shape.
261
+ async getForecast(
262
+ networkCode: string,
263
+ body: {
264
+ product_id: string;
265
+ targeting?: Record<string, unknown>;
266
+ flight_dates?: { start?: string; end?: string };
267
+ budget?: number;
268
+ }
269
+ ): Promise<UpstreamForecast | null> {
270
+ const r = await http.post<UpstreamForecast>('/v1/forecast', body, networkHeader(networkCode));
271
+ return r.body;
272
+ },
273
+
274
+ // SWAP: list orders.
275
+ async listOrders(networkCode: string): Promise<UpstreamOrder[]> {
276
+ const { body } = await http.get<{ orders: UpstreamOrder[] }>('/v1/orders', undefined, networkHeader(networkCode));
277
+ return body?.orders ?? [];
278
+ },
279
+
280
+ // SWAP: create order. Mock returns 201 with status='pending_approval' +
281
+ // approval_task_id. Real platforms vary; GAM creates an Order in DRAFT
282
+ // and IO signing is handled out-of-band.
283
+ async createOrder(
284
+ networkCode: string,
285
+ body: { name: string; advertiser_id: string; currency: string; budget: number; client_request_id?: string }
286
+ ): Promise<UpstreamOrder> {
287
+ const r = await http.post<UpstreamOrder>('/v1/orders', body, networkHeader(networkCode));
288
+ if (r.body === null) {
289
+ throw new AdcpError('INVALID_REQUEST', { message: 'order creation rejected by upstream' });
290
+ }
291
+ return r.body;
292
+ },
293
+
294
+ async getOrder(networkCode: string, orderId: string): Promise<UpstreamOrder | null> {
295
+ const { body } = await http.get<UpstreamOrder>(
296
+ `/v1/orders/${encodeURIComponent(orderId)}`,
297
+ undefined,
298
+ networkHeader(networkCode)
299
+ );
300
+ return body;
301
+ },
302
+
303
+ // SWAP: list line items under an order. Mock's GET /v1/orders/{id} strips
304
+ // line_items from the response — fetch them via this separate call.
305
+ // Real GAM mirrors this split (OrderService vs LineItemService).
306
+ //
307
+ // Note: returns `[]` on null response body. Callers MUST validate the
308
+ // order exists separately (via `getOrder`) before calling — a missing
309
+ // order returns `[]` here rather than throwing, so it would surface as
310
+ // "no packages match" rather than `MEDIA_BUY_NOT_FOUND`. Both
311
+ // `updateMediaBuy` and `getMediaBuys` below pre-validate by calling
312
+ // `getOrder` / `listOrders`, so the existence check has already run.
313
+ async listLineItems(networkCode: string, orderId: string): Promise<NonNullable<UpstreamOrder['line_items']>> {
314
+ const { body } = await http.get<{ line_items: NonNullable<UpstreamOrder['line_items']> }>(
315
+ `/v1/orders/${encodeURIComponent(orderId)}/lineitems`,
316
+ undefined,
317
+ networkHeader(networkCode)
318
+ );
319
+ return body?.line_items ?? [];
320
+ },
321
+
322
+ // SWAP: create line item under an order. Real GAM uses LineItemService.
323
+ async createLineItem(
324
+ networkCode: string,
325
+ orderId: string,
326
+ body: { product_id: string; budget: number; ad_unit_targeting?: string[]; client_request_id?: string }
327
+ ): Promise<{ line_item_id: string }> {
328
+ const r = await http.post<{ line_item_id: string }>(
329
+ `/v1/orders/${encodeURIComponent(orderId)}/lineitems`,
330
+ body,
331
+ networkHeader(networkCode)
332
+ );
333
+ if (r.body === null) {
334
+ throw new AdcpError('INVALID_REQUEST', { message: 'line item creation rejected by upstream' });
335
+ }
336
+ return r.body;
337
+ },
338
+
339
+ // SWAP: poll the IO review task. Mock auto-promotes submitted → working →
340
+ // completed after 2 polls. Real platforms expose a similar poll endpoint
341
+ // OR push the result via webhook; mirror whichever your backend uses.
342
+ async getTask(networkCode: string, taskId: string): Promise<UpstreamTask | null> {
343
+ const { body } = await http.get<UpstreamTask>(
344
+ `/v1/tasks/${encodeURIComponent(taskId)}`,
345
+ undefined,
346
+ networkHeader(networkCode)
347
+ );
348
+ return body;
349
+ },
350
+
351
+ async createCreative(
352
+ networkCode: string,
353
+ body: { name: string; format_id: string; advertiser_id: string; client_request_id?: string }
354
+ ): Promise<UpstreamCreative> {
355
+ const r = await http.post<UpstreamCreative>('/v1/creatives', body, networkHeader(networkCode));
356
+ if (r.body === null) {
357
+ throw new AdcpError('INVALID_REQUEST', { message: 'creative creation rejected by upstream' });
358
+ }
359
+ return r.body;
360
+ },
361
+
362
+ async getDelivery(networkCode: string, orderId: string): Promise<UpstreamDelivery | null> {
363
+ const { body } = await http.get<UpstreamDelivery>(
364
+ `/v1/orders/${encodeURIComponent(orderId)}/delivery`,
365
+ undefined,
366
+ networkHeader(networkCode)
367
+ );
368
+ return body;
369
+ },
370
+ };
371
+
372
+ // ---------------------------------------------------------------------------
373
+ // AdCP-side adapter — typed against SalesPlatform.
374
+ // ---------------------------------------------------------------------------
375
+
376
+ interface NetworkMeta {
377
+ network_code: string;
378
+ publisher_domain: string;
379
+ [key: string]: unknown;
380
+ }
381
+
382
+ const FORMAT_AGENT_URL = PUBLIC_AGENT_URL;
383
+
384
+ /** Project upstream product onto AdCP `Product`. The wire `Product` shape
385
+ * has many optional fields; we populate only the ones the storyboard
386
+ * validates plus the bare-minimum required spec fields. Production
387
+ * adopters lift more from their backend (forecast, performance_standards,
388
+ * reporting_capabilities, etc.). */
389
+ function projectProduct(p: UpstreamProduct, publisherDomain: string): Product {
390
+ return {
391
+ product_id: p.product_id,
392
+ name: p.name,
393
+ description: `${p.name} — ${p.delivery_type} ${p.channel}`,
394
+ // publisher_properties is required minItems: 1. Production sellers
395
+ // surface their actual property catalog (per adagents.json). For the
396
+ // worked example we declare the catch-all selector — every property
397
+ // owned by the publisher domain is in scope.
398
+ publisher_properties: [{ publisher_domain: publisherDomain, selection_type: 'all' }],
399
+ channels: [
400
+ p.channel === 'video'
401
+ ? 'olv'
402
+ : p.channel === 'ctv'
403
+ ? 'ctv'
404
+ : p.channel === 'audio'
405
+ ? 'streaming_audio'
406
+ : 'display',
407
+ ],
408
+ format_ids: p.format_ids.map(id => ({ agent_url: FORMAT_AGENT_URL, id })),
409
+ delivery_type: p.delivery_type,
410
+ pricing_options: [
411
+ {
412
+ pricing_option_id: 'cpm_guaranteed_fixed',
413
+ pricing_model: 'cpm',
414
+ currency: p.pricing.currency,
415
+ fixed_price: p.pricing.cpm,
416
+ ...(p.pricing.min_spend !== undefined && { min_spend: p.pricing.min_spend }),
417
+ },
418
+ ],
419
+ reporting_capabilities: {
420
+ available_reporting_frequencies: ['daily'],
421
+ expected_delay_minutes: 240,
422
+ timezone: 'UTC',
423
+ supports_webhooks: false,
424
+ available_metrics: ['impressions', 'clicks', 'spend'],
425
+ date_range_support: 'date_range',
426
+ },
427
+ // Pass through per-query forecast verbatim — mock returns AdCP-shape
428
+ // already (`points`, `metrics.{impressions,reach,frequency,spend}` with
429
+ // `{low,mid,high}`, `forecast_range_unit`, `method`, `currency`). Real
430
+ // GAM responses need adapter-side translation; the mock skips that step
431
+ // intentionally so adopters can see what AdCP-shape forecast looks like
432
+ // without writing the projection first.
433
+ ...(p.forecast && { forecast: p.forecast }),
434
+ };
435
+ }
436
+
437
+ function mapMediaBuyStatus(
438
+ orderStatus: UpstreamOrder['status']
439
+ ): 'pending_creatives' | 'pending_start' | 'active' | 'paused' | 'completed' | 'canceled' {
440
+ switch (orderStatus) {
441
+ case 'delivering':
442
+ return 'active';
443
+ case 'approved':
444
+ return 'pending_start';
445
+ case 'completed':
446
+ return 'completed';
447
+ case 'canceled':
448
+ case 'rejected':
449
+ return 'canceled';
450
+ default:
451
+ // pending_approval / draft both project to pending_creatives — by the
452
+ // time the buyer reads MediaBuy status the upstream has at minimum
453
+ // accepted the order. The HITL-only "pending_approval" upstream state
454
+ // never reaches MediaBuy.status in this adapter because
455
+ // `createMediaBuy` blocks the task envelope until upstream transitions
456
+ // out of pending_approval.
457
+ return 'pending_creatives';
458
+ }
459
+ }
460
+
461
+ const sleep = (ms: number) => new Promise<void>(r => setTimeout(r, ms));
462
+
463
+ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never>, NetworkMeta> {
464
+ capabilities = {
465
+ specialisms: ['sales-guaranteed'] as const,
466
+ channels: ['olv', 'ctv', 'display'] as const,
467
+ pricingModels: ['cpm'] as const,
468
+ config: {},
469
+ // Declares the comply_test_controller surface so the conformance
470
+ // runner picks up `controller_detected: true` and grades missing
471
+ // scenarios as `not_applicable` instead of `failed`. The framework
472
+ // auto-derives the actual `scenarios` list from the `complyTest:`
473
+ // adapter set wired on `createAdcpServerFromPlatform` below.
474
+ compliance_testing: {
475
+ scenarios: ['force_media_buy_status', 'simulate_delivery'] as const,
476
+ },
477
+ };
478
+
479
+ accounts: AccountStore<NetworkMeta> = {
480
+ /** AdCP `account.brand.domain` → upstream `network_code`. The storyboard
481
+ * uses brand.domain, mapped 1:1 onto the mock's `adcp_publisher` field.
482
+ * Production may use account.publisher or a separate auth-derived
483
+ * binding. */
484
+ resolve: async ref => {
485
+ if (!ref) return null;
486
+ // AccountReference discriminated union — see the worked-example notes
487
+ // on the same pattern in hello_seller_adapter_social. The mock has no
488
+ // account_id → network_code index, so the account_id arm is
489
+ // unreachable; production sellers add a directory lookup.
490
+ // SWAP: persist `account_id → network_code` during sync_accounts and
491
+ // serve account_id lookups from there.
492
+ if ('account_id' in ref) return null;
493
+
494
+ // ─── TEST-ONLY: cascade-scenario sandbox-arm ─────────────────────
495
+ // DELETE THIS BLOCK BEFORE DEPLOYING. The compliance runner injects
496
+ // synthetic refs like `{brand: {domain: 'test.example'}, sandbox: true}`
497
+ // for `media_buy_seller/*` cascade scenarios that test wire shape
498
+ // without depending on real test-kit principals. The block routes
499
+ // those synthetic refs to a fixed seeded network so the rest of the
500
+ // adapter has something concrete to operate on. Production sellers
501
+ // either reject sandbox refs entirely or route them to a dedicated
502
+ // sandbox tenant their IO desk owns; either way, this in-example
503
+ // synthesis isn't appropriate for prod traffic.
504
+ //
505
+ // Gate is `ADCP_SANDBOX === '1'` exclusively — single-source so
506
+ // accidentally setting `ADCP_SANDBOX` in any non-sandbox environment
507
+ // is the only way this branch fires.
508
+ if (ref.sandbox === true && process.env['ADCP_SANDBOX'] === '1') {
509
+ const sandboxDomain = 'acmeoutdoor.example';
510
+ const network = await upstream.lookupNetwork(sandboxDomain);
511
+ if (!network) return null;
512
+ return {
513
+ id: `${SANDBOX_ID_PREFIX}${network.network_code}`,
514
+ name: `Sandbox: ${network.display_name}`,
515
+ status: 'active',
516
+ ...(ref.operator !== undefined && { operator: ref.operator }),
517
+ brand: { domain: ref.brand.domain ?? sandboxDomain },
518
+ ctx_metadata: {
519
+ network_code: network.network_code,
520
+ publisher_domain: network.adcp_publisher,
521
+ },
522
+ };
523
+ }
524
+ // ─── /TEST-ONLY ──────────────────────────────────────────────────
525
+
526
+ const publisherDomain = ref.brand.domain;
527
+ if (!publisherDomain) return null;
528
+ const network = await upstream.lookupNetwork(publisherDomain);
529
+ if (!network) return null;
530
+ const operator = ref.operator;
531
+ return {
532
+ id: network.network_code,
533
+ name: network.display_name,
534
+ status: 'active',
535
+ ...(operator !== undefined && { operator }),
536
+ brand: { domain: network.adcp_publisher },
537
+ ctx_metadata: {
538
+ network_code: network.network_code,
539
+ publisher_domain: network.adcp_publisher,
540
+ },
541
+ };
542
+ },
543
+
544
+ /** sync_accounts handler. Echoes the buyer's account refs back with the
545
+ * resolved upstream network_code. */
546
+ upsert: async refs => {
547
+ const out: SyncAccountsResultRow[] = [];
548
+ for (const ref of refs) {
549
+ // sync_accounts always carries the brand+operator arm — buyer is
550
+ // registering, not referencing.
551
+ if ('account_id' in ref) {
552
+ out.push({
553
+ brand: { domain: '' },
554
+ operator: '',
555
+ action: 'failed',
556
+ status: 'rejected',
557
+ errors: [{ code: 'INVALID_REQUEST', message: 'sync_accounts requires brand+operator, not account_id' }],
558
+ });
559
+ continue;
560
+ }
561
+ const domain = ref.brand.domain;
562
+ const operator = ref.operator;
563
+ const network = domain ? await upstream.lookupNetwork(domain) : null;
564
+ if (!network) {
565
+ out.push({
566
+ brand: { domain },
567
+ operator,
568
+ action: 'failed',
569
+ status: 'rejected',
570
+ errors: [{ code: 'ACCOUNT_NOT_FOUND', message: `No publisher network registered for ${domain}` }],
571
+ });
572
+ continue;
573
+ }
574
+ out.push({
575
+ account_id: network.network_code,
576
+ name: network.display_name,
577
+ brand: { domain: network.adcp_publisher },
578
+ operator,
579
+ action: 'unchanged',
580
+ status: 'active',
581
+ });
582
+ }
583
+ return out;
584
+ },
585
+
586
+ list: async () => {
587
+ const items: Array<Account<NetworkMeta>> = [];
588
+ for (const domain of KNOWN_PUBLISHERS) {
589
+ const n = await upstream.lookupNetwork(domain);
590
+ if (!n) continue;
591
+ items.push({
592
+ id: n.network_code,
593
+ name: n.display_name,
594
+ status: 'active',
595
+ brand: { domain: n.adcp_publisher },
596
+ ctx_metadata: { network_code: n.network_code, publisher_domain: n.adcp_publisher },
597
+ });
598
+ }
599
+ return { items, has_more: false };
600
+ },
601
+ };
602
+
603
+ // Required: explicit `SalesCorePlatform<Meta> & SalesIngestionPlatform<Meta>`
604
+ // annotation. `defineSalesPlatform` widens to all-optional, and the
605
+ // per-specialism `RequiredPlatformsFor<'sales-guaranteed'>` check rejects
606
+ // a widened literal. The intersection annotation flows the closed shape
607
+ // into the literal so all five core methods stay required at the type
608
+ // level. See `decisioning.type-checks.ts` for the regression-locked
609
+ // patterns.
610
+ sales: SalesCorePlatform<NetworkMeta> & SalesIngestionPlatform<NetworkMeta> = {
611
+ getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsResponse> => {
612
+ const networkCode = ctx.account.ctx_metadata.network_code;
613
+ const publisherDomain = ctx.account.ctx_metadata.publisher_domain;
614
+ // Storyboard sends buying_mode: 'brief' with a free-text brief —
615
+ // production maps to a relevance ranker. The mock returns the full
616
+ // product catalog; we pull guaranteed products to match the
617
+ // sales-guaranteed specialism's value proposition.
618
+ //
619
+ // When the buyer provides structured filters (flight dates, budget),
620
+ // forward them so each product comes back with a per-query
621
+ // DeliveryForecast — a single upstream round-trip surfaces both the
622
+ // catalog and the forecast curve. SWAP: production GAM splits this
623
+ // into `inventoryService` (catalog) + `forecastService.getDeliveryForecast`
624
+ // (per-product forecast). Use the discrete `getForecast` below if
625
+ // your backend can't fold forecast into the catalog response.
626
+ const briefBudget = (req.filters?.budget_range as { max?: number } | undefined)?.max;
627
+ const guaranteed = await upstream.listProducts(networkCode, {
628
+ deliveryType: 'guaranteed',
629
+ ...(req.filters?.start_date && { flightStart: req.filters.start_date }),
630
+ ...(req.filters?.end_date && { flightEnd: req.filters.end_date }),
631
+ ...(briefBudget !== undefined && { budget: briefBudget }),
632
+ });
633
+ return { products: guaranteed.map(p => projectProduct(p, publisherDomain)) };
634
+ },
635
+
636
+ /**
637
+ * HITL-handoff create_media_buy. Returns `ctx.handoffToTask(fn)`; the
638
+ * buyer gets `{status: 'submitted', task_id}` immediately and the
639
+ * framework runs `fn` in the background. `fn`'s returned
640
+ * `CreateMediaBuySuccess` becomes the task's terminal artifact, which
641
+ * the buyer reads via `tasks_get` polling or the configured webhook.
642
+ */
643
+ createMediaBuy: async (req: CreateMediaBuyRequest, ctx) => {
644
+ const networkCode = ctx.account.ctx_metadata.network_code;
645
+ // SWAP: production splits network_code (the publisher's tenant) and
646
+ // advertiser_id (the brand seat under that tenant) — they're distinct
647
+ // upstream identifiers. The mock doesn't model the split (every
648
+ // advertiser is owned by the same network), so this worked example
649
+ // collapses both into network_code. Real GAM/FreeWheel/Operative
650
+ // adapters resolve advertiser_id from `req.brand` against the
651
+ // publisher's advertiser directory before issuing the order.
652
+ const advertiserId = networkCode;
653
+
654
+ // Reject aggressive measurement_terms before the buy hits upstream.
655
+ // The storyboard exercises this path and asserts TERMS_REJECTED on
656
+ // the wire. Production sellers branch on viewability / completion-rate
657
+ // / IVT thresholds the platform won't commit to.
658
+ //
659
+ // SWAP: replace these defaults with your IO team's committable maxima.
660
+ const MAX_VIEWABILITY = 0.85;
661
+ const MAX_COMPLETION_RATE = 0.9;
662
+ // Surface the offending package + threshold name + observed value +
663
+ // committable max so the buyer agent can fix the constraint and retry.
664
+ // Opaque "exceed seller commitments" messages get cargo-culted into
665
+ // every adopter's constraint enforcement and produce un-actionable
666
+ // errors at the buyer-agent boundary.
667
+ // The cascade `measurement_terms_rejected` storyboard sends 0% (zero
668
+ // tolerance), which no operator commits to. Threshold lives at module
669
+ // scope above for one-grep tunability.
670
+ const packagesArr = (req.packages ?? []) as Array<{
671
+ measurement_terms?: {
672
+ viewability_threshold?: number;
673
+ completion_rate_threshold?: number;
674
+ billing_measurement?: { max_variance_percent?: number };
675
+ };
676
+ }>;
677
+ for (let i = 0; i < packagesArr.length; i++) {
678
+ const terms = packagesArr[i]?.measurement_terms;
679
+ if (!terms) continue;
680
+ if (typeof terms.viewability_threshold === 'number' && terms.viewability_threshold > MAX_VIEWABILITY) {
681
+ throw new AdcpError('TERMS_REJECTED', {
682
+ message: `packages[${i}].measurement_terms.viewability_threshold = ${terms.viewability_threshold} exceeds maximum committable threshold (${MAX_VIEWABILITY}). Lower to ≤${MAX_VIEWABILITY} or remove the term to retry.`,
683
+ field: `packages[${i}].measurement_terms.viewability_threshold`,
684
+ recovery: 'correctable',
685
+ });
686
+ }
687
+ if (
688
+ typeof terms.completion_rate_threshold === 'number' &&
689
+ terms.completion_rate_threshold > MAX_COMPLETION_RATE
690
+ ) {
691
+ throw new AdcpError('TERMS_REJECTED', {
692
+ message: `packages[${i}].measurement_terms.completion_rate_threshold = ${terms.completion_rate_threshold} exceeds maximum committable threshold (${MAX_COMPLETION_RATE}). Lower to ≤${MAX_COMPLETION_RATE} or remove the term to retry.`,
693
+ field: `packages[${i}].measurement_terms.completion_rate_threshold`,
694
+ recovery: 'correctable',
695
+ });
696
+ }
697
+ const variance = terms.billing_measurement?.max_variance_percent;
698
+ if (typeof variance === 'number' && variance < MIN_VARIANCE_TOLERANCE) {
699
+ throw new AdcpError('TERMS_REJECTED', {
700
+ message: `packages[${i}].measurement_terms.billing_measurement.max_variance_percent = ${variance} is below the seller's minimum commitment (${MIN_VARIANCE_TOLERANCE}%). Real billing-count divergence between buyer and seller routinely exceeds zero; commit to ≥${MIN_VARIANCE_TOLERANCE}% or remove the term.`,
701
+ field: `packages[${i}].measurement_terms.billing_measurement.max_variance_percent`,
702
+ recovery: 'correctable',
703
+ });
704
+ }
705
+ }
706
+
707
+ const totalBudget =
708
+ req.total_budget?.amount ??
709
+ (req.packages ?? []).reduce((s, p) => s + ((p as { budget?: number }).budget ?? 0), 0);
710
+ const currency = req.total_budget?.currency ?? 'USD';
711
+
712
+ // Create the upstream order eagerly. The mock returns immediately
713
+ // with status: 'pending_approval' + approval_task_id. The buyer
714
+ // never sees this state — we hold the task envelope open until
715
+ // upstream completes IO review.
716
+ const order = await upstream.createOrder(networkCode, {
717
+ name: `MediaBuy from ${req.brand?.domain ?? 'unknown'}`,
718
+ advertiser_id: advertiserId,
719
+ currency,
720
+ budget: totalBudget,
721
+ client_request_id: req.idempotency_key,
722
+ });
723
+
724
+ const packagesRequest = (req.packages ?? []) as Array<{
725
+ product_id?: string;
726
+ budget?: number;
727
+ }>;
728
+
729
+ // Build the synchronous-confirmation flow as a closure so both
730
+ // the HITL handoff path AND the sandbox-direct path can call it.
731
+ // The work is identical; only the wrapper differs.
732
+ const completeIoAndCreateLineItems = async (): Promise<CreateMediaBuySuccess> => {
733
+ // Poll upstream IO task to terminal state. Mock promotes
734
+ // submitted → working → completed across two polls; production
735
+ // platforms vary in cadence. Bound the poll loop so a stuck
736
+ // upstream doesn't keep the AdCP task open indefinitely.
737
+ if (order.approval_task_id) {
738
+ for (let i = 0; i < 10; i++) {
739
+ const task = await upstream.getTask(networkCode, order.approval_task_id);
740
+ if (!task) break;
741
+ if (task.status === 'completed' && task.result?.outcome === 'approved') break;
742
+ if (task.status === 'rejected' || task.result?.outcome === 'rejected') {
743
+ throw new AdcpError('INVALID_REQUEST', {
744
+ message: task.result?.reviewer_note ?? 'IO review rejected the buy',
745
+ recovery: 'terminal',
746
+ });
747
+ }
748
+ await sleep(50);
749
+ }
750
+ }
751
+
752
+ // Trigger the upstream order's auto-transition approved → delivering
753
+ // by reading it once. Real platforms publish this transition via
754
+ // status webhooks; the mock advances on GET.
755
+ await upstream.getOrder(networkCode, order.order_id);
756
+
757
+ // Create line items per requested package.
758
+ const packagesOut: CreateMediaBuySuccess['packages'] = [];
759
+ for (let i = 0; i < packagesRequest.length; i++) {
760
+ const pkg = packagesRequest[i];
761
+ if (!pkg) continue;
762
+ if (!pkg.product_id) {
763
+ throw new AdcpError('INVALID_REQUEST', {
764
+ message: `package[${i}]: product_id required`,
765
+ field: `packages[${i}].product_id`,
766
+ });
767
+ }
768
+ const li = await upstream.createLineItem(networkCode, order.order_id, {
769
+ product_id: pkg.product_id,
770
+ budget: pkg.budget ?? 0,
771
+ client_request_id: `${req.idempotency_key}.li.${i}`,
772
+ });
773
+ packagesOut.push({
774
+ package_id: li.line_item_id,
775
+ product_id: pkg.product_id,
776
+ budget: pkg.budget ?? 0,
777
+ });
778
+ }
779
+
780
+ // `confirmed_at = now` per the spec (`media-buy.json:24-28` —
781
+ // "ISO 8601 timestamp when the seller confirmed this media buy.
782
+ // A successful create_media_buy response constitutes order
783
+ // confirmation"). The handoff fn's return IS that confirmation.
784
+ //
785
+ // Status is `pending_creatives` (not `active`) until creatives
786
+ // sync. The MediaBuyStatus enum is `pending_creatives | pending_start
787
+ // | active | paused | completed | rejected | canceled` —
788
+ // `pending_creatives` is the right value when the buy is approved
789
+ // but no creatives have been assigned. Buyers transition to
790
+ // `active` after `sync_creatives` lands, which the framework
791
+ // surfaces via `publishStatusChange` on `resource_type: 'media_buy'`.
792
+ return {
793
+ media_buy_id: order.order_id,
794
+ status: 'pending_creatives',
795
+ confirmed_at: new Date().toISOString(),
796
+ packages: packagesOut,
797
+ };
798
+ };
799
+
800
+ // ─── TEST-ONLY: HITL bypass for sandbox accounts ─────────────────
801
+ // DELETE THIS BLOCK BEFORE DEPLOYING. The compliance runner expects
802
+ // synchronous `media_buy_id` for `media_buy_seller/*` cascade
803
+ // scenarios (pending_creatives_to_start / inventory_list_* /
804
+ // invalid_transitions / measurement_terms_rejected follow-up); the
805
+ // BASE `sales_guaranteed` storyboard tests the IO-signing async
806
+ // path. Production sellers route every buy through the same path —
807
+ // either always-HITL or always-sync, never both based on a runtime
808
+ // flag. Belt-and-suspenders env re-check below: if the env flag
809
+ // isn't set even though the id flowed in marked sandbox, fall
810
+ // through to the production HITL path. Defends against an
811
+ // upstream-resolved account that somehow carries the sandbox prefix
812
+ // without the env being sandbox-mode.
813
+ const isSandbox = ctx.account.id.startsWith(SANDBOX_ID_PREFIX) && process.env['ADCP_SANDBOX'] === '1';
814
+ if (isSandbox) {
815
+ return completeIoAndCreateLineItems();
816
+ }
817
+ // ─── /TEST-ONLY ──────────────────────────────────────────────────
818
+
819
+ return ctx.handoffToTask(async (taskCtx): Promise<CreateMediaBuySuccess> => {
820
+ void taskCtx;
821
+ return completeIoAndCreateLineItems();
822
+ });
823
+ },
824
+
825
+ updateMediaBuy: async (buyId: string, patch: UpdateMediaBuyRequest, ctx): Promise<UpdateMediaBuySuccess> => {
826
+ const networkCode = ctx.account.ctx_metadata.network_code;
827
+ // Validate the buy exists before touching it. Storyboard exercises
828
+ // bogus media_buy_id and bogus package_id paths and asserts the
829
+ // wire spec's MEDIA_BUY_NOT_FOUND / PACKAGE_NOT_FOUND error codes.
830
+ const order = await upstream.getOrder(networkCode, buyId);
831
+ if (!order) {
832
+ throw new AdcpError('MEDIA_BUY_NOT_FOUND', {
833
+ message: `Media buy ${buyId} not found`,
834
+ field: 'media_buy_id',
835
+ recovery: 'terminal',
836
+ });
837
+ }
838
+ if (patch.packages) {
839
+ const lineItems = await upstream.listLineItems(networkCode, buyId);
840
+ const knownPackageIds = new Set(lineItems.map(li => li.line_item_id));
841
+ for (const p of patch.packages) {
842
+ const pid = (p as { package_id?: string }).package_id;
843
+ if (pid && !knownPackageIds.has(pid)) {
844
+ throw new AdcpError('PACKAGE_NOT_FOUND', {
845
+ message: `Package ${pid} not found in media buy ${buyId}`,
846
+ field: 'packages.package_id',
847
+ recovery: 'terminal',
848
+ });
849
+ }
850
+ }
851
+ }
852
+ // Mock doesn't model partial updates; production wires each patch
853
+ // field onto the upstream's OrderService update endpoint. The
854
+ // worked example just echoes success.
855
+ return {
856
+ media_buy_id: buyId,
857
+ status: mapMediaBuyStatus(order.status),
858
+ };
859
+ },
860
+
861
+ getMediaBuys: async (req: GetMediaBuysRequest, ctx): Promise<GetMediaBuysResponse> => {
862
+ const networkCode = ctx.account.ctx_metadata.network_code;
863
+ const orders = await upstream.listOrders(networkCode);
864
+ const filtered = req.media_buy_ids ? orders.filter(o => req.media_buy_ids!.includes(o.order_id)) : orders;
865
+ // Fetch line items per order — mock's GET /v1/orders strips them.
866
+ // Production GAM/FreeWheel similarly splits Order vs LineItem services.
867
+ // SWAP: this is N+1 against the upstream. Real adapters either batch
868
+ // (e.g. POST /v1/lineitems:batchGet with order_ids[]) or accept the
869
+ // round-trip cost. Some platforms expose a `?include=lineitems`
870
+ // query param on the list endpoint that folds them in.
871
+ const buys = await Promise.all(
872
+ filtered.map(async o => {
873
+ const lineItems = await upstream.listLineItems(networkCode, o.order_id);
874
+ return {
875
+ media_buy_id: o.order_id,
876
+ status: mapMediaBuyStatus(o.status),
877
+ currency: o.currency,
878
+ ...(o.budget !== undefined && { total_budget: o.budget }),
879
+ confirmed_at: o.updated_at,
880
+ created_at: o.created_at,
881
+ updated_at: o.updated_at,
882
+ packages: lineItems.map(li => ({
883
+ package_id: li.line_item_id,
884
+ product_id: li.product_id,
885
+ budget: li.budget,
886
+ currency: o.currency,
887
+ })),
888
+ };
889
+ })
890
+ );
891
+ return { media_buys: buys };
892
+ },
893
+
894
+ syncCreatives: async (creatives, ctx): Promise<SyncCreativesRow[]> => {
895
+ const networkCode = ctx.account.ctx_metadata.network_code;
896
+ const rows: SyncCreativesRow[] = [];
897
+ for (const c of creatives) {
898
+ try {
899
+ const created = await upstream.createCreative(networkCode, {
900
+ name: c.name,
901
+ format_id: c.format_id.id,
902
+ advertiser_id: networkCode,
903
+ });
904
+ rows.push({
905
+ creative_id: c.creative_id,
906
+ action: 'created',
907
+ status: 'approved',
908
+ platform_id: created.creative_id,
909
+ });
910
+ } catch (err) {
911
+ rows.push({
912
+ creative_id: c.creative_id,
913
+ action: 'failed',
914
+ errors: [
915
+ {
916
+ code: err instanceof AdcpError ? err.code : 'INVALID_REQUEST',
917
+ message: err instanceof Error ? err.message : 'creative sync failed',
918
+ },
919
+ ],
920
+ });
921
+ }
922
+ }
923
+ return rows;
924
+ },
925
+
926
+ getMediaBuyDelivery: async (req: GetMediaBuyDeliveryRequest, ctx): Promise<GetMediaBuyDeliveryResponse> => {
927
+ const networkCode = ctx.account.ctx_metadata.network_code;
928
+ const ids = req.media_buy_ids ?? [];
929
+ const deliveries = await Promise.all(ids.map(id => upstream.getDelivery(networkCode, id)));
930
+ const present = deliveries.filter((d): d is UpstreamDelivery => d !== null);
931
+
932
+ const earliest = present.reduce(
933
+ (acc, d) => (acc < d.reporting_period.start ? acc : d.reporting_period.start),
934
+ present[0]?.reporting_period.start ?? new Date().toISOString()
935
+ );
936
+ const latest = present.reduce(
937
+ (acc, d) => (acc > d.reporting_period.end ? acc : d.reporting_period.end),
938
+ present[0]?.reporting_period.end ?? new Date().toISOString()
939
+ );
940
+ const currency = present[0]?.currency ?? 'USD';
941
+
942
+ const aggregateImpressions = present.reduce((s, d) => s + d.totals.impressions, 0);
943
+ const aggregateSpend = present.reduce((s, d) => s + d.totals.spend, 0);
944
+ const aggregateClicks = present.reduce((s, d) => s + d.totals.clicks, 0);
945
+
946
+ return {
947
+ reporting_period: { start: earliest, end: latest },
948
+ currency,
949
+ aggregated_totals: {
950
+ impressions: aggregateImpressions,
951
+ spend: aggregateSpend,
952
+ clicks: aggregateClicks,
953
+ media_buy_count: present.length,
954
+ },
955
+ media_buy_deliveries: present.map(d => ({
956
+ media_buy_id: d.order_id,
957
+ status: 'active' as const,
958
+ totals: {
959
+ impressions: d.totals.impressions,
960
+ spend: d.totals.spend,
961
+ clicks: d.totals.clicks,
962
+ },
963
+ // by_package is required even when we don't have per-package
964
+ // breakdown from upstream — include an empty array OR project
965
+ // the line-item-level rows the mock returns. Mock's
966
+ // line_item_breakdown carries impressions+spend per LI.
967
+ by_package: (d.line_item_breakdown ?? []).map(li => ({
968
+ package_id: li.line_item_id,
969
+ impressions: li.impressions,
970
+ spend: li.spend,
971
+ })),
972
+ })),
973
+ };
974
+ },
975
+ };
976
+ }
977
+
978
+ // ---------------------------------------------------------------------------
979
+ // Boot
980
+ // ---------------------------------------------------------------------------
981
+
982
+ const platform = new SalesGuaranteedAdapter();
983
+ const idempotencyStore = createIdempotencyStore({ backend: memoryBackend(), ttlSeconds: 86_400 });
984
+
985
+ // ─── TEST-ONLY: in-memory state for comply_test_controller adapters ─────
986
+ // DELETE THESE MAPS BEFORE DEPLOYING (or scope per-tenant if you keep the
987
+ // controller wired in a sandbox tenant). Module-scope shared maps leak
988
+ // state across accounts — that's fine for a worked example whose only
989
+ // caller is the conformance harness, but unacceptable in production.
990
+ // SWAP: scope by `account.id` (or your tenant key) and persist via the
991
+ // same data layer your production handlers read from. The controller
992
+ // and production tools should share one source of truth for state.
993
+ const seededMediaBuys = new Map<string, { status: string; revision: number }>();
994
+ const simulatedDelivery = new Map<
995
+ string,
996
+ { impressions: number; clicks: number; reported_spend: { amount: number; currency: string } }
997
+ >();
998
+ // ─── /TEST-ONLY ──────────────────────────────────────────────────────────
999
+
1000
+ // Persist `packages[].targeting_overlay` from create_media_buy and echo it
1001
+ // on get_media_buys. The seller spec MANDATES this echo for any seller
1002
+ // claiming property-lists / collection-lists, and SHOULD echo any persisted
1003
+ // targeting regardless. SWAP `InMemoryStateStore` for `PostgresStateStore`
1004
+ // in production — in-memory loss after restart silently strips the echo
1005
+ // from buyers who created buys before the bounce.
1006
+ const stateStore = new InMemoryStateStore();
1007
+ const mediaBuyStore = createMediaBuyStore({ store: stateStore });
1008
+
1009
+ serve(
1010
+ ({ taskStore }) =>
1011
+ createAdcpServerFromPlatform(platform, {
1012
+ name: 'hello-seller-adapter-guaranteed',
1013
+ version: '1.0.0',
1014
+ taskStore,
1015
+ idempotency: idempotencyStore,
1016
+ mediaBuyStore,
1017
+ resolveSessionKey: ctx => {
1018
+ const acct = ctx.account as Account<NetworkMeta> | undefined;
1019
+ return acct?.id ?? 'anonymous';
1020
+ },
1021
+ // ─── TEST-ONLY: comply_test_controller wiring ──────────────────────
1022
+ // DELETE THIS BLOCK BEFORE DEPLOYING. The conformance runner uses
1023
+ // `comply_test_controller` to seed media-buy fixtures and force
1024
+ // state transitions deterministically across cascade scenarios.
1025
+ // Production sellers don't need this surface — and shouldn't ship
1026
+ // it. Per `examples/comply-controller-seller.ts`, the recommended
1027
+ // production posture is "don't register the controller at all";
1028
+ // a seller running their own sandbox tenant gates registration on
1029
+ // an env flag controlled by the deploy pipeline (`ADCP_SANDBOX=1`).
1030
+ //
1031
+ // SECURITY: gate is `ADCP_SANDBOX === '1'` exclusively — single env
1032
+ // var. Don't add an `|| NODE_ENV === 'test'` clause — staging boxes
1033
+ // commonly run with `NODE_ENV=test` and the controller would open
1034
+ // there too. The gate test (`test/examples/hello-seller-adapter-
1035
+ // guaranteed.test.js`) sets `ADCP_SANDBOX=1` in `extraEnv`.
1036
+ complyTest: {
1037
+ sandboxGate: () => process.env['ADCP_SANDBOX'] === '1',
1038
+ seed: {
1039
+ media_buy: ({ media_buy_id, fixture }) => {
1040
+ const existing = seededMediaBuys.get(media_buy_id);
1041
+ const status = typeof fixture['status'] === 'string' ? (fixture['status'] as string) : 'pending_creatives';
1042
+ seededMediaBuys.set(media_buy_id, { status, revision: existing?.revision ?? 0 });
1043
+ },
1044
+ },
1045
+ force: {
1046
+ media_buy_status: ({ media_buy_id, status, rejection_reason }) => {
1047
+ const buy = seededMediaBuys.get(media_buy_id);
1048
+ const previous = buy?.status ?? 'pending_creatives';
1049
+ seededMediaBuys.set(media_buy_id, { status, revision: (buy?.revision ?? 0) + 1 });
1050
+ void rejection_reason;
1051
+ return { success: true, previous_state: previous, current_state: status };
1052
+ },
1053
+ },
1054
+ simulate: {
1055
+ delivery: ({ media_buy_id, impressions, clicks, reported_spend }) => {
1056
+ const prev = simulatedDelivery.get(media_buy_id) ?? {
1057
+ impressions: 0,
1058
+ clicks: 0,
1059
+ reported_spend: { amount: 0, currency: 'USD' },
1060
+ };
1061
+ simulatedDelivery.set(media_buy_id, {
1062
+ impressions: prev.impressions + (impressions ?? 0),
1063
+ clicks: prev.clicks + (clicks ?? 0),
1064
+ reported_spend: reported_spend ?? prev.reported_spend,
1065
+ });
1066
+ return { success: true, simulated: { media_buy_id, impressions, clicks, reported_spend } };
1067
+ },
1068
+ },
1069
+ },
1070
+ // ─── /TEST-ONLY ──────────────────────────────────────────────────
1071
+ }),
1072
+ {
1073
+ port: PORT,
1074
+ authenticate: verifyApiKey({
1075
+ keys: { [ADCP_AUTH_TOKEN]: { principal: 'compliance-runner' } },
1076
+ }),
1077
+ }
1078
+ );
1079
+
1080
+ console.log(`sales-guaranteed adapter on http://127.0.0.1:${PORT}/mcp · upstream: ${UPSTREAM_URL}`);