@adcp/sdk 8.1.0-beta.13 → 8.1.0-beta.14

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 (363) hide show
  1. package/README.md +1 -1
  2. package/bin/adcp-registry.js +2 -2
  3. package/dist/lib/canonical-references/index.d.ts +107 -0
  4. package/dist/lib/canonical-references/index.d.ts.map +1 -0
  5. package/dist/lib/canonical-references/index.js +551 -0
  6. package/dist/lib/canonical-references/index.js.map +1 -0
  7. package/dist/lib/core/ConversationTypes.d.ts +7 -0
  8. package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
  9. package/dist/lib/core/ProtocolResponseParser.d.ts +10 -0
  10. package/dist/lib/core/ProtocolResponseParser.d.ts.map +1 -1
  11. package/dist/lib/core/ProtocolResponseParser.js +110 -0
  12. package/dist/lib/core/ProtocolResponseParser.js.map +1 -1
  13. package/dist/lib/core/ResponseValidator.d.ts +2 -0
  14. package/dist/lib/core/ResponseValidator.d.ts.map +1 -1
  15. package/dist/lib/core/ResponseValidator.js +3 -3
  16. package/dist/lib/core/ResponseValidator.js.map +1 -1
  17. package/dist/lib/core/TaskExecutor.d.ts +2 -0
  18. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  19. package/dist/lib/core/TaskExecutor.js +32 -8
  20. package/dist/lib/core/TaskExecutor.js.map +1 -1
  21. package/dist/lib/index.d.ts +5 -4
  22. package/dist/lib/index.d.ts.map +1 -1
  23. package/dist/lib/index.js +27 -11
  24. package/dist/lib/index.js.map +1 -1
  25. package/dist/lib/mock-server/creative-ad-server/server.d.ts +2 -0
  26. package/dist/lib/mock-server/creative-ad-server/server.d.ts.map +1 -1
  27. package/dist/lib/mock-server/creative-ad-server/server.js +37 -1
  28. package/dist/lib/mock-server/creative-ad-server/server.js.map +1 -1
  29. package/dist/lib/mock-server/creative-template/server.d.ts +2 -0
  30. package/dist/lib/mock-server/creative-template/server.d.ts.map +1 -1
  31. package/dist/lib/mock-server/creative-template/server.js +29 -2
  32. package/dist/lib/mock-server/creative-template/server.js.map +1 -1
  33. package/dist/lib/mock-server/index.d.ts +10 -1
  34. package/dist/lib/mock-server/index.d.ts.map +1 -1
  35. package/dist/lib/mock-server/index.js +38 -8
  36. package/dist/lib/mock-server/index.js.map +1 -1
  37. package/dist/lib/mock-server/sales-guaranteed/server.d.ts +2 -0
  38. package/dist/lib/mock-server/sales-guaranteed/server.d.ts.map +1 -1
  39. package/dist/lib/mock-server/sales-guaranteed/server.js +64 -7
  40. package/dist/lib/mock-server/sales-guaranteed/server.js.map +1 -1
  41. package/dist/lib/mock-server/sales-non-guaranteed/server.d.ts +2 -0
  42. package/dist/lib/mock-server/sales-non-guaranteed/server.d.ts.map +1 -1
  43. package/dist/lib/mock-server/sales-non-guaranteed/server.js +44 -1
  44. package/dist/lib/mock-server/sales-non-guaranteed/server.js.map +1 -1
  45. package/dist/lib/mock-server/sales-social/server.d.ts +2 -0
  46. package/dist/lib/mock-server/sales-social/server.d.ts.map +1 -1
  47. package/dist/lib/mock-server/sales-social/server.js +64 -4
  48. package/dist/lib/mock-server/sales-social/server.js.map +1 -1
  49. package/dist/lib/mock-server/scenario.d.ts +97 -0
  50. package/dist/lib/mock-server/scenario.d.ts.map +1 -0
  51. package/dist/lib/mock-server/scenario.js +464 -0
  52. package/dist/lib/mock-server/scenario.js.map +1 -0
  53. package/dist/lib/mock-server/signal-marketplace/server.d.ts +2 -0
  54. package/dist/lib/mock-server/signal-marketplace/server.d.ts.map +1 -1
  55. package/dist/lib/mock-server/signal-marketplace/server.js +29 -1
  56. package/dist/lib/mock-server/signal-marketplace/server.js.map +1 -1
  57. package/dist/lib/mock-server/sponsored-intelligence/server.d.ts +2 -0
  58. package/dist/lib/mock-server/sponsored-intelligence/server.d.ts.map +1 -1
  59. package/dist/lib/mock-server/sponsored-intelligence/server.js +47 -9
  60. package/dist/lib/mock-server/sponsored-intelligence/server.js.map +1 -1
  61. package/dist/lib/protocols/index.d.ts +4 -2
  62. package/dist/lib/protocols/index.d.ts.map +1 -1
  63. package/dist/lib/protocols/index.js +10 -3
  64. package/dist/lib/protocols/index.js.map +1 -1
  65. package/dist/lib/registry/index.d.ts +42 -16
  66. package/dist/lib/registry/index.d.ts.map +1 -1
  67. package/dist/lib/registry/index.js +191 -24
  68. package/dist/lib/registry/index.js.map +1 -1
  69. package/dist/lib/registry/types.d.ts +39 -8
  70. package/dist/lib/registry/types.d.ts.map +1 -1
  71. package/dist/lib/registry/types.generated.d.ts +2873 -699
  72. package/dist/lib/registry/types.generated.d.ts.map +1 -1
  73. package/dist/lib/registry/types.generated.js +2 -2
  74. package/dist/lib/registry/types.generated.js.map +1 -1
  75. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  76. package/dist/lib/server/a2a-adapter.d.ts +3 -1
  77. package/dist/lib/server/a2a-adapter.d.ts.map +1 -1
  78. package/dist/lib/server/a2a-adapter.js +11 -2
  79. package/dist/lib/server/a2a-adapter.js.map +1 -1
  80. package/dist/lib/server/adcp-server.js +32 -0
  81. package/dist/lib/server/adcp-server.js.map +1 -1
  82. package/dist/lib/server/create-adcp-server.d.ts +12 -6
  83. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  84. package/dist/lib/server/create-adcp-server.js +72 -11
  85. package/dist/lib/server/create-adcp-server.js.map +1 -1
  86. package/dist/lib/server/decisioning/account.d.ts +17 -17
  87. package/dist/lib/server/decisioning/account.d.ts.map +1 -1
  88. package/dist/lib/server/decisioning/account.js.map +1 -1
  89. package/dist/lib/server/decisioning/buyer-agent.d.ts +27 -10
  90. package/dist/lib/server/decisioning/buyer-agent.d.ts.map +1 -1
  91. package/dist/lib/server/decisioning/buyer-agent.js +25 -7
  92. package/dist/lib/server/decisioning/buyer-agent.js.map +1 -1
  93. package/dist/lib/server/decisioning/capabilities.d.ts +35 -7
  94. package/dist/lib/server/decisioning/capabilities.d.ts.map +1 -1
  95. package/dist/lib/server/decisioning/errors-typed.d.ts +18 -16
  96. package/dist/lib/server/decisioning/errors-typed.d.ts.map +1 -1
  97. package/dist/lib/server/decisioning/errors-typed.js +26 -24
  98. package/dist/lib/server/decisioning/errors-typed.js.map +1 -1
  99. package/dist/lib/server/decisioning/index.d.ts +1 -1
  100. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  101. package/dist/lib/server/decisioning/index.js +4 -2
  102. package/dist/lib/server/decisioning/index.js.map +1 -1
  103. package/dist/lib/server/decisioning/platform-helpers.d.ts +3 -2
  104. package/dist/lib/server/decisioning/platform-helpers.d.ts.map +1 -1
  105. package/dist/lib/server/decisioning/platform-helpers.js +3 -2
  106. package/dist/lib/server/decisioning/platform-helpers.js.map +1 -1
  107. package/dist/lib/server/decisioning/platform.d.ts +27 -10
  108. package/dist/lib/server/decisioning/platform.d.ts.map +1 -1
  109. package/dist/lib/server/decisioning/platform.js.map +1 -1
  110. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +14 -10
  111. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  112. package/dist/lib/server/decisioning/runtime/from-platform.js +374 -59
  113. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  114. package/dist/lib/server/decisioning/runtime/validate-platform.d.ts.map +1 -1
  115. package/dist/lib/server/decisioning/runtime/validate-platform.js +3 -8
  116. package/dist/lib/server/decisioning/runtime/validate-platform.js.map +1 -1
  117. package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.d.ts +9 -11
  118. package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.d.ts.map +1 -1
  119. package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.js +9 -11
  120. package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.js.map +1 -1
  121. package/dist/lib/server/operational-platform.d.ts +6 -8
  122. package/dist/lib/server/operational-platform.d.ts.map +1 -1
  123. package/dist/lib/server/operational-platform.js +4 -6
  124. package/dist/lib/server/operational-platform.js.map +1 -1
  125. package/dist/lib/server/test-controller-bridge.d.ts +14 -14
  126. package/dist/lib/server/test-controller-bridge.d.ts.map +1 -1
  127. package/dist/lib/server/test-controller-bridge.js +16 -16
  128. package/dist/lib/server/test-controller-bridge.js.map +1 -1
  129. package/dist/lib/server/test-controller.d.ts +31 -9
  130. package/dist/lib/server/test-controller.d.ts.map +1 -1
  131. package/dist/lib/server/test-controller.js +106 -54
  132. package/dist/lib/server/test-controller.js.map +1 -1
  133. package/dist/lib/signing/canonicalize.d.ts +0 -53
  134. package/dist/lib/signing/canonicalize.d.ts.map +1 -1
  135. package/dist/lib/signing/canonicalize.js +1 -33
  136. package/dist/lib/signing/canonicalize.js.map +1 -1
  137. package/dist/lib/signing/client.d.ts +5 -5
  138. package/dist/lib/signing/client.d.ts.map +1 -1
  139. package/dist/lib/signing/client.js +1 -10
  140. package/dist/lib/signing/client.js.map +1 -1
  141. package/dist/lib/signing/errors.d.ts +0 -11
  142. package/dist/lib/signing/errors.d.ts.map +1 -1
  143. package/dist/lib/signing/errors.js +1 -11
  144. package/dist/lib/signing/errors.js.map +1 -1
  145. package/dist/lib/signing/jwks-helpers.d.ts +2 -4
  146. package/dist/lib/signing/jwks-helpers.d.ts.map +1 -1
  147. package/dist/lib/signing/jwks-helpers.js +9 -0
  148. package/dist/lib/signing/jwks-helpers.js.map +1 -1
  149. package/dist/lib/signing/provider.d.ts +11 -10
  150. package/dist/lib/signing/provider.d.ts.map +1 -1
  151. package/dist/lib/signing/request-context.d.ts +8 -11
  152. package/dist/lib/signing/request-context.d.ts.map +1 -1
  153. package/dist/lib/signing/request-context.js +7 -10
  154. package/dist/lib/signing/request-context.js.map +1 -1
  155. package/dist/lib/signing/server.d.ts +3 -4
  156. package/dist/lib/signing/server.d.ts.map +1 -1
  157. package/dist/lib/signing/server.js +1 -9
  158. package/dist/lib/signing/server.js.map +1 -1
  159. package/dist/lib/signing/signer-async.d.ts +2 -8
  160. package/dist/lib/signing/signer-async.d.ts.map +1 -1
  161. package/dist/lib/signing/signer-async.js +0 -12
  162. package/dist/lib/signing/signer-async.js.map +1 -1
  163. package/dist/lib/signing/signer.d.ts +4 -111
  164. package/dist/lib/signing/signer.d.ts.map +1 -1
  165. package/dist/lib/signing/signer.js +2 -98
  166. package/dist/lib/signing/signer.js.map +1 -1
  167. package/dist/lib/signing/testing.d.ts +10 -10
  168. package/dist/lib/signing/testing.d.ts.map +1 -1
  169. package/dist/lib/signing/testing.js +6 -13
  170. package/dist/lib/signing/testing.js.map +1 -1
  171. package/dist/lib/signing/types.d.ts +0 -36
  172. package/dist/lib/signing/types.d.ts.map +1 -1
  173. package/dist/lib/signing/types.js +1 -37
  174. package/dist/lib/signing/types.js.map +1 -1
  175. package/dist/lib/testing/agent-tester.d.ts +1 -0
  176. package/dist/lib/testing/agent-tester.d.ts.map +1 -1
  177. package/dist/lib/testing/agent-tester.js.map +1 -1
  178. package/dist/lib/testing/client.d.ts +1 -1
  179. package/dist/lib/testing/client.d.ts.map +1 -1
  180. package/dist/lib/testing/client.js +4 -2
  181. package/dist/lib/testing/client.js.map +1 -1
  182. package/dist/lib/testing/compliance/comply.d.ts +8 -0
  183. package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
  184. package/dist/lib/testing/compliance/comply.js +98 -7
  185. package/dist/lib/testing/compliance/comply.js.map +1 -1
  186. package/dist/lib/testing/compliance/spec-conformance.d.ts +6 -6
  187. package/dist/lib/testing/compliance/spec-conformance.d.ts.map +1 -1
  188. package/dist/lib/testing/compliance/spec-conformance.js +6 -6
  189. package/dist/lib/testing/compliance/spec-conformance.js.map +1 -1
  190. package/dist/lib/testing/compliance/summary.d.ts +5 -0
  191. package/dist/lib/testing/compliance/summary.d.ts.map +1 -1
  192. package/dist/lib/testing/compliance/summary.js +17 -0
  193. package/dist/lib/testing/compliance/summary.js.map +1 -1
  194. package/dist/lib/testing/comply-controller.d.ts +19 -0
  195. package/dist/lib/testing/comply-controller.d.ts.map +1 -1
  196. package/dist/lib/testing/comply-controller.js +11 -8
  197. package/dist/lib/testing/comply-controller.js.map +1 -1
  198. package/dist/lib/testing/index.d.ts +4 -3
  199. package/dist/lib/testing/index.d.ts.map +1 -1
  200. package/dist/lib/testing/index.js +13 -1
  201. package/dist/lib/testing/index.js.map +1 -1
  202. package/dist/lib/testing/storyboard/canonical-format-satisfaction.d.ts +4 -0
  203. package/dist/lib/testing/storyboard/canonical-format-satisfaction.d.ts.map +1 -0
  204. package/dist/lib/testing/storyboard/canonical-format-satisfaction.js +881 -0
  205. package/dist/lib/testing/storyboard/canonical-format-satisfaction.js.map +1 -0
  206. package/dist/lib/testing/storyboard/compliance.d.ts +6 -0
  207. package/dist/lib/testing/storyboard/compliance.d.ts.map +1 -1
  208. package/dist/lib/testing/storyboard/compliance.js +8 -4
  209. package/dist/lib/testing/storyboard/compliance.js.map +1 -1
  210. package/dist/lib/testing/storyboard/index.d.ts +2 -1
  211. package/dist/lib/testing/storyboard/index.d.ts.map +1 -1
  212. package/dist/lib/testing/storyboard/index.js +9 -1
  213. package/dist/lib/testing/storyboard/index.js.map +1 -1
  214. package/dist/lib/testing/storyboard/loader.d.ts +3 -2
  215. package/dist/lib/testing/storyboard/loader.d.ts.map +1 -1
  216. package/dist/lib/testing/storyboard/loader.js +73 -2
  217. package/dist/lib/testing/storyboard/loader.js.map +1 -1
  218. package/dist/lib/testing/storyboard/path.d.ts +21 -0
  219. package/dist/lib/testing/storyboard/path.d.ts.map +1 -1
  220. package/dist/lib/testing/storyboard/path.js +86 -0
  221. package/dist/lib/testing/storyboard/path.js.map +1 -1
  222. package/dist/lib/testing/storyboard/rate-limit-trip.d.ts +92 -0
  223. package/dist/lib/testing/storyboard/rate-limit-trip.d.ts.map +1 -0
  224. package/dist/lib/testing/storyboard/rate-limit-trip.js +276 -0
  225. package/dist/lib/testing/storyboard/rate-limit-trip.js.map +1 -0
  226. package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
  227. package/dist/lib/testing/storyboard/runner.js +361 -28
  228. package/dist/lib/testing/storyboard/runner.js.map +1 -1
  229. package/dist/lib/testing/storyboard/seeding.d.ts +5 -4
  230. package/dist/lib/testing/storyboard/seeding.d.ts.map +1 -1
  231. package/dist/lib/testing/storyboard/seeding.js +23 -3
  232. package/dist/lib/testing/storyboard/seeding.js.map +1 -1
  233. package/dist/lib/testing/storyboard/types.d.ts +108 -20
  234. package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
  235. package/dist/lib/testing/storyboard/types.js +1 -0
  236. package/dist/lib/testing/storyboard/types.js.map +1 -1
  237. package/dist/lib/testing/storyboard/validations.d.ts +18 -0
  238. package/dist/lib/testing/storyboard/validations.d.ts.map +1 -1
  239. package/dist/lib/testing/storyboard/validations.js +238 -33
  240. package/dist/lib/testing/storyboard/validations.js.map +1 -1
  241. package/dist/lib/testing/test-controller.d.ts +17 -25
  242. package/dist/lib/testing/test-controller.d.ts.map +1 -1
  243. package/dist/lib/testing/test-controller.js.map +1 -1
  244. package/dist/lib/testing/types.d.ts +13 -1
  245. package/dist/lib/testing/types.d.ts.map +1 -1
  246. package/dist/lib/types/check-governance.d.ts +1 -1
  247. package/dist/lib/types/comply-test-controller.d.ts +243 -3
  248. package/dist/lib/types/core.generated.d.ts +261 -21
  249. package/dist/lib/types/core.generated.d.ts.map +1 -1
  250. package/dist/lib/types/core.generated.js +1 -1
  251. package/dist/lib/types/create-media-buy.d.ts +107 -3
  252. package/dist/lib/types/error-codes.d.ts +2 -2
  253. package/dist/lib/types/get-adcp-capabilities.d.ts +1 -1
  254. package/dist/lib/types/get-media-buys.d.ts +107 -3
  255. package/dist/lib/types/get-plan-audit-logs.d.ts +1 -1
  256. package/dist/lib/types/get-products.d.ts +104 -3
  257. package/dist/lib/types/inline-enums.generated.d.ts +27 -17
  258. package/dist/lib/types/inline-enums.generated.d.ts.map +1 -1
  259. package/dist/lib/types/inline-enums.generated.js +39 -28
  260. package/dist/lib/types/inline-enums.generated.js.map +1 -1
  261. package/dist/lib/types/manifest.generated.d.ts +7 -4
  262. package/dist/lib/types/manifest.generated.d.ts.map +1 -1
  263. package/dist/lib/types/manifest.generated.js +2 -2
  264. package/dist/lib/types/manifest.generated.js.map +1 -1
  265. package/dist/lib/types/report-plan-outcome.d.ts +1 -1
  266. package/dist/lib/types/schemas.generated.d.ts +714 -193
  267. package/dist/lib/types/schemas.generated.d.ts.map +1 -1
  268. package/dist/lib/types/schemas.generated.js +194 -79
  269. package/dist/lib/types/schemas.generated.js.map +1 -1
  270. package/dist/lib/types/sync-plans.d.ts +1 -1
  271. package/dist/lib/types/tools.generated.d.ts +331 -28
  272. package/dist/lib/types/tools.generated.d.ts.map +1 -1
  273. package/dist/lib/types/update-media-buy.d.ts +107 -3
  274. package/dist/lib/types/v3-1-beta/tools.generated.d.ts +20 -0
  275. package/dist/lib/types/v3-1-beta/tools.generated.d.ts.map +1 -1
  276. package/dist/lib/upstream-recorder/constants.d.ts +2 -0
  277. package/dist/lib/upstream-recorder/constants.d.ts.map +1 -0
  278. package/dist/lib/upstream-recorder/constants.js +5 -0
  279. package/dist/lib/upstream-recorder/constants.js.map +1 -0
  280. package/dist/lib/upstream-recorder/index.d.ts +20 -10
  281. package/dist/lib/upstream-recorder/index.d.ts.map +1 -1
  282. package/dist/lib/upstream-recorder/index.js +21 -10
  283. package/dist/lib/upstream-recorder/index.js.map +1 -1
  284. package/dist/lib/upstream-recorder/recorder.d.ts +65 -0
  285. package/dist/lib/upstream-recorder/recorder.d.ts.map +1 -1
  286. package/dist/lib/upstream-recorder/recorder.js +500 -47
  287. package/dist/lib/upstream-recorder/recorder.js.map +1 -1
  288. package/dist/lib/upstream-recorder/types.d.ts +109 -13
  289. package/dist/lib/upstream-recorder/types.d.ts.map +1 -1
  290. package/dist/lib/upstream-recorder/types.js.map +1 -1
  291. package/dist/lib/utils/adcp-version-config.d.ts +1 -0
  292. package/dist/lib/utils/adcp-version-config.d.ts.map +1 -1
  293. package/dist/lib/utils/adcp-version-config.js +21 -0
  294. package/dist/lib/utils/adcp-version-config.js.map +1 -1
  295. package/dist/lib/utils/capability-rollups.d.ts +5 -5
  296. package/dist/lib/utils/capability-rollups.d.ts.map +1 -1
  297. package/dist/lib/utils/capability-rollups.js +1 -1
  298. package/dist/lib/utils/capability-rollups.js.map +1 -1
  299. package/dist/lib/utils/json-depth.d.ts +2 -0
  300. package/dist/lib/utils/json-depth.d.ts.map +1 -0
  301. package/dist/lib/utils/json-depth.js +5 -0
  302. package/dist/lib/utils/json-depth.js.map +1 -0
  303. package/dist/lib/utils/media-buy-delivery-notification-builders.d.ts +1 -1
  304. package/dist/lib/utils/media-buy-delivery-notification-builders.d.ts.map +1 -1
  305. package/dist/lib/utils/preview-creative-builders.d.ts +1 -1
  306. package/dist/lib/utils/preview-creative-builders.d.ts.map +1 -1
  307. package/dist/lib/utils/redact-secrets.d.ts +13 -2
  308. package/dist/lib/utils/redact-secrets.d.ts.map +1 -1
  309. package/dist/lib/utils/redact-secrets.js +40 -13
  310. package/dist/lib/utils/redact-secrets.js.map +1 -1
  311. package/dist/lib/utils/response-schemas.d.ts +1 -0
  312. package/dist/lib/utils/response-schemas.d.ts.map +1 -1
  313. package/dist/lib/utils/response-schemas.js +15 -0
  314. package/dist/lib/utils/response-schemas.js.map +1 -1
  315. package/dist/lib/utils/response-unwrapper.d.ts +2 -1
  316. package/dist/lib/utils/response-unwrapper.d.ts.map +1 -1
  317. package/dist/lib/utils/response-unwrapper.js +11 -3
  318. package/dist/lib/utils/response-unwrapper.js.map +1 -1
  319. package/dist/lib/utils/tool-request-schemas.d.ts +31 -1
  320. package/dist/lib/utils/tool-request-schemas.d.ts.map +1 -1
  321. package/dist/lib/v2/format-schema/fetch.d.ts +13 -5
  322. package/dist/lib/v2/format-schema/fetch.d.ts.map +1 -1
  323. package/dist/lib/v2/format-schema/fetch.js +27 -16
  324. package/dist/lib/v2/format-schema/fetch.js.map +1 -1
  325. package/dist/lib/v2/format-schema/index.d.ts +13 -11
  326. package/dist/lib/v2/format-schema/index.d.ts.map +1 -1
  327. package/dist/lib/v2/format-schema/index.js +19 -12
  328. package/dist/lib/v2/format-schema/index.js.map +1 -1
  329. package/dist/lib/v2/format-schema/resolver.d.ts +71 -0
  330. package/dist/lib/v2/format-schema/resolver.d.ts.map +1 -0
  331. package/dist/lib/v2/format-schema/resolver.js +284 -0
  332. package/dist/lib/v2/format-schema/resolver.js.map +1 -0
  333. package/dist/lib/v2/format-schema/sandbox-refs.d.ts +6 -0
  334. package/dist/lib/v2/format-schema/sandbox-refs.d.ts.map +1 -1
  335. package/dist/lib/v2/format-schema/sandbox-refs.js +36 -15
  336. package/dist/lib/v2/format-schema/sandbox-refs.js.map +1 -1
  337. package/dist/lib/validation/schema-loader.d.ts.map +1 -1
  338. package/dist/lib/validation/schema-loader.js +48 -3
  339. package/dist/lib/validation/schema-loader.js.map +1 -1
  340. package/dist/lib/version.d.ts +3 -3
  341. package/dist/lib/version.js +3 -3
  342. package/docs/guides/BUILD-AN-AGENT.md +7 -7
  343. package/docs/guides/CANONICAL-REFERENCE-RESOLVER.md +75 -0
  344. package/docs/llms.txt +37 -8
  345. package/examples/README.md +29 -16
  346. package/examples/hello_creative_adapter_ad_server.ts +8 -2
  347. package/examples/hello_seller_adapter_guaranteed.ts +26 -18
  348. package/examples/hello_seller_adapter_multi_tenant.ts +6 -6
  349. package/examples/hello_seller_adapter_social.ts +80 -4
  350. package/examples/hello_si_adapter_brand.ts +10 -21
  351. package/examples/hello_signals_adapter_marketplace.ts +184 -9
  352. package/examples/proxy-seller-snap/README.md +47 -0
  353. package/examples/proxy-seller-snap/index.ts +321 -0
  354. package/package.json +19 -4
  355. package/skills/build-creative-agent/SKILL.md +1 -15
  356. package/skills/build-decisioning-platform/SKILL.md +6 -1
  357. package/skills/build-seller-agent/SKILL.md +5 -2
  358. package/skills/build-si-agent/SKILL.md +2 -2
  359. package/skills/call-adcp-agent/SKILL.md +4 -1
  360. package/dist/lib/signing/response-verifier.d.ts +0 -105
  361. package/dist/lib/signing/response-verifier.d.ts.map +0 -1
  362. package/dist/lib/signing/response-verifier.js +0 -271
  363. package/dist/lib/signing/response-verifier.js.map +0 -1
