@adcp/sdk 8.1.0-beta.1 → 8.1.0-beta.11

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 (286) hide show
  1. package/README.md +16 -1
  2. package/bin/adcp.js +75 -21
  3. package/dist/lib/conformance/oracle.d.ts.map +1 -1
  4. package/dist/lib/conformance/oracle.js +8 -1
  5. package/dist/lib/conformance/oracle.js.map +1 -1
  6. package/dist/lib/conformance/schemaArbitrary.js +135 -9
  7. package/dist/lib/conformance/schemaArbitrary.js.map +1 -1
  8. package/dist/lib/core/AgentClient.d.ts +1 -1
  9. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  10. package/dist/lib/core/AgentClient.js.map +1 -1
  11. package/dist/lib/core/GovernanceMiddleware.d.ts +2 -1
  12. package/dist/lib/core/GovernanceMiddleware.d.ts.map +1 -1
  13. package/dist/lib/core/GovernanceMiddleware.js +9 -2
  14. package/dist/lib/core/GovernanceMiddleware.js.map +1 -1
  15. package/dist/lib/core/ResponseValidator.js +1 -1
  16. package/dist/lib/core/ResponseValidator.js.map +1 -1
  17. package/dist/lib/core/SingleAgentClient.d.ts +6 -0
  18. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  19. package/dist/lib/core/SingleAgentClient.js +2 -3
  20. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  21. package/dist/lib/core/TaskExecutor.d.ts +1 -0
  22. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  23. package/dist/lib/core/TaskExecutor.js +14 -3
  24. package/dist/lib/core/TaskExecutor.js.map +1 -1
  25. package/dist/lib/index.d.ts +3 -2
  26. package/dist/lib/index.d.ts.map +1 -1
  27. package/dist/lib/index.js +26 -11
  28. package/dist/lib/index.js.map +1 -1
  29. package/dist/lib/media-buy/index.d.ts +1 -1
  30. package/dist/lib/media-buy/index.d.ts.map +1 -1
  31. package/dist/lib/media-buy/index.js.map +1 -1
  32. package/dist/lib/media-buy/types.d.ts +12 -52
  33. package/dist/lib/media-buy/types.d.ts.map +1 -1
  34. package/dist/lib/media-buy/types.js +12 -15
  35. package/dist/lib/media-buy/types.js.map +1 -1
  36. package/dist/lib/net/index.d.ts +1 -1
  37. package/dist/lib/net/index.d.ts.map +1 -1
  38. package/dist/lib/net/index.js +2 -1
  39. package/dist/lib/net/index.js.map +1 -1
  40. package/dist/lib/protocols/index.d.ts +10 -2
  41. package/dist/lib/protocols/index.d.ts.map +1 -1
  42. package/dist/lib/protocols/index.js +7 -6
  43. package/dist/lib/protocols/index.js.map +1 -1
  44. package/dist/lib/schemas/index.d.ts +68 -10
  45. package/dist/lib/schemas/index.d.ts.map +1 -1
  46. package/dist/lib/schemas/index.js +57 -16
  47. package/dist/lib/schemas/index.js.map +1 -1
  48. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  49. package/dist/lib/server/create-adcp-server.d.ts +59 -53
  50. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  51. package/dist/lib/server/create-adcp-server.js +62 -10
  52. package/dist/lib/server/create-adcp-server.js.map +1 -1
  53. package/dist/lib/server/decisioning/account.d.ts +22 -6
  54. package/dist/lib/server/decisioning/account.d.ts.map +1 -1
  55. package/dist/lib/server/decisioning/account.js.map +1 -1
  56. package/dist/lib/server/decisioning/capabilities.d.ts +8 -0
  57. package/dist/lib/server/decisioning/capabilities.d.ts.map +1 -1
  58. package/dist/lib/server/decisioning/index.d.ts +12 -11
  59. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  60. package/dist/lib/server/decisioning/index.js.map +1 -1
  61. package/dist/lib/server/decisioning/list-helpers.d.ts +3 -2
  62. package/dist/lib/server/decisioning/list-helpers.d.ts.map +1 -1
  63. package/dist/lib/server/decisioning/list-helpers.js +0 -1
  64. package/dist/lib/server/decisioning/list-helpers.js.map +1 -1
  65. package/dist/lib/server/decisioning/manifest-helpers.d.ts +8 -2
  66. package/dist/lib/server/decisioning/manifest-helpers.d.ts.map +1 -1
  67. package/dist/lib/server/decisioning/manifest-helpers.js +8 -2
  68. package/dist/lib/server/decisioning/manifest-helpers.js.map +1 -1
  69. package/dist/lib/server/decisioning/proposal/dispatch.d.ts +3 -2
  70. package/dist/lib/server/decisioning/proposal/dispatch.d.ts.map +1 -1
  71. package/dist/lib/server/decisioning/proposal/dispatch.js +1 -0
  72. package/dist/lib/server/decisioning/proposal/dispatch.js.map +1 -1
  73. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts +3 -2
  74. package/dist/lib/server/decisioning/proposal/mock-manager.d.ts.map +1 -1
  75. package/dist/lib/server/decisioning/proposal/mock-manager.js.map +1 -1
  76. package/dist/lib/server/decisioning/proposal/types.d.ts +3 -2
  77. package/dist/lib/server/decisioning/proposal/types.d.ts.map +1 -1
  78. package/dist/lib/server/decisioning/proposal/types.js.map +1 -1
  79. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  80. package/dist/lib/server/decisioning/runtime/from-platform.js +14 -1
  81. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  82. package/dist/lib/server/decisioning/specialisms/audiences.d.ts +4 -1
  83. package/dist/lib/server/decisioning/specialisms/audiences.d.ts.map +1 -1
  84. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts +19 -7
  85. package/dist/lib/server/decisioning/specialisms/brand-rights.d.ts.map +1 -1
  86. package/dist/lib/server/decisioning/specialisms/campaign-governance.d.ts +9 -4
  87. package/dist/lib/server/decisioning/specialisms/campaign-governance.d.ts.map +1 -1
  88. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts +17 -8
  89. package/dist/lib/server/decisioning/specialisms/content-standards.d.ts.map +1 -1
  90. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts +13 -5
  91. package/dist/lib/server/decisioning/specialisms/creative-ad-server.d.ts.map +1 -1
  92. package/dist/lib/server/decisioning/specialisms/creative.d.ts +14 -9
  93. package/dist/lib/server/decisioning/specialisms/creative.d.ts.map +1 -1
  94. package/dist/lib/server/decisioning/specialisms/lists.d.ts +21 -10
  95. package/dist/lib/server/decisioning/specialisms/lists.d.ts.map +1 -1
  96. package/dist/lib/server/decisioning/specialisms/sales.d.ts +27 -12
  97. package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
  98. package/dist/lib/server/decisioning/specialisms/signals.d.ts +5 -2
  99. package/dist/lib/server/decisioning/specialisms/signals.d.ts.map +1 -1
  100. package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.d.ts +9 -4
  101. package/dist/lib/server/decisioning/specialisms/sponsored-intelligence.d.ts.map +1 -1
  102. package/dist/lib/server/index.d.ts +2 -0
  103. package/dist/lib/server/index.d.ts.map +1 -1
  104. package/dist/lib/server/index.js.map +1 -1
  105. package/dist/lib/server/operational-platform.d.ts +4 -3
  106. package/dist/lib/server/operational-platform.d.ts.map +1 -1
  107. package/dist/lib/server/operational-platform.js.map +1 -1
  108. package/dist/lib/server/responses.d.ts +28 -27
  109. package/dist/lib/server/responses.d.ts.map +1 -1
  110. package/dist/lib/server/responses.js +96 -35
  111. package/dist/lib/server/responses.js.map +1 -1
  112. package/dist/lib/signing/types.d.ts +6 -0
  113. package/dist/lib/signing/types.d.ts.map +1 -1
  114. package/dist/lib/signing/types.js.map +1 -1
  115. package/dist/lib/signing/verifier.d.ts.map +1 -1
  116. package/dist/lib/signing/verifier.js +33 -4
  117. package/dist/lib/signing/verifier.js.map +1 -1
  118. package/dist/lib/testing/client.d.ts +5 -0
  119. package/dist/lib/testing/client.d.ts.map +1 -1
  120. package/dist/lib/testing/client.js +34 -3
  121. package/dist/lib/testing/client.js.map +1 -1
  122. package/dist/lib/testing/compliance/comply.d.ts +8 -1
  123. package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
  124. package/dist/lib/testing/compliance/comply.js +57 -25
  125. package/dist/lib/testing/compliance/comply.js.map +1 -1
  126. package/dist/lib/testing/compliance/types.d.ts +2 -0
  127. package/dist/lib/testing/compliance/types.d.ts.map +1 -1
  128. package/dist/lib/testing/index.d.ts +1 -1
  129. package/dist/lib/testing/index.d.ts.map +1 -1
  130. package/dist/lib/testing/index.js +4 -1
  131. package/dist/lib/testing/index.js.map +1 -1
  132. package/dist/lib/testing/scenarios/media-buy.d.ts.map +1 -1
  133. package/dist/lib/testing/scenarios/media-buy.js +12 -9
  134. package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
  135. package/dist/lib/testing/storyboard/compliance.d.ts +11 -1
  136. package/dist/lib/testing/storyboard/compliance.d.ts.map +1 -1
  137. package/dist/lib/testing/storyboard/compliance.js +37 -3
  138. package/dist/lib/testing/storyboard/compliance.js.map +1 -1
  139. package/dist/lib/testing/storyboard/context.d.ts.map +1 -1
  140. package/dist/lib/testing/storyboard/context.js +26 -11
  141. package/dist/lib/testing/storyboard/context.js.map +1 -1
  142. package/dist/lib/testing/storyboard/index.d.ts +2 -2
  143. package/dist/lib/testing/storyboard/index.d.ts.map +1 -1
  144. package/dist/lib/testing/storyboard/index.js +6 -2
  145. package/dist/lib/testing/storyboard/index.js.map +1 -1
  146. package/dist/lib/testing/storyboard/probes.d.ts.map +1 -1
  147. package/dist/lib/testing/storyboard/probes.js +3 -0
  148. package/dist/lib/testing/storyboard/probes.js.map +1 -1
  149. package/dist/lib/testing/storyboard/request-builder.d.ts.map +1 -1
  150. package/dist/lib/testing/storyboard/request-builder.js +4 -1
  151. package/dist/lib/testing/storyboard/request-builder.js.map +1 -1
  152. package/dist/lib/testing/storyboard/runner.d.ts +2 -0
  153. package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
  154. package/dist/lib/testing/storyboard/runner.js +357 -47
  155. package/dist/lib/testing/storyboard/runner.js.map +1 -1
  156. package/dist/lib/testing/storyboard/types.d.ts +65 -0
  157. package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
  158. package/dist/lib/testing/storyboard/types.js.map +1 -1
  159. package/dist/lib/testing/storyboard/validations.d.ts +4 -3
  160. package/dist/lib/testing/storyboard/validations.d.ts.map +1 -1
  161. package/dist/lib/testing/storyboard/validations.js +27 -3
  162. package/dist/lib/testing/storyboard/validations.js.map +1 -1
  163. package/dist/lib/testing/types.d.ts +19 -0
  164. package/dist/lib/testing/types.d.ts.map +1 -1
  165. package/dist/lib/types/activate-signal.d.ts +647 -0
  166. package/dist/lib/types/build-creative.d.ts +2105 -0
  167. package/dist/lib/types/calibrate-content.d.ts +675 -0
  168. package/dist/lib/types/check-governance.d.ts +619 -0
  169. package/dist/lib/types/comply-test-controller.d.ts +8428 -0
  170. package/dist/lib/types/core.generated.d.ts +547 -537
  171. package/dist/lib/types/core.generated.d.ts.map +1 -1
  172. package/dist/lib/types/core.generated.js +1 -1
  173. package/dist/lib/types/create-collection-list.d.ts +693 -0
  174. package/dist/lib/types/create-content-standards.d.ts +830 -0
  175. package/dist/lib/types/create-media-buy.d.ts +3374 -0
  176. package/dist/lib/types/create-property-list.d.ts +836 -0
  177. package/dist/lib/types/delete-collection-list.d.ts +497 -0
  178. package/dist/lib/types/delete-property-list.d.ts +497 -0
  179. package/dist/lib/types/get-account-financials.d.ts +624 -0
  180. package/dist/lib/types/get-adcp-capabilities.d.ts +2863 -0
  181. package/dist/lib/types/get-collection-list.d.ts +763 -0
  182. package/dist/lib/types/get-content-standards.d.ts +919 -0
  183. package/dist/lib/types/get-creative-delivery.d.ts +2219 -0
  184. package/dist/lib/types/get-creative-features.d.ts +1736 -0
  185. package/dist/lib/types/get-media-buy-artifacts.d.ts +864 -0
  186. package/dist/lib/types/get-media-buys.d.ts +1670 -0
  187. package/dist/lib/types/get-plan-audit-logs.d.ts +455 -0
  188. package/dist/lib/types/get-products.d.ts +4935 -0
  189. package/dist/lib/types/get-property-list.d.ts +874 -0
  190. package/dist/lib/types/get-signals.d.ts +986 -0
  191. package/dist/lib/types/index.d.ts +2 -0
  192. package/dist/lib/types/index.d.ts.map +1 -1
  193. package/dist/lib/types/index.js +1 -0
  194. package/dist/lib/types/index.js.map +1 -1
  195. package/dist/lib/types/inline-enums.generated.d.ts +163 -7
  196. package/dist/lib/types/inline-enums.generated.d.ts.map +1 -1
  197. package/dist/lib/types/inline-enums.generated.js +222 -9
  198. package/dist/lib/types/inline-enums.generated.js.map +1 -1
  199. package/dist/lib/types/list-accounts.d.ts +851 -0
  200. package/dist/lib/types/list-content-standards.d.ts +975 -0
  201. package/dist/lib/types/list-creative-formats.d.ts +3132 -0
  202. package/dist/lib/types/list-creatives.d.ts +2390 -0
  203. package/dist/lib/types/list-property-lists.d.ts +855 -0
  204. package/dist/lib/types/log-event.d.ts +373 -0
  205. package/dist/lib/types/per-tool-index.json +391 -0
  206. package/dist/lib/types/preview-creative.d.ts +1981 -0
  207. package/dist/lib/types/provide-performance-feedback.d.ts +218 -0
  208. package/dist/lib/types/report-plan-outcome.d.ts +433 -0
  209. package/dist/lib/types/report-usage.d.ts +579 -0
  210. package/dist/lib/types/schemas.generated.d.ts +146765 -128986
  211. package/dist/lib/types/schemas.generated.d.ts.map +1 -1
  212. package/dist/lib/types/schemas.generated.js +405 -437
  213. package/dist/lib/types/schemas.generated.js.map +1 -1
  214. package/dist/lib/types/server-payload-aliases.d.ts +78 -0
  215. package/dist/lib/types/server-payload-aliases.d.ts.map +1 -0
  216. package/dist/lib/types/server-payload-aliases.js +11 -0
  217. package/dist/lib/types/server-payload-aliases.js.map +1 -0
  218. package/dist/lib/types/server-payload.d.ts +39 -0
  219. package/dist/lib/types/server-payload.d.ts.map +1 -0
  220. package/dist/lib/types/server-payload.js +11 -0
  221. package/dist/lib/types/server-payload.js.map +1 -0
  222. package/dist/lib/types/si-get-offering.d.ts +259 -0
  223. package/dist/lib/types/si-initiate-session.d.ts +372 -0
  224. package/dist/lib/types/si-send-message.d.ts +300 -0
  225. package/dist/lib/types/si-terminate-session.d.ts +213 -0
  226. package/dist/lib/types/sync-accounts.d.ts +856 -0
  227. package/dist/lib/types/sync-audiences.d.ts +707 -0
  228. package/dist/lib/types/sync-catalogs.d.ts +766 -0
  229. package/dist/lib/types/sync-creatives.d.ts +2134 -0
  230. package/dist/lib/types/sync-event-sources.d.ts +665 -0
  231. package/dist/lib/types/sync-governance.d.ts +558 -0
  232. package/dist/lib/types/sync-plans.d.ts +979 -0
  233. package/dist/lib/types/tools.generated.d.ts +236 -188
  234. package/dist/lib/types/tools.generated.d.ts.map +1 -1
  235. package/dist/lib/types/update-collection-list.d.ts +697 -0
  236. package/dist/lib/types/update-content-standards.d.ts +847 -0
  237. package/dist/lib/types/update-media-buy.d.ts +3047 -0
  238. package/dist/lib/types/update-property-list.d.ts +840 -0
  239. package/dist/lib/types/validate-content-delivery.d.ts +722 -0
  240. package/dist/lib/types/validate-input.d.ts +1683 -0
  241. package/dist/lib/utils/adcp-version-config.d.ts +2 -0
  242. package/dist/lib/utils/adcp-version-config.d.ts.map +1 -1
  243. package/dist/lib/utils/adcp-version-config.js +42 -0
  244. package/dist/lib/utils/adcp-version-config.js.map +1 -1
  245. package/dist/lib/utils/envelope-status-compat.d.ts +24 -5
  246. package/dist/lib/utils/envelope-status-compat.d.ts.map +1 -1
  247. package/dist/lib/utils/envelope-status-compat.js +71 -5
  248. package/dist/lib/utils/envelope-status-compat.js.map +1 -1
  249. package/dist/lib/utils/index.d.ts +1 -0
  250. package/dist/lib/utils/index.d.ts.map +1 -1
  251. package/dist/lib/utils/index.js +5 -2
  252. package/dist/lib/utils/index.js.map +1 -1
  253. package/dist/lib/utils/media-buy-status.d.ts +22 -0
  254. package/dist/lib/utils/media-buy-status.d.ts.map +1 -0
  255. package/dist/lib/utils/media-buy-status.js +55 -0
  256. package/dist/lib/utils/media-buy-status.js.map +1 -0
  257. package/dist/lib/utils/response-schemas.d.ts.map +1 -1
  258. package/dist/lib/utils/response-schemas.js +3 -0
  259. package/dist/lib/utils/response-schemas.js.map +1 -1
  260. package/dist/lib/utils/response-unwrapper.d.ts.map +1 -1
  261. package/dist/lib/utils/response-unwrapper.js +48 -6
  262. package/dist/lib/utils/response-unwrapper.js.map +1 -1
  263. package/dist/lib/utils/tool-request-schemas.d.ts +8574 -1
  264. package/dist/lib/utils/tool-request-schemas.d.ts.map +1 -1
  265. package/dist/lib/utils/tool-request-schemas.js +4 -5
  266. package/dist/lib/utils/tool-request-schemas.js.map +1 -1
  267. package/dist/lib/utils/union-errors.d.ts +13 -6
  268. package/dist/lib/utils/union-errors.d.ts.map +1 -1
  269. package/dist/lib/utils/union-errors.js +34 -7
  270. package/dist/lib/utils/union-errors.js.map +1 -1
  271. package/dist/lib/validation/schema-loader.d.ts.map +1 -1
  272. package/dist/lib/validation/schema-loader.js +68 -15
  273. package/dist/lib/validation/schema-loader.js.map +1 -1
  274. package/dist/lib/validation/schema-validator.js +1 -1
  275. package/dist/lib/validation/schema-validator.js.map +1 -1
  276. package/dist/lib/version.d.ts +27 -3
  277. package/dist/lib/version.d.ts.map +1 -1
  278. package/dist/lib/version.js +42 -3
  279. package/dist/lib/version.js.map +1 -1
  280. package/examples/error-compliant-server.ts +1 -1
  281. package/examples/hello_seller_adapter_guaranteed.ts +14 -10
  282. package/examples/hello_seller_adapter_multi_tenant.ts +27 -23
  283. package/examples/hello_seller_adapter_non_guaranteed.ts +16 -14
  284. package/examples/hello_seller_adapter_proposal_mode.ts +22 -6
  285. package/examples/hello_signals_adapter_marketplace.ts +34 -3
  286. package/package.json +17 -2
