@adcp/sdk 14.0.0-beta.0 → 14.0.0-beta.1

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 (140) hide show
  1. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/get-account-financials-request.json +610 -0
  2. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/get-account-financials-response.json +1055 -0
  3. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/list-accounts-request.json +629 -0
  4. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/list-accounts-response.json +1558 -0
  5. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/report-usage-request.json +702 -0
  6. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/report-usage-response.json +309 -0
  7. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/sync-accounts-request.json +1113 -0
  8. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/sync-accounts-response.json +1567 -0
  9. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/sync-governance-request.json +662 -0
  10. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/sync-governance-response.json +921 -0
  11. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/creative/list-creatives-request.json +992 -0
  12. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/creative/list-creatives-response.json +5965 -0
  13. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/creative/sync-creatives-request.json +3936 -0
  14. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/creative/sync-creatives-response.json +3859 -0
  15. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/manifest.json +206 -0
  16. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/accept-proposal-request.json +601 -0
  17. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/accept-proposal-response.json +4799 -0
  18. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/buy-products-request.json +4107 -0
  19. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/buy-products-response.json +4799 -0
  20. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/control-media-buy-request.json +3365 -0
  21. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/control-media-buy-response.json +656 -0
  22. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/decline-proposals-request.json +334 -0
  23. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/decline-proposals-response.json +271 -0
  24. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/get-media-buy-delivery-request.json +1236 -0
  25. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/get-media-buy-delivery-response.json +2861 -0
  26. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/get-media-buys-request.json +678 -0
  27. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/get-media-buys-response.json +10861 -0
  28. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/list-products-request.json +4229 -0
  29. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/list-products-response.json +3824 -0
  30. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/log-event-request.json +421 -0
  31. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/log-event-response.json +394 -0
  32. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/media-buy-delivery-webhook-result.json +1366 -0
  33. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/provide-performance-feedback-request.json +884 -0
  34. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/provide-performance-feedback-response.json +422 -0
  35. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/refine-proposals-request.json +4335 -0
  36. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/refine-proposals-response.json +7328 -0
  37. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/request-proposals-request.json +4307 -0
  38. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/request-proposals-response.json +7105 -0
  39. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-audiences-request.json +760 -0
  40. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-audiences-response.json +541 -0
  41. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-catalogs-request.json +1142 -0
  42. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-catalogs-response.json +1153 -0
  43. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-event-sources-request.json +743 -0
  44. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-event-sources-response.json +619 -0
  45. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/account/get-account-financials-request.json +544 -0
  46. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/account/list-accounts-request.json +557 -0
  47. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/account/report-usage-request.json +617 -0
  48. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/account/sync-accounts-request.json +984 -0
  49. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/account/sync-governance-request.json +581 -0
  50. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/creative/list-creatives-request.json +878 -0
  51. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/creative/sync-creatives-request.json +3456 -0
  52. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/manifest.json +175 -0
  53. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/accept-proposal-request.json +498 -0
  54. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/buy-products-request.json +3675 -0
  55. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/control-media-buy-request.json +3030 -0
  56. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/decline-proposals-request.json +282 -0
  57. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/get-media-buy-delivery-request.json +1136 -0
  58. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/get-media-buys-request.json +597 -0
  59. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/list-products-request.json +3780 -0
  60. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/log-event-request.json +386 -0
  61. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/provide-performance-feedback-request.json +784 -0
  62. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/refine-proposals-request.json +3878 -0
  63. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/request-proposals-request.json +3852 -0
  64. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/sync-audiences-request.json +682 -0
  65. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/sync-catalogs-request.json +1016 -0
  66. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/sync-event-sources-request.json +660 -0
  67. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/protocol/get-adcp-capabilities-request.json +51 -0
  68. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/protocol/get-task-status-request.json +534 -0
  69. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/protocol/list-tasks-request.json +692 -0
  70. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/protocol/sync-agent-notification-configs-request.json +129 -0
  71. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/get-adcp-capabilities-request.json +58 -0
  72. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/get-adcp-capabilities-response.json +8069 -0
  73. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/get-task-status-request.json +601 -0
  74. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/get-task-status-response.json +612 -0
  75. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/list-tasks-request.json +775 -0
  76. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/list-tasks-response.json +483 -0
  77. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/sync-agent-notification-configs-request.json +155 -0
  78. package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/sync-agent-notification-configs-response.json +382 -0
  79. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  80. package/dist/lib/server/create-adcp-server.d.mts +27 -0
  81. package/dist/lib/server/create-adcp-server.d.ts +27 -0
  82. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  83. package/dist/lib/server/create-adcp-server.js +120 -4
  84. package/dist/lib/server/create-adcp-server.js.map +1 -1
  85. package/dist/lib/server/create-adcp-server.mjs +121 -6
  86. package/dist/lib/server/create-adcp-server.mjs.map +1 -1
  87. package/dist/lib/server/decisioning/context.d.mts +6 -0
  88. package/dist/lib/server/decisioning/context.d.ts +6 -0
  89. package/dist/lib/server/decisioning/context.d.ts.map +1 -1
  90. package/dist/lib/server/decisioning/context.js.map +1 -1
  91. package/dist/lib/server/decisioning/index.d.mts +1 -1
  92. package/dist/lib/server/decisioning/index.d.ts +1 -1
  93. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  94. package/dist/lib/server/decisioning/index.js.map +1 -1
  95. package/dist/lib/server/decisioning/index.mjs.map +1 -1
  96. package/dist/lib/server/decisioning/platform.d.mts +21 -6
  97. package/dist/lib/server/decisioning/platform.d.ts +21 -6
  98. package/dist/lib/server/decisioning/platform.d.ts.map +1 -1
  99. package/dist/lib/server/decisioning/platform.js.map +1 -1
  100. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  101. package/dist/lib/server/decisioning/runtime/from-platform.js +201 -18
  102. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  103. package/dist/lib/server/decisioning/runtime/from-platform.mjs +203 -19
  104. package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
  105. package/dist/lib/server/decisioning/runtime/to-context.d.ts.map +1 -1
  106. package/dist/lib/server/decisioning/runtime/to-context.js +6 -0
  107. package/dist/lib/server/decisioning/runtime/to-context.js.map +1 -1
  108. package/dist/lib/server/decisioning/runtime/to-context.mjs +6 -0
  109. package/dist/lib/server/decisioning/runtime/to-context.mjs.map +1 -1
  110. package/dist/lib/server/decisioning/runtime/validate-platform.d.ts.map +1 -1
  111. package/dist/lib/server/decisioning/runtime/validate-platform.js +35 -4
  112. package/dist/lib/server/decisioning/runtime/validate-platform.js.map +1 -1
  113. package/dist/lib/server/decisioning/runtime/validate-platform.mjs +35 -4
  114. package/dist/lib/server/decisioning/runtime/validate-platform.mjs.map +1 -1
  115. package/dist/lib/server/decisioning/specialisms/sales.d.mts +39 -0
  116. package/dist/lib/server/decisioning/specialisms/sales.d.ts +39 -0
  117. package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
  118. package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
  119. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  120. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  121. package/dist/lib/validation/schema-loader.d.mts +2 -0
  122. package/dist/lib/validation/schema-loader.d.ts +2 -0
  123. package/dist/lib/validation/schema-loader.d.ts.map +1 -1
  124. package/dist/lib/validation/schema-loader.js +31 -0
  125. package/dist/lib/validation/schema-loader.js.map +1 -1
  126. package/dist/lib/validation/schema-loader.mjs +30 -0
  127. package/dist/lib/validation/schema-loader.mjs.map +1 -1
  128. package/dist/lib/version.d.mts +3 -3
  129. package/dist/lib/version.d.ts +3 -3
  130. package/dist/lib/version.js +3 -3
  131. package/dist/lib/version.js.map +1 -1
  132. package/dist/lib/version.mjs +3 -3
  133. package/dist/lib/version.mjs.map +1 -1
  134. package/docs/guides/BUILD-AN-AGENT.md +10 -1
  135. package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +119 -0
  136. package/docs/llms.txt +1 -1
  137. package/docs/migration-12-to-14.md +8 -0
  138. package/docs/migration-13-to-14.md +30 -4
  139. package/docs/releases/14.0.0-beta.0.md +19 -1
  140. package/package.json +2 -1
@@ -27,9 +27,15 @@ import type { TaskHandoff, TaskHandoffContext, TaskHandoffOptions } from './asyn
27
27
  import type { CtxMetadataRef, ResourceKind } from '../ctx-metadata/index.mjs';
28
28
  import type { BuyerAgent } from './buyer-agent.mjs';
29
29
  import type { Recipe } from './proposal/index.mjs';