@@ -4,22 +4,23 @@ This directory contains practical examples of how to use the `@adcp/sdk` library
4
4
 
5
5
  ## Building an AdCP agent — fork-target reference adapters
6
6
 
7
- Pick the example whose AdCP role and specialism most closely match what you're building, fork the file, replace the `// SWAP:` markers, and follow the `FORK CHECKLIST` block at the top of each adapter for the unmarked but load-bearing constants. Each adapter is paired with a three-gate CI test (strict tsc / storyboard / upstream-traffic) so a regression in your fork fails CI before it ships.
8
-
9
- | If you're claiming… | Fork | Then… |
10
- | ---------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
- | `signal-marketplace` / `signal-owned` | `hello_signals_adapter_marketplace.ts` | as-is for marketplace; `signal-owned` adopters drop the marketplace-specific tax/rev-share fields |
12
- | `creative-template` | `hello_creative_adapter_template.ts` | as-is — single-tenant; production adopters add per-tenant workspace binding (see SWAP markers) |
13
- | `creative-generative` | `hello_creative_adapter_template.ts` | replace template-driven `buildCreative` with brief-driven generation; keep the `previewCreative` shape |
14
- | `creative-ad-server` | `hello_creative_adapter_ad_server.ts` | as-is — covers the stateful library + tag generation + macro substitution + delivery reporting flow |
7
+ Pick the example whose AdCP role and specialism most closely matches what you're building, fork it, replace the `// SWAP:` markers, and follow the `FORK CHECKLIST` block for the unmarked but load-bearing constants. The `hello_*_adapter_*` examples are paired with the three-gate CI test (strict tsc / storyboard / upstream-traffic) where a matching mock server exists; examples without one are called out below with the narrower runtime coverage they currently have. `proxy-seller-snap/` is a lighter bridge-pattern fork target: it proves seed-bridge wiring and must be paired with your live-OAuth sandbox runner for upstream health.
8
+
9
+ | If you're claiming… | Fork | Then… |
10
+ | ---------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
11
+ | `signal-marketplace` / `signal-owned` | `hello_signals_adapter_marketplace.ts` | as-is for marketplace; `signal-owned` adopters drop the marketplace-specific tax/rev-share fields |
12
+ | `creative-template` | `hello_creative_adapter_template.ts` | as-is — single-tenant; production adopters add per-tenant workspace binding (see SWAP markers) |
13
+ | `creative-generative` | `hello_creative_adapter_template.ts` | replace template-driven `buildCreative` with brief-driven generation; keep the `previewCreative` shape |
14
+ | `creative-ad-server` | `hello_creative_adapter_ad_server.ts` | as-is — covers the stateful library + tag generation + macro substitution + delivery reporting flow |
15
15
  | `sales-non-guaranteed` | `hello_seller_adapter_non_guaranteed.ts` | as-is — covers sync confirmation, floor pricing, spend-only forecast, pacing propagation |
