@adcp/sdk 14.0.0-beta.8 → 14.0.0-beta.9

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 (150) hide show
  1. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  2. package/dist/lib/core/ConversationTypes.d.mts +8 -0
  3. package/dist/lib/core/ConversationTypes.d.ts +8 -0
  4. package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
  5. package/dist/lib/core/ConversationTypes.js.map +1 -1
  6. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  7. package/dist/lib/core/SingleAgentClient.js +30 -3
  8. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  9. package/dist/lib/core/SingleAgentClient.mjs +30 -3
  10. package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
  11. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  12. package/dist/lib/core/TaskExecutor.js +32 -5
  13. package/dist/lib/core/TaskExecutor.js.map +1 -1
  14. package/dist/lib/core/TaskExecutor.mjs +32 -5
  15. package/dist/lib/core/TaskExecutor.mjs.map +1 -1
  16. package/dist/lib/index.d.mts +2 -2
  17. package/dist/lib/index.d.ts +2 -2
  18. package/dist/lib/index.d.ts.map +1 -1
  19. package/dist/lib/index.js +2 -0
  20. package/dist/lib/index.js.map +1 -1
  21. package/dist/lib/index.mjs +2 -1
  22. package/dist/lib/index.mjs.map +1 -1
  23. package/dist/lib/schemas/index.d.mts +14 -0
  24. package/dist/lib/schemas/index.d.ts +14 -0
  25. package/dist/lib/schemas/index.d.ts.map +1 -1
  26. package/dist/lib/schemas/index.js +13 -1
  27. package/dist/lib/schemas/index.js.map +1 -1
  28. package/dist/lib/schemas/index.mjs +13 -1
  29. package/dist/lib/schemas/index.mjs.map +1 -1
  30. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  31. package/dist/lib/server/adcp-server.d.mts +1 -0
  32. package/dist/lib/server/adcp-server.d.ts +1 -0
  33. package/dist/lib/server/adcp-server.d.ts.map +1 -1
  34. package/dist/lib/server/adcp-server.js +1 -1
  35. package/dist/lib/server/adcp-server.js.map +1 -1
  36. package/dist/lib/server/adcp-server.mjs +1 -1
  37. package/dist/lib/server/adcp-server.mjs.map +1 -1
  38. package/dist/lib/server/create-adcp-server.d.mts +10 -2
  39. package/dist/lib/server/create-adcp-server.d.ts +10 -2
  40. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  41. package/dist/lib/server/create-adcp-server.js +26 -19
  42. package/dist/lib/server/create-adcp-server.js.map +1 -1
  43. package/dist/lib/server/create-adcp-server.mjs +26 -26
  44. package/dist/lib/server/create-adcp-server.mjs.map +1 -1
  45. package/dist/lib/server/decisioning/capabilities.d.mts +15 -1
  46. package/dist/lib/server/decisioning/capabilities.d.ts +15 -1
  47. package/dist/lib/server/decisioning/capabilities.d.ts.map +1 -1
  48. package/dist/lib/server/decisioning/capabilities.js.map +1 -1
  49. package/dist/lib/server/decisioning/capabilities.mjs.map +1 -1
  50. package/dist/lib/server/decisioning/index.d.mts +2 -2
  51. package/dist/lib/server/decisioning/index.d.ts +2 -2
  52. package/dist/lib/server/decisioning/index.d.ts.map +1 -1
  53. package/dist/lib/server/decisioning/index.js +2 -0
  54. package/dist/lib/server/decisioning/index.js.map +1 -1
  55. package/dist/lib/server/decisioning/index.mjs +2 -0
  56. package/dist/lib/server/decisioning/index.mjs.map +1 -1
  57. package/dist/lib/server/decisioning/proposal/types.d.mts +3 -2
  58. package/dist/lib/server/decisioning/proposal/types.d.ts +3 -2
  59. package/dist/lib/server/decisioning/proposal/types.d.ts.map +1 -1
  60. package/dist/lib/server/decisioning/proposal/types.js.map +1 -1
  61. package/dist/lib/server/decisioning/proposal/types.mjs.map +1 -1
  62. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +14 -1
  63. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +14 -1
  64. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  65. package/dist/lib/server/decisioning/runtime/from-platform.js +402 -9
  66. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  67. package/dist/lib/server/decisioning/runtime/from-platform.mjs +405 -9
  68. package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
  69. package/dist/lib/server/decisioning/runtime/validate-platform.d.mts +1 -1
  70. package/dist/lib/server/decisioning/runtime/validate-platform.d.ts +1 -1
  71. package/dist/lib/server/decisioning/runtime/validate-platform.d.ts.map +1 -1
  72. package/dist/lib/server/decisioning/runtime/validate-platform.js +2 -2
  73. package/dist/lib/server/decisioning/runtime/validate-platform.js.map +1 -1
  74. package/dist/lib/server/decisioning/runtime/validate-platform.mjs +2 -2
  75. package/dist/lib/server/decisioning/runtime/validate-platform.mjs.map +1 -1
  76. package/dist/lib/server/decisioning/specialisms/sales.d.mts +7 -1
  77. package/dist/lib/server/decisioning/specialisms/sales.d.ts +7 -1
  78. package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
  79. package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
  80. package/dist/lib/storage/interfaces.d.mts +2 -0
  81. package/dist/lib/storage/interfaces.d.ts +2 -0
  82. package/dist/lib/storage/interfaces.d.ts.map +1 -1
  83. package/dist/lib/storage/interfaces.js.map +1 -1
  84. package/dist/lib/testing/compliance/comply.d.mts +18 -0
  85. package/dist/lib/testing/compliance/comply.d.ts +18 -0
  86. package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
  87. package/dist/lib/testing/compliance/comply.js +30 -5
  88. package/dist/lib/testing/compliance/comply.js.map +1 -1
  89. package/dist/lib/testing/compliance/comply.mjs +28 -4
  90. package/dist/lib/testing/compliance/comply.mjs.map +1 -1
  91. package/dist/lib/testing/compliance/index.d.mts +1 -1
  92. package/dist/lib/testing/compliance/index.d.ts +1 -1
  93. package/dist/lib/testing/compliance/index.d.ts.map +1 -1
  94. package/dist/lib/testing/compliance/index.js +4 -2
  95. package/dist/lib/testing/compliance/index.js.map +1 -1
  96. package/dist/lib/testing/compliance/index.mjs +4 -2
  97. package/dist/lib/testing/compliance/index.mjs.map +1 -1
  98. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  99. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  100. package/dist/lib/types/list-creatives.d.ts +129 -6
  101. package/dist/lib/types/schemas.generated.d.ts +411 -16
  102. package/dist/lib/types/schemas.generated.d.ts.map +1 -1
  103. package/dist/lib/types/schemas.generated.js +22 -6
  104. package/dist/lib/types/schemas.generated.js.map +1 -1
  105. package/dist/lib/types/schemas.generated.mjs +22 -6
  106. package/dist/lib/types/schemas.generated.mjs.map +1 -1
  107. package/dist/lib/types/tools.generated.d.mts +80 -6
  108. package/dist/lib/types/tools.generated.d.ts +80 -6
  109. package/dist/lib/types/tools.generated.d.ts.map +1 -1
  110. package/dist/lib/types/tools.generated.js.map +1 -1
  111. package/dist/lib/utils/adcp-version-config.d.mts +12 -0
  112. package/dist/lib/utils/adcp-version-config.d.ts +12 -0
  113. package/dist/lib/utils/adcp-version-config.d.ts.map +1 -1
  114. package/dist/lib/utils/adcp-version-config.js +5 -3
  115. package/dist/lib/utils/adcp-version-config.js.map +1 -1
  116. package/dist/lib/utils/adcp-version-config.mjs +4 -3
  117. package/dist/lib/utils/adcp-version-config.mjs.map +1 -1
  118. package/dist/lib/utils/pricing-adapter.d.mts +2 -0
  119. package/dist/lib/utils/pricing-adapter.d.ts +2 -0
  120. package/dist/lib/utils/pricing-adapter.d.ts.map +1 -1
  121. package/dist/lib/utils/pricing-adapter.js +68 -1
  122. package/dist/lib/utils/pricing-adapter.js.map +1 -1
  123. package/dist/lib/utils/pricing-adapter.mjs +67 -1
  124. package/dist/lib/utils/pricing-adapter.mjs.map +1 -1
  125. package/dist/lib/v2/projection/index.d.mts +1 -1
  126. package/dist/lib/v2/projection/index.d.ts +1 -1
  127. package/dist/lib/v2/projection/index.d.ts.map +1 -1
  128. package/dist/lib/v2/projection/index.js.map +1 -1
  129. package/dist/lib/v2/projection/index.mjs.map +1 -1
  130. package/dist/lib/v2/projection/v1-to-v2.d.mts +17 -3
  131. package/dist/lib/v2/projection/v1-to-v2.d.ts +17 -3
  132. package/dist/lib/v2/projection/v1-to-v2.d.ts.map +1 -1
  133. package/dist/lib/v2/projection/v1-to-v2.js.map +1 -1
  134. package/dist/lib/v2/projection/v1-to-v2.mjs.map +1 -1
  135. package/dist/lib/validation/schema-loader.d.mts +17 -0
  136. package/dist/lib/validation/schema-loader.d.ts +17 -0
  137. package/dist/lib/validation/schema-loader.d.ts.map +1 -1
  138. package/dist/lib/validation/schema-loader.js +24 -0
  139. package/dist/lib/validation/schema-loader.js.map +1 -1
  140. package/dist/lib/validation/schema-loader.mjs +23 -0
  141. package/dist/lib/validation/schema-loader.mjs.map +1 -1
  142. package/dist/lib/version.d.mts +3 -3
  143. package/dist/lib/version.d.ts +3 -3
  144. package/dist/lib/version.js +3 -3
  145. package/dist/lib/version.js.map +1 -1
  146. package/dist/lib/version.mjs +3 -3
  147. package/dist/lib/version.mjs.map +1 -1
  148. package/docs/llms.txt +2 -2
  149. package/docs/migration-13-to-14.md +59 -0
  150. package/package.json +1 -1
@@ -38,6 +38,7 @@ import { composeMethod } from "./compose.mjs";
38
38
  import { requireAccountMatch, requireAdvertiserMatch, requireOrgScope } from "./resolve-presets.mjs";
39
39
  import {
40
40
  createAdcpServerFromPlatform,
41
+ getHydratedLegacyFormatIds,
41
42
  getAllAdcpMigrations
42
43
  } from "./runtime/from-platform.mjs";
43
44
  import { PlatformConfigError, validatePlatform } from "./runtime/validate-platform.mjs";