30
+ import type { CallerMutationScope } from '../create-adcp-server.mjs';
31
+ import type { ProposalRefinementScope } from '../../negotiation/seller.mjs';
30
32
  export interface RequestContext<TAccount = Account> {
31
33
  /** Resolved account for this request. */
32
34
  account: TAccount;
35
+ /** Framework-derived caller namespace for authenticated mutations. */
36
+ callerMutationScope?: Readonly<CallerMutationScope>;
37
+ /** Framework-derived proposal namespace; never sourced from request fields. */
38
+ proposalRefinementScope?: Readonly<ProposalRefinementScope>;
33
39
  /**
34
40
  * Resolved buyer agent for this request, when an `agentRegistry` is
35
41
  * configured on the platform (Phase 1 of #1269). Carries the durable
@@ -27,9 +27,15 @@ import type { TaskHandoff, TaskHandoffContext, TaskHandoffOptions } from './asyn
27
27
  import type { CtxMetadataRef, ResourceKind } from '../ctx-metadata';
28
28
  import type { BuyerAgent } from './buyer-agent';
29
29
  import type { Recipe } from './proposal';
30
+ import type { CallerMutationScope } from '../create-adcp-server';
31
+ import type { ProposalRefinementScope } from '../../negotiation/seller';
30
32
  export interface RequestContext<TAccount = Account> {
31
33
  /** Resolved account for this request. */
32
34
  account: TAccount;
35
+ /** Framework-derived caller namespace for authenticated mutations. */
36
+ callerMutationScope?: Readonly<CallerMutationScope>;
37
+ /** Framework-derived proposal namespace; never sourced from request fields. */
38
+ proposalRefinementScope?: Readonly<ProposalRefinementScope>;
33
39
  /**
34
40
  * Resolved buyer agent for this request, when an `agentRegistry` is
35
41
  * configured on the platform (Phase 1 of #1269). Carries the durable
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EACV,MAAM,EACN,+BAA+B,EAC/B,YAAY,EACZ,cAAc,EACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAOzC,MAAM,WAAW,cAAc,CAAC,QAAQ,GAAG,OAAO;IAChD,yCAAyC;IACzC,OAAO,EAAE,QAAQ,CAAC;IAElB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,qCAAqC;IACrC,KAAK,EAAE,mBAAmB,CAAC;IAE3B,0CAA0C;IAC1C,OAAO,EAAE,gBAAgB,CAAC;IAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+DG;IACH,KAAK,CAAC,E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MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;CAClD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/server/decisioning/context.ts"],"sourcesContent":["/**\n * RequestContext — what the framework passes to every decision-point method.\n *\n * - `account` — resolved tenant for this request (from `accounts.resolve()`)\n * - `state.*` — sync state reads (workflow steps, governance context, proposal lookups)\n * - `resolve.*` — async framework-mediated fetches (property lists, formats)\n *\n * Async patterns:\n * - **Sync**: adopter implements `xxx(req, ctx) => Promise<T>`. Framework\n * awaits in foreground; projects to wire success arm.\n * - **HITL**: adopter implements `xxxTask(taskId, req, ctx) => Promise<T>`.\n * Framework returns submitted envelope to buyer first, then runs the\n * task method in background; return value becomes terminal task state.\n * - **Status changes**: adopter calls `publishStatusChange(...)` (event bus)\n * from anywhere — webhook handler, cron, in-process worker. Framework\n * records the change and projects to subscribers / per-resource reads.\n *\n * Platform reads only; framework writes only. Adopters never mutate the context.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { Account } from './account';\nimport type {\n Format,\n FormatReferenceStructuredObject,\n PropertyList,\n CollectionList,\n} from '../../types/tools.generated';\nimport type { TaskHandoff, TaskHandoffContext, TaskHandoffOptions } from './async-outcome';\nimport type { CtxMetadataRef, ResourceKind } from '../ctx-metadata';\nimport type { BuyerAgent } from './buyer-agent';\nimport type { Recipe } from './proposal';\n\n// Unconstrained `TAccount` (no `extends Account`) so adopters with metadata\n// types that don't extend `Record<string, unknown>` (interfaces without index\n// signatures, type aliases pointing to unions, etc.) can still parameterize.\n// The framework only ever passes the resolved `Account<TCtxMeta>` here; constraint\n// is implicit through the generic flow from `DecisioningPlatform<_, TCtxMeta>`.\nexport interface RequestContext<TAccount = Account> {\n /** Resolved account for this request. */\n account: TAccount;\n\n /**\n * Resolved buyer agent for this request, when an `agentRegistry` is\n * configured on the platform (Phase 1 of #1269). Carries the durable\n * commercial relationship — status, billing capabilities, default\n * account terms — distinct from the per-request credential. Undefined\n * when no registry is configured OR when the registry returned null\n * for the request's credential. Phase 2 (#1292) wires framework-level\n * billing-capability enforcement to the AdCP-3.1 error codes.\n */\n agent?: BuyerAgent;\n\n /** Sync reads of in-flight state. */\n state: WorkflowStateReader;\n\n /** Async framework-mediated resolvers. */\n resolve: ResourceResolver;\n\n /**\n * Ctx-metadata accessor — opaque-blob round-trip cache for adapter-internal\n * state (GAM `ad_unit_ids` per product, `gam_order_id` per media buy, etc.).\n *\n * **Present only when `createAdcpServerFromPlatform({ ctxMetadata })` was\n * wired with a `CtxMetadataStore`.** Adopters who don't wire a store see\n * `undefined` here — branch defensively.\n *\n * The accessor is account-scoped automatically (uses `ctx.account.id` as\n * the tenant boundary). Pass `kind + id`, get an opaque blob the publisher\n * stashed during a prior call's response. Returns `undefined` on miss —\n * fall through to your own DB.\n *\n * @example Read a product's ctx_metadata in createMediaBuy\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * for (const pkg of req.packages) {\n * const meta = await ctx.ctxMetadata?.product(pkg.product_id);\n * if (meta?.gam?.ad_unit_ids) {\n * await this.gam.createLineItem(pkg, meta.gam.ad_unit_ids);\n * }\n * }\n * }\n * ```\n *\n * @example Persist platform IDs from createMediaBuy\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * const order = await this.gam.createOrder(req);\n * await ctx.ctxMetadata?.set('media_buy', order.id, { gam_order_id: order.id });\n * for (const li of order.lineItems) {\n * await ctx.ctxMetadata?.set('package', li.id, { gam_line_item_id: li.id });\n * }\n * return { media_buy_id: order.id, status: 'pending_creatives', packages: ... };\n * }\n * ```\n *\n * @public\n */\n ctxMetadata?: CtxMetadataAccessor;\n\n /**\n * Request payload as the platform method sees it. The framework sets\n * this on every v6 platform-method dispatch so methods can read request\n * fields the typed signature doesn't model.\n *\n * **Why it exists.** Several `sync_*` request schemas carry modifier\n * fields (`assignments[]` on `sync_creatives`; `delete_missing`,\n * `dry_run`, `validation_mode` on the same; `delete_missing` on\n * `sync_audiences` and `sync_accounts`) that the platform method's\n * typed signature drops — the framework destructures the payload array\n * and passes only that. Without `ctx.input`, adopters implementing\n * those fields at the wire layer would see them silently disappear on\n * the `/sales/mcp` route while working on `/mcp` — a silent-conformance\n * trap. Read the field from `ctx.input` and the modifier survives to\n * the adapter.\n *\n * **Same reference as the typed payload arg, not a snapshot.** `ctx.input`\n * is set BEFORE the framework's auto-hydrate seams\n * (`hydratePackagesWithProducts`, `hydrateForTool`) run, but those\n * seams mutate the same object in place. By the time the platform\n * method's body executes, `ctx.input` and the first positional arg are\n * the same reference and both reflect framework hydration. Fields the\n * buyer sent are authoritative; framework-injected entities\n * (`pkg.product`, `req.media_buy`) are present too — distinguish by\n * field shape, not by which path you read from.\n *\n * **For methods that hoist a field to a positional arg** (e.g.\n * `updateMediaBuy(media_buy_id, patch, ctx)` hoists `media_buy_id` out\n * of the wire envelope), that field is still present at the top level\n * of `ctx.input`. `ctx.input` is NOT \"what the method didn't get\" — it\n * is the full envelope, hoist included. Prefer reading any field\n * present on both the positional arg and `ctx.input` from the\n * positional arg; reach for `ctx.input` only for fields the typed\n * signature drops.\n *\n * **Typed as unknown** to match the `comply_test_controller` bridge\n * precedent (`TestControllerBridgeContext.input`) and to avoid coupling\n * adopters to specific schema versions. Cast at the read site:\n *\n * ```ts\n * syncCreatives: async (creatives, ctx) => {\n * const wire = ctx.input as SyncCreativesRequest;\n * if (wire.delete_missing) { ... }\n * for (const assignment of wire.assignments ?? []) { ... }\n * }\n * ```\n *\n * **Security — `ctx.input` is buyer-controlled and may carry secrets.**\n * Mutating-tool envelopes can include `push_notification_config.token`\n * (the buyer's webhook-signature secret); `sync_*` requests can carry\n * `ctx_metadata` blobs the adopter persisted on a prior turn. Do NOT\n * log `ctx.input` wholesale — read named fields. Free-text fields\n * (`brief` on `getProducts`, `message` on `si_send_message`, creative\n * snippets, etc.) are attacker-controlled; when templating into LLM\n * prompts, validate or fence — don't string-interpolate. See\n * `docs/guides/CTX-METADATA-SAFETY.md` for the broader policy on\n * buyer-controlled inputs.\n *\n * **Optional in the type signature** so adopters constructing ad-hoc\n * `RequestContext` for unit tests aren't forced to set it; the\n * framework always sets it on real dispatches.\n *\n * @public\n */\n input?: Readonly<Record<string, unknown>>;\n\n /**\n * Hydrated typed recipes (`product_id -> Recipe`) for proposal-mode\n * dispatch. Populated by the framework's v1.5 ProposalManager seams:\n *\n * - `createMediaBuy` with `proposal_id`: framework reserves the\n * proposal, validates expiry + capability overlap, and writes the\n * recipe map here BEFORE the adapter runs.\n * - `updateMediaBuy` / `getMediaBuyDelivery`: framework hydrates\n * via the `getByMediaBuyId` reverse-index.\n *\n * Adopters read this map to apply per-product internal-config\n * (e.g., `recipe.line_item_template_id` on the matching adapter\n * upstream call). Undefined when no proposal-mode dispatch is wired\n * for the request — the v1 path leaves it untouched.\n *\n * @public\n */\n recipes?: ReadonlyMap<string, Recipe>;\n\n /**\n * Hand off the call to a background task. Returns a `TaskHandoff<T>`\n * marker — return that from your method to signal the framework should\n * project the spec-defined `Submitted` envelope to the buyer and run\n * `fn` asynchronously. `fn` receives a `TaskHandoffContext` with the\n * framework-issued `id` plus `update`/`heartbeat` affordances; its\n * return value becomes the task's terminal artifact.\n *\n * Use this for hybrid sellers — the same tool serves both fast\n * (programmatic remnant, instant `media_buy_id`) and slow (guaranteed\n * inventory, trafficker review) inventory. Branch in your method body\n * on whatever signal determines the path (product type, buyer\n * pre-approval, etc.). Buyers pattern-match on the wire response shape\n * (`media_buy_id` → sync; `task_id` → submitted) — predictable per\n * request, dynamic per call.\n *\n * @example\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * if (this.requiresHITL(req)) {\n * return ctx.handoffToTask(async (taskCtx) => {\n * await taskCtx.update({ message: 'Awaiting trafficker' });\n * return await this.runHITL(req);\n * });\n * }\n * return await this.commitSync(req);\n * }\n * ```\n *\n * Pass `options.task_id` when an upstream system or test-controller directive\n * has already issued the task id and the spec contract requires the response\n * to echo it verbatim (e.g. `force_create_media_buy_arm`). The framework uses\n * the supplied id instead of minting a fresh one; `taskCtx.id` reflects it.\n * Constraints: non-empty, ≤ 128 characters. Throws if violated.\n */\n handoffToTask<TResult>(\n fn: (taskCtx: TaskHandoffContext) => Promise<TResult>,\n options?: TaskHandoffOptions\n ): TaskHandoff<TResult>;\n}\n\n// ---------------------------------------------------------------------------\n// State (sync) — what the framework knows about this request and prior steps\n// ---------------------------------------------------------------------------\n\nexport interface WorkflowStateReader {\n /**\n * Workflow steps that touched a given object. Object types: 'media_buy',\n * 'creative', 'product', 'plan', 'audience', 'rights_grant', 'task'.\n * Returns chronological steps. Used for \"what's happened to this buy?\"\n * queries without re-fetching from the platform.\n */\n findByObject(type: WorkflowObjectType, id: string): readonly WorkflowStep[];\n\n /**\n * Resolve a proposal_id to its proposal context. Threaded by the framework\n * across get_products → refine → create_media_buy without platform code.\n * Returns null if the framework doesn't recognize the id.\n */\n findProposalById(proposalId: string): Proposal | null;\n\n /**\n * Currently in-flight verified governance context for the call. Returns\n * the JWS string for downstream checks (or null for non-governance flows).\n * Framework verifies signature, plan-binding, seller-binding, and\n * phase-binding before exposing — platform can trust the value.\n */\n governanceContext(): GovernanceContextJWS | null;\n\n /** Chronological steps for this request's account. Useful for audit reads. */\n workflowSteps(): readonly WorkflowStep[];\n}\n\n// ---------------------------------------------------------------------------\n// Resolve (async) — framework-mediated fetches with cache + validation\n// ---------------------------------------------------------------------------\n\nexport interface ResourceResolver {\n /**\n * Fetch a property list by id. Framework validates the id exists in the\n * seller's declared lists before returning; consumers can trust the result.\n */\n propertyList(listId: string): Promise<PropertyList>;\n\n /** Same for collection lists. */\n collectionList(listId: string): Promise<CollectionList>;\n\n /**\n * Fetch a creative format definition. Framework routes through the\n * `capabilities.creative_agents` declaration with a 1h cache; self-hosted\n * formats hit the local CreativePlatform.listFormats(). Returns the\n * resolved Format with full asset slot definitions.\n */\n creativeFormat(formatId: FormatReferenceStructuredObject): Promise<Format>;\n}\n\n// ---------------------------------------------------------------------------\n// Workflow object model\n// ---------------------------------------------------------------------------\n\nexport type WorkflowObjectType = 'media_buy' | 'creative' | 'product' | 'plan' | 'audience' | 'rights_grant' | 'task';\n\nexport interface WorkflowStep {\n /** Stable step identifier. */\n id: string;\n /** Object that this step touched. */\n object: { type: WorkflowObjectType; id: string };\n /** Tool that was called (wire verb). */\n tool: string;\n /** ISO 8601 timestamp. */\n at: string;\n /** Caller principal. */\n actor: { agent_url?: string; principal?: string };\n /** Outcome: 'submitted' / 'completed' / 'failed' / 'progress'. */\n status: 'submitted' | 'completed' | 'failed' | 'progress';\n}\n\nexport interface Proposal {\n proposal_id: string;\n /** Products in this proposal. */\n product_ids: string[];\n /** When the proposal was generated. */\n issued_at: string;\n /** When the proposal expires. */\n expires_at?: string;\n /** Account this proposal was issued to. */\n account_id: string;\n}\n\n/**\n * JWS-signed governance context. The framework returns the verified token;\n * platform can re-pass to downstream calls (e.g., report_usage) and the\n * framework will validate consistency. Don't unwrap or modify.\n */\nexport type GovernanceContextJWS = string;\n\n// ---------------------------------------------------------------------------\n// Ctx-metadata accessor (6.1)\n// ---------------------------------------------------------------------------\n\n/**\n * Account-scoped ctx-metadata accessor. The framework binds this to the\n * resolved `ctx.account.id` per request — adopters never pass account.\n *\n * Generic `get`/`set`/`bulkGet` carry a `ResourceKind` discriminator;\n * per-kind shorthand methods (`product(id)`, `mediaBuy(id)`, etc.) map to\n * `get(kind, id)` for ergonomic call sites.\n */\nexport interface CtxMetadataAccessor {\n /** Look up by kind + id. Returns `undefined` on miss. */\n get(kind: ResourceKind, id: string): Promise<unknown | undefined>;\n /** Bulk lookup. Result Map keyed by `${kind}:${id}`. Misses absent from Map. */\n bulkGet(refs: readonly CtxMetadataRef[]): Promise<ReadonlyMap<string, unknown>>;\n /**\n * Persist a blob under (account, kind, id). Throws `CTX_METADATA_TOO_LARGE`\n * if serialized size exceeds the configured cap (16KB default).\n */\n set(kind: ResourceKind, id: string, value: unknown, ttlSeconds?: number): Promise<void>;\n /** Delete a single entry. */\n delete(kind: ResourceKind, id: string): Promise<void>;\n\n // Per-kind shorthand readers — purely ergonomic; map to `get(kind, id)`.\n // Note: ctx.account.ctx_metadata is the canonical reader for the current\n // request's account — `account(id)` here is for the rare cross-account\n // lookup case (e.g., listing context for an account other than ctx.account).\n account(id: string): Promise<unknown | undefined>;\n product(id: string): Promise<unknown | undefined>;\n mediaBuy(id: string): Promise<unknown | undefined>;\n package(id: string): Promise<unknown | undefined>;\n creative(id: string): Promise<unknown | undefined>;\n audience(id: string): Promise<unknown | undefined>;\n signal(id: string): Promise<unknown | undefined>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/server/decisioning/context.ts"],"sourcesContent":["/**\n * RequestContext — what the framework passes to every decision-point method.\n *\n * - `account` — resolved tenant for this request (from `accounts.resolve()`)\n * - `state.*` — sync state reads (workflow steps, governance context, proposal lookups)\n * - `resolve.*` — async framework-mediated fetches (property lists, formats)\n *\n * Async patterns:\n * - **Sync**: adopter implements `xxx(req, ctx) => Promise<T>`. Framework\n * awaits in foreground; projects to wire success arm.\n * - **HITL**: adopter implements `xxxTask(taskId, req, ctx) => Promise<T>`.\n * Framework returns submitted envelope to buyer first, then runs the\n * task method in background; return value becomes terminal task state.\n * - **Status changes**: adopter calls `publishStatusChange(...)` (event bus)\n * from anywhere — webhook handler, cron, in-process worker. Framework\n * records the change and projects to subscribers / per-resource reads.\n *\n * Platform reads only; framework writes only. Adopters never mutate the context.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { Account } from './account';\nimport type {\n Format,\n FormatReferenceStructuredObject,\n PropertyList,\n CollectionList,\n} from '../../types/tools.generated';\nimport type { TaskHandoff, TaskHandoffContext, TaskHandoffOptions } from './async-outcome';\nimport type { CtxMetadataRef, ResourceKind } from '../ctx-metadata';\nimport type { BuyerAgent } from './buyer-agent';\nimport type { Recipe } from './proposal';\nimport type { CallerMutationScope } from '../create-adcp-server';\nimport type { ProposalRefinementScope } from '../../negotiation/seller';\n\n// Unconstrained `TAccount` (no `extends Account`) so adopters with metadata\n// types that don't extend `Record<string, unknown>` (interfaces without index\n// signatures, type aliases pointing to unions, etc.) can still parameterize.\n// The framework only ever passes the resolved `Account<TCtxMeta>` here; constraint\n// is implicit through the generic flow from `DecisioningPlatform<_, TCtxMeta>`.\nexport interface RequestContext<TAccount = Account> {\n /** Resolved account for this request. */\n account: TAccount;\n\n /** Framework-derived caller namespace for authenticated mutations. */\n callerMutationScope?: Readonly<CallerMutationScope>;\n\n /** Framework-derived proposal namespace; never sourced from request fields. */\n proposalRefinementScope?: Readonly<ProposalRefinementScope>;\n\n /**\n * Resolved buyer agent for this request, when an `agentRegistry` is\n * configured on the platform (Phase 1 of #1269). Carries the durable\n * commercial relationship — status, billing capabilities, default\n * account terms — distinct from the per-request credential. Undefined\n * when no registry is configured OR when the registry returned null\n * for the request's credential. Phase 2 (#1292) wires framework-level\n * billing-capability enforcement to the AdCP-3.1 error codes.\n */\n agent?: BuyerAgent;\n\n /** Sync reads of in-flight state. */\n state: WorkflowStateReader;\n\n /** Async framework-mediated resolvers. */\n resolve: ResourceResolver;\n\n /**\n * Ctx-metadata accessor — opaque-blob round-trip cache for adapter-internal\n * state (GAM `ad_unit_ids` per product, `gam_order_id` per media buy, etc.).\n *\n * **Present only when `createAdcpServerFromPlatform({ ctxMetadata })` was\n * wired with a `CtxMetadataStore`.** Adopters who don't wire a store see\n * `undefined` here — branch defensively.\n *\n * The accessor is account-scoped automatically (uses `ctx.account.id` as\n * the tenant boundary). Pass `kind + id`, get an opaque blob the publisher\n * stashed during a prior call's response. Returns `undefined` on miss —\n * fall through to your own DB.\n *\n * @example Read a product's ctx_metadata in createMediaBuy\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * for (const pkg of req.packages) {\n * const meta = await ctx.ctxMetadata?.product(pkg.product_id);\n * if (meta?.gam?.ad_unit_ids) {\n * await this.gam.createLineItem(pkg, meta.gam.ad_unit_ids);\n * }\n * }\n * }\n * ```\n *\n * @example Persist platform IDs from createMediaBuy\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * const order = await this.gam.createOrder(req);\n * await ctx.ctxMetadata?.set('media_buy', order.id, { gam_order_id: order.id });\n * for (const li of order.lineItems) {\n * await ctx.ctxMetadata?.set('package', li.id, { gam_line_item_id: li.id });\n * }\n * return { media_buy_id: order.id, status: 'pending_creatives', packages: ... };\n * }\n * ```\n *\n * @public\n */\n ctxMetadata?: CtxMetadataAccessor;\n\n /**\n * Request payload as the platform method sees it. The framework sets\n * this on every v6 platform-method dispatch so methods can read request\n * fields the typed signature doesn't model.\n *\n * **Why it exists.** Several `sync_*` request schemas carry modifier\n * fields (`assignments[]` on `sync_creatives`; `delete_missing`,\n * `dry_run`, `validation_mode` on the same; `delete_missing` on\n * `sync_audiences` and `sync_accounts`) that the platform method's\n * typed signature drops — the framework destructures the payload array\n * and passes only that. Without `ctx.input`, adopters implementing\n * those fields at the wire layer would see them silently disappear on\n * the `/sales/mcp` route while working on `/mcp` — a silent-conformance\n * trap. Read the field from `ctx.input` and the modifier survives to\n * the adapter.\n *\n * **Same reference as the typed payload arg, not a snapshot.** `ctx.input`\n * is set BEFORE the framework's auto-hydrate seams\n * (`hydratePackagesWithProducts`, `hydrateForTool`) run, but those\n * seams mutate the same object in place. By the time the platform\n * method's body executes, `ctx.input` and the first positional arg are\n * the same reference and both reflect framework hydration. Fields the\n * buyer sent are authoritative; framework-injected entities\n * (`pkg.product`, `req.media_buy`) are present too — distinguish by\n * field shape, not by which path you read from.\n *\n * **For methods that hoist a field to a positional arg** (e.g.\n * `updateMediaBuy(media_buy_id, patch, ctx)` hoists `media_buy_id` out\n * of the wire envelope), that field is still present at the top level\n * of `ctx.input`. `ctx.input` is NOT \"what the method didn't get\" — it\n * is the full envelope, hoist included. Prefer reading any field\n * present on both the positional arg and `ctx.input` from the\n * positional arg; reach for `ctx.input` only for fields the typed\n * signature drops.\n *\n * **Typed as unknown** to match the `comply_test_controller` bridge\n * precedent (`TestControllerBridgeContext.input`) and to avoid coupling\n * adopters to specific schema versions. Cast at the read site:\n *\n * ```ts\n * syncCreatives: async (creatives, ctx) => {\n * const wire = ctx.input as SyncCreativesRequest;\n * if (wire.delete_missing) { ... }\n * for (const assignment of wire.assignments ?? []) { ... }\n * }\n * ```\n *\n * **Security — `ctx.input` is buyer-controlled and may carry secrets.**\n * Mutating-tool envelopes can include `push_notification_config.token`\n * (the buyer's webhook-signature secret); `sync_*` requests can carry\n * `ctx_metadata` blobs the adopter persisted on a prior turn. Do NOT\n * log `ctx.input` wholesale — read named fields. Free-text fields\n * (`brief` on `getProducts`, `message` on `si_send_message`, creative\n * snippets, etc.) are attacker-controlled; when templating into LLM\n * prompts, validate or fence — don't string-interpolate. See\n * `docs/guides/CTX-METADATA-SAFETY.md` for the broader policy on\n * buyer-controlled inputs.\n *\n * **Optional in the type signature** so adopters constructing ad-hoc\n * `RequestContext` for unit tests aren't forced to set it; the\n * framework always sets it on real dispatches.\n *\n * @public\n */\n input?: Readonly<Record<string, unknown>>;\n\n /**\n * Hydrated typed recipes (`product_id -> Recipe`) for proposal-mode\n * dispatch. Populated by the framework's v1.5 ProposalManager seams:\n *\n * - `createMediaBuy` with `proposal_id`: framework reserves the\n * proposal, validates expiry + capability overlap, and writes the\n * recipe map here BEFORE the adapter runs.\n * - `updateMediaBuy` / `getMediaBuyDelivery`: framework hydrates\n * via the `getByMediaBuyId` reverse-index.\n *\n * Adopters read this map to apply per-product internal-config\n * (e.g., `recipe.line_item_template_id` on the matching adapter\n * upstream call). Undefined when no proposal-mode dispatch is wired\n * for the request — the v1 path leaves it untouched.\n *\n * @public\n */\n recipes?: ReadonlyMap<string, Recipe>;\n\n /**\n * Hand off the call to a background task. Returns a `TaskHandoff<T>`\n * marker — return that from your method to signal the framework should\n * project the spec-defined `Submitted` envelope to the buyer and run\n * `fn` asynchronously. `fn` receives a `TaskHandoffContext` with the\n * framework-issued `id` plus `update`/`heartbeat` affordances; its\n * return value becomes the task's terminal artifact.\n *\n * Use this for hybrid sellers — the same tool serves both fast\n * (programmatic remnant, instant `media_buy_id`) and slow (guaranteed\n * inventory, trafficker review) inventory. Branch in your method body\n * on whatever signal determines the path (product type, buyer\n * pre-approval, etc.). Buyers pattern-match on the wire response shape\n * (`media_buy_id` → sync; `task_id` → submitted) — predictable per\n * request, dynamic per call.\n *\n * @example\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * if (this.requiresHITL(req)) {\n * return ctx.handoffToTask(async (taskCtx) => {\n * await taskCtx.update({ message: 'Awaiting trafficker' });\n * return await this.runHITL(req);\n * });\n * }\n * return await this.commitSync(req);\n * }\n * ```\n *\n * Pass `options.task_id` when an upstream system or test-controller directive\n * has already issued the task id and the spec contract requires the response\n * to echo it verbatim (e.g. `force_create_media_buy_arm`). The framework uses\n * the supplied id instead of minting a fresh one; `taskCtx.id` reflects it.\n * Constraints: non-empty, ≤ 128 characters. Throws if violated.\n */\n handoffToTask<TResult>(\n fn: (taskCtx: TaskHandoffContext) => Promise<TResult>,\n options?: TaskHandoffOptions\n ): TaskHandoff<TResult>;\n}\n\n// ---------------------------------------------------------------------------\n// State (sync) — what the framework knows about this request and prior steps\n// ---------------------------------------------------------------------------\n\nexport interface WorkflowStateReader {\n /**\n * Workflow steps that touched a given object. Object types: 'media_buy',\n * 'creative', 'product', 'plan', 'audience', 'rights_grant', 'task'.\n * Returns chronological steps. Used for \"what's happened to this buy?\"\n * queries without re-fetching from the platform.\n */\n findByObject(type: WorkflowObjectType, id: string): readonly WorkflowStep[];\n\n /**\n * Resolve a proposal_id to its proposal context. Threaded by the framework\n * across get_products → refine → create_media_buy without platform code.\n * Returns null if the framework doesn't recognize the id.\n */\n findProposalById(proposalId: string): Proposal | null;\n\n /**\n * Currently in-flight verified governance context for the call. Returns\n * the JWS string for downstream checks (or null for non-governance flows).\n * Framework verifies signature, plan-binding, seller-binding, and\n * phase-binding before exposing — platform can trust the value.\n */\n governanceContext(): GovernanceContextJWS | null;\n\n /** Chronological steps for this request's account. Useful for audit reads. */\n workflowSteps(): readonly WorkflowStep[];\n}\n\n// ---------------------------------------------------------------------------\n// Resolve (async) — framework-mediated fetches with cache + validation\n// ---------------------------------------------------------------------------\n\nexport interface ResourceResolver {\n /**\n * Fetch a property list by id. Framework validates the id exists in the\n * seller's declared lists before returning; consumers can trust the result.\n */\n propertyList(listId: string): Promise<PropertyList>;\n\n /** Same for collection lists. */\n collectionList(listId: string): Promise<CollectionList>;\n\n /**\n * Fetch a creative format definition. Framework routes through the\n * `capabilities.creative_agents` declaration with a 1h cache; self-hosted\n * formats hit the local CreativePlatform.listFormats(). Returns the\n * resolved Format with full asset slot definitions.\n */\n creativeFormat(formatId: FormatReferenceStructuredObject): Promise<Format>;\n}\n\n// ---------------------------------------------------------------------------\n// Workflow object model\n// ---------------------------------------------------------------------------\n\nexport type WorkflowObjectType = 'media_buy' | 'creative' | 'product' | 'plan' | 'audience' | 'rights_grant' | 'task';\n\nexport interface WorkflowStep {\n /** Stable step identifier. */\n id: string;\n /** Object that this step touched. */\n object: { type: WorkflowObjectType; id: string };\n /** Tool that was called (wire verb). */\n tool: string;\n /** ISO 8601 timestamp. */\n at: string;\n /** Caller principal. */\n actor: { agent_url?: string; principal?: string };\n /** Outcome: 'submitted' / 'completed' / 'failed' / 'progress'. */\n status: 'submitted' | 'completed' | 'failed' | 'progress';\n}\n\nexport interface Proposal {\n proposal_id: string;\n /** Products in this proposal. */\n product_ids: string[];\n /** When the proposal was generated. */\n issued_at: string;\n /** When the proposal expires. */\n expires_at?: string;\n /** Account this proposal was issued to. */\n account_id: string;\n}\n\n/**\n * JWS-signed governance context. The framework returns the verified token;\n * platform can re-pass to downstream calls (e.g., report_usage) and the\n * framework will validate consistency. Don't unwrap or modify.\n */\nexport type GovernanceContextJWS = string;\n\n// ---------------------------------------------------------------------------\n// Ctx-metadata accessor (6.1)\n// ---------------------------------------------------------------------------\n\n/**\n * Account-scoped ctx-metadata accessor. The framework binds this to the\n * resolved `ctx.account.id` per request — adopters never pass account.\n *\n * Generic `get`/`set`/`bulkGet` carry a `ResourceKind` discriminator;\n * per-kind shorthand methods (`product(id)`, `mediaBuy(id)`, etc.) map to\n * `get(kind, id)` for ergonomic call sites.\n */\nexport interface CtxMetadataAccessor {\n /** Look up by kind + id. Returns `undefined` on miss. */\n get(kind: ResourceKind, id: string): Promise<unknown | undefined>;\n /** Bulk lookup. Result Map keyed by `${kind}:${id}`. Misses absent from Map. */\n bulkGet(refs: readonly CtxMetadataRef[]): Promise<ReadonlyMap<string, unknown>>;\n /**\n * Persist a blob under (account, kind, id). Throws `CTX_METADATA_TOO_LARGE`\n * if serialized size exceeds the configured cap (16KB default).\n */\n set(kind: ResourceKind, id: string, value: unknown, ttlSeconds?: number): Promise<void>;\n /** Delete a single entry. */\n delete(kind: ResourceKind, id: string): Promise<void>;\n\n // Per-kind shorthand readers — purely ergonomic; map to `get(kind, id)`.\n // Note: ctx.account.ctx_metadata is the canonical reader for the current\n // request's account — `account(id)` here is for the rare cross-account\n // lookup case (e.g., listing context for an account other than ctx.account).\n account(id: string): Promise<unknown | undefined>;\n product(id: string): Promise<unknown | undefined>;\n mediaBuy(id: string): Promise<unknown | undefined>;\n package(id: string): Promise<unknown | undefined>;\n creative(id: string): Promise<unknown | undefined>;\n audience(id: string): Promise<unknown | undefined>;\n signal(id: string): Promise<unknown | undefined>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -36,7 +36,7 @@ export type { CreativeAdServerPlatform, LegacyBuildCreativeReturn as CreativeAdS
36
36
  export type { CampaignGovernancePlatform, CheckGovernancePayload, SyncPlansPayload, ReportPlanOutcomePayload, GetPlanAuditLogsPayload, } from './specialisms/campaign-governance.mjs';