16
- | `sales-guaranteed` | `hello_seller_adapter_guaranteed.ts` | as-is — covers the HITL flow |
17
- | `sales-broadcast-tv` | `hello_seller_adapter_guaranteed.ts` | replace `audience_targeting` with broadcast-DMA targeting; replace `Product.channels` with `linear_tv` |
18
- | `sales-streaming-tv` | `hello_seller_adapter_guaranteed.ts` | adjust `Product.channels` to `ctv` |
19
- | `sales-social` | `hello_seller_adapter_social.ts` | as-is |
20
- | `sales-catalog-driven` | `hello_seller_adapter_social.ts` | promote `syncCatalogs` to a real catalog ingestion + `getProducts` reads from the catalog |
21
- | `audience-sync` | `hello_seller_adapter_social.ts` | strip everything except `syncAudiences` + `pollAudienceStatuses`; this is the standalone audience-sync seller pattern |
22
- | `governance-spend-authority` / `property-lists` / `brand-rights` | `hello_seller_adapter_multi_tenant.ts` | as-is multi-specialism + multi-tenant agency / holdco shape; closes adcp-client#1332 (governance) and adcp-client#1334 (brand-rights). Single-specialism adopters fork the relevant handler block out of the same file. |
16
+ | `sales-guaranteed` | `hello_seller_adapter_guaranteed.ts` | as-is — covers the HITL flow |
17
+ | `sales-broadcast-tv` | `hello_seller_adapter_guaranteed.ts` | replace `audience_targeting` with broadcast-DMA targeting; replace `Product.channels` with `linear_tv` |
18
+ | `sales-streaming-tv` | `hello_seller_adapter_guaranteed.ts` | adjust `Product.channels` to `ctv` |
19
+ | `sales-social` | `hello_seller_adapter_social.ts` | as-is |
20
+ | Proxy-shaped seller / DSP / walled garden | `proxy-seller-snap/` | start here when reads proxy an upstream platform API and storyboard seeds need `TestControllerBridge` to appear in sandbox reads |
21
+ | `sales-catalog-driven` | `hello_seller_adapter_social.ts` | promote `syncCatalogs` to a real catalog ingestion + `getProducts` reads from the catalog |
22
+ | `audience-sync` | `hello_seller_adapter_social.ts` | strip everything except `syncAudiences` + `pollAudienceStatuses`; this is the standalone audience-sync seller pattern |
23
+ | `governance-spend-authority` / `property-lists` / `brand-rights` | `hello_seller_adapter_multi_tenant.ts` | as-is — multi-specialism + multi-tenant agency / holdco shape; closes adcp-client#1332 (governance) and adcp-client#1334 (brand-rights). Single-specialism adopters fork the relevant handler block out of the same file. |
23
24
 