@@ -170,6 +171,7 @@ export {
170
171
  getAsset,
171
172
  getAssetSlot,
172
173
  getDecisioningTaskRegistryMigration,
174
+ getHydratedLegacyFormatIds,
173
175
  getStatusChangeBus,
174
176
  identityStatusMappers,
175
177
  maybeHydrateRecipesForMediaBuyId,
@@ -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 PreviewCreativePayload,\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 PreviewCreativePayload as CreativeAdServerPreviewCreativePayload,\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;AA2K7E;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 PreviewCreativePayload,\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 PreviewCreativePayload as CreativeAdServerPreviewCreativePayload,\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 GetProductsProjectionInput,\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 getHydratedLegacyFormatIds,\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;AA4K7E;AAAA,EACE;AAAA,EACA;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":[]}
@@ -32,11 +32,12 @@ import type { MaybePromise } from '../../create-adcp-server.mjs';
32
32
  import type { Account } from '../account.mjs';
33
33
  import type { RequestContext } from '../context.mjs';
34
34
  import type { GetProductsResponse } from '../../../types/tools.generated.mjs';
35
- import type { CanonicalCreativeResponse, CanonicalGetProductsRequest, CanonicalProduct } from '../../../v2/projection/creative-delivery.mjs';
35
+ import type { CanonicalCreativeResponse, CanonicalGetProductsRequest } from '../../../v2/projection/creative-delivery.mjs';
36
36
  import type { RequireCacheScopeWhenProducts, ServerPayload } from '../../../types/server-payload.mjs';
37
37
  import type { TaskHandoff } from '../async-outcome.mjs';
38
+ import type { GetProductsProjectionInput } from '../specialisms/sales.mjs';
38
39
  export type ProposalGetProductsPayload = RequireCacheScopeWhenProducts<Omit<ServerPayload<CanonicalCreativeResponse<GetProductsResponse>>, 'products'> & {
39
- products?: CanonicalProduct[];
40
+ products?: GetProductsProjectionInput[];
40
41
  }>;
41
42
  export type LegacyProposalGetProductsPayload = RequireCacheScopeWhenProducts<ServerPayload<GetProductsResponse>>;
42
43
  /**
@@ -32,11 +32,12 @@ import type { MaybePromise } from '../../create-adcp-server';
32
32
  import type { Account } from '../account';
33
33
  import type { RequestContext } from '../context';
34
34
  import type { GetProductsResponse } from '../../../types/tools.generated';
35
- import type { CanonicalCreativeResponse, CanonicalGetProductsRequest, CanonicalProduct } from '../../../v2/projection/creative-delivery';
35
+ import type { CanonicalCreativeResponse, CanonicalGetProductsRequest } from '../../../v2/projection/creative-delivery';
36
36
  import type { RequireCacheScopeWhenProducts, ServerPayload } from '../../../types/server-payload';
37
37
  import type { TaskHandoff } from '../async-outcome';
38
+ import type { GetProductsProjectionInput } from '../specialisms/sales';
38
39
  export type ProposalGetProductsPayload = RequireCacheScopeWhenProducts<Omit<ServerPayload<CanonicalCreativeResponse<GetProductsResponse>>, 'products'> & {
39
- products?: CanonicalProduct[];
40
+ products?: GetProductsProjectionInput[];
40
41
  }>;
41
42
  export type LegacyProposalGetProductsPayload = RequireCacheScopeWhenProducts<ServerPayload<GetProductsResponse>>;
42
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/server/decisioning/proposal/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EACjB,MAAM,0CAA0C,CAAC;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AAC,0BAA0B,CAAC,CAAC;IAE5G;;;;;;;;;;;;;;;;;;OAkBG;IACH,cAAc,CAAC,CAAC,GAAG,EAAE,2BAA2B,EAAE,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,0BAA0B,CAAC,CAAC;IAEhH;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,CACf,GAAG,EAAE,uBAAuB,CAAC,OAAO,CAAC,EACrC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,GACjB,YAAY,CAAC,uBAAuB,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CACnG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/lib/server/decisioning/proposal/types.ts"],"sourcesContent":["/**\n * ProposalManager — primitives for the two-platform composition.\n *\n * The existing `DecisioningPlatform` conflates two concerns: assembling\n * proposals from briefs (`get_products`, refine) vs. executing media buys\n * against an upstream (`create_media_buy`, `update_media_buy`,\n * `get_media_buy_delivery`). The two-platform composition splits them: a\n * separate {@link ProposalManager} handles the proposal side; the\n * `DecisioningPlatform` keeps the execution side. Either platform can be\n * mock-backed independently.\n *\n * Ports the Python primitives shipped in `adcp-client-python` PRs #504\n * (v1) and #550 (v1.5):\n *\n * - {@link ProposalManager} — interface with `getProducts` (required)\n * plus optional `refineProducts` and `finalizeProposal`.\n * - {@link ProposalCapabilities} — sales-axis-scoped capability flags.\n * - {@link Recipe} — typed `recipe_kind`-discriminated base; adopters\n * subclass with their internal-config schema. Rides on\n * `Product.implementation_config` (opaque to the buyer).\n * - {@link CapabilityOverlap} — typed declaration of which wire\n * capabilities the buyer can configure on a product. The framework\n * validates buyer requests against the overlap pre-adapter.\n * - {@link FinalizeProposalRequest} / {@link FinalizeProposalSuccess} —\n * framework-internal shapes for the finalize lifecycle (wired in the\n * v1.5 dispatch helpers).\n *\n * @public\n * @packageDocumentation\n */\n\nimport type { MaybePromise } from '../../create-adcp-server';\nimport type { Account } from '../account';\nimport type { RequestContext } from '../context';\nimport type { GetProductsResponse } from '../../../types/tools.generated';\nimport type {\n CanonicalCreativeResponse,\n CanonicalGetProductsRequest,\n CanonicalProduct,\n} from '../../../v2/projection/creative-delivery';\nimport type { RequireCacheScopeWhenProducts, ServerPayload } from '../../../types/server-payload';\nimport type { TaskHandoff } from '../async-outcome';\n\nexport type ProposalGetProductsPayload = RequireCacheScopeWhenProducts<\n Omit<ServerPayload<CanonicalCreativeResponse<GetProductsResponse>>, 'products'> & { products?: CanonicalProduct[] }\n>;\nexport type LegacyProposalGetProductsPayload = RequireCacheScopeWhenProducts<ServerPayload<GetProductsResponse>>;\n\n// ---------------------------------------------------------------------------\n// Capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Sales specialisms a {@link ProposalManager} can serve. Mirrors the\n * `sales-*` slugs in the spec's specialism enum.\n *\n * v1 scopes to the two `ProposalManager`-relevant flavours; broader\n * coverage (broadcast-tv, social, proposal-mode, catalog-driven) lands\n * as adopter signal grows.\n *\n * @public\n */\nexport type ProposalSalesSpecialism = 'sales-guaranteed' | 'sales-non-guaranteed';\n\n/**\n * Capability declaration for a {@link ProposalManager}.\n *\n * Sales-axis-scoped: proposal handling is a sales-specialism concern,\n * not a generic platform-wide concept. The `salesSpecialism` field\n * declares which AdCP sales specialism this manager serves; capability\n * flags declare which optional behaviours it supports.\n *\n * The framework reads this declaration at server-construction time to\n * decide which dispatch paths apply (e.g. `refineProducts` is only\n * invoked when `refine` is true; `finalizeProposal` is only invoked\n * when `finalize` is true).\n *\n * @public\n */\nexport interface ProposalCapabilities {\n /**\n * Which AdCP sales specialism this manager serves.\n *\n * `sales-guaranteed` for guaranteed-direct flows with proposal\n * lifecycle (finalize → committed proposal → media buy).\n *\n * `sales-non-guaranteed` for catalog-style flows where `getProducts`\n * returns a static catalog and buyers reference products directly at\n * `create_media_buy`.\n */\n salesSpecialism: ProposalSalesSpecialism;\n\n /**\n * When true, the manager implements {@link ProposalManager.refineProducts}\n * and the framework routes `get_products` requests with\n * `buying_mode: 'refine'` to that method. When false, refine requests\n * fall through to `getProducts` (or surface `UNSUPPORTED_FEATURE` if\n * the manager rejects them).\n */\n refine?: boolean;\n\n /**\n * When true, the manager implements {@link ProposalManager.finalizeProposal}\n * and the framework intercepts `refine[i].action: 'finalize'` entries to\n * commit drafts via the lifecycle helpers. When false, finalize entries\n * pass through to the underlying `getProducts` / `refineProducts` method\n * unchanged.\n */\n finalize?: boolean;\n\n /**\n * Grace window (in seconds) added to a committed proposal's `expires_at`\n * before the framework rejects `create_media_buy` calls referencing the\n * proposal with `PROPOSAL_EXPIRED`. Default 0 (strict).\n */\n expiresAtGraceSeconds?: number;\n\n /**\n * Signal-driven product assembly — the manager constructs products from\n * buyer signals at request time rather than enumerating a static\n * catalogue. Informational in v1.5; future PRs may validate that\n * inventory / signal stores are wired when this flag is set.\n */\n dynamicProducts?: boolean;\n\n /**\n * The manager consults rate cards (per buyer relationship per product)\n * when emitting prices. Informational in v1.5.\n */\n rateCardPricing?: boolean;\n\n /**\n * The manager reserves capacity at proposal time (typical for\n * guaranteed). Informational in v1.5; the `finalize` transition that\n * drives the actual hold is wired via the lifecycle helpers.\n */\n availabilityReservations?: boolean;\n}\n\n/**\n * Validate a {@link ProposalCapabilities} object. Throws when the declaration\n * is malformed (unknown `salesSpecialism`, negative `expiresAtGraceSeconds`).\n * The framework calls this at boot; adopters can call it from their own\n * config-validation code paths to fail fast on misconfiguration.\n *\n * Kept as a plain function rather than a class constructor to match the\n * codebase's preference for plain TS interfaces over runtime classes\n * for adopter-facing types.\n *\n * @public\n */\nexport function validateProposalCapabilities(caps: ProposalCapabilities): void {\n const valid: readonly ProposalSalesSpecialism[] = ['sales-guaranteed', 'sales-non-guaranteed'];\n if (!valid.includes(caps.salesSpecialism)) {\n throw new Error(\n `ProposalCapabilities.salesSpecialism must be one of ${JSON.stringify(valid)}. ` +\n `Got ${JSON.stringify(caps.salesSpecialism)}. v1.5 scopes ProposalManager to the two ` +\n `core sales specialisms; broader specialism support lands in subsequent releases.`\n );\n }\n if (caps.expiresAtGraceSeconds != null && caps.expiresAtGraceSeconds < 0) {\n throw new Error(\n `ProposalCapabilities.expiresAtGraceSeconds must be >= 0; got ${caps.expiresAtGraceSeconds}. ` +\n `The grace window extends the inventory hold past expires_at; negative values would shrink it.`\n );\n }\n}\n\n// ---------------------------------------------------------------------------\n// Recipe + CapabilityOverlap\n// ---------------------------------------------------------------------------\n\n/**\n * Per-product subset of wire capability flags that the buyer can\n * configure on this product.\n *\n * Buyer requests asking for capabilities outside this overlap are\n * rejected by the framework before the adapter sees them (validated by\n * the lifecycle helpers — see `proposal/lifecycle.ts`).\n *\n * Each field is `ReadonlySet<string> | undefined`:\n *\n * - `undefined` → framework does not gate this axis (open).\n * - `ReadonlySet` → buyer choices must be subsets of this set.\n * An empty set means deny-all on this axis.\n *\n * The undefined vs. empty-set distinction matches set intuition:\n * \"no constraint\" is `undefined`; \"allowed set is empty\" is `new Set()`.\n *\n * **Why no extras dict?** v1.5 deliberately omits an `extras` escape\n * hatch (per Python design § D4). Adopters with novel gating needs\n * extend the interface with typed fields; a dict bag leaves no paper\n * trail. If a new axis turns out to be widely useful, it lands as a\n * typed field on `CapabilityOverlap` upstream.\n *\n * @public\n */\nexport interface CapabilityOverlap {\n /**\n * Subset of wire `pricing_models` the buyer can choose. Validated\n * against the matching `PricingOption.pricing_model` on the buyer's\n * package.\n */\n pricingModels?: ReadonlySet<string>;\n\n /**\n * Subset of wire targeting dimensions (`geo`, `device_type`,\n * `language`, etc.). Validated against the keys present on the\n * buyer's `targeting_overlay`.\n */\n targetingDimensions?: ReadonlySet<string>;\n\n /**\n * Subset of `{ guaranteed, non_guaranteed }` the product offers.\n */\n deliveryTypes?: ReadonlySet<string>;\n\n /**\n * If the seller integrates signals, which signal types this product\n * accepts. An empty set means the seller explicitly refuses all\n * signals on this product; `undefined` means no framework gate.\n */\n signalTypes?: ReadonlySet<string>;\n}\n\n/**\n * Base type for typed product `implementation_config` payloads.\n *\n * Adopters declare a discriminated subtype with a literal `recipe_kind`:\n *\n * ```ts\n * interface GAMRecipe extends Recipe {\n * recipe_kind: 'gam';\n * line_item_template_id: string;\n * ad_unit_ids: readonly string[];\n * capability_overlap?: CapabilityOverlap;\n * }\n * ```\n *\n * The kind tag enables router-by-recipe-kind dispatch in the\n * multi-decisioning case (one ProposalManager + many DecisioningPlatforms,\n * each handling a subset of recipe kinds). v1.5 doesn't yet wire that\n * routing — adopters using a single DecisioningPlatform attach recipes\n * freely without registry validation.\n *\n * **The recipe is never on the buyer's wire surface.** It rides inside\n * `Product.implementation_config` (an opaque-to-buyer dict). Buyers treat\n * it as a black box; the framework persists it through the proposal\n * lifecycle so the executing DecisioningPlatform sees a stable view.\n *\n * `capability_overlap` is optional. When present, the framework activates\n * the v1.5 buyer-request validation seam against the declared subsets.\n *\n * @public\n */\nexport interface Recipe {\n /** Adapter-family discriminator. Subtypes narrow with a literal type. */\n recipe_kind: string;\n\n /**\n * Optional typed declaration of which wire capabilities the buyer can\n * configure on this product. `undefined` means no framework gating.\n * An explicit {@link CapabilityOverlap} activates the v1.5 validation.\n */\n capability_overlap?: CapabilityOverlap;\n}\n\n// ---------------------------------------------------------------------------\n// Finalize lifecycle shapes\n// ---------------------------------------------------------------------------\n\n/**\n * Framework-internal request shape passed to {@link ProposalManager.finalizeProposal}.\n *\n * Constructed by the framework dispatcher when a buyer's `get_products`\n * request with `buying_mode: 'refine'` carries a `refine[i].action: 'finalize'`\n * entry. Adopters don't parse the wire envelope; the framework projects.\n *\n * @public\n */\nexport interface FinalizeProposalRequest<TRecipe extends Recipe = Recipe> {\n /**\n * The draft proposal the buyer is asking to finalize. Hydrated from\n * the wire's `refine[i].proposal_id` field.\n */\n proposalId: string;\n\n /**\n * `product_id -> Recipe` mapping pulled from the {@link ProposalStore}\n * draft. The adopter's finalize logic typically lock-prices these and\n * emits the committed proposal.\n */\n recipes: ReadonlyMap<string, TRecipe>;\n\n /**\n * The draft's wire `Proposal` shape (the same payload the adopter\n * returned on the prior `getProducts` / `refineProducts` call).\n * Adopter typically modifies this with locked pricing and returns it\n * on {@link FinalizeProposalSuccess}.\n */\n proposalPayload: Record<string, unknown>;\n\n /**\n * The buyer's per-entry refine `ask` text — what they want finalized.\n * Free-form; adopter consumes.\n */\n ask?: string;\n\n /**\n * The parent canonical get-products request so the adopter sees the full\n * envelope (account, etc.) without the framework projecting fields\n * one-by-one.\n */\n parentRequest: CanonicalGetProductsRequest;\n}\n\n/**\n * Adopter-returned shape from {@link ProposalManager.finalizeProposal} —\n * inline commit.\n *\n * Framework calls `ProposalStore.commit` with these fields before\n * projecting the wire response. The buyer sees the committed `Proposal`\n * with `proposal_status: 'committed'` + `expires_at` populated on the\n * next `get_products` response payload.\n *\n * @public\n */\nexport interface FinalizeProposalSuccess<TRecipe extends Recipe = Recipe> {\n /**\n * The wire `Proposal` shape with locked pricing and\n * `proposal_status: 'committed'`. Adopter typically derives this from\n * {@link FinalizeProposalRequest.proposalPayload} with modifications.\n *\n * **Must be JSON-serializable end-to-end** — non-JSON values won't\n * survive a process restart through a durable {@link ProposalStore}.\n */\n proposal: Record<string, unknown>;\n\n /**\n * Inventory hold deadline. After this (plus the adopter's\n * {@link ProposalCapabilities.expiresAtGraceSeconds} window), the\n * framework rejects `create_media_buy` calls referencing the proposal\n * with `PROPOSAL_EXPIRED`.\n */\n expiresAt: Date;\n\n /**\n * Optional refreshed recipe mapping. Omitting preserves the draft's\n * recipes verbatim. Adopters whose finalize logic mutates recipe\n * fields (e.g. locking a line-item template id) supply a fresh\n * mapping.\n */\n recipes?: ReadonlyMap<string, TRecipe>;\n}\n\n// ---------------------------------------------------------------------------\n// ProposalManager interface\n// ---------------------------------------------------------------------------\n\ntype Ctx<TCtxMeta> = RequestContext<Account<TCtxMeta>>;\n\n/**\n * Assembles proposals from buyer briefs.\n *\n * Reads inventory, signals, rate cards, availability. Produces proposals\n * where each `Product` carries a typed `implementation_config` (a recipe;\n * see {@link Recipe}) that the bound `DecisioningPlatform` consumes at\n * `create_media_buy` time.\n *\n * Methods may be sync or async; the framework awaits whatever is\n * returned. Same convention as `SalesPlatform`.\n *\n * **Required surface:** {@link getProducts}.\n *\n * **Optional surfaces (capability-gated):**\n *\n * - {@link refineProducts} — only invoked when\n * {@link ProposalCapabilities.refine} is true.\n * - {@link finalizeProposal} — only invoked when\n * {@link ProposalCapabilities.finalize} is true. Wired by the\n * framework's lifecycle helpers; intercepts `refine[i].action: 'finalize'`\n * entries before the underlying `getProducts` / `refineProducts` runs.\n *\n * Throw `AdcpError` for buyer-fixable rejection (`BUDGET_TOO_LOW`,\n * `POLICY_VIOLATION`, `UNSUPPORTED_FEATURE`); the framework projects to\n * the wire structured-error envelope.\n *\n * Adopter typing tip: parameterize on your concrete `Recipe` subtype to\n * get end-to-end recipe typing through `ctx.recipes` in the bound\n * `DecisioningPlatform`'s methods:\n *\n * ```ts\n * type MyRecipe = GAMRecipe | KevelRecipe;\n * const manager: ProposalManager<MyRecipe, MyTenantMeta> = { ... };\n * ```\n *\n * @public\n */\nexport interface ProposalManager<TRecipe extends Recipe = Recipe, TCtxMeta = unknown> {\n /**\n * What this ProposalManager can do — sales specialism + capability flags.\n */\n capabilities: ProposalCapabilities;\n\n /**\n * Initial product discovery from a buyer brief.\n *\n * Each returned `Product` SHOULD carry an `implementation_config`\n * matching the bound `DecisioningPlatform`'s recipe schema (see\n * {@link Recipe}). The framework treats `implementation_config` as\n * opaque on the wire; recipe typing is enforced through the\n * `TRecipe` type parameter on the adopter side.\n *\n * For non-guaranteed flows: typically a static catalogue, possibly\n * filtered by buyer brief / signals.\n *\n * For guaranteed flows: typically a brief-driven assembly consulting\n * rate cards + availability. Adopters return draft proposals; the\n * buyer drives the finalize transition via subsequent refine calls\n * with `action: 'finalize'`.\n */\n getProducts(req: CanonicalGetProductsRequest, ctx: Ctx<TCtxMeta>): MaybePromise<ProposalGetProductsPayload>;\n\n /**\n * Refine-mode iteration on a previous `getProducts` response.\n *\n * Per the spec, refine is a `buying_mode` value on `get_products` —\n * the wire envelope is the same. The framework routes refine requests\n * to this method when:\n *\n * 1. The wired ProposalManager declares `capabilities.refine` = true,\n * 2. The request has `buying_mode === 'refine'`, AND\n * 3. The manager implements this method.\n *\n * Otherwise refine requests fall through to {@link getProducts}.\n *\n * Adopters implementing `refineProducts` without `finalize` support\n * should treat `action: 'finalize'` entries as `UNSUPPORTED_FEATURE`\n * and return a structured error. Adopters with `finalize` support\n * see those entries intercepted by the framework before this method\n * is called.\n */\n refineProducts?(req: CanonicalGetProductsRequest, ctx: Ctx<TCtxMeta>): MaybePromise<ProposalGetProductsPayload>;\n\n /**\n * Commit a draft proposal to firm pricing + inventory hold.\n *\n * Wired by the framework's lifecycle helpers when:\n *\n * 1. `capabilities.finalize === true`,\n * 2. The buyer's request has `buying_mode === 'refine'` with a\n * `refine[i]` entry of `{ scope: 'proposal', action: 'finalize',\n * proposal_id }`, AND\n * 3. The proposal_id resolves to a DRAFT entry in the\n * {@link ProposalStore}.\n *\n * Return a {@link FinalizeProposalSuccess} for inline commit (the\n * spec-default route), or a `TaskHandoff<FinalizeProposalSuccess>` to\n * promote to a HITL background task. The HITL commit hook is wired\n * in v1.6+; v1.5 inline-only.\n */\n finalizeProposal?(\n req: FinalizeProposalRequest<TRecipe>,\n ctx: Ctx<TCtxMeta>\n ): MaybePromise<FinalizeProposalSuccess<TRecipe> | TaskHandoff<FinalizeProposalSuccess<TRecipe>>>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuJO,SAAS,6BAA6B,MAAkC;AAC7E,QAAM,QAA4C,CAAC,oBAAoB,sBAAsB;AAC7F,MAAI,CAAC,MAAM,SAAS,KAAK,eAAe,GAAG;AACzC,UAAM,IAAI;AAAA,MACR,uDAAuD,KAAK,UAAU,KAAK,CAAC,SACnE,KAAK,UAAU,KAAK,eAAe,CAAC;AAAA,IAE/C;AAAA,EACF;AACA,MAAI,KAAK,yBAAyB,QAAQ,KAAK,wBAAwB,GAAG;AACxE,UAAM,IAAI;AAAA,MACR,gEAAgE,KAAK,qBAAqB;AAAA,IAE5F;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/lib/server/decisioning/proposal/types.ts"],"sourcesContent":["/**\n * ProposalManager — primitives for the two-platform composition.\n *\n * The existing `DecisioningPlatform` conflates two concerns: assembling\n * proposals from briefs (`get_products`, refine) vs. executing media buys\n * against an upstream (`create_media_buy`, `update_media_buy`,\n * `get_media_buy_delivery`). The two-platform composition splits them: a\n * separate {@link ProposalManager} handles the proposal side; the\n * `DecisioningPlatform` keeps the execution side. Either platform can be\n * mock-backed independently.\n *\n * Ports the Python primitives shipped in `adcp-client-python` PRs #504\n * (v1) and #550 (v1.5):\n *\n * - {@link ProposalManager} — interface with `getProducts` (required)\n * plus optional `refineProducts` and `finalizeProposal`.\n * - {@link ProposalCapabilities} — sales-axis-scoped capability flags.\n * - {@link Recipe} — typed `recipe_kind`-discriminated base; adopters\n * subclass with their internal-config schema. Rides on\n * `Product.implementation_config` (opaque to the buyer).\n * - {@link CapabilityOverlap} — typed declaration of which wire\n * capabilities the buyer can configure on a product. The framework\n * validates buyer requests against the overlap pre-adapter.\n * - {@link FinalizeProposalRequest} / {@link FinalizeProposalSuccess} —\n * framework-internal shapes for the finalize lifecycle (wired in the\n * v1.5 dispatch helpers).\n *\n * @public\n * @packageDocumentation\n */\n\nimport type { MaybePromise } from '../../create-adcp-server';\nimport type { Account } from '../account';\nimport type { RequestContext } from '../context';\nimport type { GetProductsResponse } from '../../../types/tools.generated';\nimport type { CanonicalCreativeResponse, CanonicalGetProductsRequest } from '../../../v2/projection/creative-delivery';\nimport type { RequireCacheScopeWhenProducts, ServerPayload } from '../../../types/server-payload';\nimport type { TaskHandoff } from '../async-outcome';\nimport type { GetProductsProjectionInput } from '../specialisms/sales';\n\nexport type ProposalGetProductsPayload = RequireCacheScopeWhenProducts<\n Omit<ServerPayload<CanonicalCreativeResponse<GetProductsResponse>>, 'products'> & {\n products?: GetProductsProjectionInput[];\n }\n>;\nexport type LegacyProposalGetProductsPayload = RequireCacheScopeWhenProducts<ServerPayload<GetProductsResponse>>;\n\n// ---------------------------------------------------------------------------\n// Capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Sales specialisms a {@link ProposalManager} can serve. Mirrors the\n * `sales-*` slugs in the spec's specialism enum.\n *\n * v1 scopes to the two `ProposalManager`-relevant flavours; broader\n * coverage (broadcast-tv, social, proposal-mode, catalog-driven) lands\n * as adopter signal grows.\n *\n * @public\n */\nexport type ProposalSalesSpecialism = 'sales-guaranteed' | 'sales-non-guaranteed';\n\n/**\n * Capability declaration for a {@link ProposalManager}.\n *\n * Sales-axis-scoped: proposal handling is a sales-specialism concern,\n * not a generic platform-wide concept. The `salesSpecialism` field\n * declares which AdCP sales specialism this manager serves; capability\n * flags declare which optional behaviours it supports.\n *\n * The framework reads this declaration at server-construction time to\n * decide which dispatch paths apply (e.g. `refineProducts` is only\n * invoked when `refine` is true; `finalizeProposal` is only invoked\n * when `finalize` is true).\n *\n * @public\n */\nexport interface ProposalCapabilities {\n /**\n * Which AdCP sales specialism this manager serves.\n *\n * `sales-guaranteed` for guaranteed-direct flows with proposal\n * lifecycle (finalize → committed proposal → media buy).\n *\n * `sales-non-guaranteed` for catalog-style flows where `getProducts`\n * returns a static catalog and buyers reference products directly at\n * `create_media_buy`.\n */\n salesSpecialism: ProposalSalesSpecialism;\n\n /**\n * When true, the manager implements {@link ProposalManager.refineProducts}\n * and the framework routes `get_products` requests with\n * `buying_mode: 'refine'` to that method. When false, refine requests\n * fall through to `getProducts` (or surface `UNSUPPORTED_FEATURE` if\n * the manager rejects them).\n */\n refine?: boolean;\n\n /**\n * When true, the manager implements {@link ProposalManager.finalizeProposal}\n * and the framework intercepts `refine[i].action: 'finalize'` entries to\n * commit drafts via the lifecycle helpers. When false, finalize entries\n * pass through to the underlying `getProducts` / `refineProducts` method\n * unchanged.\n */\n finalize?: boolean;\n\n /**\n * Grace window (in seconds) added to a committed proposal's `expires_at`\n * before the framework rejects `create_media_buy` calls referencing the\n * proposal with `PROPOSAL_EXPIRED`. Default 0 (strict).\n */\n expiresAtGraceSeconds?: number;\n\n /**\n * Signal-driven product assembly — the manager constructs products from\n * buyer signals at request time rather than enumerating a static\n * catalogue. Informational in v1.5; future PRs may validate that\n * inventory / signal stores are wired when this flag is set.\n */\n dynamicProducts?: boolean;\n\n /**\n * The manager consults rate cards (per buyer relationship per product)\n * when emitting prices. Informational in v1.5.\n */\n rateCardPricing?: boolean;\n\n /**\n * The manager reserves capacity at proposal time (typical for\n * guaranteed). Informational in v1.5; the `finalize` transition that\n * drives the actual hold is wired via the lifecycle helpers.\n */\n availabilityReservations?: boolean;\n}\n\n/**\n * Validate a {@link ProposalCapabilities} object. Throws when the declaration\n * is malformed (unknown `salesSpecialism`, negative `expiresAtGraceSeconds`).\n * The framework calls this at boot; adopters can call it from their own\n * config-validation code paths to fail fast on misconfiguration.\n *\n * Kept as a plain function rather than a class constructor to match the\n * codebase's preference for plain TS interfaces over runtime classes\n * for adopter-facing types.\n *\n * @public\n */\nexport function validateProposalCapabilities(caps: ProposalCapabilities): void {\n const valid: readonly ProposalSalesSpecialism[] = ['sales-guaranteed', 'sales-non-guaranteed'];\n if (!valid.includes(caps.salesSpecialism)) {\n throw new Error(\n `ProposalCapabilities.salesSpecialism must be one of ${JSON.stringify(valid)}. ` +\n `Got ${JSON.stringify(caps.salesSpecialism)}. v1.5 scopes ProposalManager to the two ` +\n `core sales specialisms; broader specialism support lands in subsequent releases.`\n );\n }\n if (caps.expiresAtGraceSeconds != null && caps.expiresAtGraceSeconds < 0) {\n throw new Error(\n `ProposalCapabilities.expiresAtGraceSeconds must be >= 0; got ${caps.expiresAtGraceSeconds}. ` +\n `The grace window extends the inventory hold past expires_at; negative values would shrink it.`\n );\n }\n}\n\n// ---------------------------------------------------------------------------\n// Recipe + CapabilityOverlap\n// ---------------------------------------------------------------------------\n\n/**\n * Per-product subset of wire capability flags that the buyer can\n * configure on this product.\n *\n * Buyer requests asking for capabilities outside this overlap are\n * rejected by the framework before the adapter sees them (validated by\n * the lifecycle helpers — see `proposal/lifecycle.ts`).\n *\n * Each field is `ReadonlySet<string> | undefined`:\n *\n * - `undefined` → framework does not gate this axis (open).\n * - `ReadonlySet` → buyer choices must be subsets of this set.\n * An empty set means deny-all on this axis.\n *\n * The undefined vs. empty-set distinction matches set intuition:\n * \"no constraint\" is `undefined`; \"allowed set is empty\" is `new Set()`.\n *\n * **Why no extras dict?** v1.5 deliberately omits an `extras` escape\n * hatch (per Python design § D4). Adopters with novel gating needs\n * extend the interface with typed fields; a dict bag leaves no paper\n * trail. If a new axis turns out to be widely useful, it lands as a\n * typed field on `CapabilityOverlap` upstream.\n *\n * @public\n */\nexport interface CapabilityOverlap {\n /**\n * Subset of wire `pricing_models` the buyer can choose. Validated\n * against the matching `PricingOption.pricing_model` on the buyer's\n * package.\n */\n pricingModels?: ReadonlySet<string>;\n\n /**\n * Subset of wire targeting dimensions (`geo`, `device_type`,\n * `language`, etc.). Validated against the keys present on the\n * buyer's `targeting_overlay`.\n */\n targetingDimensions?: ReadonlySet<string>;\n\n /**\n * Subset of `{ guaranteed, non_guaranteed }` the product offers.\n */\n deliveryTypes?: ReadonlySet<string>;\n\n /**\n * If the seller integrates signals, which signal types this product\n * accepts. An empty set means the seller explicitly refuses all\n * signals on this product; `undefined` means no framework gate.\n */\n signalTypes?: ReadonlySet<string>;\n}\n\n/**\n * Base type for typed product `implementation_config` payloads.\n *\n * Adopters declare a discriminated subtype with a literal `recipe_kind`:\n *\n * ```ts\n * interface GAMRecipe extends Recipe {\n * recipe_kind: 'gam';\n * line_item_template_id: string;\n * ad_unit_ids: readonly string[];\n * capability_overlap?: CapabilityOverlap;\n * }\n * ```\n *\n * The kind tag enables router-by-recipe-kind dispatch in the\n * multi-decisioning case (one ProposalManager + many DecisioningPlatforms,\n * each handling a subset of recipe kinds). v1.5 doesn't yet wire that\n * routing — adopters using a single DecisioningPlatform attach recipes\n * freely without registry validation.\n *\n * **The recipe is never on the buyer's wire surface.** It rides inside\n * `Product.implementation_config` (an opaque-to-buyer dict). Buyers treat\n * it as a black box; the framework persists it through the proposal\n * lifecycle so the executing DecisioningPlatform sees a stable view.\n *\n * `capability_overlap` is optional. When present, the framework activates\n * the v1.5 buyer-request validation seam against the declared subsets.\n *\n * @public\n */\nexport interface Recipe {\n /** Adapter-family discriminator. Subtypes narrow with a literal type. */\n recipe_kind: string;\n\n /**\n * Optional typed declaration of which wire capabilities the buyer can\n * configure on this product. `undefined` means no framework gating.\n * An explicit {@link CapabilityOverlap} activates the v1.5 validation.\n */\n capability_overlap?: CapabilityOverlap;\n}\n\n// ---------------------------------------------------------------------------\n// Finalize lifecycle shapes\n// ---------------------------------------------------------------------------\n\n/**\n * Framework-internal request shape passed to {@link ProposalManager.finalizeProposal}.\n *\n * Constructed by the framework dispatcher when a buyer's `get_products`\n * request with `buying_mode: 'refine'` carries a `refine[i].action: 'finalize'`\n * entry. Adopters don't parse the wire envelope; the framework projects.\n *\n * @public\n */\nexport interface FinalizeProposalRequest<TRecipe extends Recipe = Recipe> {\n /**\n * The draft proposal the buyer is asking to finalize. Hydrated from\n * the wire's `refine[i].proposal_id` field.\n */\n proposalId: string;\n\n /**\n * `product_id -> Recipe` mapping pulled from the {@link ProposalStore}\n * draft. The adopter's finalize logic typically lock-prices these and\n * emits the committed proposal.\n */\n recipes: ReadonlyMap<string, TRecipe>;\n\n /**\n * The draft's wire `Proposal` shape (the same payload the adopter\n * returned on the prior `getProducts` / `refineProducts` call).\n * Adopter typically modifies this with locked pricing and returns it\n * on {@link FinalizeProposalSuccess}.\n */\n proposalPayload: Record<string, unknown>;\n\n /**\n * The buyer's per-entry refine `ask` text — what they want finalized.\n * Free-form; adopter consumes.\n */\n ask?: string;\n\n /**\n * The parent canonical get-products request so the adopter sees the full\n * envelope (account, etc.) without the framework projecting fields\n * one-by-one.\n */\n parentRequest: CanonicalGetProductsRequest;\n}\n\n/**\n * Adopter-returned shape from {@link ProposalManager.finalizeProposal} —\n * inline commit.\n *\n * Framework calls `ProposalStore.commit` with these fields before\n * projecting the wire response. The buyer sees the committed `Proposal`\n * with `proposal_status: 'committed'` + `expires_at` populated on the\n * next `get_products` response payload.\n *\n * @public\n */\nexport interface FinalizeProposalSuccess<TRecipe extends Recipe = Recipe> {\n /**\n * The wire `Proposal` shape with locked pricing and\n * `proposal_status: 'committed'`. Adopter typically derives this from\n * {@link FinalizeProposalRequest.proposalPayload} with modifications.\n *\n * **Must be JSON-serializable end-to-end** — non-JSON values won't\n * survive a process restart through a durable {@link ProposalStore}.\n */\n proposal: Record<string, unknown>;\n\n /**\n * Inventory hold deadline. After this (plus the adopter's\n * {@link ProposalCapabilities.expiresAtGraceSeconds} window), the\n * framework rejects `create_media_buy` calls referencing the proposal\n * with `PROPOSAL_EXPIRED`.\n */\n expiresAt: Date;\n\n /**\n * Optional refreshed recipe mapping. Omitting preserves the draft's\n * recipes verbatim. Adopters whose finalize logic mutates recipe\n * fields (e.g. locking a line-item template id) supply a fresh\n * mapping.\n */\n recipes?: ReadonlyMap<string, TRecipe>;\n}\n\n// ---------------------------------------------------------------------------\n// ProposalManager interface\n// ---------------------------------------------------------------------------\n\ntype Ctx<TCtxMeta> = RequestContext<Account<TCtxMeta>>;\n\n/**\n * Assembles proposals from buyer briefs.\n *\n * Reads inventory, signals, rate cards, availability. Produces proposals\n * where each `Product` carries a typed `implementation_config` (a recipe;\n * see {@link Recipe}) that the bound `DecisioningPlatform` consumes at\n * `create_media_buy` time.\n *\n * Methods may be sync or async; the framework awaits whatever is\n * returned. Same convention as `SalesPlatform`.\n *\n * **Required surface:** {@link getProducts}.\n *\n * **Optional surfaces (capability-gated):**\n *\n * - {@link refineProducts} — only invoked when\n * {@link ProposalCapabilities.refine} is true.\n * - {@link finalizeProposal} — only invoked when\n * {@link ProposalCapabilities.finalize} is true. Wired by the\n * framework's lifecycle helpers; intercepts `refine[i].action: 'finalize'`\n * entries before the underlying `getProducts` / `refineProducts` runs.\n *\n * Throw `AdcpError` for buyer-fixable rejection (`BUDGET_TOO_LOW`,\n * `POLICY_VIOLATION`, `UNSUPPORTED_FEATURE`); the framework projects to\n * the wire structured-error envelope.\n *\n * Adopter typing tip: parameterize on your concrete `Recipe` subtype to\n * get end-to-end recipe typing through `ctx.recipes` in the bound\n * `DecisioningPlatform`'s methods:\n *\n * ```ts\n * type MyRecipe = GAMRecipe | KevelRecipe;\n * const manager: ProposalManager<MyRecipe, MyTenantMeta> = { ... };\n * ```\n *\n * @public\n */\nexport interface ProposalManager<TRecipe extends Recipe = Recipe, TCtxMeta = unknown> {\n /**\n * What this ProposalManager can do — sales specialism + capability flags.\n */\n capabilities: ProposalCapabilities;\n\n /**\n * Initial product discovery from a buyer brief.\n *\n * Each returned `Product` SHOULD carry an `implementation_config`\n * matching the bound `DecisioningPlatform`'s recipe schema (see\n * {@link Recipe}). The framework treats `implementation_config` as\n * opaque on the wire; recipe typing is enforced through the\n * `TRecipe` type parameter on the adopter side.\n *\n * For non-guaranteed flows: typically a static catalogue, possibly\n * filtered by buyer brief / signals.\n *\n * For guaranteed flows: typically a brief-driven assembly consulting\n * rate cards + availability. Adopters return draft proposals; the\n * buyer drives the finalize transition via subsequent refine calls\n * with `action: 'finalize'`.\n */\n getProducts(req: CanonicalGetProductsRequest, ctx: Ctx<TCtxMeta>): MaybePromise<ProposalGetProductsPayload>;\n\n /**\n * Refine-mode iteration on a previous `getProducts` response.\n *\n * Per the spec, refine is a `buying_mode` value on `get_products` —\n * the wire envelope is the same. The framework routes refine requests\n * to this method when:\n *\n * 1. The wired ProposalManager declares `capabilities.refine` = true,\n * 2. The request has `buying_mode === 'refine'`, AND\n * 3. The manager implements this method.\n *\n * Otherwise refine requests fall through to {@link getProducts}.\n *\n * Adopters implementing `refineProducts` without `finalize` support\n * should treat `action: 'finalize'` entries as `UNSUPPORTED_FEATURE`\n * and return a structured error. Adopters with `finalize` support\n * see those entries intercepted by the framework before this method\n * is called.\n */\n refineProducts?(req: CanonicalGetProductsRequest, ctx: Ctx<TCtxMeta>): MaybePromise<ProposalGetProductsPayload>;\n\n /**\n * Commit a draft proposal to firm pricing + inventory hold.\n *\n * Wired by the framework's lifecycle helpers when:\n *\n * 1. `capabilities.finalize === true`,\n * 2. The buyer's request has `buying_mode === 'refine'` with a\n * `refine[i]` entry of `{ scope: 'proposal', action: 'finalize',\n * proposal_id }`, AND\n * 3. The proposal_id resolves to a DRAFT entry in the\n * {@link ProposalStore}.\n *\n * Return a {@link FinalizeProposalSuccess} for inline commit (the\n * spec-default route), or a `TaskHandoff<FinalizeProposalSuccess>` to\n * promote to a HITL background task. The HITL commit hook is wired\n * in v1.6+; v1.5 inline-only.\n */\n finalizeProposal?(\n req: FinalizeProposalRequest<TRecipe>,\n ctx: Ctx<TCtxMeta>\n ): MaybePromise<FinalizeProposalSuccess<TRecipe> | TaskHandoff<FinalizeProposalSuccess<TRecipe>>>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsJO,SAAS,6BAA6B,MAAkC;AAC7E,QAAM,QAA4C,CAAC,oBAAoB,sBAAsB;AAC7F,MAAI,CAAC,MAAM,SAAS,KAAK,eAAe,GAAG;AACzC,UAAM,IAAI;AAAA,MACR,uDAAuD,KAAK,UAAU,KAAK,CAAC,SACnE,KAAK,UAAU,KAAK,eAAe,CAAC;AAAA,IAE/C;AAAA,EACF;AACA,MAAI,KAAK,yBAAyB,QAAQ,KAAK,wBAAwB,GAAG;AACxE,UAAM,IAAI;AAAA,MACR,gEAAgE,KAAK,qBAAqB;AAAA,IAE5F;AAAA,EACF;AACF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/lib/server/decisioning/proposal/types.ts"],"sourcesContent":["/**\n * ProposalManager — primitives for the two-platform composition.\n *\n * The existing `DecisioningPlatform` conflates two concerns: assembling\n * proposals from briefs (`get_products`, refine) vs. executing media buys\n * against an upstream (`create_media_buy`, `update_media_buy`,\n * `get_media_buy_delivery`). The two-platform composition splits them: a\n * separate {@link ProposalManager} handles the proposal side; the\n * `DecisioningPlatform` keeps the execution side. Either platform can be\n * mock-backed independently.\n *\n * Ports the Python primitives shipped in `adcp-client-python` PRs #504\n * (v1) and #550 (v1.5):\n *\n * - {@link ProposalManager} — interface with `getProducts` (required)\n * plus optional `refineProducts` and `finalizeProposal`.\n * - {@link ProposalCapabilities} — sales-axis-scoped capability flags.\n * - {@link Recipe} — typed `recipe_kind`-discriminated base; adopters\n * subclass with their internal-config schema. Rides on\n * `Product.implementation_config` (opaque to the buyer).\n * - {@link CapabilityOverlap} — typed declaration of which wire\n * capabilities the buyer can configure on a product. The framework\n * validates buyer requests against the overlap pre-adapter.\n * - {@link FinalizeProposalRequest} / {@link FinalizeProposalSuccess} —\n * framework-internal shapes for the finalize lifecycle (wired in the\n * v1.5 dispatch helpers).\n *\n * @public\n * @packageDocumentation\n */\n\nimport type { MaybePromise } from '../../create-adcp-server';\nimport type { Account } from '../account';\nimport type { RequestContext } from '../context';\nimport type { GetProductsResponse } from '../../../types/tools.generated';\nimport type {\n CanonicalCreativeResponse,\n CanonicalGetProductsRequest,\n CanonicalProduct,\n} from '../../../v2/projection/creative-delivery';\nimport type { RequireCacheScopeWhenProducts, ServerPayload } from '../../../types/server-payload';\nimport type { TaskHandoff } from '../async-outcome';\n\nexport type ProposalGetProductsPayload = RequireCacheScopeWhenProducts<\n Omit<ServerPayload<CanonicalCreativeResponse<GetProductsResponse>>, 'products'> & { products?: CanonicalProduct[] }\n>;\nexport type LegacyProposalGetProductsPayload = RequireCacheScopeWhenProducts<ServerPayload<GetProductsResponse>>;\n\n// ---------------------------------------------------------------------------\n// Capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Sales specialisms a {@link ProposalManager} can serve. Mirrors the\n * `sales-*` slugs in the spec's specialism enum.\n *\n * v1 scopes to the two `ProposalManager`-relevant flavours; broader\n * coverage (broadcast-tv, social, proposal-mode, catalog-driven) lands\n * as adopter signal grows.\n *\n * @public\n */\nexport type ProposalSalesSpecialism = 'sales-guaranteed' | 'sales-non-guaranteed';\n\n/**\n * Capability declaration for a {@link ProposalManager}.\n *\n * Sales-axis-scoped: proposal handling is a sales-specialism concern,\n * not a generic platform-wide concept. The `salesSpecialism` field\n * declares which AdCP sales specialism this manager serves; capability\n * flags declare which optional behaviours it supports.\n *\n * The framework reads this declaration at server-construction time to\n * decide which dispatch paths apply (e.g. `refineProducts` is only\n * invoked when `refine` is true; `finalizeProposal` is only invoked\n * when `finalize` is true).\n *\n * @public\n */\nexport interface ProposalCapabilities {\n /**\n * Which AdCP sales specialism this manager serves.\n *\n * `sales-guaranteed` for guaranteed-direct flows with proposal\n * lifecycle (finalize → committed proposal → media buy).\n *\n * `sales-non-guaranteed` for catalog-style flows where `getProducts`\n * returns a static catalog and buyers reference products directly at\n * `create_media_buy`.\n */\n salesSpecialism: ProposalSalesSpecialism;\n\n /**\n * When true, the manager implements {@link ProposalManager.refineProducts}\n * and the framework routes `get_products` requests with\n * `buying_mode: 'refine'` to that method. When false, refine requests\n * fall through to `getProducts` (or surface `UNSUPPORTED_FEATURE` if\n * the manager rejects them).\n */\n refine?: boolean;\n\n /**\n * When true, the manager implements {@link ProposalManager.finalizeProposal}\n * and the framework intercepts `refine[i].action: 'finalize'` entries to\n * commit drafts via the lifecycle helpers. When false, finalize entries\n * pass through to the underlying `getProducts` / `refineProducts` method\n * unchanged.\n */\n finalize?: boolean;\n\n /**\n * Grace window (in seconds) added to a committed proposal's `expires_at`\n * before the framework rejects `create_media_buy` calls referencing the\n * proposal with `PROPOSAL_EXPIRED`. Default 0 (strict).\n */\n expiresAtGraceSeconds?: number;\n\n /**\n * Signal-driven product assembly — the manager constructs products from\n * buyer signals at request time rather than enumerating a static\n * catalogue. Informational in v1.5; future PRs may validate that\n * inventory / signal stores are wired when this flag is set.\n */\n dynamicProducts?: boolean;\n\n /**\n * The manager consults rate cards (per buyer relationship per product)\n * when emitting prices. Informational in v1.5.\n */\n rateCardPricing?: boolean;\n\n /**\n * The manager reserves capacity at proposal time (typical for\n * guaranteed). Informational in v1.5; the `finalize` transition that\n * drives the actual hold is wired via the lifecycle helpers.\n */\n availabilityReservations?: boolean;\n}\n\n/**\n * Validate a {@link ProposalCapabilities} object. Throws when the declaration\n * is malformed (unknown `salesSpecialism`, negative `expiresAtGraceSeconds`).\n * The framework calls this at boot; adopters can call it from their own\n * config-validation code paths to fail fast on misconfiguration.\n *\n * Kept as a plain function rather than a class constructor to match the\n * codebase's preference for plain TS interfaces over runtime classes\n * for adopter-facing types.\n *\n * @public\n */\nexport function validateProposalCapabilities(caps: ProposalCapabilities): void {\n const valid: readonly ProposalSalesSpecialism[] = ['sales-guaranteed', 'sales-non-guaranteed'];\n if (!valid.includes(caps.salesSpecialism)) {\n throw new Error(\n `ProposalCapabilities.salesSpecialism must be one of ${JSON.stringify(valid)}. ` +\n `Got ${JSON.stringify(caps.salesSpecialism)}. v1.5 scopes ProposalManager to the two ` +\n `core sales specialisms; broader specialism support lands in subsequent releases.`\n );\n }\n if (caps.expiresAtGraceSeconds != null && caps.expiresAtGraceSeconds < 0) {\n throw new Error(\n `ProposalCapabilities.expiresAtGraceSeconds must be >= 0; got ${caps.expiresAtGraceSeconds}. ` +\n `The grace window extends the inventory hold past expires_at; negative values would shrink it.`\n );\n }\n}\n\n// ---------------------------------------------------------------------------\n// Recipe + CapabilityOverlap\n// ---------------------------------------------------------------------------\n\n/**\n * Per-product subset of wire capability flags that the buyer can\n * configure on this product.\n *\n * Buyer requests asking for capabilities outside this overlap are\n * rejected by the framework before the adapter sees them (validated by\n * the lifecycle helpers — see `proposal/lifecycle.ts`).\n *\n * Each field is `ReadonlySet<string> | undefined`:\n *\n * - `undefined` → framework does not gate this axis (open).\n * - `ReadonlySet` → buyer choices must be subsets of this set.\n * An empty set means deny-all on this axis.\n *\n * The undefined vs. empty-set distinction matches set intuition:\n * \"no constraint\" is `undefined`; \"allowed set is empty\" is `new Set()`.\n *\n * **Why no extras dict?** v1.5 deliberately omits an `extras` escape\n * hatch (per Python design § D4). Adopters with novel gating needs\n * extend the interface with typed fields; a dict bag leaves no paper\n * trail. If a new axis turns out to be widely useful, it lands as a\n * typed field on `CapabilityOverlap` upstream.\n *\n * @public\n */\nexport interface CapabilityOverlap {\n /**\n * Subset of wire `pricing_models` the buyer can choose. Validated\n * against the matching `PricingOption.pricing_model` on the buyer's\n * package.\n */\n pricingModels?: ReadonlySet<string>;\n\n /**\n * Subset of wire targeting dimensions (`geo`, `device_type`,\n * `language`, etc.). Validated against the keys present on the\n * buyer's `targeting_overlay`.\n */\n targetingDimensions?: ReadonlySet<string>;\n\n /**\n * Subset of `{ guaranteed, non_guaranteed }` the product offers.\n */\n deliveryTypes?: ReadonlySet<string>;\n\n /**\n * If the seller integrates signals, which signal types this product\n * accepts. An empty set means the seller explicitly refuses all\n * signals on this product; `undefined` means no framework gate.\n */\n signalTypes?: ReadonlySet<string>;\n}\n\n/**\n * Base type for typed product `implementation_config` payloads.\n *\n * Adopters declare a discriminated subtype with a literal `recipe_kind`:\n *\n * ```ts\n * interface GAMRecipe extends Recipe {\n * recipe_kind: 'gam';\n * line_item_template_id: string;\n * ad_unit_ids: readonly string[];\n * capability_overlap?: CapabilityOverlap;\n * }\n * ```\n *\n * The kind tag enables router-by-recipe-kind dispatch in the\n * multi-decisioning case (one ProposalManager + many DecisioningPlatforms,\n * each handling a subset of recipe kinds). v1.5 doesn't yet wire that\n * routing — adopters using a single DecisioningPlatform attach recipes\n * freely without registry validation.\n *\n * **The recipe is never on the buyer's wire surface.** It rides inside\n * `Product.implementation_config` (an opaque-to-buyer dict). Buyers treat\n * it as a black box; the framework persists it through the proposal\n * lifecycle so the executing DecisioningPlatform sees a stable view.\n *\n * `capability_overlap` is optional. When present, the framework activates\n * the v1.5 buyer-request validation seam against the declared subsets.\n *\n * @public\n */\nexport interface Recipe {\n /** Adapter-family discriminator. Subtypes narrow with a literal type. */\n recipe_kind: string;\n\n /**\n * Optional typed declaration of which wire capabilities the buyer can\n * configure on this product. `undefined` means no framework gating.\n * An explicit {@link CapabilityOverlap} activates the v1.5 validation.\n */\n capability_overlap?: CapabilityOverlap;\n}\n\n// ---------------------------------------------------------------------------\n// Finalize lifecycle shapes\n// ---------------------------------------------------------------------------\n\n/**\n * Framework-internal request shape passed to {@link ProposalManager.finalizeProposal}.\n *\n * Constructed by the framework dispatcher when a buyer's `get_products`\n * request with `buying_mode: 'refine'` carries a `refine[i].action: 'finalize'`\n * entry. Adopters don't parse the wire envelope; the framework projects.\n *\n * @public\n */\nexport interface FinalizeProposalRequest<TRecipe extends Recipe = Recipe> {\n /**\n * The draft proposal the buyer is asking to finalize. Hydrated from\n * the wire's `refine[i].proposal_id` field.\n */\n proposalId: string;\n\n /**\n * `product_id -> Recipe` mapping pulled from the {@link ProposalStore}\n * draft. The adopter's finalize logic typically lock-prices these and\n * emits the committed proposal.\n */\n recipes: ReadonlyMap<string, TRecipe>;\n\n /**\n * The draft's wire `Proposal` shape (the same payload the adopter\n * returned on the prior `getProducts` / `refineProducts` call).\n * Adopter typically modifies this with locked pricing and returns it\n * on {@link FinalizeProposalSuccess}.\n */\n proposalPayload: Record<string, unknown>;\n\n /**\n * The buyer's per-entry refine `ask` text — what they want finalized.\n * Free-form; adopter consumes.\n */\n ask?: string;\n\n /**\n * The parent canonical get-products request so the adopter sees the full\n * envelope (account, etc.) without the framework projecting fields\n * one-by-one.\n */\n parentRequest: CanonicalGetProductsRequest;\n}\n\n/**\n * Adopter-returned shape from {@link ProposalManager.finalizeProposal} —\n * inline commit.\n *\n * Framework calls `ProposalStore.commit` with these fields before\n * projecting the wire response. The buyer sees the committed `Proposal`\n * with `proposal_status: 'committed'` + `expires_at` populated on the\n * next `get_products` response payload.\n *\n * @public\n */\nexport interface FinalizeProposalSuccess<TRecipe extends Recipe = Recipe> {\n /**\n * The wire `Proposal` shape with locked pricing and\n * `proposal_status: 'committed'`. Adopter typically derives this from\n * {@link FinalizeProposalRequest.proposalPayload} with modifications.\n *\n * **Must be JSON-serializable end-to-end** — non-JSON values won't\n * survive a process restart through a durable {@link ProposalStore}.\n */\n proposal: Record<string, unknown>;\n\n /**\n * Inventory hold deadline. After this (plus the adopter's\n * {@link ProposalCapabilities.expiresAtGraceSeconds} window), the\n * framework rejects `create_media_buy` calls referencing the proposal\n * with `PROPOSAL_EXPIRED`.\n */\n expiresAt: Date;\n\n /**\n * Optional refreshed recipe mapping. Omitting preserves the draft's\n * recipes verbatim. Adopters whose finalize logic mutates recipe\n * fields (e.g. locking a line-item template id) supply a fresh\n * mapping.\n */\n recipes?: ReadonlyMap<string, TRecipe>;\n}\n\n// ---------------------------------------------------------------------------\n// ProposalManager interface\n// ---------------------------------------------------------------------------\n\ntype Ctx<TCtxMeta> = RequestContext<Account<TCtxMeta>>;\n\n/**\n * Assembles proposals from buyer briefs.\n *\n * Reads inventory, signals, rate cards, availability. Produces proposals\n * where each `Product` carries a typed `implementation_config` (a recipe;\n * see {@link Recipe}) that the bound `DecisioningPlatform` consumes at\n * `create_media_buy` time.\n *\n * Methods may be sync or async; the framework awaits whatever is\n * returned. Same convention as `SalesPlatform`.\n *\n * **Required surface:** {@link getProducts}.\n *\n * **Optional surfaces (capability-gated):**\n *\n * - {@link refineProducts} — only invoked when\n * {@link ProposalCapabilities.refine} is true.\n * - {@link finalizeProposal} — only invoked when\n * {@link ProposalCapabilities.finalize} is true. Wired by the\n * framework's lifecycle helpers; intercepts `refine[i].action: 'finalize'`\n * entries before the underlying `getProducts` / `refineProducts` runs.\n *\n * Throw `AdcpError` for buyer-fixable rejection (`BUDGET_TOO_LOW`,\n * `POLICY_VIOLATION`, `UNSUPPORTED_FEATURE`); the framework projects to\n * the wire structured-error envelope.\n *\n * Adopter typing tip: parameterize on your concrete `Recipe` subtype to\n * get end-to-end recipe typing through `ctx.recipes` in the bound\n * `DecisioningPlatform`'s methods:\n *\n * ```ts\n * type MyRecipe = GAMRecipe | KevelRecipe;\n * const manager: ProposalManager<MyRecipe, MyTenantMeta> = { ... };\n * ```\n *\n * @public\n */\nexport interface ProposalManager<TRecipe extends Recipe = Recipe, TCtxMeta = unknown> {\n /**\n * What this ProposalManager can do — sales specialism + capability flags.\n */\n capabilities: ProposalCapabilities;\n\n /**\n * Initial product discovery from a buyer brief.\n *\n * Each returned `Product` SHOULD carry an `implementation_config`\n * matching the bound `DecisioningPlatform`'s recipe schema (see\n * {@link Recipe}). The framework treats `implementation_config` as\n * opaque on the wire; recipe typing is enforced through the\n * `TRecipe` type parameter on the adopter side.\n *\n * For non-guaranteed flows: typically a static catalogue, possibly\n * filtered by buyer brief / signals.\n *\n * For guaranteed flows: typically a brief-driven assembly consulting\n * rate cards + availability. Adopters return draft proposals; the\n * buyer drives the finalize transition via subsequent refine calls\n * with `action: 'finalize'`.\n */\n getProducts(req: CanonicalGetProductsRequest, ctx: Ctx<TCtxMeta>): MaybePromise<ProposalGetProductsPayload>;\n\n /**\n * Refine-mode iteration on a previous `getProducts` response.\n *\n * Per the spec, refine is a `buying_mode` value on `get_products` —\n * the wire envelope is the same. The framework routes refine requests\n * to this method when:\n *\n * 1. The wired ProposalManager declares `capabilities.refine` = true,\n * 2. The request has `buying_mode === 'refine'`, AND\n * 3. The manager implements this method.\n *\n * Otherwise refine requests fall through to {@link getProducts}.\n *\n * Adopters implementing `refineProducts` without `finalize` support\n * should treat `action: 'finalize'` entries as `UNSUPPORTED_FEATURE`\n * and return a structured error. Adopters with `finalize` support\n * see those entries intercepted by the framework before this method\n * is called.\n */\n refineProducts?(req: CanonicalGetProductsRequest, ctx: Ctx<TCtxMeta>): MaybePromise<ProposalGetProductsPayload>;\n\n /**\n * Commit a draft proposal to firm pricing + inventory hold.\n *\n * Wired by the framework's lifecycle helpers when:\n *\n * 1. `capabilities.finalize === true`,\n * 2. The buyer's request has `buying_mode === 'refine'` with a\n * `refine[i]` entry of `{ scope: 'proposal', action: 'finalize',\n * proposal_id }`, AND\n * 3. The proposal_id resolves to a DRAFT entry in the\n * {@link ProposalStore}.\n *\n * Return a {@link FinalizeProposalSuccess} for inline commit (the\n * spec-default route), or a `TaskHandoff<FinalizeProposalSuccess>` to\n * promote to a HITL background task. The HITL commit hook is wired\n * in v1.6+; v1.5 inline-only.\n */\n finalizeProposal?(\n req: FinalizeProposalRequest<TRecipe>,\n ctx: Ctx<TCtxMeta>\n ): MaybePromise<FinalizeProposalSuccess<TRecipe> | TaskHandoff<FinalizeProposalSuccess<TRecipe>>>;\n}\n"],"mappings":"AAuJO,SAAS,6BAA6B,MAAkC;AAC7E,QAAM,QAA4C,CAAC,oBAAoB,sBAAsB;AAC7F,MAAI,CAAC,MAAM,SAAS,KAAK,eAAe,GAAG;AACzC,UAAM,IAAI;AAAA,MACR,uDAAuD,KAAK,UAAU,KAAK,CAAC,SACnE,KAAK,UAAU,KAAK,eAAe,CAAC;AAAA,IAE/C;AAAA,EACF;AACA,MAAI,KAAK,yBAAyB,QAAQ,KAAK,wBAAwB,GAAG;AACxE,UAAM,IAAI;AAAA,MACR,gEAAgE,KAAK,qBAAqB;AAAA,IAE5F;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/lib/server/decisioning/proposal/types.ts"],"sourcesContent":["/**\n * ProposalManager — primitives for the two-platform composition.\n *\n * The existing `DecisioningPlatform` conflates two concerns: assembling\n * proposals from briefs (`get_products`, refine) vs. executing media buys\n * against an upstream (`create_media_buy`, `update_media_buy`,\n * `get_media_buy_delivery`). The two-platform composition splits them: a\n * separate {@link ProposalManager} handles the proposal side; the\n * `DecisioningPlatform` keeps the execution side. Either platform can be\n * mock-backed independently.\n *\n * Ports the Python primitives shipped in `adcp-client-python` PRs #504\n * (v1) and #550 (v1.5):\n *\n * - {@link ProposalManager} — interface with `getProducts` (required)\n * plus optional `refineProducts` and `finalizeProposal`.\n * - {@link ProposalCapabilities} — sales-axis-scoped capability flags.\n * - {@link Recipe} — typed `recipe_kind`-discriminated base; adopters\n * subclass with their internal-config schema. Rides on\n * `Product.implementation_config` (opaque to the buyer).\n * - {@link CapabilityOverlap} — typed declaration of which wire\n * capabilities the buyer can configure on a product. The framework\n * validates buyer requests against the overlap pre-adapter.\n * - {@link FinalizeProposalRequest} / {@link FinalizeProposalSuccess} —\n * framework-internal shapes for the finalize lifecycle (wired in the\n * v1.5 dispatch helpers).\n *\n * @public\n * @packageDocumentation\n */\n\nimport type { MaybePromise } from '../../create-adcp-server';\nimport type { Account } from '../account';\nimport type { RequestContext } from '../context';\nimport type { GetProductsResponse } from '../../../types/tools.generated';\nimport type { CanonicalCreativeResponse, CanonicalGetProductsRequest } from '../../../v2/projection/creative-delivery';\nimport type { RequireCacheScopeWhenProducts, ServerPayload } from '../../../types/server-payload';\nimport type { TaskHandoff } from '../async-outcome';\nimport type { GetProductsProjectionInput } from '../specialisms/sales';\n\nexport type ProposalGetProductsPayload = RequireCacheScopeWhenProducts<\n Omit<ServerPayload<CanonicalCreativeResponse<GetProductsResponse>>, 'products'> & {\n products?: GetProductsProjectionInput[];\n }\n>;\nexport type LegacyProposalGetProductsPayload = RequireCacheScopeWhenProducts<ServerPayload<GetProductsResponse>>;\n\n// ---------------------------------------------------------------------------\n// Capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Sales specialisms a {@link ProposalManager} can serve. Mirrors the\n * `sales-*` slugs in the spec's specialism enum.\n *\n * v1 scopes to the two `ProposalManager`-relevant flavours; broader\n * coverage (broadcast-tv, social, proposal-mode, catalog-driven) lands\n * as adopter signal grows.\n *\n * @public\n */\nexport type ProposalSalesSpecialism = 'sales-guaranteed' | 'sales-non-guaranteed';\n\n/**\n * Capability declaration for a {@link ProposalManager}.\n *\n * Sales-axis-scoped: proposal handling is a sales-specialism concern,\n * not a generic platform-wide concept. The `salesSpecialism` field\n * declares which AdCP sales specialism this manager serves; capability\n * flags declare which optional behaviours it supports.\n *\n * The framework reads this declaration at server-construction time to\n * decide which dispatch paths apply (e.g. `refineProducts` is only\n * invoked when `refine` is true; `finalizeProposal` is only invoked\n * when `finalize` is true).\n *\n * @public\n */\nexport interface ProposalCapabilities {\n /**\n * Which AdCP sales specialism this manager serves.\n *\n * `sales-guaranteed` for guaranteed-direct flows with proposal\n * lifecycle (finalize → committed proposal → media buy).\n *\n * `sales-non-guaranteed` for catalog-style flows where `getProducts`\n * returns a static catalog and buyers reference products directly at\n * `create_media_buy`.\n */\n salesSpecialism: ProposalSalesSpecialism;\n\n /**\n * When true, the manager implements {@link ProposalManager.refineProducts}\n * and the framework routes `get_products` requests with\n * `buying_mode: 'refine'` to that method. When false, refine requests\n * fall through to `getProducts` (or surface `UNSUPPORTED_FEATURE` if\n * the manager rejects them).\n */\n refine?: boolean;\n\n /**\n * When true, the manager implements {@link ProposalManager.finalizeProposal}\n * and the framework intercepts `refine[i].action: 'finalize'` entries to\n * commit drafts via the lifecycle helpers. When false, finalize entries\n * pass through to the underlying `getProducts` / `refineProducts` method\n * unchanged.\n */\n finalize?: boolean;\n\n /**\n * Grace window (in seconds) added to a committed proposal's `expires_at`\n * before the framework rejects `create_media_buy` calls referencing the\n * proposal with `PROPOSAL_EXPIRED`. Default 0 (strict).\n */\n expiresAtGraceSeconds?: number;\n\n /**\n * Signal-driven product assembly — the manager constructs products from\n * buyer signals at request time rather than enumerating a static\n * catalogue. Informational in v1.5; future PRs may validate that\n * inventory / signal stores are wired when this flag is set.\n */\n dynamicProducts?: boolean;\n\n /**\n * The manager consults rate cards (per buyer relationship per product)\n * when emitting prices. Informational in v1.5.\n */\n rateCardPricing?: boolean;\n\n /**\n * The manager reserves capacity at proposal time (typical for\n * guaranteed). Informational in v1.5; the `finalize` transition that\n * drives the actual hold is wired via the lifecycle helpers.\n */\n availabilityReservations?: boolean;\n}\n\n/**\n * Validate a {@link ProposalCapabilities} object. Throws when the declaration\n * is malformed (unknown `salesSpecialism`, negative `expiresAtGraceSeconds`).\n * The framework calls this at boot; adopters can call it from their own\n * config-validation code paths to fail fast on misconfiguration.\n *\n * Kept as a plain function rather than a class constructor to match the\n * codebase's preference for plain TS interfaces over runtime classes\n * for adopter-facing types.\n *\n * @public\n */\nexport function validateProposalCapabilities(caps: ProposalCapabilities): void {\n const valid: readonly ProposalSalesSpecialism[] = ['sales-guaranteed', 'sales-non-guaranteed'];\n if (!valid.includes(caps.salesSpecialism)) {\n throw new Error(\n `ProposalCapabilities.salesSpecialism must be one of ${JSON.stringify(valid)}. ` +\n `Got ${JSON.stringify(caps.salesSpecialism)}. v1.5 scopes ProposalManager to the two ` +\n `core sales specialisms; broader specialism support lands in subsequent releases.`\n );\n }\n if (caps.expiresAtGraceSeconds != null && caps.expiresAtGraceSeconds < 0) {\n throw new Error(\n `ProposalCapabilities.expiresAtGraceSeconds must be >= 0; got ${caps.expiresAtGraceSeconds}. ` +\n `The grace window extends the inventory hold past expires_at; negative values would shrink it.`\n );\n }\n}\n\n// ---------------------------------------------------------------------------\n// Recipe + CapabilityOverlap\n// ---------------------------------------------------------------------------\n\n/**\n * Per-product subset of wire capability flags that the buyer can\n * configure on this product.\n *\n * Buyer requests asking for capabilities outside this overlap are\n * rejected by the framework before the adapter sees them (validated by\n * the lifecycle helpers — see `proposal/lifecycle.ts`).\n *\n * Each field is `ReadonlySet<string> | undefined`:\n *\n * - `undefined` → framework does not gate this axis (open).\n * - `ReadonlySet` → buyer choices must be subsets of this set.\n * An empty set means deny-all on this axis.\n *\n * The undefined vs. empty-set distinction matches set intuition:\n * \"no constraint\" is `undefined`; \"allowed set is empty\" is `new Set()`.\n *\n * **Why no extras dict?** v1.5 deliberately omits an `extras` escape\n * hatch (per Python design § D4). Adopters with novel gating needs\n * extend the interface with typed fields; a dict bag leaves no paper\n * trail. If a new axis turns out to be widely useful, it lands as a\n * typed field on `CapabilityOverlap` upstream.\n *\n * @public\n */\nexport interface CapabilityOverlap {\n /**\n * Subset of wire `pricing_models` the buyer can choose. Validated\n * against the matching `PricingOption.pricing_model` on the buyer's\n * package.\n */\n pricingModels?: ReadonlySet<string>;\n\n /**\n * Subset of wire targeting dimensions (`geo`, `device_type`,\n * `language`, etc.). Validated against the keys present on the\n * buyer's `targeting_overlay`.\n */\n targetingDimensions?: ReadonlySet<string>;\n\n /**\n * Subset of `{ guaranteed, non_guaranteed }` the product offers.\n */\n deliveryTypes?: ReadonlySet<string>;\n\n /**\n * If the seller integrates signals, which signal types this product\n * accepts. An empty set means the seller explicitly refuses all\n * signals on this product; `undefined` means no framework gate.\n */\n signalTypes?: ReadonlySet<string>;\n}\n\n/**\n * Base type for typed product `implementation_config` payloads.\n *\n * Adopters declare a discriminated subtype with a literal `recipe_kind`:\n *\n * ```ts\n * interface GAMRecipe extends Recipe {\n * recipe_kind: 'gam';\n * line_item_template_id: string;\n * ad_unit_ids: readonly string[];\n * capability_overlap?: CapabilityOverlap;\n * }\n * ```\n *\n * The kind tag enables router-by-recipe-kind dispatch in the\n * multi-decisioning case (one ProposalManager + many DecisioningPlatforms,\n * each handling a subset of recipe kinds). v1.5 doesn't yet wire that\n * routing — adopters using a single DecisioningPlatform attach recipes\n * freely without registry validation.\n *\n * **The recipe is never on the buyer's wire surface.** It rides inside\n * `Product.implementation_config` (an opaque-to-buyer dict). Buyers treat\n * it as a black box; the framework persists it through the proposal\n * lifecycle so the executing DecisioningPlatform sees a stable view.\n *\n * `capability_overlap` is optional. When present, the framework activates\n * the v1.5 buyer-request validation seam against the declared subsets.\n *\n * @public\n */\nexport interface Recipe {\n /** Adapter-family discriminator. Subtypes narrow with a literal type. */\n recipe_kind: string;\n\n /**\n * Optional typed declaration of which wire capabilities the buyer can\n * configure on this product. `undefined` means no framework gating.\n * An explicit {@link CapabilityOverlap} activates the v1.5 validation.\n */\n capability_overlap?: CapabilityOverlap;\n}\n\n// ---------------------------------------------------------------------------\n// Finalize lifecycle shapes\n// ---------------------------------------------------------------------------\n\n/**\n * Framework-internal request shape passed to {@link ProposalManager.finalizeProposal}.\n *\n * Constructed by the framework dispatcher when a buyer's `get_products`\n * request with `buying_mode: 'refine'` carries a `refine[i].action: 'finalize'`\n * entry. Adopters don't parse the wire envelope; the framework projects.\n *\n * @public\n */\nexport interface FinalizeProposalRequest<TRecipe extends Recipe = Recipe> {\n /**\n * The draft proposal the buyer is asking to finalize. Hydrated from\n * the wire's `refine[i].proposal_id` field.\n */\n proposalId: string;\n\n /**\n * `product_id -> Recipe` mapping pulled from the {@link ProposalStore}\n * draft. The adopter's finalize logic typically lock-prices these and\n * emits the committed proposal.\n */\n recipes: ReadonlyMap<string, TRecipe>;\n\n /**\n * The draft's wire `Proposal` shape (the same payload the adopter\n * returned on the prior `getProducts` / `refineProducts` call).\n * Adopter typically modifies this with locked pricing and returns it\n * on {@link FinalizeProposalSuccess}.\n */\n proposalPayload: Record<string, unknown>;\n\n /**\n * The buyer's per-entry refine `ask` text — what they want finalized.\n * Free-form; adopter consumes.\n */\n ask?: string;\n\n /**\n * The parent canonical get-products request so the adopter sees the full\n * envelope (account, etc.) without the framework projecting fields\n * one-by-one.\n */\n parentRequest: CanonicalGetProductsRequest;\n}\n\n/**\n * Adopter-returned shape from {@link ProposalManager.finalizeProposal} —\n * inline commit.\n *\n * Framework calls `ProposalStore.commit` with these fields before\n * projecting the wire response. The buyer sees the committed `Proposal`\n * with `proposal_status: 'committed'` + `expires_at` populated on the\n * next `get_products` response payload.\n *\n * @public\n */\nexport interface FinalizeProposalSuccess<TRecipe extends Recipe = Recipe> {\n /**\n * The wire `Proposal` shape with locked pricing and\n * `proposal_status: 'committed'`. Adopter typically derives this from\n * {@link FinalizeProposalRequest.proposalPayload} with modifications.\n *\n * **Must be JSON-serializable end-to-end** — non-JSON values won't\n * survive a process restart through a durable {@link ProposalStore}.\n */\n proposal: Record<string, unknown>;\n\n /**\n * Inventory hold deadline. After this (plus the adopter's\n * {@link ProposalCapabilities.expiresAtGraceSeconds} window), the\n * framework rejects `create_media_buy` calls referencing the proposal\n * with `PROPOSAL_EXPIRED`.\n */\n expiresAt: Date;\n\n /**\n * Optional refreshed recipe mapping. Omitting preserves the draft's\n * recipes verbatim. Adopters whose finalize logic mutates recipe\n * fields (e.g. locking a line-item template id) supply a fresh\n * mapping.\n */\n recipes?: ReadonlyMap<string, TRecipe>;\n}\n\n// ---------------------------------------------------------------------------\n// ProposalManager interface\n// ---------------------------------------------------------------------------\n\ntype Ctx<TCtxMeta> = RequestContext<Account<TCtxMeta>>;\n\n/**\n * Assembles proposals from buyer briefs.\n *\n * Reads inventory, signals, rate cards, availability. Produces proposals\n * where each `Product` carries a typed `implementation_config` (a recipe;\n * see {@link Recipe}) that the bound `DecisioningPlatform` consumes at\n * `create_media_buy` time.\n *\n * Methods may be sync or async; the framework awaits whatever is\n * returned. Same convention as `SalesPlatform`.\n *\n * **Required surface:** {@link getProducts}.\n *\n * **Optional surfaces (capability-gated):**\n *\n * - {@link refineProducts} — only invoked when\n * {@link ProposalCapabilities.refine} is true.\n * - {@link finalizeProposal} — only invoked when\n * {@link ProposalCapabilities.finalize} is true. Wired by the\n * framework's lifecycle helpers; intercepts `refine[i].action: 'finalize'`\n * entries before the underlying `getProducts` / `refineProducts` runs.\n *\n * Throw `AdcpError` for buyer-fixable rejection (`BUDGET_TOO_LOW`,\n * `POLICY_VIOLATION`, `UNSUPPORTED_FEATURE`); the framework projects to\n * the wire structured-error envelope.\n *\n * Adopter typing tip: parameterize on your concrete `Recipe` subtype to\n * get end-to-end recipe typing through `ctx.recipes` in the bound\n * `DecisioningPlatform`'s methods:\n *\n * ```ts\n * type MyRecipe = GAMRecipe | KevelRecipe;\n * const manager: ProposalManager<MyRecipe, MyTenantMeta> = { ... };\n * ```\n *\n * @public\n */\nexport interface ProposalManager<TRecipe extends Recipe = Recipe, TCtxMeta = unknown> {\n /**\n * What this ProposalManager can do — sales specialism + capability flags.\n */\n capabilities: ProposalCapabilities;\n\n /**\n * Initial product discovery from a buyer brief.\n *\n * Each returned `Product` SHOULD carry an `implementation_config`\n * matching the bound `DecisioningPlatform`'s recipe schema (see\n * {@link Recipe}). The framework treats `implementation_config` as\n * opaque on the wire; recipe typing is enforced through the\n * `TRecipe` type parameter on the adopter side.\n *\n * For non-guaranteed flows: typically a static catalogue, possibly\n * filtered by buyer brief / signals.\n *\n * For guaranteed flows: typically a brief-driven assembly consulting\n * rate cards + availability. Adopters return draft proposals; the\n * buyer drives the finalize transition via subsequent refine calls\n * with `action: 'finalize'`.\n */\n getProducts(req: CanonicalGetProductsRequest, ctx: Ctx<TCtxMeta>): MaybePromise<ProposalGetProductsPayload>;\n\n /**\n * Refine-mode iteration on a previous `getProducts` response.\n *\n * Per the spec, refine is a `buying_mode` value on `get_products` —\n * the wire envelope is the same. The framework routes refine requests\n * to this method when:\n *\n * 1. The wired ProposalManager declares `capabilities.refine` = true,\n * 2. The request has `buying_mode === 'refine'`, AND\n * 3. The manager implements this method.\n *\n * Otherwise refine requests fall through to {@link getProducts}.\n *\n * Adopters implementing `refineProducts` without `finalize` support\n * should treat `action: 'finalize'` entries as `UNSUPPORTED_FEATURE`\n * and return a structured error. Adopters with `finalize` support\n * see those entries intercepted by the framework before this method\n * is called.\n */\n refineProducts?(req: CanonicalGetProductsRequest, ctx: Ctx<TCtxMeta>): MaybePromise<ProposalGetProductsPayload>;\n\n /**\n * Commit a draft proposal to firm pricing + inventory hold.\n *\n * Wired by the framework's lifecycle helpers when:\n *\n * 1. `capabilities.finalize === true`,\n * 2. The buyer's request has `buying_mode === 'refine'` with a\n * `refine[i]` entry of `{ scope: 'proposal', action: 'finalize',\n * proposal_id }`, AND\n * 3. The proposal_id resolves to a DRAFT entry in the\n * {@link ProposalStore}.\n *\n * Return a {@link FinalizeProposalSuccess} for inline commit (the\n * spec-default route), or a `TaskHandoff<FinalizeProposalSuccess>` to\n * promote to a HITL background task. The HITL commit hook is wired\n * in v1.6+; v1.5 inline-only.\n */\n finalizeProposal?(\n req: FinalizeProposalRequest<TRecipe>,\n ctx: Ctx<TCtxMeta>\n ): MaybePromise<FinalizeProposalSuccess<TRecipe> | TaskHandoff<FinalizeProposalSuccess<TRecipe>>>;\n}\n"],"mappings":"AAsJO,SAAS,6BAA6B,MAAkC;AAC7E,QAAM,QAA4C,CAAC,oBAAoB,sBAAsB;AAC7F,MAAI,CAAC,MAAM,SAAS,KAAK,eAAe,GAAG;AACzC,UAAM,IAAI;AAAA,MACR,uDAAuD,KAAK,UAAU,KAAK,CAAC,SACnE,KAAK,UAAU,KAAK,eAAe,CAAC;AAAA,IAE/C;AAAA,EACF;AACA,MAAI,KAAK,yBAAyB,QAAQ,KAAK,wBAAwB,GAAG;AACxE,UAAM,IAAI;AAAA,MACR,gEAAgE,KAAK,qBAAqB;AAAA,IAE5F;AAAA,EACF;AACF;","names":[]}
@@ -59,8 +59,11 @@ import type { PgQueryable } from '../../postgres-task-store.mjs';
59
59
  import { type TaskRegistry, type TaskRecord } from './task-registry.mjs';
60
60
  import { type StatusChangeBus } from '../status-changes.mjs';
61
61
  import { type ComplyControllerConfig } from '../../../testing/comply-controller.mjs';
62
- import { type LegacyFormatConverter } from '../../../v2/projection/v1-to-v2.mjs';
62
+ import { type LegacyFormatConverter, type LegacyFormatResolver } from '../../../v2/projection/v1-to-v2.mjs';
63
63
  import type { CanonicalFormatLegacyResolver } from '../../../v2/projection/v2-to-v1.mjs';
64
+ import { type V1FormatId } from '../../../v2/projection/types.mjs';
65
+ /** Read exact SDK-private legacy routes restored on an auto-hydrated product or placement. */
66
+ export declare function getHydratedLegacyFormatIds(value: unknown): readonly V1FormatId[] | undefined;
64
67
  /**
65
68
  * Lifecycle observability hooks the v6 runtime fires at well-known points.
66
69
  * Each callback is optional; throws are caught and logged via the framework
@@ -183,6 +186,16 @@ export interface CreateAdcpServerFromPlatformOptions extends Omit<AdcpServerConf
183
186
  * declaration (normally `format_kind: 'custom'` + shape/schema).
184
187
  */
185
188
  legacyCreativeFormatConverter?: LegacyFormatConverter;
189
+ /**
190
+ * Resolve seller-specific legacy product formats asynchronously before the
191
+ * canonical `get_products` projection. The resolver receives only the exact
192
+ * format tuple plus non-secret request routing context and fails closed.
193
+ */
194
+ legacyCreativeFormatResolver?: LegacyFormatResolver;
195
+ /** Shared resolver-phase deadline in milliseconds. Defaults to 10 seconds. */
196
+ legacyCreativeFormatResolverTimeoutMs?: number;
197
+ /** Maximum concurrent resolver calls within one get_products response (1–64). Defaults to 8. */
198
+ legacyCreativeFormatResolverConcurrency?: number;
186
199
  /** Resolve persisted canonical custom formats when this server emits a legacy wire response. */
187
200
  canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver;
188
201
  /**
@@ -59,8 +59,11 @@ import type { PgQueryable } from '../../postgres-task-store';
59
59
  import { type TaskRegistry, type TaskRecord } from './task-registry';
60
60
  import { type StatusChangeBus } from '../status-changes';
61
61
  import { type ComplyControllerConfig } from '../../../testing/comply-controller';
62
- import { type LegacyFormatConverter } from '../../../v2/projection/v1-to-v2';
62
+ import { type LegacyFormatConverter, type LegacyFormatResolver } from '../../../v2/projection/v1-to-v2';
63
63
  import type { CanonicalFormatLegacyResolver } from '../../../v2/projection/v2-to-v1';
64
+ import { type V1FormatId } from '../../../v2/projection/types';
65
+ /** Read exact SDK-private legacy routes restored on an auto-hydrated product or placement. */
66
+ export declare function getHydratedLegacyFormatIds(value: unknown): readonly V1FormatId[] | undefined;
64
67
  /**
65
68
  * Lifecycle observability hooks the v6 runtime fires at well-known points.
66
69
  * Each callback is optional; throws are caught and logged via the framework
@@ -183,6 +186,16 @@ export interface CreateAdcpServerFromPlatformOptions extends Omit<AdcpServerConf
183
186
  * declaration (normally `format_kind: 'custom'` + shape/schema).
184
187
  */
185
188
  legacyCreativeFormatConverter?: LegacyFormatConverter;
189
+ /**
190
+ * Resolve seller-specific legacy product formats asynchronously before the
191
+ * canonical `get_products` projection. The resolver receives only the exact
192
+ * format tuple plus non-secret request routing context and fails closed.
193
+ */
194
+ legacyCreativeFormatResolver?: LegacyFormatResolver;
195
+ /** Shared resolver-phase deadline in milliseconds. Defaults to 10 seconds. */
196
+ legacyCreativeFormatResolverTimeoutMs?: number;
197
+ /** Maximum concurrent resolver calls within one get_products response (1–64). Defaults to 8. */
198
+ legacyCreativeFormatResolverConcurrency?: number;
186
199
  /** Resolve persisted canonical custom formats when this server emits a legacy wire response. */
187
200
  canonicalFormatLegacyResolver?: CanonicalFormatLegacyResolver;
188
201
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"from-platform.d.ts","sourceRoot":"","sources":["../../../../../src/lib/server/decisioning/runtime/from-platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAGL,KAAK,gBAAgB,EAUrB,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAGrE,OAAO,KAAK,EAAE,OAAO,EAAoC,MAAM,YAAY,CAAC;AA8C5E,OAAO,EACL,KAAK,gBAAgB,EAOtB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EACV,aAAa,EAKd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAI7D,OAAO,EAA8B,KAAK,YAAY,EAAE,KAAK,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAkBlH,OAAO,EAAiC,KAAK,eAAe,EAAgC,MAAM,mBAAmB,CAAC;AACtH,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAoBzG,OAAO,EAAwB,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAcnG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAgsCrF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;;;;;;;;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