37
37
  export type { ContentStandardsPlatform, LegacyListContentStandardsPayload, LegacyGetContentStandardsPayload, LegacyCreateContentStandardsPayload, LegacyUpdateContentStandardsPayload, LegacyCalibrateContentPayload, LegacyValidateContentDeliveryPayload, LegacyGetMediaBuyArtifactsPayload, LegacyGetCreativeFeaturesPayload, } from './specialisms/content-standards.mjs';
38
38
  export type { PropertyListsPlatform, CollectionListsPlatform, CreatePropertyListPayload, UpdatePropertyListPayload, GetPropertyListPayload, ListPropertyListsPayload, DeletePropertyListPayload, CreateCollectionListPayload, UpdateCollectionListPayload, GetCollectionListPayload, ListCollectionListsPayload, DeleteCollectionListPayload, } from './specialisms/lists.mjs';
39
- export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, GetProductsPayload, LegacyGetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, LegacyCreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, LegacyUpdateMediaBuyPayload, UpdateMediaBuyHandlerResult, GetMediaBuyDeliveryPayload, LegacyGetMediaBuyDeliveryPayload, GetMediaBuysPayload, LegacyGetMediaBuysPayload, ProvidePerformanceFeedbackPayload, LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload, ListCreativesPayload, LegacyListCreativesPayload, SyncCreativesPayload, SyncCreativesHandlerResult, SyncCatalogsPayload, LogEventPayload, SyncEventSourcesPayload, } from './specialisms/sales.mjs';
39
+ export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, MediaBuyLifecyclePlatform, MediaBuyLifecycleCorePlatform, MediaBuyLifecycleProposalPlatform, GetProductsPayload, LegacyGetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, LegacyCreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, LegacyUpdateMediaBuyPayload, UpdateMediaBuyHandlerResult, GetMediaBuyDeliveryPayload, LegacyGetMediaBuyDeliveryPayload, GetMediaBuysPayload, LegacyGetMediaBuysPayload, ProvidePerformanceFeedbackPayload, LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload, ListCreativesPayload, LegacyListCreativesPayload, SyncCreativesPayload, SyncCreativesHandlerResult, SyncCatalogsPayload, LogEventPayload, SyncEventSourcesPayload, ListProductsPayload, RequestProposalsPayload, RefineProposalsPayload, DeclineProposalsPayload, BuyProductsPayload, AcceptProposalPayload, ControlMediaBuyPayload, } from './specialisms/sales.mjs';
40
40
  export type { AudiencePlatform, Audience, SyncAudiencesPayload, SyncAudiencesRow, SyncAudiencesHandlerResult, AudienceStatus, } from './specialisms/audiences.mjs';