24
25
  Naming convention: `hello_<role>_adapter_<specialism>.ts` where `<role>` is the AdCP protocol layer (`seller` for `media-buy`, `creative` for `creative`, `signals` for `signals`, `governance` for `governance`, `brand` for `brand`). `<specialism>` strips the role-implied prefix (so `creative-template` → `_template`, `sales-guaranteed` → `_guaranteed`). The multi-tenant holdco adapter sits outside this convention because it spans multiple roles (governance + brand-rights + property-lists) — naming follows the deployment shape rather than a single role.
25
26
 
@@ -39,6 +40,16 @@ Real platforms typically claim more than one specialism. Claim a specialism only
39
40
 
40
41
  > Each specialism runs its own compliance storyboard independently — no joint multi-specialism storyboard exists yet. For cross-protocol bundles (e.g. DSP-side seller spans `media-buy` + `signals`), run each protocol's storyboard separately.
41
42
 
43
+ ## AdCP 3.1 commercial-state model
44
+
45
+ Keep three axes separate when forking a Hello agent:
46
+
47
+ - `capabilities.account.supported_billing` is the seller-wide wire capability. Set `capabilities.supportedBillings` on decisioning-platform examples when the seller accepts `operator`, `agent`, or `advertiser` billing at all.
48
+ - `BuyerAgentRegistry` is the per-caller commercial relationship. `hello_signals_adapter_marketplace.ts`, `hello_seller_adapter_social.ts`, and `hello_seller_adapter_multi_tenant.ts` show the durable buyer-agent identity seam; `ctx.agent` is the trusted record for status, sandbox-only reach, tenant routing, and billing gates.
49
+ - `fixtures.buyer_agents[]` plus `seed_buyer_agent` is the compliance setup path. The signals Hello agent wires a test-only overlay so a 3.1 storyboard can vary Addie's `status`, `sandbox_only`, or `billing_capabilities` without inventing a special bearer-token prefix. Production agents should back this with their onboarding ledger and invalidate the registry cache after mutation.
50
+
51
+ The framework resolves buyer agents, status-gates them, and enforces `sync_accounts.billing` against both seller-wide `supportedBillings` and the resolved `ctx.agent.billing_capabilities`. The social Hello agent includes a buyer-agent ledger so the framework can exercise the per-agent billing gate; do not fork a separate bearer-token prefix or unscoped test-only shortcut.
52
+
42
53
  ## Examples