@@ -72,6 +72,9 @@ import {
72
72
  type DecisioningPlatform,
73
73
  type SalesCorePlatform,
74
74
  type SalesIngestionPlatform,
75
+ type GetProductsPayload,
76
+ type GetMediaBuyDeliveryPayload,
77
+ type GetMediaBuysPayload,
75
78
  type AccountStore,
76
79
  type Account,
77
80
  type SyncCreativesRow,
@@ -86,9 +89,7 @@ import type {
86
89
  UpdateMediaBuyRequest,
87
90
  UpdateMediaBuySuccess,
88
91
  GetMediaBuysRequest,
89
- GetMediaBuysResponse,
90
92
  GetMediaBuyDeliveryRequest,
91
- GetMediaBuyDeliveryResponse,
92
93
  } from '@adcp/sdk/types';
93
94
 
94
95
  // `Product` isn't re-exported from `@adcp/sdk/types` (#1254 in the rollup);
@@ -516,6 +517,7 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
516
517
  specialisms: ['sales-guaranteed'] as const,
517
518
  channels: ['olv', 'ctv', 'display'] as const,
518
519
  pricingModels: ['cpm'] as const,
520
+ supportsProposals: false,
519
521
  config: {},
520
522
  // Declares the comply_test_controller surface so the conformance
521
523
  // runner picks up `controller_detected: true` and grades missing
@@ -729,7 +731,7 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
729
731
  // level. See `decisioning.type-checks.ts` for the regression-locked
730
732
  // patterns.
731
733
  sales: SalesCorePlatform<NetworkMeta> & SalesIngestionPlatform<NetworkMeta> = {
732
- getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsResponse> => {
734
+ getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsPayload> => {
733
735
  const networkCode = ctx.account.ctx_metadata.network_code;
734
736
  const publisherDomain = ctx.account.ctx_metadata.publisher_domain;
735
737
  // Storyboard sends buying_mode: 'brief' with a free-text brief —
@@ -751,7 +753,10 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
751
753
  ...(req.filters?.end_date && { flightEnd: req.filters.end_date }),
752
754
  ...(briefBudget !== undefined && { budget: briefBudget }),
753
755
  });
754
- return { status: 'completed', products: guaranteed.map(p => projectProduct(p, publisherDomain)) };
756
+ return {
757
+ products: guaranteed.map(p => projectProduct(p, publisherDomain)),
758
+ cache_scope: 'account',
759
+ };
755
760
  },
756
761
 
757
762
  /**
@@ -915,7 +920,7 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
915
920
  localBuyStatus.set(order.order_id, 'pending_creatives');
916
921
  return {
917
922
  media_buy_id: order.order_id,
918
- status: 'pending_creatives',
923
+ media_buy_status: 'pending_creatives',
919
924
  confirmed_at: new Date().toISOString(),
920
925
  packages: packagesOut,
921
926
  };
@@ -1010,11 +1015,11 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
1010
1015
  // worked example just echoes success with the post-transition status.
1011
1016
  return {
1012
1017
  media_buy_id: buyId,
1013
- status: nextStatus,
1018
+ media_buy_status: nextStatus,
1014
1019
  };
1015
1020
  },
1016
1021
 
1017
- getMediaBuys: async (req: GetMediaBuysRequest, ctx): Promise<GetMediaBuysResponse> => {
1022
+ getMediaBuys: async (req: GetMediaBuysRequest, ctx): Promise<GetMediaBuysPayload> => {
1018
1023
  const networkCode = ctx.account.ctx_metadata.network_code;
1019
1024
  const orders = await upstream.listOrders(networkCode);
1020
1025
  const filtered = req.media_buy_ids ? orders.filter(o => req.media_buy_ids!.includes(o.order_id)) : orders;
@@ -1044,7 +1049,7 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
1044
1049
  };
1045
1050
  })
1046
1051
  );
1047
- return { status: 'completed', media_buys: buys };
1052
+ return { media_buys: buys };
1048
1053
  },
1049
1054
 
1050
1055
  syncCreatives: async (creatives, ctx): Promise<SyncCreativesRow[]> => {
@@ -1085,7 +1090,7 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
1085
1090
  return rows;
1086
1091
  },
1087
1092
 
1088
- getMediaBuyDelivery: async (req: GetMediaBuyDeliveryRequest, ctx): Promise<GetMediaBuyDeliveryResponse> => {
1093
+ getMediaBuyDelivery: async (req: GetMediaBuyDeliveryRequest, ctx): Promise<GetMediaBuyDeliveryPayload> => {
1089
1094
  const networkCode = ctx.account.ctx_metadata.network_code;
1090
1095
  const ids = req.media_buy_ids ?? [];
1091
1096
  const deliveries = await Promise.all(ids.map(id => upstream.getDelivery(networkCode, id)));
@@ -1106,7 +1111,6 @@ class SalesGuaranteedAdapter implements DecisioningPlatform<Record<string, never
1106
1111
  const aggregateClicks = present.reduce((s, d) => s + d.totals.clicks, 0);
1107
1112
 
1108
1113
  return {
1109
- status: 'completed',
1110
1114
  reporting_period: { start: earliest, end: latest },
1111
1115
  currency,
1112
1116
  aggregated_totals: {
@@ -551,10 +551,13 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
551
551
  tenant.governanceBindings.delete(brandDomain);
552
552
  }
553
553
  }
554
- const echoedAgents = entry.governance_agents.map(a => ({
555
- url: a.url,
556
- ...(a.categories && { categories: a.categories }),
557
- }));
554
+ const echoedAgents = entry.governance_agents.map(a => {
555
+ const categories = (a as { categories?: unknown }).categories;
556
+ return {
557
+ url: a.url,
558
+ ...(categories !== undefined && { categories }),
559
+ };
560
+ });
558
561
  return {
559
562
  account: entry.account,
560
563
  status: 'synced' as const,
@@ -594,7 +597,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
594
597
  // pre-existing plan.
595
598
  const firstNew = (req.plans ?? [])[0]?.plan_id;
596
599
  if (firstNew && !tenant.active_plan_id) tenant.active_plan_id = firstNew;
597
- return { plans };
600
+ return { status: 'completed', plans };
598
601
  },
599
602
 
600
603
  checkGovernance: async (req: CheckGovernanceRequest, ctx): Promise<CheckGovernanceResponse> => {
@@ -615,18 +618,18 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
615
618
  : (proposed.packages ?? []).reduce((s, p) => s + (p.budget ?? 0), 0);
616
619
 
617
620
  const overBudget = proposedBudget > plan.budget_total;
618
- const status = overBudget ? 'denied' : plan.custom_policies.length > 0 ? 'conditions' : 'approved';
621
+ const verdict = overBudget ? 'denied' : plan.custom_policies.length > 0 ? 'conditions' : 'approved';
619
622
 
620
623
  const response: CheckGovernanceResponse = {
621
624
  check_id: checkId,
622
- status,
625
+ verdict,
623
626
  plan_id: plan.plan_id,
624
627
  explanation: overBudget
625
628
  ? `Proposed spend ${proposedBudget} ${plan.currency} exceeds plan budget ${plan.budget_total} ${plan.currency}.`
626
- : status === 'conditions'
629
+ : verdict === 'conditions'
627
630
  ? 'Approved with custom policy conditions.'
628
631
  : 'Approved.',
629
- ...(status === 'denied' && {
632
+ ...(verdict === 'denied' && {
630
633
  findings: [
631
634
  {
632
635
  category_id: 'budget_compliance',
@@ -635,13 +638,13 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
635
638
  },
636
639
  ],
637
640
  }),
638
- ...(status === 'conditions' && {
641
+ ...(verdict === 'conditions' && {
639
642
  conditions: plan.custom_policies.map(p => ({
640
643
  field: `payload.${p.policy_id}`,
641
644
  reason: p.policy,
642
645
  })),
643
646
  }),
644
- ...(status !== 'denied' && {
647
+ ...(verdict !== 'denied' && {
645
648
  governance_context: `gov_ctx_${plan.plan_id}_${checkId}`,
646
649
  expires_at: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
647
650
  }),
@@ -651,7 +654,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
651
654
  timestamp: new Date().toISOString(),
652
655
  kind: 'check',
653
656
  check_id: checkId,
654
- detail: { status, proposed_budget: proposedBudget },
657
+ detail: { verdict, proposed_budget: proposedBudget },
655
658
  });
656
659
  return response;
657
660
  },
@@ -674,7 +677,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
674
677
  });
675
678
  return {
676
679
  outcome_id: randomUUID(),
677
- status: 'accepted',
680
+ outcome_state: 'accepted',
678
681
  committed_budget: committed,
679
682
  plan_summary: {
680
683
  total_committed: committed,
@@ -702,7 +705,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
702
705
  governed_actions: [],
703
706
  };
704
707
  });
705
- return { plans };
708
+ return { status: 'completed', plans };
706
709
  },
707
710
  });
708
711
 
@@ -726,7 +729,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
726
729
  };
727
730
  const auth_token = `pltok_${randomUUID().replace(/-/g, '')}`;
728
731
  tenant.propertyLists.set(listId, { list, auth_token });
729
- return { list, auth_token };
732
+ return { status: 'completed', list, auth_token };
730
733
  },
731
734
 
732
735
  updatePropertyList: async (req: UpdatePropertyListRequest, ctx): Promise<UpdatePropertyListResponse> => {
@@ -748,7 +751,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
748
751
  updated_at: new Date().toISOString(),
749
752
  };
750
753
  stored.list = updated;
751
- return { list: updated };
754
+ return { status: 'completed', list: updated };
752
755
  },
753
756
 
754
757
  getPropertyList: async (req: GetPropertyListRequest, ctx): Promise<GetPropertyListResponse> => {
@@ -761,6 +764,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
761
764
  });
762
765
  }
763
766
  return {
767
+ status: 'completed',
764
768
  list: stored.list,
765
769
  identifiers: [],
766
770
  resolved_at: new Date().toISOString(),
@@ -774,13 +778,13 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
774
778
  const filtered = req.name_contains
775
779
  ? all.filter(l => l.name.toLowerCase().includes(req.name_contains!.toLowerCase()))
776
780
  : all;
777
- return { lists: filtered };
781
+ return { status: 'completed', lists: filtered };
778
782
  },
779
783
 
780
784
  deletePropertyList: async (req: DeletePropertyListRequest, ctx): Promise<DeletePropertyListResponse> => {
781
785
  const tenant = getTenant(ctx);
782
786
  const existed = tenant.propertyLists.delete(req.list_id);
783
- return { deleted: existed, list_id: req.list_id };
787
+ return { status: 'completed', deleted: existed, list_id: req.list_id };
784
788
  },
785
789
  });
786
790
 
@@ -879,7 +883,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
879
883
  if (unsupported.length > 0) {
880
884
  return {
881
885
  rights_id: offering.rights_id,
882
- status: 'rejected',
886
+ rights_status: 'rejected',
883
887
  brand_id: offering.brand_id,
884
888
  reason: `Requested uses [${unsupported.join(', ')}] are not covered by offering ${offering.rights_id}.`,
885
889
  suggestions: [`This offering covers: ${offering.available_uses.join(', ')}.`],
@@ -891,7 +895,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
891
895
  // tenant-scoped persistence when wiring a real backend.
892
896
  return {
893
897
  rights_id: offering.rights_id,
894
- status: 'acquired',
898
+ rights_status: 'acquired',
895
899
  brand_id: offering.brand_id,
896
900
  terms: {
897
901
  pricing_option_id: offering.pricing_option_id,
@@ -936,7 +940,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
936
940
  // adopters validate brand-guideline compliance, queue for human review,
937
941
  // or reject with structured `reason` + `suggestions[]`.
938
942
  return {
939
- status: 'approved',
943
+ approval_status: 'approved',
940
944
  rights_id: req.rights_id,
941
945
  ...(req.creative_id !== undefined && { creative_id: req.creative_id }),
942
946
  };
@@ -1010,7 +1014,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
1010
1014
  },
1011
1015
  ctx
1012
1016
  );
1013
- if (govResp.status !== 'denied') return null;
1017
+ if (govResp.verdict !== 'denied') return null;
1014
1018
 
1015
1019
  // Spec-correct denial shape: `AcquireRightsRejected` with `reason`
1016
1020
  // (and optional `suggestions`). Don't echo the buyer-controlled
@@ -1020,7 +1024,7 @@ class MultiTenantAdapter implements DecisioningPlatform<Record<string, never>, T
1020
1024
  // belongs in server-side logs, not the buyer envelope.
1021
1025
  return {
1022
1026
  rights_id: offering.rights_id,
1023
- status: 'rejected',
1027
+ rights_status: 'rejected',
1024
1028
  brand_id: offering.brand_id,
1025
1029
  reason: `Denied by governance plan ${planId}: ${govResp.explanation}`,
1026
1030
  ...(govResp.findings &&
@@ -66,6 +66,10 @@ import {
66
66
  type DecisioningPlatform,
67
67
  type SalesCorePlatform,
68
68
  type SalesIngestionPlatform,
69
+ type GetProductsPayload,
70
+ type GetMediaBuyDeliveryPayload,
71
+ type GetMediaBuysPayload,
72
+ type ListCreativeFormatsPayload,
69
73
  type AccountStore,
70
74
  type Account,
71
75
  type AdcpMediaBuyStatus,
@@ -81,10 +85,7 @@ import type {
81
85
  UpdateMediaBuyRequest,
82
86
  UpdateMediaBuySuccess,
83
87
  GetMediaBuysRequest,
84
- GetMediaBuysResponse,
85
88
  GetMediaBuyDeliveryRequest,
86
- GetMediaBuyDeliveryResponse,
87
- ListCreativeFormatsResponse,
88
89
  } from '@adcp/sdk/types';
89
90
 
90
91
  // `Product` isn't re-exported from `@adcp/sdk/types`; derive from response.
@@ -580,7 +581,7 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
580
581
  // all-optional and `RequiredPlatformsFor<'sales-non-guaranteed'>` requires
581
582
  // the closed shape on the way out.
582
583
  sales: SalesCorePlatform<NetworkMeta> & SalesIngestionPlatform<NetworkMeta> = {
583
- getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsResponse> => {
584
+ getProducts: async (req: GetProductsRequest, ctx): Promise<GetProductsPayload> => {
584
585
  const networkCode = ctx.account.ctx_metadata.network_code;
585
586
  const publisherDomain = ctx.account.ctx_metadata.publisher_domain;
586
587
  // When the buyer provides structured filters (flight dates, budget),
@@ -593,7 +594,10 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
593
594
  ...(req.filters?.end_date && { flightEnd: req.filters.end_date }),
594
595
  ...(briefBudget !== undefined && { budget: briefBudget }),
595
596
  });
596
- return { status: 'completed', products: products.map(p => projectProduct(p, publisherDomain)) };
597
+ return {
598
+ products: products.map(p => projectProduct(p, publisherDomain)),
599
+ cache_scope: 'account',
600
+ };
597
601
  },
598
602
 
599
603
  /**
@@ -706,7 +710,7 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
706
710
  media_buy_id: order.order_id,
707
711
  // pending_creatives — buy is auction-confirmed but no creatives
708
712
  // attached yet. Buyer transitions to `active` after sync_creatives.
709
- status: 'pending_creatives',
713
+ media_buy_status: 'pending_creatives',
710
714
  confirmed_at: order.created_at ?? new Date().toISOString(),
711
715
  packages: packagesOut,
712
716
  };
@@ -782,11 +786,11 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
782
786
  }
783
787
  return {
784
788
  media_buy_id: existing.order_id,
785
- status: nextStatus,
789
+ media_buy_status: nextStatus,
786
790
  };
787
791
  },
788
792
 
789
- getMediaBuyDelivery: async (req: GetMediaBuyDeliveryRequest, ctx): Promise<GetMediaBuyDeliveryResponse> => {
793
+ getMediaBuyDelivery: async (req: GetMediaBuyDeliveryRequest, ctx): Promise<GetMediaBuyDeliveryPayload> => {
790
794
  const networkCode = ctx.account.ctx_metadata.network_code;
791
795
  const requestedIds = req.media_buy_ids ?? [];
792
796
  // Multi-id pass-through per #1342 contract — fan out per id; framework
@@ -824,8 +828,7 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
824
828
  `[sales-non-guaranteed] get_media_buy_delivery: ${missing.length} unknown media_buy_id(s) returned no delivery rows: ${missing.join(', ')}`
825
829
  );
826
830
  }
827
- const response: GetMediaBuyDeliveryResponse = {
828
- status: 'completed',
831
+ const response: GetMediaBuyDeliveryPayload = {
829
832
  currency: filtered[0]?.currency ?? 'USD',
830
833
  reporting_period: {
831
834
  start: filtered[0]?.reporting_period.start ?? new Date().toISOString(),
@@ -854,7 +857,7 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
854
857
  return response;
855
858
  },
856
859
 
857
- getMediaBuys: async (req: GetMediaBuysRequest, ctx): Promise<GetMediaBuysResponse> => {
860
+ getMediaBuys: async (req: GetMediaBuysRequest, ctx): Promise<GetMediaBuysPayload> => {
858
861
  const networkCode = ctx.account.ctx_metadata.network_code;
859
862
  const requestedIds = req.media_buy_ids ?? [];
860
863
  let orders: UpstreamOrder[];
@@ -892,7 +895,7 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
892
895
  };
893
896
  })
894
897
  );
895
- const response: GetMediaBuysResponse = { status: 'completed', media_buys };
898
+ const response: GetMediaBuysPayload = { media_buys };
896
899
  return response;
897
900
  },
898
901
 
@@ -939,7 +942,7 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
939
942
  return out;
940
943
  },
941
944
 
942
- listCreativeFormats: async (_req, _ctx): Promise<ListCreativeFormatsResponse> => {
945
+ listCreativeFormats: async (_req, _ctx): Promise<ListCreativeFormatsPayload> => {
943
946
  // Publisher-owned format catalog. The mock doesn't have a discrete
944
947
  // formats endpoint (formats live inline on Product); production sellers
945
948
  // typically expose `/v1/formats` separately. SWAP: replace with your
@@ -960,7 +963,6 @@ class SalesNonGuaranteedAdapter implements DecisioningPlatform<Record<string, ne
960
963
  FormatAsset.url({ asset_id: 'click_url', required: true }),
961
964
  ];
962
965
  return {
963
- status: 'completed',
964
966
  formats: [
965
967
  {
966
968
  format_id: { agent_url: FORMAT_AGENT_URL, id: 'display_300x250' },
@@ -68,7 +68,7 @@ import type {
68
68
  // Wire `Product` and `Proposal` aren't directly re-exported from
69
69
  // `@adcp/sdk/types` — derive from the response array (same pattern as
70
70
  // `hello_seller_adapter_guaranteed.ts`).
71
- type Product = GetProductsResponse['products'][number];
71
+ type Product = NonNullable<GetProductsResponse['products']>[number];
72
72
  type Proposal = NonNullable<GetProductsResponse['proposals']>[number];
73
73
  type Package = CreateMediaBuySuccess['packages'][number];
74
74
 
@@ -324,6 +324,16 @@ function projectProposal(up: UpstreamProposal, total_budget?: { amount: number;
324
324
  ? `Locked at ${a.locked_cpm} ${total_budget?.currency ?? 'USD'} CPM.`
325
325
  : `Indicative pricing ${a.indicative_cpm} CPM.`,
326
326
  })),
327
+ ...(up.status === 'committed' && {
328
+ insertion_order: {
329
+ io_id: `io_${up.proposal_id}`,
330
+ requires_signature: false,
331
+ terms: {
332
+ publisher: up.network_code,
333
+ ...(total_budget && { total_budget }),
334
+ },
335
+ },
336
+ }),
327
337
  ...(up.expires_at !== undefined && { expires_at: up.expires_at }),
328
338
  ...(total_budget && { total_budget }),
329
339
  };
@@ -343,7 +353,7 @@ const proposalManager: ProposalManager<GAMLikeRecipe, NetworkMeta> = {
343
353
  const networkCode = ctx.account.ctx_metadata.network_code;
344
354
  const publisherDomain = ctx.account.ctx_metadata.publisher_domain;
345
355
  const products = await upstream.listProducts(networkCode);
346
- if (products.length === 0) return { products: [] };
356
+ if (products.length === 0) return { status: 'completed', products: [], cache_scope: 'account' };
347
357
 
348
358
  // brief + total_budget signals → curated proposal. Without a brief
349
359
  // the buyer is browsing the catalog; skip proposal generation.
@@ -352,7 +362,7 @@ const proposalManager: ProposalManager<GAMLikeRecipe, NetworkMeta> = {
352
362
  if (!brief) {
353
363
  // Catalog mode — return products with recipes, no proposals.
354
364
  const productsOut = products.map(p => projectProduct(p, publisherDomain, buildGAMLikeRecipe(p)));
355
- return { products: productsOut };
365
+ return { status: 'completed', products: productsOut, cache_scope: 'account' };
356
366
  }
357
367
 
358
368
  const draft = await upstream.createProposal(networkCode, {
@@ -364,8 +374,10 @@ const proposalManager: ProposalManager<GAMLikeRecipe, NetworkMeta> = {
364
374
  .filter(p => referencedIds.has(p.product_id))
365
375
  .map(p => projectProduct(p, publisherDomain, buildGAMLikeRecipe(p)));
366
376
  return {
377
+ status: 'completed',
367
378
  products: productsOut,
368
379
  proposals: [projectProposal(draft, totalBudget)],
380
+ cache_scope: 'account',
369
381
  };
370
382
  },
371
383
 
@@ -390,8 +402,10 @@ const proposalManager: ProposalManager<GAMLikeRecipe, NetworkMeta> = {
390
402
  .filter(p => referencedIds.has(p.product_id))
391
403
  .map(p => projectProduct(p, publisherDomain, buildGAMLikeRecipe(p)));
392
404
  return {
405
+ status: 'completed',
393
406
  products: productsOut,
394
407
  proposals: [projectProposal(refined)],
408
+ cache_scope: 'account',
395
409
  refinement_applied: refine.map(r => ({
396
410
  scope: r.scope ?? 'request',
397
411
  ...(r.proposal_id !== undefined && { proposal_id: r.proposal_id }),
@@ -449,7 +463,7 @@ const sales: SalesCorePlatform<NetworkMeta> = {
449
463
  // getProducts is owned by proposalManager when wired; the framework
450
464
  // routes there. We keep this empty at the type level — the framework
451
465
  // never reaches it.
452
- getProducts: async () => ({ products: [] }),
466
+ getProducts: async () => ({ status: 'completed', products: [], cache_scope: 'account' }),
453
467
 
454
468
  async createMediaBuy(req: CreateMediaBuyRequest, ctx): Promise<CreateMediaBuySuccess> {
455
469
  const networkCode = ctx.account.ctx_metadata.network_code;
@@ -494,7 +508,8 @@ const sales: SalesCorePlatform<NetworkMeta> = {
494
508
  }
495
509
  return {
496
510
  media_buy_id: order.order_id,
497
- status: 'pending_creatives',
511
+ status: 'completed',
512
+ media_buy_status: 'pending_creatives',
498
513
  packages,
499
514
  };
500
515
  },
@@ -529,6 +544,7 @@ const sales: SalesCorePlatform<NetworkMeta> = {
529
544
  });
530
545
  }
531
546
  return {
547
+ status: 'completed',
532
548
  reporting_period: { start: '2026-04-01T00:00:00Z', end: '2026-06-30T23:59:59Z' },
533
549
  currency: 'USD',
534
550
  media_buy_deliveries: deliveries,
@@ -536,7 +552,7 @@ const sales: SalesCorePlatform<NetworkMeta> = {
536
552
  },
537
553
 
538
554
  async getMediaBuys(_req: GetMediaBuysRequest): Promise<GetMediaBuysResponse> {
539
- return { media_buys: [] };
555
+ return { status: 'completed', media_buys: [] };
540
556
  },
541
557
  };
542
558
 
@@ -79,6 +79,20 @@ interface UpstreamActivation {
79
79
  agent_activation_key?: { agent_segment?: string };
80
80
  }
81
81
 
82
+ const PLATFORM_CODE_ALIASES: Record<string, string> = {
83
+ // The compliance storyboard uses the buyer-facing DSP label; the mock
84
+ // upstream exposes the concrete integration vendor code.
85
+ 'pinnacle-dsp': 'the-trade-desk',
86
+ };
87
+
88
+ function resolvePlatformDestination(
89
+ destinations: UpstreamDestination[],
90
+ requestedPlatform: string
91
+ ): UpstreamDestination | undefined {
92
+ const platformCode = PLATFORM_CODE_ALIASES[requestedPlatform] ?? requestedPlatform;
93
+ return destinations.find(d => d.platform_type !== 'agent' && d.platform_code === platformCode);
94
+ }
95
+
82
96
  // ---------------------------------------------------------------------------
83
97
  // Upstream-traffic recorder (sandbox-only, opts into `upstream_traffic` storyboard checks)
84
98
  // ---------------------------------------------------------------------------
@@ -120,6 +134,12 @@ const http = createUpstreamHttpClient({
120
134
 
121
135
  const tenantHeader = (operatorId: string) => ({ 'X-Operator-Id': operatorId });
122
136
 
137
+ function upstreamPlatformCode(platform: string): string {
138
+ // The compliance storyboard uses a fictional buyer-facing DSP label;
139
+ // this adapter maps it onto the mock upstream's concrete destination.
140
+ return platform === 'pinnacle-dsp' ? 'the-trade-desk' : platform;
141
+ }
142
+
123
143
  const upstream = {
124
144
  // SWAP: tenant lookup. Mock exposes /_lookup; production typically a
125
145
  // directory service or config registry.
@@ -159,7 +179,13 @@ const upstream = {
159
179
  // SWAP: post an activation.
160
180
  async activate(
161
181
  operatorId: string,
162
- body: { cohort_id: string; destination_id: string; pricing_id: string; client_request_id: string }
182
+ body: {
183
+ cohort_id: string;
184
+ destination_id: string;
185
+ pricing_id: string;
186
+ client_request_id: string;
187
+ signal_agent_segment_id: string;
188
+ }
163
189
  ): Promise<UpstreamActivation> {
164
190
  const r = await http.post<UpstreamActivation>('/v2/activations', body, tenantHeader(operatorId));
165
191
  if (r.body === null) {
@@ -405,7 +431,11 @@ class SignalMarketplaceAdapter implements DecisioningPlatform<Record<string, nev
405
431
  sid.id === c.data_provider_id
406
432
  );
407
433
  });
408
- return { status: 'completed', signals: filtered.map(toAdcpSignal) } satisfies GetSignalsResponse;
434
+ return {
435
+ status: 'completed',
436
+ signals: filtered.map(toAdcpSignal),
437
+ cache_scope: 'account',
438
+ } satisfies GetSignalsResponse;
409
439
  }),
410
440
 
411
441
  activateSignal: (req: ActivateSignalRequest, ctx): Promise<ActivateSignalSuccess> =>
@@ -433,7 +463,7 @@ class SignalMarketplaceAdapter implements DecisioningPlatform<Record<string, nev
433
463
  req.destinations.map(async (dest, i) => {
434
464
  const matched =
435
465
  dest.type === 'platform'
436
- ? upstreamDests.find(d => d.platform_type !== 'agent' && d.platform_code === dest.platform)
466
+ ? resolvePlatformDestination(upstreamDests, dest.platform)
437
467
  : upstreamDests.find(d => d.platform_type === 'agent' && d.agent_url === dest.agent_url);
438
468
  if (!matched) {
439
469
  const target = dest.type === 'platform' ? dest.platform : dest.agent_url;
@@ -444,6 +474,7 @@ class SignalMarketplaceAdapter implements DecisioningPlatform<Record<string, nev
444
474
  }
445
475
  const activation = await upstream.activate(operatorId, {
446
476
  cohort_id: cohort.cohort_id,
477
+ signal_agent_segment_id: cohort.cohort_id,
447
478
  destination_id: matched.destination_id,
448
479
  pricing_id: pricingId,
449
480
  client_request_id: `${idempotency}.${i}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adcp/sdk",
3
- "version": "8.1.0-beta.1",
3
+ "version": "8.1.0-beta.11",
4
4
  "description": "AdCP SDK — client, server, and compliance harnesses for the AdContext Protocol (MCP + A2A)",
5
5
  "workspaces": [
6
6
  ".",
@@ -45,6 +45,9 @@
45
45
  "require": "./dist/lib/types/v3-1-beta/index.js",
46
46
  "types": "./dist/lib/types/v3-1-beta/index.d.ts"
47
47
  },
48
+ "./types/*": {
49
+ "types": "./dist/lib/types/*.d.ts"
50
+ },
48
51
  "./wholesale-feed-sync": {
49
52
  "import": "./dist/lib/wholesale-feed-sync/index.js",
50
53
  "require": "./dist/lib/wholesale-feed-sync/index.js",
@@ -85,6 +88,11 @@
85
88
  "require": "./dist/lib/webhooks/index.js",
86
89
  "types": "./dist/lib/webhooks/index.d.ts"
87
90
  },
91
+ "./net": {
92
+ "import": "./dist/lib/net/index.js",
93
+ "require": "./dist/lib/net/index.js",
94
+ "types": "./dist/lib/net/index.d.ts"
95
+ },
88
96
  "./server": {
89
97
  "import": "./dist/lib/server/index.js",
90
98
  "require": "./dist/lib/server/index.js",
@@ -193,6 +201,9 @@
193
201
  "webhooks": [
194
202
  "dist/lib/webhooks/index.d.ts"
195
203
  ],
204
+ "net": [
205
+ "dist/lib/net/index.d.ts"
206
+ ],
196
207
  "server": [
197
208
  "dist/lib/server/index.d.ts"
198
209
  ],
@@ -228,6 +239,9 @@
228
239
  ],
229
240
  "upstream-recorder": [
230
241
  "dist/lib/upstream-recorder/index.d.ts"
242
+ ],
243
+ "types/*": [
244
+ "dist/lib/types/*.d.ts"
231
245
  ]
232
246
  }
233
247
  },
@@ -253,7 +267,7 @@
253
267
  "sync:agents": "node scripts/import-claude-agents.mjs",
254
268
  "prepublishOnly": "npm run clean && npm run sync-schemas:all && (test -f src/lib/types/tools.generated.ts || npm run generate-types) && npm run build:lib && node --test-timeout=60000 --test-force-exit --test test/lib/adcp-client.test.js test/lib/validation.test.js test/lib/zod-schemas.test.js",
255
269
  "build": "npm run build:lib",
256
- "build:lib": "npm run sync-version && npm run schemas:ensure && tsx scripts/generate-wire-spec-fields.ts && tsc --project tsconfig.lib.json && tsx scripts/copy-schemas-to-dist.ts && tsx scripts/copy-v2-projection-catalog.ts",
270
+ "build:lib": "npm run sync-version && npm run schemas:ensure && tsx scripts/generate-wire-spec-fields.ts && tsc --project tsconfig.lib.json && tsx scripts/copy-schemas-to-dist.ts && tsx scripts/copy-v2-projection-catalog.ts && tsx scripts/generate-per-tool-types.ts",
257
271
  "build:test-agents": "npm run build:lib && tsc -p test-agents/tsconfig.json --rootDir test-agents",
258
272
  "pretest": "npm run schemas:ensure",
259
273
  "test": "NODE_ENV=test node --test-timeout=60000 --test-force-exit --test test/*.test.js test/lib/*.test.js && npm test --workspace=packages/eslint-plugin --if-present",
@@ -294,6 +308,7 @@
294
308
  "typecheck:skill-examples": "tsx scripts/typecheck-skill-examples.ts",
295
309
  "check:skill-sync": "tsx scripts/check-skill-sync.ts",
296
310
  "check:adopter-types": "tsx scripts/check-adopter-types.ts",
311
+ "check:adopter-types-narrow": "tsx scripts/check-adopter-types-narrow.ts",
297
312
  "sync-version": "tsx scripts/sync-version.ts",
298
313
  "validate-schemas": "tsx scripts/validate-schemas.ts",
299
314
  "lint": "eslint 'src/lib/testing/**/*.ts'",