41
41
  export type { SignalsPlatform, GetSignalsPayload, GetSignalsHandlerResult, ActivateSignalPayload, } from './specialisms/signals.mjs';
42
42
  export type { SponsoredIntelligencePlatform, SIGetOfferingPayload, SIInitiateSessionPayload, SISendMessagePayload, SITerminateSessionPayload, } from './specialisms/sponsored-intelligence.mjs';
@@ -36,7 +36,7 @@ export type { CreativeAdServerPlatform, LegacyBuildCreativeReturn as CreativeAdS
36
36
  export type { CampaignGovernancePlatform, CheckGovernancePayload, SyncPlansPayload, ReportPlanOutcomePayload, GetPlanAuditLogsPayload, } from './specialisms/campaign-governance';
37
37
  export type { ContentStandardsPlatform, LegacyListContentStandardsPayload, LegacyGetContentStandardsPayload, LegacyCreateContentStandardsPayload, LegacyUpdateContentStandardsPayload, LegacyCalibrateContentPayload, LegacyValidateContentDeliveryPayload, LegacyGetMediaBuyArtifactsPayload, LegacyGetCreativeFeaturesPayload, } from './specialisms/content-standards';
38
38
  export type { PropertyListsPlatform, CollectionListsPlatform, CreatePropertyListPayload, UpdatePropertyListPayload, GetPropertyListPayload, ListPropertyListsPayload, DeletePropertyListPayload, CreateCollectionListPayload, UpdateCollectionListPayload, GetCollectionListPayload, ListCollectionListsPayload, DeleteCollectionListPayload, } from './specialisms/lists';
39
- export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, GetProductsPayload, LegacyGetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, LegacyCreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, LegacyUpdateMediaBuyPayload, UpdateMediaBuyHandlerResult, GetMediaBuyDeliveryPayload, LegacyGetMediaBuyDeliveryPayload, GetMediaBuysPayload, LegacyGetMediaBuysPayload, ProvidePerformanceFeedbackPayload, LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload, ListCreativesPayload, LegacyListCreativesPayload, SyncCreativesPayload, SyncCreativesHandlerResult, SyncCatalogsPayload, LogEventPayload, SyncEventSourcesPayload, } from './specialisms/sales';
39
+ export type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, MediaBuyLifecyclePlatform, MediaBuyLifecycleCorePlatform, MediaBuyLifecycleProposalPlatform, GetProductsPayload, LegacyGetProductsPayload, GetProductsHandlerResult, CreateMediaBuyPayload, LegacyCreateMediaBuyPayload, CreateMediaBuyHandlerResult, UpdateMediaBuyPayload, LegacyUpdateMediaBuyPayload, UpdateMediaBuyHandlerResult, GetMediaBuyDeliveryPayload, LegacyGetMediaBuyDeliveryPayload, GetMediaBuysPayload, LegacyGetMediaBuysPayload, ProvidePerformanceFeedbackPayload, LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload, ListCreativesPayload, LegacyListCreativesPayload, SyncCreativesPayload, SyncCreativesHandlerResult, SyncCatalogsPayload, LogEventPayload, SyncEventSourcesPayload, ListProductsPayload, RequestProposalsPayload, RefineProposalsPayload, DeclineProposalsPayload, BuyProductsPayload, AcceptProposalPayload, ControlMediaBuyPayload, } from './specialisms/sales';
40
40
  export type { AudiencePlatform, Audience, SyncAudiencesPayload, SyncAudiencesRow, SyncAudiencesHandlerResult, AudienceStatus, } from './specialisms/audiences';