43
54
 
44
55
  ### Basic Usage
@@ -50,7 +61,7 @@ Real platforms typically claim more than one specialism. Claim a specialism only
50
61
 
51
62
  ### Multi-specialism + multi-tenant (account-routed)
52
63
 
53
- `hello_seller_adapter_multi_tenant.ts` demonstrates the **account-routed** multi-tenant model: one server hosts `governance-spend-authority`, `property-lists`, and `brand-rights` for two distinct tenants whose data never crosses. The agency / holdco hub shape. Two resolution paths:
64
+ `hello_seller_adapter_multi_tenant.ts` demonstrates the **account-routed** multi-tenant model: one server hosts `governance-spend-authority`, `property-lists`, and `brand-rights` for two distinct tenants whose data never crosses. The agency / holdco hub shape. It has strict typecheck coverage plus a direct MCP runtime test for buyer-agent-derived no-account tenant routing; full storyboard/façade gates will land once governance / brand-rights mock servers exist. Two resolution paths:
54
65
 
55
66
  - Tools that carry `account` (governance, property-lists, sync_accounts, sync_governance) → `accounts.resolve(ref)` reads `ref.operator` and routes to the matching tenant. Same buyer credential can hit different tenants by varying `account.operator`.
56
67
  - Tools without `account` (`get_brand_identity`, `get_rights`) → `accounts.resolve(undefined, ctx)` reads the resolved buyer agent's home tenant from `ctx.agent`. Different credentials → different views of the catalog without any account field on the wire.