41
41
  export type { SignalsPlatform, GetSignalsPayload, GetSignalsHandlerResult, ActivateSignalPayload, } from './specialisms/signals';
42
42
  export type { SponsoredIntelligencePlatform, SIGetOfferingPayload, SIInitiateSessionPayload, SISendMessagePayload, SITerminateSessionPayload, } from './specialisms/sponsored-intelligence';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,EAAE,KAAK,mBAAmB,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4B,GAC7B,MAAM,oBAAoB,CAAC;AAM5B,YAAY,EACV,eAAe,EACf,0BAA0B,EAC1B,gCAAgC,EAChC,oBAAoB,EACpB,uBAAuB,EACvB,MAAM,EACN,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,cAAc,EACd,aAAa,EACb,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,iCAAiC,EACjC,qCAAqC,EACrC,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAKxH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxG,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/server/decisioning/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtF,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAMhE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,mBAA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ACvB,aAAa,EACb,cAAc,EACd,aAAa,EACb,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,iCAAiC,EACjC,qCAAqC,EACrC,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAKxH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxG,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n LegacyBuildCreativeReturn,\n LegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n LegacyBuildCreativeReturn as CreativeAdServerLegacyBuildCreativeReturn,\n LegacyBuildCreativePayload as CreativeAdServerLegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload as CreativeAdServerLegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload as CreativeAdServerLegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload as CreativeAdServerLegacyListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n LegacyGetCreativeDeliveryPayload as CreativeAdServerLegacyGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n LegacyListContentStandardsPayload,\n LegacyGetContentStandardsPayload,\n LegacyCreateContentStandardsPayload,\n LegacyUpdateContentStandardsPayload,\n LegacyCalibrateContentPayload,\n LegacyValidateContentDeliveryPayload,\n LegacyGetMediaBuyArtifactsPayload,\n LegacyGetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n GetProductsPayload,\n LegacyGetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n LegacyCreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n LegacyUpdateMediaBuyPayload,\n UpdateMediaBuyHandlerResult,\n GetMediaBuyDeliveryPayload,\n LegacyGetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n LegacyGetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload,\n ListCreativesPayload,\n LegacyListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n LegacyGetRightsPayload,\n LegacyAcquireRightsAcquiredPayload,\n LegacyAcquireRightsPendingApprovalPayload,\n LegacyAcquireRightsRejectedPayload,\n LegacyAcquireRightsPayload,\n LegacyUpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest as LegacyGetRightsRequest,\n GetRightsSuccess as LegacyGetRightsSuccess,\n AcquireRightsRequest as LegacyAcquireRightsRequest,\n AcquireRightsAcquired as LegacyAcquireRightsAcquired,\n AcquireRightsPendingApproval as LegacyAcquireRightsPendingApproval,\n AcquireRightsRejected as LegacyAcquireRightsRejected,\n AcquireRightsError as LegacyAcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type LegacyDecisioningHandlerGroups,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, getAssetSlot, requireAsset } from './manifest-helpers';\nexport type { CreativeAssetsContainer } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport {\n buildListCreativesResponse,\n buildListCreativesResponseLegacy,\n type BuildListCreativesResponseOpts,\n type BuildListCreativesResponseLegacyOpts,\n} from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalGetProductsPayload,\n LegacyProposalGetProductsPayload,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Canonical assembly helpers — emit Product / PricingOption / package shapes\n// from intent-shaped input. Raw named-format product assembly is available\n// only through the explicit buildProductLegacy compatibility helper.\nexport { buildProduct, buildProductLegacy, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type {\n BuildProductInput,\n BuildProductLegacyInput,\n BuildPricingOptionInput,\n BuildPackageInput,\n} from './assembly-helpers';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBA,2BAAoE;AAQpE,0BAuBO;AAUP,4BAUO;AAWP,0BAA2E;AA8B3E,qBAAmD;AAMnD,0BAAoD;AAsBpD,yBAAmC;AAInC,4BAAsC;AAkBtC,qBAA8B;AAM9B,6BAA6E;AA+J7E,2BAQO;AACP,+BAAsD;AACtD,2BAKO;AACP,oCAKO;AAKP,6BAaO;AAKP,8BAAqD;AAKrD,0BAKO;AAIP,wBAA+D;AAI/D,0BAMO;AAIP,qBAA0D;AAW1D,8BAgBO;AAsBP,sBAeO;AAMP,8BAAmF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n LegacyBuildCreativeReturn,\n LegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n LegacyBuildCreativeReturn as CreativeAdServerLegacyBuildCreativeReturn,\n LegacyBuildCreativePayload as CreativeAdServerLegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload as CreativeAdServerLegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload as CreativeAdServerLegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload as CreativeAdServerLegacyListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n LegacyGetCreativeDeliveryPayload as CreativeAdServerLegacyGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n LegacyListContentStandardsPayload,\n LegacyGetContentStandardsPayload,\n LegacyCreateContentStandardsPayload,\n LegacyUpdateContentStandardsPayload,\n LegacyCalibrateContentPayload,\n LegacyValidateContentDeliveryPayload,\n LegacyGetMediaBuyArtifactsPayload,\n LegacyGetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n MediaBuyLifecyclePlatform,\n MediaBuyLifecycleCorePlatform,\n MediaBuyLifecycleProposalPlatform,\n GetProductsPayload,\n LegacyGetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n LegacyCreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n LegacyUpdateMediaBuyPayload,\n UpdateMediaBuyHandlerResult,\n GetMediaBuyDeliveryPayload,\n LegacyGetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n LegacyGetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload,\n ListCreativesPayload,\n LegacyListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n ListProductsPayload,\n RequestProposalsPayload,\n RefineProposalsPayload,\n DeclineProposalsPayload,\n BuyProductsPayload,\n AcceptProposalPayload,\n ControlMediaBuyPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n LegacyGetRightsPayload,\n LegacyAcquireRightsAcquiredPayload,\n LegacyAcquireRightsPendingApprovalPayload,\n LegacyAcquireRightsRejectedPayload,\n LegacyAcquireRightsPayload,\n LegacyUpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest as LegacyGetRightsRequest,\n GetRightsSuccess as LegacyGetRightsSuccess,\n AcquireRightsRequest as LegacyAcquireRightsRequest,\n AcquireRightsAcquired as LegacyAcquireRightsAcquired,\n AcquireRightsPendingApproval as LegacyAcquireRightsPendingApproval,\n AcquireRightsRejected as LegacyAcquireRightsRejected,\n AcquireRightsError as LegacyAcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type LegacyDecisioningHandlerGroups,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, getAssetSlot, requireAsset } from './manifest-helpers';\nexport type { CreativeAssetsContainer } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport {\n buildListCreativesResponse,\n buildListCreativesResponseLegacy,\n type BuildListCreativesResponseOpts,\n type BuildListCreativesResponseLegacyOpts,\n} from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalGetProductsPayload,\n LegacyProposalGetProductsPayload,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Canonical assembly helpers — emit Product / PricingOption / package shapes\n// from intent-shaped input. Raw named-format product assembly is available\n// only through the explicit buildProductLegacy compatibility helper.\nexport { buildProduct, buildProductLegacy, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type {\n BuildProductInput,\n BuildProductLegacyInput,\n BuildPricingOptionInput,\n BuildPackageInput,\n} from './assembly-helpers';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBA,2BAAoE;AAQpE,0BAuBO;AAUP,4BAUO;AAWP,0BAA2E;AA8B3E,qBAAmD;AAMnD,0BAAoD;AAsBpD,yBAAmC;AAInC,4BAAsC;AAkBtC,qBAA8B;AAM9B,6BAA6E;AAyK7E,2BAQO;AACP,+BAAsD;AACtD,2BAKO;AACP,oCAKO;AAKP,6BAaO;AAKP,8BAAqD;AAKrD,0BAKO;AAIP,wBAA+D;AAI/D,0BAMO;AAIP,qBAA0D;AAW1D,8BAgBO;AAsBP,sBAeO;AAMP,8BAAmF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n LegacyBuildCreativeReturn,\n LegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n LegacyBuildCreativeReturn as CreativeAdServerLegacyBuildCreativeReturn,\n LegacyBuildCreativePayload as CreativeAdServerLegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload as CreativeAdServerLegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload as CreativeAdServerLegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload as CreativeAdServerLegacyListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n LegacyGetCreativeDeliveryPayload as CreativeAdServerLegacyGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n LegacyListContentStandardsPayload,\n LegacyGetContentStandardsPayload,\n LegacyCreateContentStandardsPayload,\n LegacyUpdateContentStandardsPayload,\n LegacyCalibrateContentPayload,\n LegacyValidateContentDeliveryPayload,\n LegacyGetMediaBuyArtifactsPayload,\n LegacyGetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n GetProductsPayload,\n LegacyGetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n LegacyCreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n LegacyUpdateMediaBuyPayload,\n UpdateMediaBuyHandlerResult,\n GetMediaBuyDeliveryPayload,\n LegacyGetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n LegacyGetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload,\n ListCreativesPayload,\n LegacyListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n LegacyGetRightsPayload,\n LegacyAcquireRightsAcquiredPayload,\n LegacyAcquireRightsPendingApprovalPayload,\n LegacyAcquireRightsRejectedPayload,\n LegacyAcquireRightsPayload,\n LegacyUpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest as LegacyGetRightsRequest,\n GetRightsSuccess as LegacyGetRightsSuccess,\n AcquireRightsRequest as LegacyAcquireRightsRequest,\n AcquireRightsAcquired as LegacyAcquireRightsAcquired,\n AcquireRightsPendingApproval as LegacyAcquireRightsPendingApproval,\n AcquireRightsRejected as LegacyAcquireRightsRejected,\n AcquireRightsError as LegacyAcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type LegacyDecisioningHandlerGroups,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, getAssetSlot, requireAsset } from './manifest-helpers';\nexport type { CreativeAssetsContainer } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport {\n buildListCreativesResponse,\n buildListCreativesResponseLegacy,\n type BuildListCreativesResponseOpts,\n type BuildListCreativesResponseLegacyOpts,\n} from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalGetProductsPayload,\n LegacyProposalGetProductsPayload,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Canonical assembly helpers — emit Product / PricingOption / package shapes\n// from intent-shaped input. Raw named-format product assembly is available\n// only through the explicit buildProductLegacy compatibility helper.\nexport { buildProduct, buildProductLegacy, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type {\n BuildProductInput,\n BuildProductLegacyInput,\n BuildPricingOptionInput,\n BuildPackageInput,\n} from './assembly-helpers';\n"],"mappings":"AAsBA,SAAmD,iBAAiB;AAQpE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAWP,SAAS,4BAA4B,sCAAsC;AA8B3E,SAAS,sBAAsB,oBAAoB;AAMnD,SAAS,mBAAmB,wBAAwB;AAsBpD,SAAS,0BAA0B;AAInC,SAAS,6BAA6B;AAkBtC,SAAS,qBAAqB;AAM9B,SAAS,qBAAqB,wBAAwB,uBAAuB;AA+J7E;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP,SAAS,qBAAqB,wBAAwB;AACtD;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAKP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AAKP,SAAS,UAAU,cAAc,oBAAoB;AAKrD;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAIP,SAAS,wBAAsD;AAI/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAIP,SAAS,WAAW,iBAAiB,qBAAqB;AAW1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAsBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAS,cAAc,oBAAoB,oBAAoB,oBAAoB;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/server/decisioning/index.ts"],"sourcesContent":["/**\n * DecisioningPlatform v1.0 — preview surface for the v6.0 architecture.\n *\n * Status: PREVIEW. Types only; not yet wired into the framework. Subject\n * to change before 6.0 ships. Don't build production adapters against this\n * yet — the framework still routes through the v5.x handler-style API.\n *\n * Design proposal: `.context/proposals/specialism-platform-interfaces-v3.md`\n *\n * @packageDocumentation\n */\n\n// Adopter-facing structured-error primitive.\n//\n// `AdcpError` is the canonical throwable for structured rejection. Specialism\n// methods return plain `T` for success or `throw new AdcpError(...)` to project\n// to the wire `adcp_error` envelope.\n//\n// HITL is expressed in the type system via the dual-method shape on each\n// spec-HITL tool (`xxx` for sync, `xxxTask` for HITL). No adopter-facing\n// task primitives — the framework owns task lifecycle and dispatches the\n// `*Task` method in the background.\nexport { type AdcpStructuredError, type ErrorCode, AdcpError } from './async-outcome';\nexport type { TaskHandoffOptions } from './async-outcome';\nexport type { ServerPayload } from '../../types/server-payload';\n\n// Typed `AdcpError` subclasses — adopter convenience for the highest-traffic\n// error codes. Each class encodes the canonical code/recovery/field shape.\n// LLM-generated platforms get autocomplete on the import; humans skim the\n// list to find the right class. See `errors-typed.ts`.\nexport {\n PackageNotFoundError,\n MediaBuyNotFoundError,\n ProductNotFoundError,\n CreativeNotFoundError,\n ProductUnavailableError,\n CreativeRejectedError,\n BudgetTooLowError,\n BudgetExhaustedError,\n IdempotencyConflictError,\n InvalidRequestError,\n InvalidStateError,\n BackwardsTimeRangeError,\n AuthMissingError,\n AuthInvalidError,\n AuthRequiredError,\n PermissionDeniedError,\n RateLimitedError,\n ServiceUnavailableError,\n UnsupportedFeatureError,\n ComplianceUnsatisfiedError,\n GovernanceDeniedError,\n PolicyViolationError,\n} from './errors-typed';\n\n// Cursor pagination\nexport type { CursorPage, CursorRequest } from './pagination';\n\n// Status-change event bus — adopter-facing primitive for spec-native\n// lifecycle channels (media_buy / creative / audience / signal / proposal /\n// plan / rights_grant / delivery_report). Module-level so adopters can\n// publish from webhook handlers, crons, in-process workers without holding\n// a server reference.\nexport {\n publishStatusChange,\n setStatusChangeBus,\n getStatusChangeBus,\n createInMemoryStatusChangeBus,\n type StatusChange,\n type StatusChangeBus,\n type StatusChangeResourceType,\n type StatusChangeListener,\n type PublishStatusChangeOpts,\n} from './status-changes';\n\n// Capabilities (single source of truth for get_adcp_capabilities)\nexport type {\n DecisioningCapabilities,\n ComplianceTestingCapabilities,\n CreativeAgentRef,\n TargetingCapabilities,\n TargetingPostalAreaSupport,\n ReportingCapabilities,\n} from './capabilities';\nexport { normalizePostalAreaSupport, normalizeTargetingCapabilities } from './capabilities';\n\n// Account model\nexport type {\n Account,\n AuthPrincipal,\n AccountStore,\n AccountFilter,\n ListAccountsPayload,\n SyncAccountsPayload,\n SyncAccountsSuccessPayload,\n SyncAccountsRow,\n SyncAccountsResultRow,\n SyncGovernancePayload,\n SyncGovernanceSuccessPayload,\n SyncGovernanceRow,\n ReportUsagePayload,\n GetAccountFinancialsPayload,\n GetAccountFinancialsSuccessPayload,\n ListAccountsHandlerResult,\n SyncAccountsHandlerResult,\n SyncGovernanceHandlerResult,\n ReportUsageHandlerResult,\n GetAccountFinancialsHandlerResult,\n AdcpAccountStatus,\n ResolveContext,\n AccountToolContext,\n ResolvedAuthInfo,\n} from './account';\n\nexport { AccountNotFoundError, refAccountId } from './account';\n\n// Multi-tenant AccountStore builder. Bakes in the two-path resolution\n// (operator-routed + auth-derived) and the per-entry tenant-isolation gate\n// that adopters historically had to hand-write — and silently fail to\n// hand-write — on `accounts.upsert` / `accounts.syncGovernance`.\nexport { createTenantStore, narrowAccountRef } from './tenant-store';\nexport type { TenantStoreConfig } from './tenant-store';\n\n// Buyer-agent identity surface — Phase 1 of #1269. Durable commercial\n// relationship records keyed off the request credential. Factory-pattern\n// registry (signing-only / bearer-only / mixed) encodes the implementer\n// posture at construction; framework calls `BuyerAgentRegistry.resolve`\n// once per request before `accounts.resolve`. Phase 1 ships the shape and\n// resolution; framework-level billing-capability enforcement and the\n// AdCP-3.1 error-code emission land in Phase 2 (#1292).\nexport type {\n BuyerAgent,\n BuyerAgentBillingMode,\n BuyerAgentStatus,\n BuyerAgentRegistry as BuyerAgentRegistryProtocol,\n BuyerAgentResolveInput,\n BuyerAgentCacheOptions,\n CachedBuyerAgentRegistry,\n AdcpCredential,\n ResolveBuyerAgentByAgentUrl,\n ResolveBuyerAgentByCredential,\n} from './buyer-agent';\nexport { BuyerAgentRegistry } from './buyer-agent';\n\n// Native status mapping\nexport type { StatusMappers, AdcpMediaBuyStatus, AdcpCreativeStatus, AdcpPlanStatus } from './status-mappers';\nexport { identityStatusMappers } from './status-mappers';\n\n// Request context (state + resolve)\nexport type {\n RequestContext,\n WorkflowStateReader,\n ResourceResolver,\n WorkflowObjectType,\n WorkflowStep,\n Proposal,\n GovernanceContextJWS,\n} from './context';\n\n// Top-level platform + compile-time capability enforcement\nexport type { DecisioningPlatform, RequiredPlatformsFor, RequiredCapabilitiesFor } from './platform';\n\n// Method-level composition (closes #1314) — wrap individual platform methods\n// with `before` / `after` hooks for short-circuit + enrichment patterns.\nexport { composeMethod } from './compose';\nexport type { ComposeHooks, ComposeShortCircuit } from './compose';\n\n// `accounts.resolve` security presets (closes #1339) — canonical post-resolve\n// guards that standardize the multi-tenant authorization pattern instead of\n// every adopter rolling their own.\nexport { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from './resolve-presets';\nexport type { ResolveAccountHooks, ResolveGuardOptions } from './resolve-presets';\n\n// Specialism interfaces (v1.0)\nexport type {\n CreativeBuilderPlatform,\n LegacyBuildCreativeReturn,\n LegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload,\n // Deprecated aliases — kept for one-release source compat. Both\n // resolve to CreativeBuilderPlatform; see specialisms/creative.ts.\n CreativeTemplatePlatform,\n CreativeGenerativePlatform,\n RefinementMessage,\n SyncCreativesRow,\n} from './specialisms/creative';\n\nexport type {\n CreativeAdServerPlatform,\n LegacyBuildCreativeReturn as CreativeAdServerLegacyBuildCreativeReturn,\n LegacyBuildCreativePayload as CreativeAdServerLegacyBuildCreativePayload,\n LegacyBuildCreativeMultiPayload as CreativeAdServerLegacyBuildCreativeMultiPayload,\n LegacyPreviewCreativePayload as CreativeAdServerLegacyPreviewCreativePayload,\n LegacyListCreativeFormatsPayload as CreativeAdServerLegacyListCreativeFormatsPayload,\n ListCreativesPayload as CreativeAdServerListCreativesPayload,\n GetCreativeDeliveryPayload,\n GetCreativeDeliveryPayload as CreativeAdServerGetCreativeDeliveryPayload,\n LegacyGetCreativeDeliveryPayload as CreativeAdServerLegacyGetCreativeDeliveryPayload,\n} from './specialisms/creative-ad-server';\n\nexport type {\n CampaignGovernancePlatform,\n CheckGovernancePayload,\n SyncPlansPayload,\n ReportPlanOutcomePayload,\n GetPlanAuditLogsPayload,\n} from './specialisms/campaign-governance';\n\nexport type {\n ContentStandardsPlatform,\n LegacyListContentStandardsPayload,\n LegacyGetContentStandardsPayload,\n LegacyCreateContentStandardsPayload,\n LegacyUpdateContentStandardsPayload,\n LegacyCalibrateContentPayload,\n LegacyValidateContentDeliveryPayload,\n LegacyGetMediaBuyArtifactsPayload,\n LegacyGetCreativeFeaturesPayload,\n} from './specialisms/content-standards';\n\nexport type {\n PropertyListsPlatform,\n CollectionListsPlatform,\n CreatePropertyListPayload,\n UpdatePropertyListPayload,\n GetPropertyListPayload,\n ListPropertyListsPayload,\n DeletePropertyListPayload,\n CreateCollectionListPayload,\n UpdateCollectionListPayload,\n GetCollectionListPayload,\n ListCollectionListsPayload,\n DeleteCollectionListPayload,\n} from './specialisms/lists';\n\nexport type {\n SalesPlatform,\n SalesCorePlatform,\n SalesIngestionPlatform,\n MediaBuyLifecyclePlatform,\n MediaBuyLifecycleCorePlatform,\n MediaBuyLifecycleProposalPlatform,\n GetProductsPayload,\n LegacyGetProductsPayload,\n GetProductsHandlerResult,\n CreateMediaBuyPayload,\n LegacyCreateMediaBuyPayload,\n CreateMediaBuyHandlerResult,\n UpdateMediaBuyPayload,\n LegacyUpdateMediaBuyPayload,\n UpdateMediaBuyHandlerResult,\n GetMediaBuyDeliveryPayload,\n LegacyGetMediaBuyDeliveryPayload,\n GetMediaBuysPayload,\n LegacyGetMediaBuysPayload,\n ProvidePerformanceFeedbackPayload,\n LegacyListCreativeFormatsPayload as SalesLegacyListCreativeFormatsPayload,\n ListCreativesPayload,\n LegacyListCreativesPayload,\n SyncCreativesPayload,\n SyncCreativesHandlerResult,\n SyncCatalogsPayload,\n LogEventPayload,\n SyncEventSourcesPayload,\n ListProductsPayload,\n RequestProposalsPayload,\n RefineProposalsPayload,\n DeclineProposalsPayload,\n BuyProductsPayload,\n AcceptProposalPayload,\n ControlMediaBuyPayload,\n} from './specialisms/sales';\n\nexport type {\n AudiencePlatform,\n Audience,\n SyncAudiencesPayload,\n SyncAudiencesRow,\n SyncAudiencesHandlerResult,\n AudienceStatus,\n} from './specialisms/audiences';\n\nexport type {\n SignalsPlatform,\n GetSignalsPayload,\n GetSignalsHandlerResult,\n ActivateSignalPayload,\n} from './specialisms/signals';\n\nexport type {\n SponsoredIntelligencePlatform,\n SIGetOfferingPayload,\n SIInitiateSessionPayload,\n SISendMessagePayload,\n SITerminateSessionPayload,\n} from './specialisms/sponsored-intelligence';\n\nexport type {\n BrandRightsPlatform,\n GetBrandIdentityPayload,\n LegacyGetRightsPayload,\n LegacyAcquireRightsAcquiredPayload,\n LegacyAcquireRightsPendingApprovalPayload,\n LegacyAcquireRightsRejectedPayload,\n LegacyAcquireRightsPayload,\n LegacyUpdateRightsPayload,\n CreativeApprovedPayload,\n CreativeRejectedPayload,\n CreativePendingReviewPayload,\n CreativeApprovalPayload,\n} from './specialisms/brand-rights';\n\n// Brand-rights wire types — re-exported from `@adcp/sdk/server/decisioning`\n// because brand-rights is the only specialism whose wire types live in\n// `core.generated` (not `tools.generated`), and the public `@adcp/sdk/types`\n// barrel doesn't surface them. Adopters typing their own helper functions\n// import these from here, NOT from the deep `core.generated` path.\nexport type {\n GetBrandIdentityRequest,\n GetBrandIdentitySuccess,\n GetRightsRequest as LegacyGetRightsRequest,\n GetRightsSuccess as LegacyGetRightsSuccess,\n AcquireRightsRequest as LegacyAcquireRightsRequest,\n AcquireRightsAcquired as LegacyAcquireRightsAcquired,\n AcquireRightsPendingApproval as LegacyAcquireRightsPendingApproval,\n AcquireRightsRejected as LegacyAcquireRightsRejected,\n AcquireRightsError as LegacyAcquireRightsError,\n RightUse,\n RightType,\n RightsConstraint,\n RightsTerms,\n RightsPricingOption,\n GenerationCredential,\n} from '../../types/core.generated';\n\n// Runtime (v6.0 alpha) — preview surface for adopters spiking against the\n// new shape. Subject to change before 6.0 GA.\nexport {\n createAdcpServerFromPlatform,\n getAllAdcpMigrations,\n type CreateAdcpServerFromPlatformOptions,\n type LegacyDecisioningHandlerGroups,\n type RequiredOptsFor,\n type DecisioningAdcpServer,\n type DecisioningObservabilityHooks,\n} from './runtime/from-platform';\nexport { PlatformConfigError, validatePlatform } from './runtime/validate-platform';\nexport {\n createInMemoryTaskRegistry,\n type TaskRegistry,\n type TaskRecord,\n type TaskStatus,\n} from './runtime/task-registry';\nexport {\n createPostgresTaskRegistry,\n getDecisioningTaskRegistryMigration,\n type CreatePostgresTaskRegistryOptions,\n type PgQueryable,\n} from './runtime/postgres-task-registry';\n\n// Multi-tenant deployment helper — wraps createAdcpServerFromPlatform with\n// per-tenant config, health states (healthy/unverified/disabled), and JWKS\n// validation. Composes with the existing serve() host-routing surface.\nexport {\n createTenantRegistry,\n createDefaultJwksValidator,\n createSelfSignedTenantKey,\n createNoopJwksValidator,\n type TenantRegistry,\n type TenantConfig,\n type TenantSigningKey,\n type TenantStatus,\n type TenantHealth,\n type TenantRegistryOptions,\n type JwksValidator,\n type JwksValidationResult,\n} from './tenant-registry';\n\n// Manifest helpers — typed accessors for creative_manifest.assets values.\n// Save adopters from writing the same null-check + discriminator-check\n// boilerplate per call.\nexport { getAsset, getAssetSlot, requireAsset } from './manifest-helpers';\nexport type { CreativeAssetsContainer } from './manifest-helpers';\n\n// List helpers — wrap row arrays + pagination into the heavier wire shapes\n// (today: list_creatives, which carries query_summary alongside the rows).\nexport {\n buildListCreativesResponse,\n buildListCreativesResponseLegacy,\n type BuildListCreativesResponseOpts,\n type BuildListCreativesResponseLegacyOpts,\n} from './list-helpers';\n\n// Start-time helper — normalize the wire `start_time` union into a Date,\n// with platform-aware ASAP lead-time injection.\nexport { resolveStartTime, type ResolveStartTimeOptions } from './start-time';\n\n// Admin Express router for ops visibility into the TenantRegistry.\n// Mount on a separate port/path with operator auth.\nexport {\n createTenantAdminRouter,\n createTenantAdminHandlers,\n mountTenantAdmin,\n type TenantAdminHandlers,\n type RouterLike,\n} from './admin-router';\n\n// Adopter helpers — batchPoll, validationError, upstreamError, RequestShape.\n// All opt-in convenience; nothing in the framework calls these internally.\nexport { batchPoll, validationError, upstreamError } from './helpers';\nexport type { RequestShape } from './helpers';\n\n// Platform identity helpers — fix TypeScript's contextual-typing gap when\n// building a DecisioningPlatform (or sub-interface) as an object literal.\n// Without these, `createAdcpServerFromPlatform({ sales: { syncEventSources:\n// async (req, ctx) => {...} } })` gives `req: unknown` because the generic\n// `P extends DecisioningPlatform<any,any>` is inferred, not declared.\n// Wrapping the sub-object with e.g. `defineSalesPlatform<MyMeta>({...})`\n// forces the concrete type annotation TypeScript needs. The helpers are\n// pure identity functions — zero runtime cost.\nexport {\n definePlatform,\n defineSalesPlatform,\n defineSalesCorePlatform,\n defineSalesIngestionPlatform,\n defineAudiencePlatform,\n defineSignalsPlatform,\n defineSponsoredIntelligencePlatform,\n defineCreativeBuilderPlatform,\n defineCreativeAdServerPlatform,\n defineCampaignGovernancePlatform,\n defineContentStandardsPlatform,\n definePropertyListsPlatform,\n defineCollectionListsPlatform,\n defineBrandRightsPlatform,\n definePlatformWithCompliance,\n} from './platform-helpers';\n\n// ProposalManager — primitives for the two-platform composition (port of\n// adcp-client-python PRs #504 + #550). Splits proposal assembly from\n// media-buy execution; either side can be mock-backed independently.\n// Framework dispatch wiring lands in a follow-up release.\nexport type {\n ProposalManager,\n ProposalGetProductsPayload,\n LegacyProposalGetProductsPayload,\n ProposalCapabilities,\n ProposalSalesSpecialism,\n Recipe,\n CapabilityOverlap,\n FinalizeProposalRequest,\n FinalizeProposalSuccess,\n ProposalState,\n ProposalRecord,\n ProposalStore,\n InMemoryProposalStoreOptions,\n MockProposalManagerOptions,\n} from './proposal';\nexport {\n validateProposalCapabilities,\n InMemoryProposalStore,\n MockProposalManager,\n enforceProposalExpiry,\n validateCapabilityOverlap,\n validateOverlapSubsetOfWire,\n detectFinalizeAction,\n setProposalLifecycleLogger,\n maybeInterceptFinalize,\n maybePersistDraftAfterGetProducts,\n maybeReserveProposalForCreateMediaBuy,\n finalizeProposalConsumption,\n releaseProposalReservation,\n maybeHydrateRecipesForMediaBuyId,\n} from './proposal';\nexport type { FinalizeActionRef, ProposalLifecycleLogger, FinalizeInterceptResult, ReservedProposal } from './proposal';\n\n// Canonical assembly helpers — emit Product / PricingOption / package shapes\n// from intent-shaped input. Raw named-format product assembly is available\n// only through the explicit buildProductLegacy compatibility helper.\nexport { buildProduct, buildProductLegacy, buildPricingOption, buildPackage } from './assembly-helpers';\nexport type {\n BuildProductInput,\n BuildProductLegacyInput,\n BuildPricingOptionInput,\n BuildPackageInput,\n} from './assembly-helpers';\n"],"mappings":"AAsBA,SAAmD,iBAAiB;AAQpE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAWP,SAAS,4BAA4B,sCAAsC;AA8B3E,SAAS,sBAAsB,oBAAoB;AAMnD,SAAS,mBAAmB,wBAAwB;AAsBpD,SAAS,0BAA0B;AAInC,SAAS,6BAA6B;AAkBtC,SAAS,qBAAqB;AAM9B,SAAS,qBAAqB,wBAAwB,uBAAuB;AAyK7E;AAAA,EACE;AAAA,EACA;AAAA,OAMK;AACP,SAAS,qBAAqB,wBAAwB;AACtD;AAAA,EACE;AAAA,OAIK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAKP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AAKP,SAAS,UAAU,cAAc,oBAAoB;AAKrD;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAIP,SAAS,wBAAsD;AAI/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAIP,SAAS,WAAW,iBAAiB,qBAAqB;AAW1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAsBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAS,cAAc,oBAAoB,oBAAoB,oBAAoB;","names":[]}
@@ -14,7 +14,7 @@ import type { Account, AccountStore } from './account.mjs';
14
14
  import type { BuyerAgentRegistry } from './buyer-agent.mjs';
15
15
  import type { SessionContext, OnInstructionsError, MaybePromise } from '../create-adcp-server.mjs';
16
16
  import type { StatusMappers } from './status-mappers.mjs';
17
- import type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform } from './specialisms/sales.mjs';
17
+ import type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, MediaBuyLifecyclePlatform, MediaBuyLifecycleCorePlatform, MediaBuyLifecycleProposalPlatform } from './specialisms/sales.mjs';
18
18
  import type { ProposalManager, Recipe } from './proposal/index.mjs';
19
19
  import type { CreativeBuilderPlatform } from './specialisms/creative.mjs';
20
20
  import type { CreativeAdServerPlatform } from './specialisms/creative-ad-server.mjs';
@@ -209,6 +209,8 @@ export interface DecisioningPlatform<TConfig = unknown, TCtxMeta = Record<string
209
209
  */
210
210
  getCapabilitiesFor?(account: Account<TCtxMeta>): DecisioningCapabilities<TConfig> | Promise<DecisioningCapabilities<TConfig>>;
211
211
  sales?: SalesPlatform<TCtxMeta>;
212
+ /** Primary AdCP 3.2 media-buy lifecycle; compose with `sales` for 3.0/3.1 compatibility routes. */
213
+ mediaBuyLifecycle?: MediaBuyLifecyclePlatform<TCtxMeta>;
212
214
  creative?: CreativeBuilderPlatform<TCtxMeta> | CreativeAdServerPlatform<TCtxMeta>;