@@ -68,6 +79,8 @@ Start with `createComplyController` (`comply-controller-seller.ts`). Switch to `
68
79
 
69
80
  Both wire `comply_test_controller`, both auto-emit the `capabilities.compliance_testing.scenarios` block, both sit on the same primitives. Pick by state shape, not by perceived helper tier.
70
81
 
82
+ For proxy-shaped sellers where reads go to an upstream platform API, start with **`proxy-seller-snap/`**. It shows the seed bridge pattern: `comply_test_controller` writes storyboard fixtures into a session store, production read handlers call the Snap-shaped client, and `bridgeFromSessionStore` merges seeded products, creatives, and governance lists into sandbox responses after the handler succeeds.
83
+
71
84
  Run `npm run typecheck:examples` to validate both examples against the built `dist/`.
72
85
 
73
86
  ### Running Examples
@@ -378,17 +378,23 @@ class CreativeAdServerAdapter implements DecisioningPlatform<Record<string, neve
378
378
  };
379
379
 
380
380
  accounts: AccountStore<NetworkMeta> = {
381
- resolve: async ref => {
381
+ resolve: async (ref, ctx) => {
382
382
  // No-account tools (`previewCreative`, `listCreativeFormats`) hand
383
383
  // `undefined` to resolve. Return the default-listing network so
384
- // the format catalog query has tenant context.
384
+ // the format catalog query has tenant context. This worked example
385
+ // uses the same auth-derived path for the conformance runner's
386
+ // controller discovery, so authenticated ref-less calls are stamped
387
+ // sandbox. Production sellers replace this with a real principal →
388
+ // account lookup and only stamp sandbox for sandbox tenants.
385
389
  if (!ref) {
390
+ if (!ctx?.authInfo) return null;
386
391
  const network = await upstream.lookupNetwork(KNOWN_PUBLISHERS[0] ?? 'creative-network.example');
387
392
  if (!network) return null;
388
393
  return {
389
394
  id: network.network_code,
390
395
  name: network.display_name,
391
396
  status: 'active',
397
+ mode: 'sandbox',
392
398
  brand: { domain: network.adcp_publisher },
393
399
  ctx_metadata: { network_code: network.network_code, publisher_domain: network.adcp_publisher },
394
400
  };
@@ -104,8 +104,8 @@ const ADCP_AUTH_TOKEN = process.env['ADCP_AUTH_TOKEN'] ?? 'sk_harness_do_not_use
104
104
  // (adcp#4028). The runner authenticates with this bearer to probe the
105
105
  // seller's live-mode denial path. The resolver below stamps
106
106
  // `mode: 'live'` on the matching principal so the framework gate inside
107
- // `createAdcpServerFromPlatform` refuses `comply_test_controller`
108
- // dispatch with FORBIDDEN. Test-kit value pinned by
107
+ // `createAdcpServerFromPlatform` hides `comply_test_controller` from that
108
+ // principal. Test-kit value pinned by
109
109
  // `compliance/cache/<ver>/test-kits/acme-outdoor-live.yaml`.
110
110
  //
111
111
  // ⚠️ This bearer is published in the open-source SDK and in the public
@@ -528,6 +528,10 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
528
528
  specialisms: ['sales-guaranteed'] as const,
529
529
  channels: ['olv', 'ctv', 'display'] as const,
530
530
  pricingModels: ['cpm'] as const,
531
+ // Storyboard account setup uses operator-billed settlement. Declare it
532
+ // explicitly so the framework-level sync_accounts commercial gate admits
533
+ // rows before this adapter resolves them to upstream network codes.
534
+ supportedBillings: ['operator', 'agent'] as const,
531
535
  supportsProposals: false,
532
536
  config: {},
533
537
  // Declares the comply_test_controller surface so the conformance
@@ -571,24 +575,27 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
571
575
  // (1) the cascade-scenario sandbox arm below, keyed by
572
576
  // `ref.sandbox === true` and stamped with `mode: 'sandbox'`
573
577
  // and a `${SANDBOX_ID_PREFIX}${network_code}` id.
574
- // (2) the production path below, keyed by `ref.brand.domain`
578
+ // (2) the conformance principal path here, keyed by auth and
579
+ // stamped with `mode: 'sandbox'` but using the bare
580
+ // `network_code` id so tasks/get polls match direct-buy tasks.
581
+ // (3) the production path below, keyed by `ref.brand.domain`
575
582
  // and stamped with the bare `network_code` id (no mode).
576
583
  // The compliance runner exercises path (2) for the
577
584
  // sales_guaranteed HITL flow (no `sandbox: true` on the create
578
585
  // step's account), so the auth-derived ref-less fallback
579
- // returns the matching production account here. Production
580
- // sellers key this off `ctx.authInfo.credential.key_id` /
581
- // `client_id` against a real tenant store.
586
+ // returns the matching account id with sandbox principal mode here.
587
+ // Production sellers key this off `ctx.authInfo.credential.key_id`
588
+ // / `client_id` against a real tenant store.
582
589
  const publisherDomain = 'acmeoutdoor.example';
583
590
  const network = await upstream.lookupNetwork(publisherDomain);
584
591
  if (!network) return null;
585
592
  // Live-mode probe principal (comply_controller_mode_gate
586
593
  // storyboard) — stamp `mode: 'live'` so the framework gate inside
587
- // `createAdcpServerFromPlatform` refuses `comply_test_controller`
588
- // dispatch with FORBIDDEN. The probe never reaches a mutating
589
- // dispatch path; the live-mode caller is denied before scenario
590
- // execution. Production sellers source `mode` from their tenant
591
- // store, not from the principal name.
594
+ // `createAdcpServerFromPlatform` hides `comply_test_controller`
595
+ // from that principal. The probe never reaches a mutating dispatch
596
+ // path; the live-mode caller is denied before scenario execution.
597
+ // Production sellers source `mode` from their tenant store, not
598
+ // from the principal name.
592
599
  //
593
600
  // Detection: ResolvedAuthInfo doesn't surface the principal name
594
601
  // directly (the framework propagates AuthPrincipal.principal as
@@ -602,7 +609,7 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
602
609
  name: network.display_name,
603
610
  status: 'active',
604
611
  brand: { domain: network.adcp_publisher },
605
- ...(isLiveModeProbe ? { mode: 'live' as const } : {}),
612
+ mode: isLiveModeProbe ? 'live' : 'sandbox',
606
613
  ctx_metadata: {
607
614
  network_code: network.network_code,
608
615
  publisher_domain: network.adcp_publisher,
@@ -1246,10 +1253,11 @@ serve(
1246
1253
  // `createAdcpServerFromPlatform` resolves the calling principal
1247
1254
  // through `accounts.resolve` and admits only when the resolved
1248
1255
  // account's `mode` is `'sandbox'` or `'mock'` (per `Account.mode`
1249
- // in AdCP 6.7+). The synthesis branch in `accounts.resolve` above
1250
- // stamps `mode: 'sandbox'` on cascade-scenario refs; production
1251
- // refs flow through the live path with the field unset (default
1252
- // `'live'`), so the framework gate refuses dispatch for them.
1256
+ // in AdCP 6.7+). The auth-derived conformance branch and the
1257
+ // cascade-scenario ref branch in `accounts.resolve` above stamp
1258
+ // `mode: 'sandbox'`; production refs flow through the live path with
1259
+ // the field unset (default `'live'`), so the framework gate hides the
1260
+ // controller for them.
1253
1261
  // See `docs/proposals/lifecycle-state-and-sandbox-authority.md`.
1254
1262
  complyTest: {
1255
1263
  seed: {
@@ -1306,8 +1314,8 @@ serve(
1306
1314
  [ADCP_AUTH_TOKEN]: { principal: 'compliance-runner' },
1307
1315
  // Live-mode probe principal — see comply_controller_mode_gate
1308
1316
  // storyboard. The resolver below stamps `mode: 'live'` when this
1309
- // bearer is presented; the framework gate then refuses
1310
- // comply_test_controller dispatch with FORBIDDEN.
1317
+ // bearer is presented; the framework gate then hides
1318
+ // comply_test_controller from that principal.
1311
1319
  [ADCP_LIVE_MODE_AUTH_TOKEN]: { principal: LIVE_MODE_PROBE_PRINCIPAL },
1312
1320
  },
1313
1321
  }),
@@ -486,12 +486,12 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
486
486
  operator,
487
487
  ...(r?.brand?.domain && { brand: { domain: r.brand.domain } }),
488
488
  ctx_metadata: { tenant_id: tenant.id, display_name: tenant.display_name },
489
- // SWAP: read sandbox flag from your backing store. Defaults to false
490
- // production adopters route reads/writes to a sandbox backend on
491
- // this flag, so an unset wire field MUST NOT silently land in
492
- // sandbox. Buyers who want sandbox set `account.sandbox = true`
493
- // explicitly.
494
- sandbox: r?.sandbox ?? false,
489
+ // SWAP: read sandbox flag from your backing store. Account-routed
490
+ // calls default false unless the buyer explicitly sets
491
+ // `account.sandbox = true`. No-account demo calls synthesize an
492
+ // auth-derived account for local sandbox buyer credentials, so keep
493
+ // that branch sandboxed.
494
+ sandbox: r ? (r.sandbox ?? false) : true,
495
495
  };
496
496
  },
497
497
  upsertRow: (tenant, ref, _ctx) => {
@@ -12,10 +12,12 @@
12
12
  * 3. Replace `audience_targeting` and `conversion_tracking` capability
13
13
  * declarations with the identifier types / event types your platform
14
14
  * actually accepts.
15
- * 4. Replace the `m.uids[i]` `external_id_sha256` projection in
15
+ * 4. Replace `ONBOARDING_LEDGER` and `SELLER_SUPPORTED_BILLING` with your
16
+ * buyer-agent onboarding/commercial-state source of truth.
17
+ * 5. Replace the `m.uids[i]` → `external_id_sha256` projection in
16
18
  * `logEvent` with your CAPI's specific UID-to-field mapping.
17
- * 5. Replace `eventSourceMap` with persistent storage (DB / cache).
18
- * 6. Validate: `node --test test/examples/hello-seller-adapter-social.test.js`
19
+ * 6. Replace `eventSourceMap` with persistent storage (DB / cache).
20
+ * 7. Validate: `node --test test/examples/hello-seller-adapter-social.test.js`
19
21
  *
20
22
  * Demo:
21
23
  * npx @adcp/sdk@latest mock-server sales-social --port 4350
@@ -36,6 +38,7 @@ import {
36
38
  createUpstreamHttpClient,
37
39
  memoryBackend,
38
40
  AdcpError,
41
+ BuyerAgentRegistry,
39
42
  defineSalesPlatform,
40
43
  defineAudiencePlatform,
41
44
  assertNoExampleTlds,
@@ -47,6 +50,8 @@ import {
47
50
  type SyncAudiencesRow,
48
51
  type SyncCreativesRow,
49
52
  type SyncAccountsResultRow,
53
+ type BuyerAgent,
54
+ type BuyerAgentBillingMode,
50
55
  } from '@adcp/sdk/server';
51
56
  import type {
52
57
  SyncCatalogsSuccess,
@@ -54,6 +59,7 @@ import type {
54
59
  SyncEventSourcesSuccess,
55
60
  GetAccountFinancialsSuccess,
56
61
  } from '@adcp/sdk/types';
62
+ import { createHash } from 'node:crypto';
57
63
 
58
64
  const UPSTREAM_URL = process.env['UPSTREAM_URL'] ?? 'http://127.0.0.1:4350';
59
65
  const UPSTREAM_CLIENT_ID = process.env['UPSTREAM_OAUTH_CLIENT_ID'] ?? 'walled_garden_test_client_001';
@@ -61,6 +67,34 @@ const UPSTREAM_CLIENT_SECRET =
61
67
  process.env['UPSTREAM_OAUTH_CLIENT_SECRET'] ?? 'walled_garden_test_secret_do_not_use_in_prod';
62
68
  const PORT = Number(process.env['PORT'] ?? 3003);
63
69
  const ADCP_AUTH_TOKEN = process.env['ADCP_AUTH_TOKEN'] ?? 'sk_harness_do_not_use_in_prod';
70
+ const SELLER_SUPPORTED_BILLING = ['operator', 'agent'] as const satisfies readonly BuyerAgentBillingMode[];
71
+
72
+ function hashApiKey(token: string): string {
73
+ return createHash('sha256').update(token).digest('hex').slice(0, 32);
74
+ }
75
+
76
+ const ONBOARDING_LEDGER = new Map<string, BuyerAgent>([
77
+ [
78
+ hashApiKey(ADCP_AUTH_TOKEN),
79
+ {
80
+ agent_url: 'https://addie.example.com',
81
+ display_name: 'Addie (storyboard runner)',
82
+ status: 'active',
83
+ billing_capabilities: new Set(['operator']),
84
+ sandbox_only: true,
85
+ },
86
+ ],
87
+ ]);
88
+
89
+ const agentRegistry = BuyerAgentRegistry.cached(
90
+ BuyerAgentRegistry.bearerOnly({
91
+ resolveByCredential: async credential => {
92
+ if (credential.kind !== 'api_key') return null;
93
+ return ONBOARDING_LEDGER.get(credential.key_id) ?? null;
94
+ },
95
+ }),
96
+ { ttlSeconds: 60 }
97
+ );
64
98
 
65
99
  // ---------------------------------------------------------------------------
66
100
  // OAuth token cache — SWAP for production.
@@ -366,9 +400,12 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
366
400
  supported_event_types: ['purchase' as const, 'add_to_cart' as const, 'page_view' as const, 'lead' as const],
367
401
  supported_action_sources: ['website' as const, 'app' as const],
368
402
  },
403
+ supportedBillings: SELLER_SUPPORTED_BILLING,
369
404
  config: {},
370
405
  };
371
406
 
407
+ agentRegistry = agentRegistry;
408
+
372
409
  accounts: AccountStore<AdvertiserMeta> = {
373
410
  /** Translate AdCP `account.brand.domain` → upstream `advertiser_id`.
374
411
  * The mock's discovery endpoint is /_lookup/advertiser; production
@@ -407,6 +444,7 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
407
444
  status: 'active',
408
445
  ...(operator !== undefined && { operator }),
409
446
  brand: { domain: upstreamAdv.adcp_advertiser },
447
+ sandbox: ref === undefined || !('sandbox' in ref) || ref.sandbox === true,
410
448
  ctx_metadata: {
411
449
  advertiser_id: upstreamAdv.advertiser_id,
412
450
  advertiser_domain: upstreamAdv.adcp_advertiser,
@@ -439,7 +477,7 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
439
477
  * advertiser seats out-of-band — this is a discovery/echo, not a
440
478
  * provisioning call. Per the storyboard, list_accounts is the
441
479
  * canonical alternative (declared via `provides_state_for`). */
442
- upsert: async refs => {
480
+ upsert: async (refs, ctx) => {
443
481
  const out: SyncAccountsResultRow[] = [];
444
482
  for (const ref of refs) {
445
483
  // sync_accounts always carries the brand+operator arm (the buyer is
@@ -468,6 +506,42 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
468
506
  });
469
507
  continue;
470
508
  }
509
+ const requestedBilling = (ref as { billing?: BuyerAgentBillingMode }).billing ?? 'operator';
510
+ if (!(SELLER_SUPPORTED_BILLING as readonly BuyerAgentBillingMode[]).includes(requestedBilling)) {
511
+ out.push({
512
+ brand: { domain },
513
+ operator,
514
+ action: 'failed',
515
+ status: 'rejected',
516
+ errors: [
517
+ {
518
+ code: 'BILLING_NOT_SUPPORTED',
519
+ message: `Billing '${requestedBilling}' is not supported by this seller.`,
520
+ details: {
521
+ scope: 'capability',
522
+ supported_billing: [...SELLER_SUPPORTED_BILLING],
523
+ },
524
+ } as unknown as { code: string; message: string },
525
+ ],
526
+ });
527
+ continue;
528
+ }
529
+ if (ctx?.agent && !ctx.agent.billing_capabilities.has(requestedBilling)) {
530
+ out.push({
531
+ brand: { domain },
532
+ operator,
533
+ action: 'failed',
534
+ status: 'rejected',
535
+ errors: [
536
+ {
537
+ code: 'BILLING_NOT_PERMITTED_FOR_AGENT',
538
+ message: `Billing '${requestedBilling}' is not permitted for this buyer agent.`,
539
+ details: { rejected_billing: requestedBilling, suggested_billing: 'operator' },
540
+ } as unknown as { code: string; message: string },
541
+ ],
542
+ });
543
+ continue;
544
+ }
471
545
  const adv = await upstream.lookupAdvertiser(domain);
472
546
  if (!adv) {
473
547
  out.push({
@@ -486,6 +560,8 @@ class SalesSocialAdapter implements DecisioningPlatform<Record<string, never>, A
486
560
  operator,
487
561
  action: 'unchanged',
488
562
  status: 'active',
563
+ billing: requestedBilling,
564
+ sandbox: (ref as { sandbox?: boolean }).sandbox ?? true,
489
565
  });
490
566
  }
491
567
  return out;
@@ -1,18 +1,15 @@
1
1
  /**
2
2
  * hello_si_adapter_brand — worked starting point for an AdCP Sponsored
3
- * Intelligence agent (protocol `sponsored_intelligence`) that wraps an
3
+ * Intelligence agent (`sponsored-intelligence` specialism / protocol) that wraps an
4
4
  * upstream brand-agent platform via HTTP.
5
5
  *
6
6
  * Fork this. Replace `upstream` with calls to your real backend
7
7
  * (Salesforce Agentforce, OpenAI Assistants brand mode, custom brand
8
8
  * chat). The AdCP-facing platform methods stay the same.
9
9
  *
10
- * **Status**: SI is a *protocol* in AdCP 3.0, not a specialism. Spec change
11
- * to add it to `AdCPSpecialism` is tracked at adcontextprotocol/adcp#3961
12
- * for 3.1. Until then the SDK dispatches off the
13
- * `platform.sponsoredIntelligence` field's presence — which auto-derives
14
- * `'sponsored_intelligence'` into the wire-side `supported_protocols`
15
- * via `detectProtocols`.
10
+ * **Status**: SI is an AdCP 3.1 specialism. The SDK still dispatches off the
11
+ * `platform.sponsoredIntelligence` field's presence, and that field also
12
+ * auto-derives the wire-side `supported_protocols` entry via `detectProtocols`.
16
13
  *
17
14
  * FORK CHECKLIST
18
15
  * 1. Replace every `// SWAP:` marker with calls to your backend.