213
215
  audiences?: AudiencePlatform<TCtxMeta>;
214
216
  signals?: SignalsPlatform<TCtxMeta>;
@@ -263,22 +265,35 @@ export interface DecisioningPlatform<TConfig = unknown, TCtxMeta = Record<string
263
265
  * resolve to an empty requirement — the framework's runtime check is the
264
266
  * fallback gate.
265
267
  */
266
- type SalesCoreSpecialism = 'sales-non-guaranteed' | 'sales-guaranteed' | 'sales-broadcast-tv' | 'sales-catalog-driven';
268
+ type SalesCoreSpecialism = 'sales-non-guaranteed' | 'sales-guaranteed' | 'sales-broadcast-tv';
269
+ type SalesCatalogSpecialism = 'sales-catalog-driven';
267
270
  type SalesIngestionSpecialism = 'sales-social';
268
271
  type SalesProposalSpecialism = 'sales-proposal-mode';
269
272
  type SignalSpecialism = 'signal-marketplace' | 'signal-owned';
270
273
  type CampaignGovernanceSpecialism = 'governance-spend-authority' | 'governance-delivery-monitor';
274
+ type SalesCorePlatformRequirement<TCtxMeta> = {
275
+ sales: SalesCorePlatform<TCtxMeta> & SalesIngestionPlatform<TCtxMeta>;
276
+ mediaBuyLifecycle?: MediaBuyLifecyclePlatform<TCtxMeta>;
277
+ } | {
278
+ sales?: SalesPlatform<TCtxMeta>;
279
+ mediaBuyLifecycle: MediaBuyLifecycleCorePlatform<TCtxMeta>;
280
+ };
281
+ type SalesProposalPlatformRequirement<TCtxMeta> = {
282
+ sales: Required<Pick<SalesPlatform<TCtxMeta>, 'getProducts'>> & SalesIngestionPlatform<TCtxMeta>;
283
+ mediaBuyLifecycle?: MediaBuyLifecyclePlatform<TCtxMeta>;
284
+ } | {
285
+ sales?: SalesPlatform<TCtxMeta>;
286
+ mediaBuyLifecycle: MediaBuyLifecycleProposalPlatform<TCtxMeta>;
287
+ };
271
288
  export type RequiredPlatformsFor<S extends AdCPSpecialism, TCtxMeta = any> = [S] extends [never] ? {} : S extends 'creative-template' | 'creative-generative' | 'creative-transformers' ? {
272
289
  creative: CreativeBuilderPlatform<TCtxMeta>;
273
290
  } : S extends 'creative-ad-server' ? {
274
291
  creative: CreativeAdServerPlatform<TCtxMeta>;
275
- } : S extends SalesCoreSpecialism ? {
292
+ } : S extends SalesCoreSpecialism ? SalesCorePlatformRequirement<TCtxMeta> : S extends SalesCatalogSpecialism ? {
276
293
  sales: SalesCorePlatform<TCtxMeta> & SalesIngestionPlatform<TCtxMeta>;
277
294
  } : S extends SalesIngestionSpecialism ? {
278
295
  sales: SalesIngestionPlatform<TCtxMeta>;
279
- } : S extends SalesProposalSpecialism ? {
280
- sales: Required<Pick<SalesPlatform<TCtxMeta>, 'getProducts'>> & SalesIngestionPlatform<TCtxMeta>;
281
- } : S extends 'audience-sync' ? {
296
+ } : S extends SalesProposalSpecialism ? SalesProposalPlatformRequirement<TCtxMeta> : S extends 'audience-sync' ? {
282
297
  audiences: AudiencePlatform<TCtxMeta>;
283
298
  } : S extends SignalSpecialism ? {
284
299
  signals: SignalsPlatform<TCtxMeta>;
@@ -14,7 +14,7 @@ import type { Account, AccountStore } from './account';
14
14
  import type { BuyerAgentRegistry } from './buyer-agent';
15
15
  import type { SessionContext, OnInstructionsError, MaybePromise } from '../create-adcp-server';
16
16
  import type { StatusMappers } from './status-mappers';
17
- import type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform } from './specialisms/sales';
17
+ import type { SalesPlatform, SalesCorePlatform, SalesIngestionPlatform, MediaBuyLifecyclePlatform, MediaBuyLifecycleCorePlatform, MediaBuyLifecycleProposalPlatform } from './specialisms/sales';
18
18
  import type { ProposalManager, Recipe } from './proposal';
19
19
  import type { CreativeBuilderPlatform } from './specialisms/creative';
20
20
  import type { CreativeAdServerPlatform } from './specialisms/creative-ad-server';
@@ -209,6 +209,8 @@ export interface DecisioningPlatform<TConfig = unknown, TCtxMeta = Record<string
209
209
  */
210
210
  getCapabilitiesFor?(account: Account<TCtxMeta>): DecisioningCapabilities<TConfig> | Promise<DecisioningCapabilities<TConfig>>;
211
211
  sales?: SalesPlatform<TCtxMeta>;
212
+ /** Primary AdCP 3.2 media-buy lifecycle; compose with `sales` for 3.0/3.1 compatibility routes. */
213
+ mediaBuyLifecycle?: MediaBuyLifecyclePlatform<TCtxMeta>;
212
214
  creative?: CreativeBuilderPlatform<TCtxMeta> | CreativeAdServerPlatform<TCtxMeta>;
213
215
  audiences?: AudiencePlatform<TCtxMeta>;
214
216
  signals?: SignalsPlatform<TCtxMeta>;
@@ -263,22 +265,35 @@ export interface DecisioningPlatform<TConfig = unknown, TCtxMeta = Record<string
263
265
  * resolve to an empty requirement — the framework's runtime check is the
264
266
  * fallback gate.
265
267
  */
266
- type SalesCoreSpecialism = 'sales-non-guaranteed' | 'sales-guaranteed' | 'sales-broadcast-tv' | 'sales-catalog-driven';
268
+ type SalesCoreSpecialism = 'sales-non-guaranteed' | 'sales-guaranteed' | 'sales-broadcast-tv';
269
+ type SalesCatalogSpecialism = 'sales-catalog-driven';
267
270
  type SalesIngestionSpecialism = 'sales-social';
268
271
  type SalesProposalSpecialism = 'sales-proposal-mode';
269
272
  type SignalSpecialism = 'signal-marketplace' | 'signal-owned';
270
273
  type CampaignGovernanceSpecialism = 'governance-spend-authority' | 'governance-delivery-monitor';
274
+ type SalesCorePlatformRequirement<TCtxMeta> = {
275
+ sales: SalesCorePlatform<TCtxMeta> & SalesIngestionPlatform<TCtxMeta>;
276
+ mediaBuyLifecycle?: MediaBuyLifecyclePlatform<TCtxMeta>;
277
+ } | {
278
+ sales?: SalesPlatform<TCtxMeta>;
279
+ mediaBuyLifecycle: MediaBuyLifecycleCorePlatform<TCtxMeta>;
280
+ };
281
+ type SalesProposalPlatformRequirement<TCtxMeta> = {
282
+ sales: Required<Pick<SalesPlatform<TCtxMeta>, 'getProducts'>> & SalesIngestionPlatform<TCtxMeta>;
283
+ mediaBuyLifecycle?: MediaBuyLifecyclePlatform<TCtxMeta>;
284
+ } | {
285
+ sales?: SalesPlatform<TCtxMeta>;
286
+ mediaBuyLifecycle: MediaBuyLifecycleProposalPlatform<TCtxMeta>;
287
+ };
271
288
  export type RequiredPlatformsFor<S extends AdCPSpecialism, TCtxMeta = any> = [S] extends [never] ? {} : S extends 'creative-template' | 'creative-generative' | 'creative-transformers' ? {
272
289
  creative: CreativeBuilderPlatform<TCtxMeta>;
273
290
  } : S extends 'creative-ad-server' ? {
274
291
  creative: CreativeAdServerPlatform<TCtxMeta>;
275
- } : S extends SalesCoreSpecialism ? {
292
+ } : S extends SalesCoreSpecialism ? SalesCorePlatformRequirement<TCtxMeta> : S extends SalesCatalogSpecialism ? {
276
293
  sales: SalesCorePlatform<TCtxMeta> & SalesIngestionPlatform<TCtxMeta>;
277
294
  } : S extends SalesIngestionSpecialism ? {
278
295
  sales: SalesIngestionPlatform<TCtxMeta>;
279
- } : S extends SalesProposalSpecialism ? {
280
- sales: Required<Pick<SalesPlatform<TCtxMeta>, 'getProducts'>> & SalesIngestionPlatform<TCtxMeta>;
281
- } : S extends 'audience-sync' ? {
296
+ } : S extends SalesProposalSpecialism ? SalesProposalPlatformRequirement<TCtxMeta> : S extends 'audience-sync' ? {
282
297
  audiences: AudiencePlatform<TCtxMeta>;
283
298
  } : S extends SignalSpecialism ? {
284
299
  signals: SignalsPlatform<TCtxMeta>;
@@ -1 +1 @@
1
- {"version":3,"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