@@ -368,11 +365,10 @@ interface SiBrandMeta {
368
365
  [key: string]: unknown;
369
366
  }
370
367
 
371
- // SI isn't yet a specialism (adcp#3961). The platform field's presence
372
- // is the declaration; framework auto-derives 'sponsored_intelligence'
373
- // into supported_protocols from the four SI tools getting registered.
374
- // Build with `definePlatform` so the empty-`specialisms[]` flows through
375
- // `RequiredPlatformsFor`'s `[S] extends [never]` short-circuit cleanly.
368
+ // SI is a 3.1 specialism and a protocol-bundle surface. The platform field
369
+ // supplies the four SI tools; claiming `specialisms: ['sponsored-intelligence']`
370
+ // below lets the framework validate the field and auto-derive
371
+ // 'sponsored_intelligence' into wire-side supported_protocols.
376
372
 
377
373
  const accounts: AccountStore<SiBrandMeta> = {
378
374
  resolve: async ref => {
@@ -453,14 +449,7 @@ const sponsoredIntelligence = defineSponsoredIntelligencePlatform<SiBrandMeta>({
453
449
  ...(matching ? { matching_products: matching } : {}),
454
450
  total_matching: offering.total_matching,
455
451
  };
456
- // Top-level `offering_id` mirror. The canonical AdCP wire location is
457
- // `offering.offering_id` (above), but the `si_baseline` compliance
458
- // storyboard captures with `path: 'offering_id'` (top-level). The
459
- // schema allows `additionalProperties: true` at the response root so
460
- // the mirror is permitted at the wire layer; the generated TS type
461
- // doesn't model extra properties, so widen via cast. Drop once the
462
- // storyboard path is corrected to `offering.offering_id` upstream.
463
- return Object.assign({}, response, { offering_id: offering.offering_id }) as SIGetOfferingResponse;
452
+ return response;
464
453
  },
465
454
 
466
455
  initiateSession: async (req: SIInitiateSessionRequest, ctx): Promise<SIInitiateSessionResponse> => {
@@ -552,7 +541,7 @@ const sponsoredIntelligence = defineSponsoredIntelligencePlatform<SiBrandMeta>({
552
541
  // ---------------------------------------------------------------------------
553
542
 
554
543
  const platform = definePlatform<Record<string, never>, SiBrandMeta>({
555
- capabilities: { specialisms: [] as const, config: {} },
544
+ capabilities: { specialisms: ['sponsored-intelligence'] as const, config: {} },
556
545
  accounts,
557
546
  sponsoredIntelligence,
558
547
  });