@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
@@ -16,4 +16,4 @@ export declare class PlatformConfigError extends Error {
16
16
  readonly name: "PlatformConfigError";
17
17
  constructor(message: string);
18
18
  }
19
- export declare function validatePlatform(platform: DecisioningPlatform): void;
19
+ export declare function validatePlatform(platform: DecisioningPlatform, effectiveFields?: Partial<Record<keyof DecisioningPlatform, unknown>>): void;
@@ -16,5 +16,5 @@ export declare class PlatformConfigError extends Error {
16
16
  readonly name: "PlatformConfigError";
17
17
  constructor(message: string);
18
18
  }
19
- export declare function validatePlatform(platform: DecisioningPlatform): void;
19
+ export declare function validatePlatform(platform: DecisioningPlatform, effectiveFields?: Partial<Record<keyof DecisioningPlatform, unknown>>): void;
20
20
  //# sourceMappingURL=validate-platform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-platform.d.ts","sourceRoot":"","sources":["../../../../../src/lib/server/decisioning/runtime/validate-platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAgFvD,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAG,qBAAqB,CAAU;gBACnC,OAAO,EAAE,MAAM;CAG5B;AAcD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAsDpE"}
1
+ {"version":3,"file":"validate-platform.d.ts","sourceRoot":"","sources":["../../../../../src/lib/server/decisioning/runtime/validate-platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAgFvD,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAG,qBAAqB,CAAU;gBACnC,OAAO,EAAE,MAAM;CAG5B;AAcD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,eAAe,GAAE,OAAO,CAAC,MAAM,CAAC,MAAM,mBAAmB,EAAE,OAAO,CAAC,CAAM,GACxE,IAAI,CAsDN"}
@@ -92,7 +92,7 @@ class PlatformConfigError extends Error {
92
92
  super(message);
93
93
  }
94
94
  }
95
- function validatePlatform(platform) {
95
+ function validatePlatform(platform, effectiveFields = {}) {
96
96
  const claimed = platform.capabilities?.specialisms ?? [];
97
97
  const errors = [];
98
98
  for (const specialism of claimed) {
@@ -113,7 +113,7 @@ function validatePlatform(platform) {
113
113
  const required = SPECIALISM_REQUIREMENTS[specialism];
114
114
  if (!required) continue;
115
115
  for (const field of required) {
116
- if (platform[field] == null) {
116
+ if (platform[field] == null && effectiveFields[field] == null) {
117
117
  errors.push(`capabilities.specialisms claims '${specialism}'; platform.${String(field)} is missing`);
118
118
  }
119
119
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/lib/server/decisioning/runtime/validate-platform.ts"],"sourcesContent":["/**\n * Runtime validation that a `DecisioningPlatform` impl matches its\n * `capabilities.specialisms[]` declaration.\n *\n * Compile-time, `RequiredPlatformsFor<S>` enforces this in TypeScript adopter\n * code. Untyped JS callers, downstream packages with relaxed `tsconfig`, and\n * Python-port adopters running this through bindings need a runtime gate.\n *\n * Mirrors the v1.0 specialism × interface mapping in\n * `src/lib/server/decisioning/platform.ts`.\n *\n * @public\n */\n\nimport type { DecisioningPlatform } from '../platform';\nimport type { AdCPSpecialism } from '../../../types/tools.generated';\n\n// Sales specialisms require channels + pricingModels on capabilities because\n// buyers read those fields from get_adcp_capabilities to know what the seller\n// trades in. Signals/governance/creative-only platforms legitimately omit them\n// (hence the fields are optional on DecisioningCapabilities), but a media-buy\n// platform serving an empty or absent channels list is a mis-configured agent.\n// Derived from the `sales-` prefix on `AdCPSpecialism` rather than a hand-\n// maintained allowlist: when preview specialisms (`sales-streaming-tv`,\n// `sales-exchange`, `sales-retail-media`) graduate into the generated enum,\n// they automatically inherit the channels + pricingModels gate. A hand-list\n// would silently let mis-configured streaming/exchange platforms through.\nfunction isSalesSpecialism(s: AdCPSpecialism): boolean {\n return s.startsWith('sales-');\n}\n\nconst COMPACT_CORE_METHODS = [\n 'listProducts',\n 'buyProducts',\n 'controlMediaBuy',\n 'getMediaBuys',\n 'getMediaBuyDelivery',\n] as const;\nconst COMPACT_PROPOSAL_METHODS = [\n 'proposalRefinement',\n 'listProducts',\n 'requestProposals',\n 'refineProposals',\n 'declineProposals',\n 'acceptProposal',\n 'getMediaBuys',\n 'getMediaBuyDelivery',\n] as const;\n\nconst SPECIALISM_REQUIREMENTS: Partial<Record<AdCPSpecialism, ReadonlyArray<keyof DecisioningPlatform>>> = {\n // All sales-* specialisms share the SalesPlatform interface. Adopters\n // implement `sales` once; the specialism enum picks which buyer-side\n // storyboard the agent is validated against. Wired here per the AdCP 3.0\n // GA enum; preview specialisms (sales-streaming-tv, sales-exchange,\n // sales-retail-media) get added when they land in `AdCPSpecialism`.\n 'sales-non-guaranteed': [],\n 'sales-guaranteed': [],\n 'sales-broadcast-tv': [],\n 'sales-social': ['sales'],\n 'sales-catalog-driven': ['sales'],\n 'sales-proposal-mode': [],\n // Creative specialisms share the CreativeXxxPlatform field name; adopters\n // pick the right archetype (template / generative / ad-server) at\n // construction time.\n 'creative-template': ['creative'],\n 'creative-generative': ['creative'],\n 'creative-ad-server': ['creative'],\n 'creative-transformers': ['creative'],\n // Audience sync is a single specialism with a single platform interface.\n 'audience-sync': ['audiences'],\n // Signal specialisms — both share the SignalsPlatform interface.\n // Marketplace = third-party data brokers; owned = first-party providers.\n 'signal-marketplace': ['signals'],\n 'signal-owned': ['signals'],\n // Sponsored Intelligence — brand-side conversational sponsored\n // experiences.\n 'sponsored-intelligence': ['sponsoredIntelligence'],\n // Campaign governance — today's two specialisms share one platform\n // interface; consolidates to `campaign-governance` when adcp#3329 lands.\n 'governance-spend-authority': ['campaignGovernance'],\n 'governance-delivery-monitor': ['campaignGovernance'],\n // Property + collection list publishing.\n 'property-lists': ['propertyLists'],\n 'collection-lists': ['collectionLists'],\n // Content standards — brand-safety / policy compliance enforcement.\n 'content-standards': ['contentStandards'],\n // Brand-rights — identity discovery + licensing for branded inventory.\n // 4 wire tools wire through `brandRights` (`get_brand_identity`,\n // `get_rights`, `acquire_rights`, `update_rights`). `creative_approval`\n // is webhook-only (`reviewCreativeApproval` on the platform interface)\n // and not in `AdcpToolMap`.\n 'brand-rights': ['brandRights'],\n};\n\nexport class PlatformConfigError extends Error {\n readonly name = 'PlatformConfigError' as const;\n constructor(message: string) {\n super(message);\n }\n}\n\n// Note on HITL tools: the v6 unified shape collapses sync/HITL into a\n// single method per tool whose return type is `Success | TaskHandoff<Success>`.\n// Adopters branch in the body and call `ctx.handoffToTask(fn)` to defer\n// to a background task. The framework detects the handoff marker at the\n// dispatch seam — there's no exactly-one validation needed because the\n// shape is the same regardless of which path the adopter takes.\n//\n// This applies to `create_media_buy` and `sync_creatives` today (the 2\n// spec-listed tools whose per-tool response oneOf includes the Submitted\n// arm). When adcontextprotocol/adcp#3392 lands, the same shape extends\n// to `update_media_buy`, `build_creative`, `sync_catalogs`, `get_products`.\n\nexport function validatePlatform(platform: DecisioningPlatform): void {\n const claimed = platform.capabilities?.specialisms ?? [];\n const errors: string[] = [];\n\n for (const specialism of claimed) {\n const acceptsCompactLifecycle =\n specialism === 'sales-non-guaranteed' ||\n specialism === 'sales-guaranteed' ||\n specialism === 'sales-broadcast-tv' ||\n specialism === 'sales-proposal-mode';\n if (acceptsCompactLifecycle && platform.sales == null && platform.mediaBuyLifecycle == null) {\n errors.push(`${specialism} requires platform.sales or platform.mediaBuyLifecycle`);\n }\n if (acceptsCompactLifecycle && platform.sales == null && platform.mediaBuyLifecycle != null) {\n const required = specialism === 'sales-proposal-mode' ? COMPACT_PROPOSAL_METHODS : COMPACT_CORE_METHODS;\n for (const method of required) {\n if (platform.mediaBuyLifecycle[method] == null) {\n errors.push(`${specialism} requires platform.mediaBuyLifecycle.${method}`);\n }\n }\n }\n }\n\n // 1. Specialism declarations match required interfaces.\n for (const specialism of claimed) {\n const required = SPECIALISM_REQUIREMENTS[specialism];\n if (!required) continue; // forward-compat for unknown specialisms\n for (const field of required) {\n if (platform[field] == null) {\n errors.push(`capabilities.specialisms claims '${specialism}'; platform.${String(field)} is missing`);\n }\n }\n }\n\n // 2. Media-buy platforms require channels + pricingModels on capabilities.\n // These fields are optional on DecisioningCapabilities so non-media-buy\n // platforms (signals, governance, creative-only) can omit them, but a\n // sales platform that omits them will emit a broken get_adcp_capabilities\n // response that buyers cannot interpret.\n const claimedSales = claimed.filter(isSalesSpecialism);\n if (claimedSales.length > 0) {\n if (platform.capabilities?.channels == null) {\n errors.push(`capabilities.channels is required for media-buy platforms (claimed: ${claimedSales.join(', ')})`);\n }\n if (platform.capabilities?.pricingModels == null) {\n errors.push(\n `capabilities.pricingModels is required for media-buy platforms (claimed: ${claimedSales.join(', ')})`\n );\n }\n }\n\n if (errors.length > 0)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IAAI,oBAAoB;AAAA,MAAyD,OAAO,KAAK,QAAQ,CAAC,EAAE;AAAA,EAChH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/lib/server/decisioning/runtime/validate-platform.ts"],"sourcesContent":["/**\n * Runtime validation that a `DecisioningPlatform` impl matches its\n * `capabilities.specialisms[]` declaration.\n *\n * Compile-time, `RequiredPlatformsFor<S>` enforces this in TypeScript adopter\n * code. Untyped JS callers, downstream packages with relaxed `tsconfig`, and\n * Python-port adopters running this through bindings need a runtime gate.\n *\n * Mirrors the v1.0 specialism × interface mapping in\n * `src/lib/server/decisioning/platform.ts`.\n *\n * @public\n */\n\nimport type { DecisioningPlatform } from '../platform';\nimport type { AdCPSpecialism } from '../../../types/tools.generated';\n\n// Sales specialisms require channels + pricingModels on capabilities because\n// buyers read those fields from get_adcp_capabilities to know what the seller\n// trades in. Signals/governance/creative-only platforms legitimately omit them\n// (hence the fields are optional on DecisioningCapabilities), but a media-buy\n// platform serving an empty or absent channels list is a mis-configured agent.\n// Derived from the `sales-` prefix on `AdCPSpecialism` rather than a hand-\n// maintained allowlist: when preview specialisms (`sales-streaming-tv`,\n// `sales-exchange`, `sales-retail-media`) graduate into the generated enum,\n// they automatically inherit the channels + pricingModels gate. A hand-list\n// would silently let mis-configured streaming/exchange platforms through.\nfunction isSalesSpecialism(s: AdCPSpecialism): boolean {\n return s.startsWith('sales-');\n}\n\nconst COMPACT_CORE_METHODS = [\n 'listProducts',\n 'buyProducts',\n 'controlMediaBuy',\n 'getMediaBuys',\n 'getMediaBuyDelivery',\n] as const;\nconst COMPACT_PROPOSAL_METHODS = [\n 'proposalRefinement',\n 'listProducts',\n 'requestProposals',\n 'refineProposals',\n 'declineProposals',\n 'acceptProposal',\n 'getMediaBuys',\n 'getMediaBuyDelivery',\n] as const;\n\nconst SPECIALISM_REQUIREMENTS: Partial<Record<AdCPSpecialism, ReadonlyArray<keyof DecisioningPlatform>>> = {\n // All sales-* specialisms share the SalesPlatform interface. Adopters\n // implement `sales` once; the specialism enum picks which buyer-side\n // storyboard the agent is validated against. Wired here per the AdCP 3.0\n // GA enum; preview specialisms (sales-streaming-tv, sales-exchange,\n // sales-retail-media) get added when they land in `AdCPSpecialism`.\n 'sales-non-guaranteed': [],\n 'sales-guaranteed': [],\n 'sales-broadcast-tv': [],\n 'sales-social': ['sales'],\n 'sales-catalog-driven': ['sales'],\n 'sales-proposal-mode': [],\n // Creative specialisms share the CreativeXxxPlatform field name; adopters\n // pick the right archetype (template / generative / ad-server) at\n // construction time.\n 'creative-template': ['creative'],\n 'creative-generative': ['creative'],\n 'creative-ad-server': ['creative'],\n 'creative-transformers': ['creative'],\n // Audience sync is a single specialism with a single platform interface.\n 'audience-sync': ['audiences'],\n // Signal specialisms — both share the SignalsPlatform interface.\n // Marketplace = third-party data brokers; owned = first-party providers.\n 'signal-marketplace': ['signals'],\n 'signal-owned': ['signals'],\n // Sponsored Intelligence — brand-side conversational sponsored\n // experiences.\n 'sponsored-intelligence': ['sponsoredIntelligence'],\n // Campaign governance — today's two specialisms share one platform\n // interface; consolidates to `campaign-governance` when adcp#3329 lands.\n 'governance-spend-authority': ['campaignGovernance'],\n 'governance-delivery-monitor': ['campaignGovernance'],\n // Property + collection list publishing.\n 'property-lists': ['propertyLists'],\n 'collection-lists': ['collectionLists'],\n // Content standards — brand-safety / policy compliance enforcement.\n 'content-standards': ['contentStandards'],\n // Brand-rights — identity discovery + licensing for branded inventory.\n // 4 wire tools wire through `brandRights` (`get_brand_identity`,\n // `get_rights`, `acquire_rights`, `update_rights`). `creative_approval`\n // is webhook-only (`reviewCreativeApproval` on the platform interface)\n // and not in `AdcpToolMap`.\n 'brand-rights': ['brandRights'],\n};\n\nexport class PlatformConfigError extends Error {\n readonly name = 'PlatformConfigError' as const;\n constructor(message: string) {\n super(message);\n }\n}\n\n// Note on HITL tools: the v6 unified shape collapses sync/HITL into a\n// single method per tool whose return type is `Success | TaskHandoff<Success>`.\n// Adopters branch in the body and call `ctx.handoffToTask(fn)` to defer\n// to a background task. The framework detects the handoff marker at the\n// dispatch seam — there's no exactly-one validation needed because the\n// shape is the same regardless of which path the adopter takes.\n//\n// This applies to `create_media_buy` and `sync_creatives` today (the 2\n// spec-listed tools whose per-tool response oneOf includes the Submitted\n// arm). When adcontextprotocol/adcp#3392 lands, the same shape extends\n// to `update_media_buy`, `build_creative`, `sync_catalogs`, `get_products`.\n\nexport function validatePlatform(\n platform: DecisioningPlatform,\n effectiveFields: Partial<Record<keyof DecisioningPlatform, unknown>> = {}\n): void {\n const claimed = platform.capabilities?.specialisms ?? [];\n const errors: string[] = [];\n\n for (const specialism of claimed) {\n const acceptsCompactLifecycle =\n specialism === 'sales-non-guaranteed' ||\n specialism === 'sales-guaranteed' ||\n specialism === 'sales-broadcast-tv' ||\n specialism === 'sales-proposal-mode';\n if (acceptsCompactLifecycle && platform.sales == null && platform.mediaBuyLifecycle == null) {\n errors.push(`${specialism} requires platform.sales or platform.mediaBuyLifecycle`);\n }\n if (acceptsCompactLifecycle && platform.sales == null && platform.mediaBuyLifecycle != null) {\n const required = specialism === 'sales-proposal-mode' ? COMPACT_PROPOSAL_METHODS : COMPACT_CORE_METHODS;\n for (const method of required) {\n if (platform.mediaBuyLifecycle[method] == null) {\n errors.push(`${specialism} requires platform.mediaBuyLifecycle.${method}`);\n }\n }\n }\n }\n\n // 1. Specialism declarations match required interfaces.\n for (const specialism of claimed) {\n const required = SPECIALISM_REQUIREMENTS[specialism];\n if (!required) continue; // forward-compat for unknown specialisms\n for (const field of required) {\n if (platform[field] == null && effectiveFields[field] == null) {\n errors.push(`capabilities.specialisms claims '${specialism}'; platform.${String(field)} is missing`);\n }\n }\n }\n\n // 2. Media-buy platforms require channels + pricingModels on capabilities.\n // These fields are optional on DecisioningCapabilities so non-media-buy\n // platforms (signals, governance, creative-only) can omit them, but a\n // sales platform that omits them will emit a broken get_adcp_capabilities\n // response that buyers cannot interpret.\n const claimedSales = claimed.filter(isSalesSpecialism);\n if (claimedSales.length > 0) {\n if (platform.capabilities?.channels == null) {\n errors.push(`capabilities.channels is required for media-buy platforms (claimed: ${claimedSales.join(', ')})`);\n }\n if (platform.capabilities?.pricingModels == null) {\n errors.push(\n `capabilities.pricingModels is required for media-buy platforms (claimed: ${claimedSales.join(', ')})`\n );\n }\n }\n\n if (errors.length > 0) {\n throw new PlatformConfigError(`DecisioningPlatform configuration is incomplete:\\n - ${errors.join('\\n - ')}`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BA,SAAS,kBAAkB,GAA4B;AACrD,SAAO,EAAE,WAAW,QAAQ;AAC9B;AAEA,MAAM,uBAAuB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACA,MAAM,2BAA2B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,0BAAqG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzG,wBAAwB,CAAC;AAAA,EACzB,oBAAoB,CAAC;AAAA,EACrB,sBAAsB,CAAC;AAAA,EACvB,gBAAgB,CAAC,OAAO;AAAA,EACxB,wBAAwB,CAAC,OAAO;AAAA,EAChC,uBAAuB,CAAC;AAAA;AAAA;AAAA;AAAA,EAIxB,qBAAqB,CAAC,UAAU;AAAA,EAChC,uBAAuB,CAAC,UAAU;AAAA,EAClC,sBAAsB,CAAC,UAAU;AAAA,EACjC,yBAAyB,CAAC,UAAU;AAAA;AAAA,EAEpC,iBAAiB,CAAC,WAAW;AAAA;AAAA;AAAA,EAG7B,sBAAsB,CAAC,SAAS;AAAA,EAChC,gBAAgB,CAAC,SAAS;AAAA;AAAA;AAAA,EAG1B,0BAA0B,CAAC,uBAAuB;AAAA;AAAA;AAAA,EAGlD,8BAA8B,CAAC,oBAAoB;AAAA,EACnD,+BAA+B,CAAC,oBAAoB;AAAA;AAAA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AAC3C,aAAO,KAAK,uEAAuE,aAAa,KAAK,IAAI,CAAC,GAAG;AAAA,IAC/G;AACA,QAAI,SAAS,cAAc,iBAAiB,MAAM;AAChD,aAAO;AAAA,QACL,4EAA4E,aAAa,KAAK,IAAI,CAAC;AAAA,MACrG;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO,SAAS,GAAG;AACrB,UAAM,IAAI,oBAAoB;AAAA,MAAyD,OAAO,KAAK,QAAQ,CAAC,EAAE;AAAA,EAChH;AACF;","names":[]}
@@ -68,7 +68,7 @@ class PlatformConfigError extends Error {
68
68
  super(message);
69
69
  }
70
70
  }
71
- function validatePlatform(platform) {
71
+ function validatePlatform(platform, effectiveFields = {}) {
72
72
  const claimed = platform.capabilities?.specialisms ?? [];
73
73
  const errors = [];
74
74
  for (const specialism of claimed) {
@@ -89,7 +89,7 @@ function validatePlatform(platform) {
89
89
  const required = SPECIALISM_REQUIREMENTS[specialism];
90
90
  if (!required) continue;
91
91
  for (const field of required) {
92
- if (platform[field] == null) {
92
+ if (platform[field] == null && effectiveFields[field] == null) {
93
93
  errors.push(`capabilities.specialisms claims '${specialism}'; platform.${String(field)} is missing`);
94
94
  }
95
95
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/lib/server/decisioning/runtime/validate-platform.ts"],"sourcesContent":["/**\n * Runtime validation that a `DecisioningPlatform` impl matches its\n * `capabilities.specialisms[]` declaration.\n *\n * Compile-time, `RequiredPlatformsFor<S>` enforces this in TypeScript adopter\n * code. Untyped JS callers, downstream packages with relaxed `tsconfig`, and\n * Python-port adopters running this through bindings need a runtime gate.\n *\n * Mirrors the v1.0 specialism × interface mapping in\n * `src/lib/server/decisioning/platform.ts`.\n *\n * @public\n */\n\nimport type { DecisioningPlatform } from '../platform';\nimport type { AdCPSpecialism } from '../../../types/tools.generated';\n\n// Sales specialisms require channels + pricingModels on capabilities because\n// buyers read those fields from get_adcp_capabilities to know what the seller\n// trades in. Signals/governance/creative-only platforms legitimately omit them\n// (hence the fields are optional on DecisioningCapabilities), but a media-buy\n// platform serving an empty or absent channels list is a mis-configured agent.\n// Derived from the `sales-` prefix on `AdCPSpecialism` rather than a hand-\n// maintained allowlist: when preview specialisms (`sales-streaming-tv`,\n// `sales-exchange`, `sales-retail-media`) graduate into the generated enum,\n// they automatically inherit the channels + pricingModels gate. A hand-list\n// would silently let mis-configured streaming/exchange platforms through.\nfunction isSalesSpecialism(s: AdCPSpecialism): boolean {\n return s.startsWith('sales-');\n}\n\nconst COMPACT_CORE_METHODS = [\n 'listProducts',\n 'buyProducts',\n 'controlMediaBuy',\n 'getMediaBuys',\n 'getMediaBuyDelivery',\n] as const;\nconst COMPACT_PROPOSAL_METHODS = [\n 'proposalRefinement',\n 'listProducts',\n 'requestProposals',\n 'refineProposals',\n 'declineProposals',\n 'acceptProposal',\n 'getMediaBuys',\n 'getMediaBuyDelivery',\n] as const;\n\nconst SPECIALISM_REQUIREMENTS: Partial<Record<AdCPSpecialism, ReadonlyArray<keyof DecisioningPlatform>>> = {\n // All sales-* specialisms share the SalesPlatform interface. Adopters\n // implement `sales` once; the specialism enum picks which buyer-side\n // storyboard the agent is validated against. Wired here per the AdCP 3.0\n // GA enum; preview specialisms (sales-streaming-tv, sales-exchange,\n // sales-retail-media) get added when they land in `AdCPSpecialism`.\n 'sales-non-guaranteed': [],\n 'sales-guaranteed': [],\n 'sales-broadcast-tv': [],\n 'sales-social': ['sales'],\n 'sales-catalog-driven': ['sales'],\n 'sales-proposal-mode': [],\n // Creative specialisms share the CreativeXxxPlatform field name; adopters\n // pick the right archetype (template / generative / ad-server) at\n // construction time.\n 'creative-template': ['creative'],\n 'creative-generative': ['creative'],\n 'creative-ad-server': ['creative'],\n 'creative-transformers': ['creative'],\n // Audience sync is a single specialism with a single platform interface.\n 'audience-sync': ['audiences'],\n // Signal specialisms — both share the SignalsPlatform interface.\n // Marketplace = third-party data brokers; owned = first-party providers.\n 'signal-marketplace': ['signals'],\n 'signal-owned': ['signals'],\n // Sponsored Intelligence — brand-side conversational sponsored\n // experiences.\n 'sponsored-intelligence': ['sponsoredIntelligence'],\n // Campaign governance — today's two specialisms share one platform\n // interface; consolidates to `campaign-governance` when adcp#3329 lands.\n 'governance-spend-authority': ['campaignGovernance'],\n 'governance-delivery-monitor': ['campaignGovernance'],\n // Property + collection list publishing.\n 'property-lists': ['propertyLists'],\n 'collection-lists': ['collectionLists'],\n // Content standards — brand-safety / policy compliance enforcement.\n 'content-standards': ['contentStandards'],\n // Brand-rights — identity discovery + licensing for branded inventory.\n // 4 wire tools wire through `brandRights` (`get_brand_identity`,\n // `get_rights`, `acquire_rights`, `update_rights`). `creative_approval`\n // is webhook-only (`reviewCreativeApproval` on the platform interface)\n // and not in `AdcpToolMap`.\n 'brand-rights': ['brandRights'],\n};\n\nexport class PlatformConfigError extends Error {\n readonly name = 'PlatformConfigError' as const;\n constructor(message: string) {\n super(message);\n }\n}\n\n// Note on HITL tools: the v6 unified shape collapses sync/HITL into a\n// single method per tool whose return type is `Success | TaskHandoff<Success>`.\n// Adopters branch in the body and call `ctx.handoffToTask(fn)` to defer\n// to a background task. The framework detects the handoff marker at the\n// dispatch seam — there's no exactly-one validation needed because the\n// shape is the same regardless of which path the adopter takes.\n//\n// This applies to `create_media_buy` and `sync_creatives` today (the 2\n// spec-listed tools whose per-tool response oneOf includes the Submitted\n// arm). When adcontextprotocol/adcp#3392 lands, the same shape extends\n// to `update_media_buy`, `build_creative`, `sync_catalogs`, `get_products`.\n\nexport function validatePlatform(platform: DecisioningPlatform): void {\n const claimed = platform.capabilities?.specialisms ?? [];\n const errors: string[] = [];\n\n for (const specialism of claimed) {\n const acceptsCompactLifecycle =\n specialism === 'sales-non-guaranteed' ||\n specialism === 'sales-guaranteed' ||\n specialism === 'sales-broadcast-tv' ||\n specialism === 'sales-proposal-mode';\n if (acceptsCompactLifecycle && platform.sales == null && platform.mediaBuyLifecycle == null) {\n errors.push(`${specialism} requires platform.sales or platform.mediaBuyLifecycle`);\n }\n if (acceptsCompactLifecycle && platform.sales == null && platform.mediaBuyLifecycle != null) {\n const required = specialism === 'sales-proposal-mode' ? COMPACT_PROPOSAL_METHODS : COMPACT_CORE_METHODS;\n for (const method of required) {\n if (platform.mediaBuyLifecycle[method] == null) {\n errors.push(`${specialism} requires platform.mediaBuyLifecycle.${method}`);\n }\n }\n }\n }\n\n // 1. Specialism declarations match required interfaces.\n for (const specialism of claimed) {\n const required = SPECIALISM_REQUIREMENTS[specialism];\n if (!required) continue; // forward-compat for unknown specialisms\n for (const field of required) {\n if (platform[field] == null) {\n errors.push(`capabilities.specialisms claims '${specialism}'; platform.${String(field)} is missing`);\n }\n }\n }\n\n // 2. Media-buy platforms require channels + pricingModels on capabilities.\n // These fields are optional on DecisioningCapabilities so non-media-buy\n // platforms (signals, governance, creative-only) can omit them, but a\n // sales platform that omits them will emit a broken get_adcp_capabilities\n // response that buyers cannot interpret.\n const claimedSales = claimed.filter(isSalesSpecialism);\n if (claimedSales.length > 0) {\n if (platform.capabilities?.channels == null) {\n errors.push(`capabilities.channels is required for media-buy platforms (claimed: ${claimedSales.join(', ')})`);\n }\n if (platform.capabilities?.pricingModels == null) {\n errors.push(\n `capabilities.pricingModels is required for media-buy platforms (claimed: ${claimedSales.join(', ')})`\n );\n }\n }\n\n if (errors.length > 0) {\n throw new PlatformConfigError(`DecisioningPlatform configuration is incomplete:\\n - ${errors.join('\\n - ')}`);\n }\n}\n"],"mappings":"AA2BA,SAAS,kBAAkB,GAA4B;AACrD,SAAO,EAAE,WAAW,QAAQ;AAC9B;AAEA,MAAM,uBAAuB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACA,MAAM,2BAA2B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,0BAAqG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzG,wBAAwB,CAAC;AAAA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AAW,UAAU,UAAU;AAC7B,YAAI,SAAS,kBAAkB,MAAM,KAAK,MAAM;AAC9C,iBAAO,KAAK,GAAG,UAAU,wCAAwC,MAAM,EAAE;AAAA,QAC3E;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAGA,aAAW,cAAc,SAAS;AAChC,UAAM,WAAW,wBAAwB,UAAU;AACnD,QAAI,CAAC,SAAU;AACf,eAAW,SAAS,UAAU;AAC5B,UAAI,SAAS,KAAK,KAAK,MAAM;AAC3B,eAAO,KAAK,oCAAoC,UAAU,eAAe,OAAO,KAAK,CAAC,aAAa;AAAA,MACrG;AAAA,IACF;AAAA,EACF;AAOA,QAAM,eAAe,QAAQ,OAAO,iBAAiB;AACrD,MAAI,aAAa,SAAS,GAAG;AAC3B,QAAI,SAAS,cAAc,YAAY,MAAM;AAC3C,aAAO,KAAK,uEAAuE,aAAa,KAAK,IAAI,CAAC,GAAG;AAAA,IAC/G;AACA,QAAI,SAAS,cAAc,iBAAiB,MAAM;AAChD,aAAO;AAAA,QACL,4EAA4E,aAAa,KAAK,IAAI,CAAC;AAAA,MACrG;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO,SAAS,GAAG;AACrB,UAAM,IAAI,oBAAoB;AAAA,MAAyD,OAAO,KAAK,QAAQ,CAAC,EAAE;AAAA,EAChH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/lib/server/decisioning/runtime/validate-platform.ts"],"sourcesContent":["/**\n * Runtime validation that a `DecisioningPlatform` impl matches its\n * `capabilities.specialisms[]` declaration.\n *\n * Compile-time, `RequiredPlatformsFor<S>` enforces this in TypeScript adopter\n * code. Untyped JS callers, downstream packages with relaxed `tsconfig`, and\n * Python-port adopters running this through bindings need a runtime gate.\n *\n * Mirrors the v1.0 specialism × interface mapping in\n * `src/lib/server/decisioning/platform.ts`.\n *\n * @public\n */\n\nimport type { DecisioningPlatform } from '../platform';\nimport type { AdCPSpecialism } from '../../../types/tools.generated';\n\n// Sales specialisms require channels + pricingModels on capabilities because\n// buyers read those fields from get_adcp_capabilities to know what the seller\n// trades in. Signals/governance/creative-only platforms legitimately omit them\n// (hence the fields are optional on DecisioningCapabilities), but a media-buy\n// platform serving an empty or absent channels list is a mis-configured agent.\n// Derived from the `sales-` prefix on `AdCPSpecialism` rather than a hand-\n// maintained allowlist: when preview specialisms (`sales-streaming-tv`,\n// `sales-exchange`, `sales-retail-media`) graduate into the generated enum,\n// they automatically inherit the channels + pricingModels gate. A hand-list\n// would silently let mis-configured streaming/exchange platforms through.\nfunction isSalesSpecialism(s: AdCPSpecialism): boolean {\n return s.startsWith('sales-');\n}\n\nconst COMPACT_CORE_METHODS = [\n 'listProducts',\n 'buyProducts',\n 'controlMediaBuy',\n 'getMediaBuys',\n 'getMediaBuyDelivery',\n] as const;\nconst COMPACT_PROPOSAL_METHODS = [\n 'proposalRefinement',\n 'listProducts',\n 'requestProposals',\n 'refineProposals',\n 'declineProposals',\n 'acceptProposal',\n 'getMediaBuys',\n 'getMediaBuyDelivery',\n] as const;\n\nconst SPECIALISM_REQUIREMENTS: Partial<Record<AdCPSpecialism, ReadonlyArray<keyof DecisioningPlatform>>> = {\n // All sales-* specialisms share the SalesPlatform interface. Adopters\n // implement `sales` once; the specialism enum picks which buyer-side\n // storyboard the agent is validated against. Wired here per the AdCP 3.0\n // GA enum; preview specialisms (sales-streaming-tv, sales-exchange,\n // sales-retail-media) get added when they land in `AdCPSpecialism`.\n 'sales-non-guaranteed': [],\n 'sales-guaranteed': [],\n 'sales-broadcast-tv': [],\n 'sales-social': ['sales'],\n 'sales-catalog-driven': ['sales'],\n 'sales-proposal-mode': [],\n // Creative specialisms share the CreativeXxxPlatform field name; adopters\n // pick the right archetype (template / generative / ad-server) at\n // construction time.\n 'creative-template': ['creative'],\n 'creative-generative': ['creative'],\n 'creative-ad-server': ['creative'],\n 'creative-transformers': ['creative'],\n // Audience sync is a single specialism with a single platform interface.\n 'audience-sync': ['audiences'],\n // Signal specialisms — both share the SignalsPlatform interface.\n // Marketplace = third-party data brokers; owned = first-party providers.\n 'signal-marketplace': ['signals'],\n 'signal-owned': ['signals'],\n // Sponsored Intelligence — brand-side conversational sponsored\n // experiences.\n 'sponsored-intelligence': ['sponsoredIntelligence'],\n // Campaign governance — today's two specialisms share one platform\n // interface; consolidates to `campaign-governance` when adcp#3329 lands.\n 'governance-spend-authority': ['campaignGovernance'],\n 'governance-delivery-monitor': ['campaignGovernance'],\n // Property + collection list publishing.\n 'property-lists': ['propertyLists'],\n 'collection-lists': ['collectionLists'],\n // Content standards — brand-safety / policy compliance enforcement.\n 'content-standards': ['contentStandards'],\n // Brand-rights — identity discovery + licensing for branded inventory.\n // 4 wire tools wire through `brandRights` (`get_brand_identity`,\n // `get_rights`, `acquire_rights`, `update_rights`). `creative_approval`\n // is webhook-only (`reviewCreativeApproval` on the platform interface)\n // and not in `AdcpToolMap`.\n 'brand-rights': ['brandRights'],\n};\n\nexport class PlatformConfigError extends Error {\n readonly name = 'PlatformConfigError' as const;\n constructor(message: string) {\n super(message);\n }\n}\n\n// Note on HITL tools: the v6 unified shape collapses sync/HITL into a\n// single method per tool whose return type is `Success | TaskHandoff<Success>`.\n// Adopters branch in the body and call `ctx.handoffToTask(fn)` to defer\n// to a background task. The framework detects the handoff marker at the\n// dispatch seam — there's no exactly-one validation needed because the\n// shape is the same regardless of which path the adopter takes.\n//\n// This applies to `create_media_buy` and `sync_creatives` today (the 2\n// spec-listed tools whose per-tool response oneOf includes the Submitted\n// arm). When adcontextprotocol/adcp#3392 lands, the same shape extends\n// to `update_media_buy`, `build_creative`, `sync_catalogs`, `get_products`.\n\nexport function validatePlatform(\n platform: DecisioningPlatform,\n effectiveFields: Partial<Record<keyof DecisioningPlatform, unknown>> = {}\n): void {\n const claimed = platform.capabilities?.specialisms ?? [];\n const errors: string[] = [];\n\n for (const specialism of claimed) {\n const acceptsCompactLifecycle =\n specialism === 'sales-non-guaranteed' ||\n specialism === 'sales-guaranteed' ||\n specialism === 'sales-broadcast-tv' ||\n specialism === 'sales-proposal-mode';\n if (acceptsCompactLifecycle && platform.sales == null && platform.mediaBuyLifecycle == null) {\n errors.push(`${specialism} requires platform.sales or platform.mediaBuyLifecycle`);\n }\n if (acceptsCompactLifecycle && platform.sales == null && platform.mediaBuyLifecycle != null) {\n const required = specialism === 'sales-proposal-mode' ? COMPACT_PROPOSAL_METHODS : COMPACT_CORE_METHODS;\n for (const method of required) {\n if (platform.mediaBuyLifecycle[method] == null) {\n errors.push(`${specialism} requires platform.mediaBuyLifecycle.${method}`);\n }\n }\n }\n }\n\n // 1. Specialism declarations match required interfaces.\n for (const specialism of claimed) {\n const required = SPECIALISM_REQUIREMENTS[specialism];\n if (!required) continue; // forward-compat for unknown specialisms\n for (const field of required) {\n if (platform[field] == null && effectiveFields[field] == null) {\n errors.push(`capabilities.specialisms claims '${specialism}'; platform.${String(field)} is missing`);\n }\n }\n }\n\n // 2. Media-buy platforms require channels + pricingModels on capabilities.\n // These fields are optional on DecisioningCapabilities so non-media-buy\n // platforms (signals, governance, creative-only) can omit them, but a\n // sales platform that omits them will emit a broken get_adcp_capabilities\n // response that buyers cannot interpret.\n const claimedSales = claimed.filter(isSalesSpecialism);\n if (claimedSales.length > 0) {\n if (platform.capabilities?.channels == null) {\n errors.push(`capabilities.channels is required for media-buy platforms (claimed: ${claimedSales.join(', ')})`);\n }\n if (platform.capabilities?.pricingModels == null) {\n errors.push(\n `capabilities.pricingModels is required for media-buy platforms (claimed: ${claimedSales.join(', ')})`\n );\n }\n }\n\n if (errors.length > 0) {\n throw new PlatformConfigError(`DecisioningPlatform configuration is incomplete:\\n - ${errors.join('\\n - ')}`);\n }\n}\n"],"mappings":"AA2BA,SAAS,kBAAkB,GAA4B;AACrD,SAAO,EAAE,WAAW,QAAQ;AAC9B;AAEA,MAAM,uBAAuB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACA,MAAM,2BAA2B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;A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,aAAO,KAAK,GAAG,UAAU,wDAAwD;AAAA,IACnF;AACA,QAAI,2BAA2B,SAAS,SAAS,QAAQ,SAAS,qBAAqB,MAAM;AAC3F,YAAM,WAAW,eAAe,wBAAwB,2BAA2B;AACnF,iBAAW,UAAU,UAAU;AAC7B,YAAI,SAAS,kBAAkB,MAAM,KAAK,MAAM;AAC9C,iBAAO,KAAK,GAAG,UAAU,wCAAwC,MAAM,EAAE;AAAA,QAC3E;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAGA,aAAW,cAAc,SAAS;AAChC,UAAM,WAAW,wBAAwB,UAAU;AACnD,QAAI,CAAC,SAAU;AACf,eAAW,SAAS,UAAU;AAC5B,UAAI,SAAS,KAAK,KAAK,QAAQ,gBAAgB,KAAK,KAAK,MAAM;AAC7D,eAAO,KAAK,oCAAoC,UAAU,eAAe,OAAO,KAAK,CAAC,aAAa;AAAA,MACrG;AAAA,IACF;AAAA,EACF;AAOA,QAAM,eAAe,QAAQ,OAAO,iBAAiB;AACrD,MAAI,aAAa,SAAS,GAAG;AAC3B,QAAI,SAAS,cAAc,YAAY,MAAM;AAC3C,aAAO,KAAK,uEAAuE,aAAa,KAAK,IAAI,CAAC,GAAG;AAAA,IAC/G;AACA,QAAI,SAAS,cAAc,iBAAiB,MAAM;AAChD,aAAO;AAAA,QACL,4EAA4E,aAAa,KAAK,IAAI,CAAC;AAAA,MACrG;AAAA,IACF;AAAA,EACF;AAEA,MAAI,OAAO,SAAS,GAAG;AACrB,UAAM,IAAI,oBAAoB;AAAA,MAAyD,OAAO,KAAK,QAAQ,CAAC,EAAE;AAAA,EAChH;AACF;","names":[]}
@@ -67,6 +67,8 @@ import type { GetProductsResponse, CreateMediaBuyError, CreateMediaBuySuccess, U
67
67
  import type { ProposalRefinementCapabilities } from '../../../negotiation/types.mjs';
68
68
  import type { AdcpToolMap } from '../../create-adcp-server.mjs';
69
69
  import type { CanonicalSyncCreativeAsset, CanonicalCreateMediaBuyRequest, CanonicalCreativeResponse, CanonicalGetProductsRequest, CanonicalListCreativesRequest, CanonicalListCreativesResponse, CanonicalProduct, CanonicalUpdateMediaBuyRequest } from '../../../v2/projection/creative-delivery.mjs';
70
+ import type { ProjectionCatalogSnapshot } from '../../../v2/projection/catalog-snapshot.mjs';
71
+ import type { V1ProductInput } from '../../../v2/projection/types.mjs';
70
72
  type SyncCreative = CanonicalSyncCreativeAsset;
71
73
  type Ctx<TCtxMeta> = RequestContext<Account<TCtxMeta>>;
72
74
  type ExclusivePayload<TLeft, TRight> = (TLeft & {
@@ -77,8 +79,12 @@ type ExclusivePayload<TLeft, TRight> = (TLeft & {
77
79
  type LegacyMediaBuyStatusInput<T> = T & {
78
80
  status?: MediaBuyStatus;
79
81
  };
82
+ export type GetProductsProjectionInput = (CanonicalProduct | V1ProductInput) & {
83
+ /** Exact owner-scoped aliases used only while projecting this product; never emitted on the wire. */
84
+ projectionCatalogs?: readonly ProjectionCatalogSnapshot[];
85
+ };
80
86
  type CanonicalGetProductsPayload = Omit<ServerPayload<CanonicalCreativeResponse<GetProductsResponse>>, 'products'> & {
81
- products?: CanonicalProduct[];
87
+ products?: GetProductsProjectionInput[];
82
88
  };
83
89
  export type GetProductsPayload = RequireCacheScopeWhenProducts<CanonicalGetProductsPayload>;
84
90
  type CreateMediaBuySuccessPayload = LegacyMediaBuyStatusInput<ServerPayload<CanonicalCreativeResponse<CreateMediaBuySuccess>>>;
@@ -67,6 +67,8 @@ import type { GetProductsResponse, CreateMediaBuyError, CreateMediaBuySuccess, U
67
67
  import type { ProposalRefinementCapabilities } from '../../../negotiation/types';
68
68
  import type { AdcpToolMap } from '../../create-adcp-server';
69
69
  import type { CanonicalSyncCreativeAsset, CanonicalCreateMediaBuyRequest, CanonicalCreativeResponse, CanonicalGetProductsRequest, CanonicalListCreativesRequest, CanonicalListCreativesResponse, CanonicalProduct, CanonicalUpdateMediaBuyRequest } from '../../../v2/projection/creative-delivery';
70
+ import type { ProjectionCatalogSnapshot } from '../../../v2/projection/catalog-snapshot';
71
+ import type { V1ProductInput } from '../../../v2/projection/types';
70
72
  type SyncCreative = CanonicalSyncCreativeAsset;
71
73
  type Ctx<TCtxMeta> = RequestContext<Account<TCtxMeta>>;
72
74
  type ExclusivePayload<TLeft, TRight> = (TLeft & {
@@ -77,8 +79,12 @@ type ExclusivePayload<TLeft, TRight> = (TLeft & {
77
79
  type LegacyMediaBuyStatusInput<T> = T & {
78
80
  status?: MediaBuyStatus;
79
81
  };
82
+ export type GetProductsProjectionInput = (CanonicalProduct | V1ProductInput) & {
83
+ /** Exact owner-scoped aliases used only while projecting this product; never emitted on the wire. */
84
+ projectionCatalogs?: readonly ProjectionCatalogSnapshot[];
85
+ };
80
86
  type CanonicalGetProductsPayload = Omit<ServerPayload<CanonicalCreativeResponse<GetProductsResponse>>, 'products'> & {
81
- products?: CanonicalProduct[];
87
+ products?: GetProductsProjectionInput[];
82
88
  };
83
89
  export type GetProductsPayload = RequireCacheScopeWhenProducts<CanonicalGetProductsPayload>;
84
90
  type CreateMediaBuySuccessPayload = LegacyMediaBuyStatusInput<ServerPayload<CanonicalCreativeResponse<CreateMediaBuySuccess>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"sales.d.ts","sourceRoot":"","sources":["../../../../../src/lib/server/decisioning/specialisms/sales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,6BAA6B,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,KAAK,EAEV,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACn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CAAC"}
1
+ {"version":3,"file":"sales.d.ts","sourceRoot":"","sources":["../../../../../src/lib/server/decisioning/specialisms/sales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,6BAA6B,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,KAAK,EAEV,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,iCAAiC,EACjC,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAE3B,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EACV,0BAA0B,EAC1B,8BAA8B,EAC9B,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,gBAAgB,EAChB,8BAA8B,EAC/B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,KAAK,YAAY,GAAG,0BAA0B,CAAC;AAC/C,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,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAO1F,QAAQ,CAAC,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAM9E,gBAAgB,CAAC,CAAC,GAAG,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACvG;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,QAAQ,CAC1E,IAAI,CACF,aAAa,CAAC,QAAQ,CAAC,EACvB,aAAa,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,qBAAqB,GAAG,cAAc,CAC7F,CACF,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,sBAAsB,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,IAAI,CAC3E,aAAa,CAAC,QAAQ,CAAC,EACrB,eAAe,GACf,cAAc,GACd,kBAAkB,GAClB,UAAU,GACV,2BAA2B,GAC3B,eAAe,GACf,4BAA4B,CAC/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/lib/server/decisioning/specialisms/sales.ts"],"sourcesContent":["/**\n * SalesPlatform — sales specialism platform interface.\n *\n * **Unified hybrid shape.** `get_products`, `create_media_buy`, and `sync_creatives` use a\n * single method each. The method returns the wire success arm (sync fast\n * path) OR `ctx.handoffToTask(fn)` to promote the call to a background\n * task (HITL slow path). Branch per-call — the same method handles\n * programmatic remnant, guaranteed inventory, curated discovery, and hybrid\n * sellers. Every other tool is sync-only:\n *\n * - `get_products` — sync OR `ctx.handoffToTask(...)` for curated brief/refine flows.\n * - `create_media_buy` — sync OR `ctx.handoffToTask(...)`.\n * - `update_media_buy` — sync only. Re-approval flows that need HITL run\n * out-of-band; `publishStatusChange` carries the result.\n * - `sync_creatives` — sync OR `ctx.handoffToTask(...)`.\n * - `get_media_buy_delivery` — sync only.\n *\n * Sync-only tools that need long-running semantics use `publishStatusChange`\n * (see `status-changes.ts`) — that's the spec-aligned channel for tools\n * whose wire response unions don't define a Submitted arm.\n *\n * Each method either returns the value or throws `AdcpError` for structured\n * rejection. Generic thrown errors map to `SERVICE_UNAVAILABLE`.\n *\n * **Method groups** — implement the group(s) matching your specialism:\n *\n * | Group | Methods | Claim when |\n * |---|---|---|\n * | Core sales (required) | `getProducts`, `updateMediaBuy`, `getMediaBuyDelivery` | Any `sales-*` specialism |\n * | Core sales (unified hybrid) | `createMediaBuy` | Any `sales-*` specialism |\n * | Core sales (unified hybrid) | `syncCreatives` | Any `sales-*` specialism |\n * | Read / feedback | `getMediaBuys`, `providePerformanceFeedback`, `listCreativeFormats`, `listCreatives` | Most sellers; optional |\n * | Retail-media extensions | `syncCatalogs`, `logEvent`, `syncEventSources` | `sales-catalog-driven`, `sales-retail-media` |\n *\n * New adopters implementing a non-retail seller (GAM, FreeWheel, a social\n * platform) only need the three core-required methods plus `createMediaBuy`\n * and `syncCreatives`. The retail-media extension methods (`syncCatalogs`,\n * `logEvent`, `syncEventSources`) are unnecessary unless you claim\n * `sales-catalog-driven` or `sales-retail-media`.\n *\n * **No-account tools (`providePerformanceFeedback`, `listCreativeFormats`):**\n * the wire requests for these two tools don't carry an `account` field, so\n * `ctx.account` may be `undefined` when `accounts.resolution === 'explicit'`.\n * Three safe patterns:\n *\n * 1. **`'derived'` resolution** — `accounts.resolve(undefined)` returns a\n * singleton; `ctx.account` is always set. Best for single-tenant\n * deployers.\n * 2. **Don't implement the method** — the framework returns\n * `UNSUPPORTED_FEATURE`; buyers using the merge-seam custom handler or\n * external creative agents still receive a response.\n * 3. **Explicit-mode with defensive read** — cast `ctx.account as Account |\n * undefined` and derive the account from the request body (e.g., via a\n * `media_buy_id` lookup), or throw `AdcpError('ACCOUNT_NOT_FOUND')`.\n * Full `resolveAccount(undefined, { authInfo, toolName })` support for\n * explicit-mode lands in rc.1.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { Account, NoAccountCtx } from '../account';\nimport type { RequestContext } from '../context';\nimport type { TaskHandoff } from '../async-outcome';\nimport type { RequireCacheScopeWhenProducts, ServerPayload } from '../../../types/server-payload';\nimport type {\n GetProductsRequest,\n GetProductsResponse,\n CreateMediaBuyError,\n CreateMediaBuySuccess,\n UpdateMediaBuySuccess,\n GetMediaBuysRequest,\n GetMediaBuysResponse,\n GetMediaBuyDeliveryRequest,\n GetMediaBuyDeliveryResponse,\n ProvidePerformanceFeedbackRequest,\n ProvidePerformanceFeedbackSuccess,\n ListCreativeFormatsRequest,\n ListCreativeFormatsResponse,\n ListCreativesRequest,\n ListCreativesResponse,\n MediaBuyStatus,\n SyncCatalogsRequest,\n SyncCatalogsSuccess,\n LogEventRequest,\n LogEventSuccess,\n SyncEventSourcesRequest,\n SyncEventSourcesSuccess,\n SyncCreativesError,\n SyncCreativesSuccess,\n} from '../../../types/tools.generated';\nimport type { ProposalRefinementCapabilities } from '../../../negotiation/types';\nimport type { AdcpToolMap } from '../../create-adcp-server';\nimport type {\n CanonicalSyncCreativeAsset,\n CanonicalCreateMediaBuyRequest,\n CanonicalCreativeResponse,\n CanonicalGetProductsRequest,\n CanonicalListCreativesRequest,\n CanonicalListCreativesResponse,\n CanonicalProduct,\n CanonicalUpdateMediaBuyRequest,\n} from '../../../v2/projection/creative-delivery';\n\ntype SyncCreative = CanonicalSyncCreativeAsset;\ntype Ctx<TCtxMeta> = RequestContext<Account<TCtxMeta>>;\ntype ExclusivePayload<TLeft, TRight> =\n | (TLeft & { [K in Exclude<keyof TRight, keyof TLeft>]?: never })\n | (TRight & { [K in Exclude<keyof TLeft, keyof TRight>]?: never });\ntype LegacyMediaBuyStatusInput<T> = T & { status?: MediaBuyStatus };\n\ntype CanonicalGetProductsPayload = Omit<ServerPayload<CanonicalCreativeResponse<GetProductsResponse>>, 'products'> & {\n products?: CanonicalProduct[];\n};\nexport type GetProductsPayload = RequireCacheScopeWhenProducts<CanonicalGetProductsPayload>;\ntype CreateMediaBuySuccessPayload = LegacyMediaBuyStatusInput<\n ServerPayload<CanonicalCreativeResponse<CreateMediaBuySuccess>>\n>;\ntype CreateMediaBuyErrorPayload = ServerPayload<CanonicalCreativeResponse<CreateMediaBuyError>>;\nexport type CreateMediaBuyPayload = ExclusivePayload<CreateMediaBuySuccessPayload, CreateMediaBuyErrorPayload>;\nexport type UpdateMediaBuyPayload = LegacyMediaBuyStatusInput<\n ServerPayload<CanonicalCreativeResponse<UpdateMediaBuySuccess>>\n>;\nexport type GetMediaBuyDeliveryPayload = ServerPayload<CanonicalCreativeResponse<GetMediaBuyDeliveryResponse>>;\nexport type GetMediaBuysPayload = ServerPayload<CanonicalCreativeResponse<GetMediaBuysResponse>>;\nexport type ProvidePerformanceFeedbackPayload = ServerPayload<ProvidePerformanceFeedbackSuccess>;\nexport type LegacyListCreativeFormatsPayload = ServerPayload<ListCreativeFormatsResponse>;\nexport type ListCreativesPayload = ServerPayload<CanonicalListCreativesResponse>;\nexport type LegacyGetProductsPayload = RequireCacheScopeWhenProducts<ServerPayload<GetProductsResponse>>;\nexport type LegacyCreateMediaBuyPayload = ExclusivePayload<\n LegacyMediaBuyStatusInput<ServerPayload<CreateMediaBuySuccess>>,\n ServerPayload<CreateMediaBuyError>\n>;\nexport type LegacyUpdateMediaBuyPayload = LegacyMediaBuyStatusInput<ServerPayload<UpdateMediaBuySuccess>>;\nexport type LegacyGetMediaBuyDeliveryPayload = ServerPayload<GetMediaBuyDeliveryResponse>;\nexport type LegacyGetMediaBuysPayload = ServerPayload<GetMediaBuysResponse>;\nexport type LegacyListCreativesPayload = ServerPayload<ListCreativesResponse>;\nexport type SyncCreativesSuccessPayload = ServerPayload<SyncCreativesSuccess>;\nexport type SyncCreativesErrorPayload = ServerPayload<SyncCreativesError>;\nexport type SyncCreativesPayload = SyncCreativesSuccessPayload | SyncCreativesErrorPayload;\nexport type SyncCatalogsPayload = ServerPayload<SyncCatalogsSuccess>;\nexport type LogEventPayload = ServerPayload<LogEventSuccess>;\nexport type SyncEventSourcesPayload = ServerPayload<SyncEventSourcesSuccess>;\nexport type ListProductsPayload = AdcpToolMap['list_products']['result'];\nexport type RequestProposalsPayload = AdcpToolMap['request_proposals']['result'];\nexport type DeclineProposalsPayload = AdcpToolMap['decline_proposals']['result'];\nexport type BuyProductsPayload = AdcpToolMap['buy_products']['result'];\nexport type AcceptProposalPayload = AdcpToolMap['accept_proposal']['result'];\nexport type ControlMediaBuyPayload = AdcpToolMap['control_media_buy']['result'];\nexport type RefineProposalsPayload = AdcpToolMap['refine_proposals']['result'];\n\n/**\n * Wire success-row shape for `sync_creatives`. Returning the array of these\n * rows from `syncCreatives` is what adopters write — the framework wraps\n * with `{ creatives: [...] }` to form `SyncCreativesSuccess`.\n */\nexport type SyncCreativesRow = SyncCreativesSuccess['creatives'][number];\nexport type GetProductsHandlerResult = GetProductsPayload | TaskHandoff<GetProductsPayload>;\nexport type CreateMediaBuyHandlerResult = CreateMediaBuyPayload | TaskHandoff<CreateMediaBuySuccessPayload>;\nexport type UpdateMediaBuyHandlerResult = UpdateMediaBuyPayload | TaskHandoff<UpdateMediaBuyPayload>;\nexport type SyncCreativesHandlerResult = SyncCreativesRow[] | TaskHandoff<SyncCreativesRow[]>;\n\ntype CompactLifecycleHandlerResult<T> = T | TaskHandoff<T>;\n\n/**\n * Primary AdCP 3.2 media-buy lifecycle surface.\n *\n * This lives beside {@link SalesPlatform} so SDK 14 adopters can implement\n * the compact protocol without translating it back into deprecated\n * `get_products` / `create_media_buy` / `update_media_buy` methods. Keep a\n * `SalesPlatform` implementation as well when the same deployment must serve\n * legacy 3.0/3.1 buyers; the server advertises only the compact profile to\n * 3.2 MCP discovery while retaining those older call routes.\n *\n * `refineProposals` requires `proposalRefinement` so capability discovery can\n * declare the supported structured refinement dimensions truthfully.\n *\n * @public\n */\nexport interface MediaBuyLifecyclePlatform<TCtxMeta = Record<string, unknown>> {\n proposalRefinement?: ProposalRefinementCapabilities;\n listProducts?(req: AdcpToolMap['list_products']['params'], ctx: Ctx<TCtxMeta>): Promise<ListProductsPayload>;\n requestProposals?(\n req: AdcpToolMap['request_proposals']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<RequestProposalsPayload>>;\n refineProposals?(\n req: AdcpToolMap['refine_proposals']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<RefineProposalsPayload>>;\n declineProposals?(\n req: AdcpToolMap['decline_proposals']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<DeclineProposalsPayload>>;\n buyProducts?(\n req: AdcpToolMap['buy_products']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<BuyProductsPayload>>;\n acceptProposal?(\n req: AdcpToolMap['accept_proposal']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<AcceptProposalPayload>>;\n controlMediaBuy?(\n req: AdcpToolMap['control_media_buy']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<ControlMediaBuyPayload>>;\n getMediaBuys?(req: GetMediaBuysRequest, ctx: Ctx<TCtxMeta>): Promise<GetMediaBuysPayload>;\n getMediaBuyDelivery?(filter: GetMediaBuyDeliveryRequest, ctx: Ctx<TCtxMeta>): Promise<GetMediaBuyDeliveryPayload>;\n}\n\nexport type MediaBuyLifecycleCorePlatform<TCtxMeta = Record<string, unknown>> = Required<\n Pick<\n MediaBuyLifecyclePlatform<TCtxMeta>,\n 'listProducts' | 'buyProducts' | 'controlMediaBuy' | 'getMediaBuys' | 'getMediaBuyDelivery'\n >\n>;\n\nexport type MediaBuyLifecycleProposalPlatform<TCtxMeta = Record<string, unknown>> = Required<\n Pick<\n MediaBuyLifecyclePlatform<TCtxMeta>,\n | 'proposalRefinement'\n | 'listProducts'\n | 'requestProposals'\n | 'refineProposals'\n | 'declineProposals'\n | 'acceptProposal'\n | 'getMediaBuys'\n | 'getMediaBuyDelivery'\n >\n>;\n\nexport interface SalesPlatform<TCtxMeta = Record<string, unknown>> {\n // **Method shape — all optional, enforced per-specialism.** Every method on\n // `SalesPlatform` is declared optional so the type accommodates non-media-\n // buy walled gardens (sales-social, audience-sync, sales-proposal-mode)\n // that don't accept inbound media buys but compose ingestion methods on\n // this same surface. Compile-time enforcement of \"you claimed\n // sales-non-guaranteed, therefore you MUST implement getProducts /\n // createMediaBuy / updateMediaBuy / getMediaBuyDelivery / getMediaBuys\"\n // moves up to `RequiredPlatformsFor<S>` — see the {@link SalesCorePlatform}\n // type alias and the per-specialism mapping in `platform.ts`. Runtime\n // enforcement is preserved: the dispatcher returns `UNSUPPORTED_FEATURE`\n // for tools whose method is absent, and `validateSpecialismRequiredTools`\n // throws / warns when a specialism's required tools aren't implemented.\n //\n // Adopters who implement the full media-buy surface keep working — their\n // implementation is a superset of every per-specialism requirement.\n // Adopters who only do ingestion (e.g. a Meta CAPI integration claiming\n // `sales-social`) drop the 5 core stubs without compile errors.\n\n // ── get_products: unified hybrid shape ────────────────────────────\n // get_products is a CATALOG LOOKUP — fast read against the seller's\n // existing inventory. rc8 allows curated brief/refine lookups to return a\n // Submitted arm when the seller needs async enrichment. Adopters express\n // that by returning ctx.handoffToTask(fn); the framework owns task_id\n // allocation, polling state, and optional completion webhook delivery.\n //\n // Wholesale catalog dumps remain sync: if the seller cannot serve the\n // full catalog directly, it should maintain an internal cache and return\n // the current catalog view instead of turning wholesale discovery into a\n // long-running operation.\n /** Catalog discovery: return products directly or hand off curated discovery to a background task. */\n getProducts?(req: CanonicalGetProductsRequest, ctx: Ctx<TCtxMeta>): Promise<GetProductsHandlerResult>;\n\n // ── create_media_buy: unified hybrid shape ──────────────────────────\n\n /**\n * Create a media buy. Return the wire success-arm shape (sync fast path)\n * OR `ctx.handoffToTask(fn)` to promote the call to a background task\n * (HITL slow path). Adopters can branch per-call: hybrid sellers route\n * programmatic remnant sync, guaranteed inventory through HITL, all\n * from the same method.\n *\n * Buyers pattern-match on the wire response shape (`media_buy_id` on\n * the immediate response → sync; `task_id` + `status: 'submitted'` →\n * poll `tasks_get` or receive webhook). Predictable per request,\n * dynamic per call.\n *\n * Status changes flow via `publishStatusChange(...)` regardless of\n * which path was taken.\n *\n * For synchronous domain validation that produces multiple failures,\n * return the pure Error arm (`{ errors: [...] }`) with no success-only\n * fields. Handoff callbacks remain success-only; throw `AdcpError` inside\n * a handoff to transition the task to `failed`.\n *\n * The handoff function's return value is persisted as JSONB in the\n * task registry. Postgres-backed registries cap row size at 4MB —\n * offload large payloads to blob storage and return references.\n *\n * @example Sync-only adopter (no HITL inventory)\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * return await this.commitSync(req);\n * }\n * ```\n *\n * @example HITL-only adopter (every call goes through trafficker review)\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * return ctx.handoffToTask(async (taskCtx) => {\n * await taskCtx.update({ message: 'Awaiting trafficker' });\n * return await this.runHITL(req);\n * });\n * }\n * ```\n *\n * @example Hybrid adopter (programmatic + guaranteed in same tenant)\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * if (this.requiresHITL(req)) {\n * return ctx.handoffToTask(async (taskCtx) => await this.runHITL(req));\n * }\n * return await this.commitSync(req);\n * }\n * ```\n */\n createMediaBuy?(req: CanonicalCreateMediaBuyRequest, ctx: Ctx<TCtxMeta>): Promise<CreateMediaBuyHandlerResult>;\n\n // ── update_media_buy: unified hybrid shape\n /**\n * Update a media buy. Return the patched buy immediately (sync fast path)\n * OR `ctx.handoffToTask(fn)` when the upstream activation or approval flow\n * must continue in the background. The framework owns task registration,\n * caller scoping, polling, and completion webhooks on the handoff path.\n */\n updateMediaBuy?(\n buyId: string,\n patch: CanonicalUpdateMediaBuyRequest,\n ctx: Ctx<TCtxMeta>\n ): Promise<UpdateMediaBuyHandlerResult>;\n\n // ── sync_creatives: unified hybrid shape ────────────────────────────\n\n /**\n * Push creatives. Return the array of wire success rows (sync fast\n * path) OR `ctx.handoffToTask(fn)` to defer to a background task\n * (HITL slow path — manual review, brand-suitability gates, etc.).\n * Hybrid: branch per-batch — auto-approve simple creatives sync,\n * route everything else to HITL.\n *\n * Each row carries `action` (CRUD outcome) and optional `status`\n * (review state). Buyers see mixed `approved` / `pending_review`\n * rows on the sync path; subsequent review changes flow via\n * `publishStatusChange(...)`.\n *\n * @example Hybrid adopter\n * ```ts\n * syncCreatives: async (creatives, ctx) => {\n * if (creatives.some(c => this.needsReview(c))) {\n * return ctx.handoffToTask(async (taskCtx) => {\n * return await this.reviewAndPersist(creatives);\n * });\n * }\n * return creatives.map(c => ({ creative_id: c.creative_id, action: 'created', status: 'approved' }));\n * }\n * ```\n */\n syncCreatives?(creatives: SyncCreative[], ctx: Ctx<TCtxMeta>): Promise<SyncCreativesHandlerResult>;\n\n // ── get_media_buy_delivery: sync only ───────────────────────────────\n\n /**\n * Per-media-buy delivery actuals (impressions, spend, pacing,\n * conversions). Sync — report-running platforms with manual report\n * cycles return the latest cached actuals and emit `delivery_report`\n * status changes via `publishStatusChange` when fresh reports are\n * available.\n *\n * **Multi-id contract.** `filter.media_buy_ids` is an array — buyers\n * routinely request delivery for multiple buys in one call. The\n * platform MUST iterate every id and return one element per id in\n * `media_buy_deliveries[]`. Implementations that read only\n * `media_buy_ids[0]` silently truncate the buyer's request — a\n * correctness bug that has bitten multiple adopters (closes #1342).\n *\n * Pass-through is the framework contract: the platform owns fan-out\n * because `aggregated_totals` requires platform-domain knowledge —\n * `reach` (cross-buy dedup capability), `new_to_brand_rate` (weighted\n * across buys, not a per-buy average), and `frequency` (depends on\n * dedup) cannot be synthesized correctly by a naive framework loop.\n * Sellers that can't compute the cross-buy fields omit them and emit\n * the safely-summable fields (`impressions`, `spend`, `clicks`,\n * `media_buy_count`); buyers fall back to per-buy values when needed.\n *\n * Recommended pattern — prefer the upstream's native multi-id query\n * over a per-id loop. Most reporting APIs (GAM ReportService's\n * `WHERE LINE_ITEM_ID IN (...)`, TTD, DV360, Magnite, PubMatic, retail\n * media) take an id list in one round-trip; iterating one-id-at-a-time\n * is an N-roundtrip pattern that triggers upstream rate limits on\n * 50-buy reports.\n *\n * ```ts\n * getMediaBuyDelivery: async (req, ctx) => {\n * const ids = req.media_buy_ids ?? [];\n * // Native multi-id: one upstream round-trip.\n * const rows = await this.upstream.report({\n * mediaBuyIds: ids,\n * start: req.start_date,\n * end: req.end_date,\n * });\n * return {\n * reporting_period: { start, end },\n * currency: 'USD',\n * media_buy_deliveries: rows,\n * aggregated_totals: this.upstream.aggregate(rows),\n * };\n * }\n * ```\n *\n * **Single-id fallback** — only if your upstream is genuinely single-id:\n *\n * ```ts\n * const deliveries = await Promise.all(ids.map(id => fetchOne(id, ctx)));\n * ```\n *\n * When `media_buy_ids` is omitted, return a paginated set of\n * accessible media buys per the wire schema. `status_filter`\n * defaults to `['active']` when omitted; honor the filter in your\n * iteration.\n */\n getMediaBuyDelivery?(filter: GetMediaBuyDeliveryRequest, ctx: Ctx<TCtxMeta>): Promise<GetMediaBuyDeliveryPayload>;\n\n // ── get_media_buys: sync only — REQUIRED ──────────────────────────────\n // Read tool — buyers fetch a list of their media buys (often filtered by\n // status / time window). Required because:\n // 1. Every seller needs to support reading back what they created.\n // 2. Idempotent retries depend on it (replay safe-by-design).\n // 3. The 6.2 patch-decomposition redesign needs single-id reads;\n // `getMediaBuys` is the foundation.\n // 4. Framework auto-stores returned media buys for hydration on\n // subsequent updateMediaBuy calls (see `hydratePackagesWithProducts`\n // pattern in `from-platform.ts`).\n //\n // Proposal-mode adopters (write-only via push channels) return an empty\n // `media_buys: []` array — that's a valid response.\n /**\n * List media buys this account owns. Filter + pagination per the wire shape.\n *\n * **Multi-id contract.** `req.media_buy_ids` is an array — buyers\n * routinely request a specific set of buys in one call. The platform\n * MUST iterate every id and return one element per id in the response\n * `media_buys[]` array. Reading only `media_buy_ids[0]` silently\n * truncates the buyer's request — same correctness bug that #1342\n * documented for `getMediaBuyDelivery`. Same recommended pattern: prefer\n * an upstream multi-id query (one round-trip), fall back to per-id loop\n * only when the upstream is single-id-only.\n *\n * When `media_buy_ids` is omitted, return a paginated set of accessible\n * buys filtered by `status_filter` (defaults to `['active']`).\n */\n getMediaBuys?(req: GetMediaBuysRequest, ctx: Ctx<TCtxMeta>): Promise<GetMediaBuysPayload>;\n\n // ── provide_performance_feedback: sync only ─────────────────────────\n // Write tool — buyers report aggregate creative-level performance\n // (impressions, clicks, conversions) to help the seller's optimizer learn.\n // Optional because not every sales agent runs an optimizer, but every\n // buyer expects to be able to call it. Framework returns UNSUPPORTED_FEATURE\n // when omitted.\n //\n // ⚠️ NO-ACCOUNT TOOL — `ctx: NoAccountCtx<TCtxMeta>`. The wire request\n // does not carry an `account` field. `ctx.account` may be `undefined` for\n // `'explicit'`-resolution adopters; narrow before reading\n // `ctx.account.ctx_metadata`. See {@link NoAccountCtx} and the\n // `SalesPlatform` JSDoc (\"No-account tools\") for safe patterns.\n /** Accept buyer-side performance signals on a media buy / creative. */\n providePerformanceFeedback?(\n req: ProvidePerformanceFeedbackRequest,\n ctx: NoAccountCtx<TCtxMeta>\n ): Promise<ProvidePerformanceFeedbackPayload>;\n\n // ── list_creative_formats: sync only ────────────────────────────────\n // Discovery tool — buyers query what creative formats this seller\n // accepts. Optional because sellers that delegate to external\n // `creative_agents` (declared in `capabilities.creative_agents[]`) don't\n // own format definitions; framework can resolve from the declared agents.\n // Self-hosted sellers (own creative library) implement this directly.\n //\n // ⚠️ NO-ACCOUNT TOOL — `ctx: NoAccountCtx<TCtxMeta>`. See\n // `providePerformanceFeedback` note above.\n listCreativeFormatsLegacy?(\n req: ListCreativeFormatsRequest,\n ctx: NoAccountCtx<TCtxMeta>\n ): Promise<LegacyListCreativeFormatsPayload>;\n\n // ── list_creatives: sync only ───────────────────────────────────────\n // Read tool — buyers query the seller's creative library. Optional\n // because most sales adopters delegate creative state to the\n // `creative_agents` declared in capabilities; ad-server-style sales\n // platforms implement directly. Note: also lives on `CreativeAdServerPlatform.listCreatives`\n // for the standalone-creative-agent shape.\n listCreatives?(req: CanonicalListCreativesRequest, ctx: Ctx<TCtxMeta>): Promise<ListCreativesPayload>;\n\n // ── sync_catalogs: sync only ────────────────────────────────────────\n // Retail-media catalog sync. Buyers push product catalogs (SKUs, ASINs,\n // store-ids) for `sales-catalog-driven` agents (Amazon, Criteo, Citrusad,\n // Walmart Connect, Shopify ad surfaces). Optional — non-retail sales\n // adopters omit. Idempotent on the buyer's `idempotency_key`.\n syncCatalogs?(req: SyncCatalogsRequest, ctx: Ctx<TCtxMeta>): Promise<SyncCatalogsPayload>;\n\n // ── log_event: sync only ────────────────────────────────────────────\n // Conversion / engagement event logging. Buyers post events tied to\n // a `media_buy_id` for performance attribution. Used by retail-media\n // (post-purchase events) and conversion-tracked sales (Snap pixel,\n // Meta CAPI, LinkedIn conversions API). Optional.\n logEvent?(req: LogEventRequest, ctx: Ctx<TCtxMeta>): Promise<LogEventPayload>;\n\n // ── sync_event_sources: sync only ──────────────────────────────────\n // Register conversion event sources (websites, apps, offline pixel\n // IDs) so subsequent `log_event` calls can be attributed correctly.\n // Optional — adopters who don't expose conversion tracking omit.\n syncEventSources?(req: SyncEventSourcesRequest, ctx: Ctx<TCtxMeta>): Promise<SyncEventSourcesPayload>;\n}\n\n/**\n * Names the **core sales surface** — bidding + media-buy lifecycle. Required\n * for `sales-*` specialisms that own pricing/pacing\n * (`sales-non-guaranteed`, `sales-guaranteed`, `sales-broadcast-tv`,\n * `sales-streaming-tv`, `sales-exchange`, `sales-catalog-driven`,\n * `sales-retail-media`).\n *\n * Walled-garden specialisms whose value surface is asset ingestion\n * (`sales-social`, the `audience-sync` track, pure conversion-tracking\n * adopters) DON'T need to implement these — see {@link SalesIngestionPlatform}.\n *\n * Used by `RequiredPlatformsFor<S>` to pick the right slice of `SalesPlatform`\n * per claimed specialism.\n *\n * @public\n */\nexport type SalesCorePlatform<TCtxMeta = Record<string, unknown>> = Required<\n Pick<\n SalesPlatform<TCtxMeta>,\n 'getProducts' | 'createMediaBuy' | 'updateMediaBuy' | 'getMediaBuyDelivery' | 'getMediaBuys'\n >\n>;\n\n/**\n * Names the **asset-ingestion surface** — sync surfaces for creatives,\n * audiences (via {@link import('./audiences').AudiencePlatform}), catalogs,\n * events, plus the read/feedback tools. Walled-garden specialisms\n * (`sales-social`) live here.\n *\n * Every method is optional individually. Adopters claiming `sales-social`\n * pick whichever ingestion surfaces apply (typically `syncCreatives` +\n * `logEvent` + `syncEventSources`); the rest stay omitted.\n *\n * Used by `RequiredPlatformsFor<S>` so claiming `sales-social` only requires\n * this slice of `SalesPlatform`, not the full {@link SalesCorePlatform}.\n *\n * @public\n */\nexport type SalesIngestionPlatform<TCtxMeta = Record<string, unknown>> = Pick<\n SalesPlatform<TCtxMeta>,\n | 'syncCreatives'\n | 'syncCatalogs'\n | 'syncEventSources'\n | 'logEvent'\n | 'listCreativeFormatsLegacy'\n | 'listCreatives'\n | 'providePerformanceFeedback'\n>;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/lib/server/decisioning/specialisms/sales.ts"],"sourcesContent":["/**\n * SalesPlatform — sales specialism platform interface.\n *\n * **Unified hybrid shape.** `get_products`, `create_media_buy`, and `sync_creatives` use a\n * single method each. The method returns the wire success arm (sync fast\n * path) OR `ctx.handoffToTask(fn)` to promote the call to a background\n * task (HITL slow path). Branch per-call — the same method handles\n * programmatic remnant, guaranteed inventory, curated discovery, and hybrid\n * sellers. Every other tool is sync-only:\n *\n * - `get_products` — sync OR `ctx.handoffToTask(...)` for curated brief/refine flows.\n * - `create_media_buy` — sync OR `ctx.handoffToTask(...)`.\n * - `update_media_buy` — sync only. Re-approval flows that need HITL run\n * out-of-band; `publishStatusChange` carries the result.\n * - `sync_creatives` — sync OR `ctx.handoffToTask(...)`.\n * - `get_media_buy_delivery` — sync only.\n *\n * Sync-only tools that need long-running semantics use `publishStatusChange`\n * (see `status-changes.ts`) — that's the spec-aligned channel for tools\n * whose wire response unions don't define a Submitted arm.\n *\n * Each method either returns the value or throws `AdcpError` for structured\n * rejection. Generic thrown errors map to `SERVICE_UNAVAILABLE`.\n *\n * **Method groups** — implement the group(s) matching your specialism:\n *\n * | Group | Methods | Claim when |\n * |---|---|---|\n * | Core sales (required) | `getProducts`, `updateMediaBuy`, `getMediaBuyDelivery` | Any `sales-*` specialism |\n * | Core sales (unified hybrid) | `createMediaBuy` | Any `sales-*` specialism |\n * | Core sales (unified hybrid) | `syncCreatives` | Any `sales-*` specialism |\n * | Read / feedback | `getMediaBuys`, `providePerformanceFeedback`, `listCreativeFormats`, `listCreatives` | Most sellers; optional |\n * | Retail-media extensions | `syncCatalogs`, `logEvent`, `syncEventSources` | `sales-catalog-driven`, `sales-retail-media` |\n *\n * New adopters implementing a non-retail seller (GAM, FreeWheel, a social\n * platform) only need the three core-required methods plus `createMediaBuy`\n * and `syncCreatives`. The retail-media extension methods (`syncCatalogs`,\n * `logEvent`, `syncEventSources`) are unnecessary unless you claim\n * `sales-catalog-driven` or `sales-retail-media`.\n *\n * **No-account tools (`providePerformanceFeedback`, `listCreativeFormats`):**\n * the wire requests for these two tools don't carry an `account` field, so\n * `ctx.account` may be `undefined` when `accounts.resolution === 'explicit'`.\n * Three safe patterns:\n *\n * 1. **`'derived'` resolution** — `accounts.resolve(undefined)` returns a\n * singleton; `ctx.account` is always set. Best for single-tenant\n * deployers.\n * 2. **Don't implement the method** — the framework returns\n * `UNSUPPORTED_FEATURE`; buyers using the merge-seam custom handler or\n * external creative agents still receive a response.\n * 3. **Explicit-mode with defensive read** — cast `ctx.account as Account |\n * undefined` and derive the account from the request body (e.g., via a\n * `media_buy_id` lookup), or throw `AdcpError('ACCOUNT_NOT_FOUND')`.\n * Full `resolveAccount(undefined, { authInfo, toolName })` support for\n * explicit-mode lands in rc.1.\n *\n * Status: Preview / 6.0.\n *\n * @public\n */\n\nimport type { Account, NoAccountCtx } from '../account';\nimport type { RequestContext } from '../context';\nimport type { TaskHandoff } from '../async-outcome';\nimport type { RequireCacheScopeWhenProducts, ServerPayload } from '../../../types/server-payload';\nimport type {\n GetProductsRequest,\n GetProductsResponse,\n CreateMediaBuyError,\n CreateMediaBuySuccess,\n UpdateMediaBuySuccess,\n GetMediaBuysRequest,\n GetMediaBuysResponse,\n GetMediaBuyDeliveryRequest,\n GetMediaBuyDeliveryResponse,\n ProvidePerformanceFeedbackRequest,\n ProvidePerformanceFeedbackSuccess,\n ListCreativeFormatsRequest,\n ListCreativeFormatsResponse,\n ListCreativesRequest,\n ListCreativesResponse,\n MediaBuyStatus,\n SyncCatalogsRequest,\n SyncCatalogsSuccess,\n LogEventRequest,\n LogEventSuccess,\n SyncEventSourcesRequest,\n SyncEventSourcesSuccess,\n SyncCreativesError,\n SyncCreativesSuccess,\n} from '../../../types/tools.generated';\nimport type { ProposalRefinementCapabilities } from '../../../negotiation/types';\nimport type { AdcpToolMap } from '../../create-adcp-server';\nimport type {\n CanonicalSyncCreativeAsset,\n CanonicalCreateMediaBuyRequest,\n CanonicalCreativeResponse,\n CanonicalGetProductsRequest,\n CanonicalListCreativesRequest,\n CanonicalListCreativesResponse,\n CanonicalProduct,\n CanonicalUpdateMediaBuyRequest,\n} from '../../../v2/projection/creative-delivery';\nimport type { ProjectionCatalogSnapshot } from '../../../v2/projection/catalog-snapshot';\nimport type { V1ProductInput } from '../../../v2/projection/types';\n\ntype SyncCreative = CanonicalSyncCreativeAsset;\ntype Ctx<TCtxMeta> = RequestContext<Account<TCtxMeta>>;\ntype ExclusivePayload<TLeft, TRight> =\n | (TLeft & { [K in Exclude<keyof TRight, keyof TLeft>]?: never })\n | (TRight & { [K in Exclude<keyof TLeft, keyof TRight>]?: never });\ntype LegacyMediaBuyStatusInput<T> = T & { status?: MediaBuyStatus };\n\nexport type GetProductsProjectionInput = (CanonicalProduct | V1ProductInput) & {\n /** Exact owner-scoped aliases used only while projecting this product; never emitted on the wire. */\n projectionCatalogs?: readonly ProjectionCatalogSnapshot[];\n};\ntype CanonicalGetProductsPayload = Omit<ServerPayload<CanonicalCreativeResponse<GetProductsResponse>>, 'products'> & {\n products?: GetProductsProjectionInput[];\n};\nexport type GetProductsPayload = RequireCacheScopeWhenProducts<CanonicalGetProductsPayload>;\ntype CreateMediaBuySuccessPayload = LegacyMediaBuyStatusInput<\n ServerPayload<CanonicalCreativeResponse<CreateMediaBuySuccess>>\n>;\ntype CreateMediaBuyErrorPayload = ServerPayload<CanonicalCreativeResponse<CreateMediaBuyError>>;\nexport type CreateMediaBuyPayload = ExclusivePayload<CreateMediaBuySuccessPayload, CreateMediaBuyErrorPayload>;\nexport type UpdateMediaBuyPayload = LegacyMediaBuyStatusInput<\n ServerPayload<CanonicalCreativeResponse<UpdateMediaBuySuccess>>\n>;\nexport type GetMediaBuyDeliveryPayload = ServerPayload<CanonicalCreativeResponse<GetMediaBuyDeliveryResponse>>;\nexport type GetMediaBuysPayload = ServerPayload<CanonicalCreativeResponse<GetMediaBuysResponse>>;\nexport type ProvidePerformanceFeedbackPayload = ServerPayload<ProvidePerformanceFeedbackSuccess>;\nexport type LegacyListCreativeFormatsPayload = ServerPayload<ListCreativeFormatsResponse>;\nexport type ListCreativesPayload = ServerPayload<CanonicalListCreativesResponse>;\nexport type LegacyGetProductsPayload = RequireCacheScopeWhenProducts<ServerPayload<GetProductsResponse>>;\nexport type LegacyCreateMediaBuyPayload = ExclusivePayload<\n LegacyMediaBuyStatusInput<ServerPayload<CreateMediaBuySuccess>>,\n ServerPayload<CreateMediaBuyError>\n>;\nexport type LegacyUpdateMediaBuyPayload = LegacyMediaBuyStatusInput<ServerPayload<UpdateMediaBuySuccess>>;\nexport type LegacyGetMediaBuyDeliveryPayload = ServerPayload<GetMediaBuyDeliveryResponse>;\nexport type LegacyGetMediaBuysPayload = ServerPayload<GetMediaBuysResponse>;\nexport type LegacyListCreativesPayload = ServerPayload<ListCreativesResponse>;\nexport type SyncCreativesSuccessPayload = ServerPayload<SyncCreativesSuccess>;\nexport type SyncCreativesErrorPayload = ServerPayload<SyncCreativesError>;\nexport type SyncCreativesPayload = SyncCreativesSuccessPayload | SyncCreativesErrorPayload;\nexport type SyncCatalogsPayload = ServerPayload<SyncCatalogsSuccess>;\nexport type LogEventPayload = ServerPayload<LogEventSuccess>;\nexport type SyncEventSourcesPayload = ServerPayload<SyncEventSourcesSuccess>;\nexport type ListProductsPayload = AdcpToolMap['list_products']['result'];\nexport type RequestProposalsPayload = AdcpToolMap['request_proposals']['result'];\nexport type DeclineProposalsPayload = AdcpToolMap['decline_proposals']['result'];\nexport type BuyProductsPayload = AdcpToolMap['buy_products']['result'];\nexport type AcceptProposalPayload = AdcpToolMap['accept_proposal']['result'];\nexport type ControlMediaBuyPayload = AdcpToolMap['control_media_buy']['result'];\nexport type RefineProposalsPayload = AdcpToolMap['refine_proposals']['result'];\n\n/**\n * Wire success-row shape for `sync_creatives`. Returning the array of these\n * rows from `syncCreatives` is what adopters write — the framework wraps\n * with `{ creatives: [...] }` to form `SyncCreativesSuccess`.\n */\nexport type SyncCreativesRow = SyncCreativesSuccess['creatives'][number];\nexport type GetProductsHandlerResult = GetProductsPayload | TaskHandoff<GetProductsPayload>;\nexport type CreateMediaBuyHandlerResult = CreateMediaBuyPayload | TaskHandoff<CreateMediaBuySuccessPayload>;\nexport type UpdateMediaBuyHandlerResult = UpdateMediaBuyPayload | TaskHandoff<UpdateMediaBuyPayload>;\nexport type SyncCreativesHandlerResult = SyncCreativesRow[] | TaskHandoff<SyncCreativesRow[]>;\n\ntype CompactLifecycleHandlerResult<T> = T | TaskHandoff<T>;\n\n/**\n * Primary AdCP 3.2 media-buy lifecycle surface.\n *\n * This lives beside {@link SalesPlatform} so SDK 14 adopters can implement\n * the compact protocol without translating it back into deprecated\n * `get_products` / `create_media_buy` / `update_media_buy` methods. Keep a\n * `SalesPlatform` implementation as well when the same deployment must serve\n * legacy 3.0/3.1 buyers; the server advertises only the compact profile to\n * 3.2 MCP discovery while retaining those older call routes.\n *\n * `refineProposals` requires `proposalRefinement` so capability discovery can\n * declare the supported structured refinement dimensions truthfully.\n *\n * @public\n */\nexport interface MediaBuyLifecyclePlatform<TCtxMeta = Record<string, unknown>> {\n proposalRefinement?: ProposalRefinementCapabilities;\n listProducts?(req: AdcpToolMap['list_products']['params'], ctx: Ctx<TCtxMeta>): Promise<ListProductsPayload>;\n requestProposals?(\n req: AdcpToolMap['request_proposals']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<RequestProposalsPayload>>;\n refineProposals?(\n req: AdcpToolMap['refine_proposals']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<RefineProposalsPayload>>;\n declineProposals?(\n req: AdcpToolMap['decline_proposals']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<DeclineProposalsPayload>>;\n buyProducts?(\n req: AdcpToolMap['buy_products']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<BuyProductsPayload>>;\n acceptProposal?(\n req: AdcpToolMap['accept_proposal']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<AcceptProposalPayload>>;\n controlMediaBuy?(\n req: AdcpToolMap['control_media_buy']['params'],\n ctx: Ctx<TCtxMeta>\n ): Promise<CompactLifecycleHandlerResult<ControlMediaBuyPayload>>;\n getMediaBuys?(req: GetMediaBuysRequest, ctx: Ctx<TCtxMeta>): Promise<GetMediaBuysPayload>;\n getMediaBuyDelivery?(filter: GetMediaBuyDeliveryRequest, ctx: Ctx<TCtxMeta>): Promise<GetMediaBuyDeliveryPayload>;\n}\n\nexport type MediaBuyLifecycleCorePlatform<TCtxMeta = Record<string, unknown>> = Required<\n Pick<\n MediaBuyLifecyclePlatform<TCtxMeta>,\n 'listProducts' | 'buyProducts' | 'controlMediaBuy' | 'getMediaBuys' | 'getMediaBuyDelivery'\n >\n>;\n\nexport type MediaBuyLifecycleProposalPlatform<TCtxMeta = Record<string, unknown>> = Required<\n Pick<\n MediaBuyLifecyclePlatform<TCtxMeta>,\n | 'proposalRefinement'\n | 'listProducts'\n | 'requestProposals'\n | 'refineProposals'\n | 'declineProposals'\n | 'acceptProposal'\n | 'getMediaBuys'\n | 'getMediaBuyDelivery'\n >\n>;\n\nexport interface SalesPlatform<TCtxMeta = Record<string, unknown>> {\n // **Method shape — all optional, enforced per-specialism.** Every method on\n // `SalesPlatform` is declared optional so the type accommodates non-media-\n // buy walled gardens (sales-social, audience-sync, sales-proposal-mode)\n // that don't accept inbound media buys but compose ingestion methods on\n // this same surface. Compile-time enforcement of \"you claimed\n // sales-non-guaranteed, therefore you MUST implement getProducts /\n // createMediaBuy / updateMediaBuy / getMediaBuyDelivery / getMediaBuys\"\n // moves up to `RequiredPlatformsFor<S>` — see the {@link SalesCorePlatform}\n // type alias and the per-specialism mapping in `platform.ts`. Runtime\n // enforcement is preserved: the dispatcher returns `UNSUPPORTED_FEATURE`\n // for tools whose method is absent, and `validateSpecialismRequiredTools`\n // throws / warns when a specialism's required tools aren't implemented.\n //\n // Adopters who implement the full media-buy surface keep working — their\n // implementation is a superset of every per-specialism requirement.\n // Adopters who only do ingestion (e.g. a Meta CAPI integration claiming\n // `sales-social`) drop the 5 core stubs without compile errors.\n\n // ── get_products: unified hybrid shape ────────────────────────────\n // get_products is a CATALOG LOOKUP — fast read against the seller's\n // existing inventory. rc8 allows curated brief/refine lookups to return a\n // Submitted arm when the seller needs async enrichment. Adopters express\n // that by returning ctx.handoffToTask(fn); the framework owns task_id\n // allocation, polling state, and optional completion webhook delivery.\n //\n // Wholesale catalog dumps remain sync: if the seller cannot serve the\n // full catalog directly, it should maintain an internal cache and return\n // the current catalog view instead of turning wholesale discovery into a\n // long-running operation.\n /** Catalog discovery: return products directly or hand off curated discovery to a background task. */\n getProducts?(req: CanonicalGetProductsRequest, ctx: Ctx<TCtxMeta>): Promise<GetProductsHandlerResult>;\n\n // ── create_media_buy: unified hybrid shape ──────────────────────────\n\n /**\n * Create a media buy. Return the wire success-arm shape (sync fast path)\n * OR `ctx.handoffToTask(fn)` to promote the call to a background task\n * (HITL slow path). Adopters can branch per-call: hybrid sellers route\n * programmatic remnant sync, guaranteed inventory through HITL, all\n * from the same method.\n *\n * Buyers pattern-match on the wire response shape (`media_buy_id` on\n * the immediate response → sync; `task_id` + `status: 'submitted'` →\n * poll `tasks_get` or receive webhook). Predictable per request,\n * dynamic per call.\n *\n * Status changes flow via `publishStatusChange(...)` regardless of\n * which path was taken.\n *\n * For synchronous domain validation that produces multiple failures,\n * return the pure Error arm (`{ errors: [...] }`) with no success-only\n * fields. Handoff callbacks remain success-only; throw `AdcpError` inside\n * a handoff to transition the task to `failed`.\n *\n * The handoff function's return value is persisted as JSONB in the\n * task registry. Postgres-backed registries cap row size at 4MB —\n * offload large payloads to blob storage and return references.\n *\n * @example Sync-only adopter (no HITL inventory)\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * return await this.commitSync(req);\n * }\n * ```\n *\n * @example HITL-only adopter (every call goes through trafficker review)\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * return ctx.handoffToTask(async (taskCtx) => {\n * await taskCtx.update({ message: 'Awaiting trafficker' });\n * return await this.runHITL(req);\n * });\n * }\n * ```\n *\n * @example Hybrid adopter (programmatic + guaranteed in same tenant)\n * ```ts\n * createMediaBuy: async (req, ctx) => {\n * if (this.requiresHITL(req)) {\n * return ctx.handoffToTask(async (taskCtx) => await this.runHITL(req));\n * }\n * return await this.commitSync(req);\n * }\n * ```\n */\n createMediaBuy?(req: CanonicalCreateMediaBuyRequest, ctx: Ctx<TCtxMeta>): Promise<CreateMediaBuyHandlerResult>;\n\n // ── update_media_buy: unified hybrid shape\n /**\n * Update a media buy. Return the patched buy immediately (sync fast path)\n * OR `ctx.handoffToTask(fn)` when the upstream activation or approval flow\n * must continue in the background. The framework owns task registration,\n * caller scoping, polling, and completion webhooks on the handoff path.\n */\n updateMediaBuy?(\n buyId: string,\n patch: CanonicalUpdateMediaBuyRequest,\n ctx: Ctx<TCtxMeta>\n ): Promise<UpdateMediaBuyHandlerResult>;\n\n // ── sync_creatives: unified hybrid shape ────────────────────────────\n\n /**\n * Push creatives. Return the array of wire success rows (sync fast\n * path) OR `ctx.handoffToTask(fn)` to defer to a background task\n * (HITL slow path — manual review, brand-suitability gates, etc.).\n * Hybrid: branch per-batch — auto-approve simple creatives sync,\n * route everything else to HITL.\n *\n * Each row carries `action` (CRUD outcome) and optional `status`\n * (review state). Buyers see mixed `approved` / `pending_review`\n * rows on the sync path; subsequent review changes flow via\n * `publishStatusChange(...)`.\n *\n * @example Hybrid adopter\n * ```ts\n * syncCreatives: async (creatives, ctx) => {\n * if (creatives.some(c => this.needsReview(c))) {\n * return ctx.handoffToTask(async (taskCtx) => {\n * return await this.reviewAndPersist(creatives);\n * });\n * }\n * return creatives.map(c => ({ creative_id: c.creative_id, action: 'created', status: 'approved' }));\n * }\n * ```\n */\n syncCreatives?(creatives: SyncCreative[], ctx: Ctx<TCtxMeta>): Promise<SyncCreativesHandlerResult>;\n\n // ── get_media_buy_delivery: sync only ───────────────────────────────\n\n /**\n * Per-media-buy delivery actuals (impressions, spend, pacing,\n * conversions). Sync — report-running platforms with manual report\n * cycles return the latest cached actuals and emit `delivery_report`\n * status changes via `publishStatusChange` when fresh reports are\n * available.\n *\n * **Multi-id contract.** `filter.media_buy_ids` is an array — buyers\n * routinely request delivery for multiple buys in one call. The\n * platform MUST iterate every id and return one element per id in\n * `media_buy_deliveries[]`. Implementations that read only\n * `media_buy_ids[0]` silently truncate the buyer's request — a\n * correctness bug that has bitten multiple adopters (closes #1342).\n *\n * Pass-through is the framework contract: the platform owns fan-out\n * because `aggregated_totals` requires platform-domain knowledge —\n * `reach` (cross-buy dedup capability), `new_to_brand_rate` (weighted\n * across buys, not a per-buy average), and `frequency` (depends on\n * dedup) cannot be synthesized correctly by a naive framework loop.\n * Sellers that can't compute the cross-buy fields omit them and emit\n * the safely-summable fields (`impressions`, `spend`, `clicks`,\n * `media_buy_count`); buyers fall back to per-buy values when needed.\n *\n * Recommended pattern — prefer the upstream's native multi-id query\n * over a per-id loop. Most reporting APIs (GAM ReportService's\n * `WHERE LINE_ITEM_ID IN (...)`, TTD, DV360, Magnite, PubMatic, retail\n * media) take an id list in one round-trip; iterating one-id-at-a-time\n * is an N-roundtrip pattern that triggers upstream rate limits on\n * 50-buy reports.\n *\n * ```ts\n * getMediaBuyDelivery: async (req, ctx) => {\n * const ids = req.media_buy_ids ?? [];\n * // Native multi-id: one upstream round-trip.\n * const rows = await this.upstream.report({\n * mediaBuyIds: ids,\n * start: req.start_date,\n * end: req.end_date,\n * });\n * return {\n * reporting_period: { start, end },\n * currency: 'USD',\n * media_buy_deliveries: rows,\n * aggregated_totals: this.upstream.aggregate(rows),\n * };\n * }\n * ```\n *\n * **Single-id fallback** — only if your upstream is genuinely single-id:\n *\n * ```ts\n * const deliveries = await Promise.all(ids.map(id => fetchOne(id, ctx)));\n * ```\n *\n * When `media_buy_ids` is omitted, return a paginated set of\n * accessible media buys per the wire schema. `status_filter`\n * defaults to `['active']` when omitted; honor the filter in your\n * iteration.\n */\n getMediaBuyDelivery?(filter: GetMediaBuyDeliveryRequest, ctx: Ctx<TCtxMeta>): Promise<GetMediaBuyDeliveryPayload>;\n\n // ── get_media_buys: sync only — REQUIRED ──────────────────────────────\n // Read tool — buyers fetch a list of their media buys (often filtered by\n // status / time window). Required because:\n // 1. Every seller needs to support reading back what they created.\n // 2. Idempotent retries depend on it (replay safe-by-design).\n // 3. The 6.2 patch-decomposition redesign needs single-id reads;\n // `getMediaBuys` is the foundation.\n // 4. Framework auto-stores returned media buys for hydration on\n // subsequent updateMediaBuy calls (see `hydratePackagesWithProducts`\n // pattern in `from-platform.ts`).\n //\n // Proposal-mode adopters (write-only via push channels) return an empty\n // `media_buys: []` array — that's a valid response.\n /**\n * List media buys this account owns. Filter + pagination per the wire shape.\n *\n * **Multi-id contract.** `req.media_buy_ids` is an array — buyers\n * routinely request a specific set of buys in one call. The platform\n * MUST iterate every id and return one element per id in the response\n * `media_buys[]` array. Reading only `media_buy_ids[0]` silently\n * truncates the buyer's request — same correctness bug that #1342\n * documented for `getMediaBuyDelivery`. Same recommended pattern: prefer\n * an upstream multi-id query (one round-trip), fall back to per-id loop\n * only when the upstream is single-id-only.\n *\n * When `media_buy_ids` is omitted, return a paginated set of accessible\n * buys filtered by `status_filter` (defaults to `['active']`).\n */\n getMediaBuys?(req: GetMediaBuysRequest, ctx: Ctx<TCtxMeta>): Promise<GetMediaBuysPayload>;\n\n // ── provide_performance_feedback: sync only ─────────────────────────\n // Write tool — buyers report aggregate creative-level performance\n // (impressions, clicks, conversions) to help the seller's optimizer learn.\n // Optional because not every sales agent runs an optimizer, but every\n // buyer expects to be able to call it. Framework returns UNSUPPORTED_FEATURE\n // when omitted.\n //\n // ⚠️ NO-ACCOUNT TOOL — `ctx: NoAccountCtx<TCtxMeta>`. The wire request\n // does not carry an `account` field. `ctx.account` may be `undefined` for\n // `'explicit'`-resolution adopters; narrow before reading\n // `ctx.account.ctx_metadata`. See {@link NoAccountCtx} and the\n // `SalesPlatform` JSDoc (\"No-account tools\") for safe patterns.\n /** Accept buyer-side performance signals on a media buy / creative. */\n providePerformanceFeedback?(\n req: ProvidePerformanceFeedbackRequest,\n ctx: NoAccountCtx<TCtxMeta>\n ): Promise<ProvidePerformanceFeedbackPayload>;\n\n // ── list_creative_formats: sync only ────────────────────────────────\n // Discovery tool — buyers query what creative formats this seller\n // accepts. Optional because sellers that delegate to external\n // `creative_agents` (declared in `capabilities.creative_agents[]`) don't\n // own format definitions; framework can resolve from the declared agents.\n // Self-hosted sellers (own creative library) implement this directly.\n //\n // ⚠️ NO-ACCOUNT TOOL — `ctx: NoAccountCtx<TCtxMeta>`. See\n // `providePerformanceFeedback` note above.\n listCreativeFormatsLegacy?(\n req: ListCreativeFormatsRequest,\n ctx: NoAccountCtx<TCtxMeta>\n ): Promise<LegacyListCreativeFormatsPayload>;\n\n // ── list_creatives: sync only ───────────────────────────────────────\n // Read tool — buyers query the seller's creative library. Optional\n // because most sales adopters delegate creative state to the\n // `creative_agents` declared in capabilities; ad-server-style sales\n // platforms implement directly. Note: also lives on `CreativeAdServerPlatform.listCreatives`\n // for the standalone-creative-agent shape.\n listCreatives?(req: CanonicalListCreativesRequest, ctx: Ctx<TCtxMeta>): Promise<ListCreativesPayload>;\n\n // ── sync_catalogs: sync only ────────────────────────────────────────\n // Retail-media catalog sync. Buyers push product catalogs (SKUs, ASINs,\n // store-ids) for `sales-catalog-driven` agents (Amazon, Criteo, Citrusad,\n // Walmart Connect, Shopify ad surfaces). Optional — non-retail sales\n // adopters omit. Idempotent on the buyer's `idempotency_key`.\n syncCatalogs?(req: SyncCatalogsRequest, ctx: Ctx<TCtxMeta>): Promise<SyncCatalogsPayload>;\n\n // ── log_event: sync only ────────────────────────────────────────────\n // Conversion / engagement event logging. Buyers post events tied to\n // a `media_buy_id` for performance attribution. Used by retail-media\n // (post-purchase events) and conversion-tracked sales (Snap pixel,\n // Meta CAPI, LinkedIn conversions API). Optional.\n logEvent?(req: LogEventRequest, ctx: Ctx<TCtxMeta>): Promise<LogEventPayload>;\n\n // ── sync_event_sources: sync only ──────────────────────────────────\n // Register conversion event sources (websites, apps, offline pixel\n // IDs) so subsequent `log_event` calls can be attributed correctly.\n // Optional — adopters who don't expose conversion tracking omit.\n syncEventSources?(req: SyncEventSourcesRequest, ctx: Ctx<TCtxMeta>): Promise<SyncEventSourcesPayload>;\n}\n\n/**\n * Names the **core sales surface** — bidding + media-buy lifecycle. Required\n * for `sales-*` specialisms that own pricing/pacing\n * (`sales-non-guaranteed`, `sales-guaranteed`, `sales-broadcast-tv`,\n * `sales-streaming-tv`, `sales-exchange`, `sales-catalog-driven`,\n * `sales-retail-media`).\n *\n * Walled-garden specialisms whose value surface is asset ingestion\n * (`sales-social`, the `audience-sync` track, pure conversion-tracking\n * adopters) DON'T need to implement these — see {@link SalesIngestionPlatform}.\n *\n * Used by `RequiredPlatformsFor<S>` to pick the right slice of `SalesPlatform`\n * per claimed specialism.\n *\n * @public\n */\nexport type SalesCorePlatform<TCtxMeta = Record<string, unknown>> = Required<\n Pick<\n SalesPlatform<TCtxMeta>,\n 'getProducts' | 'createMediaBuy' | 'updateMediaBuy' | 'getMediaBuyDelivery' | 'getMediaBuys'\n >\n>;\n\n/**\n * Names the **asset-ingestion surface** — sync surfaces for creatives,\n * audiences (via {@link import('./audiences').AudiencePlatform}), catalogs,\n * events, plus the read/feedback tools. Walled-garden specialisms\n * (`sales-social`) live here.\n *\n * Every method is optional individually. Adopters claiming `sales-social`\n * pick whichever ingestion surfaces apply (typically `syncCreatives` +\n * `logEvent` + `syncEventSources`); the rest stay omitted.\n *\n * Used by `RequiredPlatformsFor<S>` so claiming `sales-social` only requires\n * this slice of `SalesPlatform`, not the full {@link SalesCorePlatform}.\n *\n * @public\n */\nexport type SalesIngestionPlatform<TCtxMeta = Record<string, unknown>> = Pick<\n SalesPlatform<TCtxMeta>,\n | 'syncCreatives'\n | 'syncCatalogs'\n | 'syncEventSources'\n | 'logEvent'\n | 'listCreativeFormatsLegacy'\n | 'listCreatives'\n | 'providePerformanceFeedback'\n>;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -133,6 +133,8 @@ export interface DeferredTaskState {
133
133
  a2aTaskId: string;
134
134
  /** Seller wire generation used for the original task and every continuation. */
135
135
  serverVersion: 'v2' | 'v3';
136
+ /** True when the original seller-version decision used the SDK's synthetic fallback. */
137
+ serverVersionSynthetic?: boolean;
136
138
  /** Trusted agent identifier resolved through current client configuration. */
137
139
  agentId: string;
138
140
  /** Task/tool name. */
@@ -133,6 +133,8 @@ export interface DeferredTaskState {
133
133
  a2aTaskId: string;
134
134
  /** Seller wire generation used for the original task and every continuation. */
135
135
  serverVersion: 'v2' | 'v3';
136
+ /** True when the original seller-version decision used the SDK's synthetic fallback. */
137
+ serverVersionSynthetic?: boolean;
136
138
  /** Trusted agent identifier resolved through current client configuration. */
137
139
  agentId: string;
138
140
  /** Task/tool name. */
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/lib/storage/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAEzC;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnC;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnC;;OAEG;IACH,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE3B;;OAEG;IACH,IAAI,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,CAAE,SAAQ,OAAO,CAAC,CAAC,CAAC;IACtD,wEAAwE;IACxE,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACnE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,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AE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC3D;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,CAAE,SAAQ,OAAO,CAAC,CAAC,CAAC;IACjD;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;IAEjD;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,CAAC,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7E;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,OAAO,CAAC,CAAC,CAAC;IACnD;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAEzC;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACjD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/storage/interfaces.ts"],"sourcesContent":["// Optional storage interfaces for caching and persistence\n// These are completely optional - everything works in-memory by default\n\nimport type { Message } from '../core/ConversationTypes';\n\n/**\n * Generic storage interface for caching and persistence\n *\n * Users can provide their own implementations (Redis, database, etc.)\n * The library provides a default in-memory implementation\n */\nexport interface Storage<T> {\n /**\n * Get a value by key\n * @param key - Storage key\n * @returns Value or undefined if not found\n */\n get(key: string): Promise<T | undefined>;\n\n /**\n * Set a value with optional TTL\n * @param key - Storage key\n * @param value - Value to store\n * @param ttl - Time to live in seconds (optional)\n */\n set(key: string, value: T, ttl?: number): Promise<void>;\n\n /**\n * Delete a value by key\n * @param key - Storage key\n */\n delete(key: string): Promise<void>;\n\n /**\n * Check if a key exists\n * @param key - Storage key\n */\n has(key: string): Promise<boolean>;\n\n /**\n * Clear all stored values (optional)\n */\n clear?(): Promise<void>;\n\n /**\n * Get all keys (optional, for debugging)\n */\n keys?(): Promise<string[]>;\n\n /**\n * Get storage size/count (optional, for monitoring)\n */\n size?(): Promise<number>;\n}\n\n/**\n * Storage that can atomically consume a value.\n *\n * `take()` MUST read and delete the value as one indivisible operation. A\n * `get()` followed by `delete()` is not equivalent: two replicas could both\n * read the same continuation and advance one seller task twice.\n */\nexport interface AtomicTakeStorage<T> extends Storage<T> {\n /** Atomically create a value only when the key is absent or expired. */\n putIfAbsent(key: string, value: T, ttl?: number): Promise<boolean>;\n take(key: string): Promise<T | undefined>;\n}\n\n/**\n * Agent capabilities for caching\n */\nexport interface AgentCapabilities {\n /** Agent ID */\n agentId: string;\n /** Supported task names */\n supportedTasks: string[];\n /** Task schemas/definitions */\n taskSchemas?: Record<string, any>;\n /** Agent metadata */\n metadata?: {\n version?: string;\n description?: string;\n lastUpdated?: string;\n [key: string]: any;\n };\n /** When capabilities were cached */\n cachedAt: string;\n /** Cache expiration time */\n expiresAt?: string;\n}\n\n/**\n * Conversation state for persistence\n */\nexport interface ConversationState {\n /** Conversation ID */\n conversationId: string;\n /** Agent ID */\n agentId: string;\n /** Message history */\n messages: Array<{\n id: string;\n role: 'user' | 'agent' | 'system';\n content: any;\n timestamp: string;\n metadata?: Record<string, any>;\n }>;\n /** Current task information */\n currentTask?: {\n taskId: string;\n taskName: string;\n status: string;\n params: any;\n };\n /** When conversation was created */\n createdAt: string;\n /** When conversation was last updated */\n updatedAt: string;\n /** Additional metadata */\n metadata?: Record<string, any>;\n}\n\n/**\n * Deferred task state for resumption\n */\nexport interface DeferredTaskState {\n /** Opaque record generation used for atomic claim/replace fencing. */\n continuationVersion: string;\n /** True after the human continuation has been claimed for seller dispatch. */\n continuationClaimed?: boolean;\n /**\n * Renewable owner fence for a committed continuation between human-input\n * admission and the seller protocol call. Only an expired `admission` phase\n * may be reclaimed; `dispatch-committed` is an uncertain-dispatch fence and\n * must never permit the input to be sent again.\n */\n settlementResumeDispatchLease?: {\n ownerId: string;\n phase: 'admission' | 'dispatch-committed';\n expiresAt: number;\n };\n /** Client-minted correlation ID for the original request. */\n taskId: string;\n /** Seller-issued A2A conversation identity, when one was supplied. */\n contextId?: string;\n /** Live A2A transport Task.id used to resume the exact seller task. */\n a2aTaskId: string;\n /** Seller wire generation used for the original task and every continuation. */\n serverVersion: 'v2' | 'v3';\n /** Trusted agent identifier resolved through current client configuration. */\n agentId: string;\n /** Task/tool name. */\n taskName: string;\n /** Snapshotted original task parameters. */\n params: any;\n /** Message history through the response that caused the pause. */\n messages: Message[];\n /** Exact resumable pause status retained for crash-safe route discovery. */\n pauseStatus?: 'input-required' | 'auth-required' | 'deferred';\n /** Human-facing prompt retained for crash-safe route discovery. */\n pauseQuestion?: string;\n /** Opaque, serializable owner context. Storage adapters must round-trip it unchanged. */\n clientContext?: unknown;\n /** Trusted committed-mutation route that must durably settle any terminal resume. */\n settlementOperationId?: string;\n /** New-format records whose operation index must fence every state transition. */\n settlementOperationRouteRequired?: true;\n /** Require the owning durable coordinator to authorize this token before sending seller continuation input. */\n settlementResumeAuthorizationRequired?: boolean;\n /** Seller work handle bound by the durable mutation owner before the pause. */\n settlementServerTaskId?: string;\n /** Seller work handle retained while a committed resume remains nonterminal. */\n settlementPendingTaskId?: string;\n /**\n * Opaque terminal observation retained when seller continuation succeeded but\n * committed-mutation settlement has not yet been acknowledged. Storage\n * adapters must round-trip it unchanged so retry never redispatches the\n * seller mutation.\n */\n settlementTerminalResult?: unknown;\n /** Internal renewable active-owner lease for settlement finalization. */\n settlementFinalizationLease?: {\n ownerId: string;\n expiresAt: number;\n };\n /** Exact public result after settlement and completion handlers succeeded. */\n settlementFinalizedResult?: unknown;\n /** Internal fence proving callback publication already invoked the configured completion handler. */\n settlementCompletionHandlerPublished?: boolean;\n /** Epoch milliseconds when this resumable state was stored. */\n createdAt: number;\n /** Epoch milliseconds after which this token must not be resumed. */\n expiresAt: number;\n}\n\n/** Durable deferred-task storage must generation-fence claim and cleanup. */\nexport interface DeferredTaskStorage extends Storage<DeferredTaskState> {\n /** Atomically create a value only when the key is absent or expired. */\n putIfAbsent(key: string, value: DeferredTaskState, ttl?: number): Promise<boolean>;\n /** Atomically replace only the exact record generation currently stored. */\n replaceIfVersion(key: string, expectedVersion: string, value: DeferredTaskState, ttl?: number): Promise<boolean>;\n /** Atomically return and remove only the exact record generation currently stored. */\n takeIfVersion(key: string, expectedVersion: string): Promise<DeferredTaskState | undefined>;\n /**\n * Atomically create a committed continuation and its operation route. The\n * route is the crash-recovery source of truth when the owning coordinator\n * has not yet recorded the opaque token.\n */\n putForSettlementOperationIfAbsent(\n operationId: string,\n key: string,\n value: DeferredTaskState,\n ttl?: number\n ): Promise<boolean>;\n /** Atomically resolve the current committed continuation generation. */\n getBySettlementOperationId(operationId: string): Promise<{ token: string; state: DeferredTaskState } | undefined>;\n /**\n * Atomically replace the exact routed generation. With a distinct\n * replacement key this installs a nested generation and moves the route,\n * retaining the predecessor as a dispatch fence. With the same key it\n * performs an in-place route-fenced state transition (for example, terminal\n * callback checkpointing).\n */\n replaceForSettlementOperationIfVersion(\n operationId: string,\n currentKey: string,\n expectedVersion: string,\n replacementKey: string,\n replacementValue: DeferredTaskState,\n ttl?: number\n ): Promise<boolean>;\n}\n\n/**\n * Storage configuration for different data types\n */\nexport interface StorageConfig {\n /** Storage for agent capabilities caching */\n capabilities?: Storage<AgentCapabilities>;\n\n /** Storage for conversation state persistence */\n conversations?: Storage<ConversationState>;\n\n /** Storage for deferred task tokens */\n tokens?: DeferredTaskStorage;\n\n /** Storage for debug logs (optional) */\n debugLogs?: Storage<any>;\n\n /** Custom storage instances */\n custom?: Record<string, Storage<any>>;\n}\n\n/**\n * Storage factory interface for creating storage instances\n */\nexport interface StorageFactory {\n /**\n * Create durable token storage with the atomic generation-fencing contract.\n */\n createStorage(type: 'tokens', options?: any): DeferredTaskStorage;\n /**\n * Create a storage instance for another data type.\n */\n createStorage<T>(type: string, options?: any): Storage<T>;\n}\n\n/**\n * Utility type for storage middleware/decorators\n */\nexport type StorageMiddleware<T> = (storage: Storage<T>) => Storage<T>;\n\n/**\n * Helper interface for batch operations\n */\nexport interface BatchStorage<T> extends Storage<T> {\n /**\n * Get multiple values at once\n */\n mget(keys: string[]): Promise<(T | undefined)[]>;\n\n /**\n * Set multiple values at once\n */\n mset(entries: Array<{ key: string; value: T; ttl?: number }>): Promise<void>;\n\n /**\n * Delete multiple keys at once\n */\n mdel(keys: string[]): Promise<number>;\n}\n\n/**\n * Helper interface for pattern-based operations\n */\nexport interface PatternStorage<T> extends Storage<T> {\n /**\n * Get keys matching a pattern\n */\n scan(pattern: string): Promise<string[]>;\n\n /**\n * Delete keys matching a pattern\n */\n deletePattern(pattern: string): Promise<number>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../src/lib/storage/interfaces.ts"],"sourcesContent":["// Optional storage interfaces for caching and persistence\n// These are completely optional - everything works in-memory by default\n\nimport type { Message } from '../core/ConversationTypes';\n\n/**\n * Generic storage interface for caching and persistence\n *\n * Users can provide their own implementations (Redis, database, etc.)\n * The library provides a default in-memory implementation\n */\nexport interface Storage<T> {\n /**\n * Get a value by key\n * @param key - Storage key\n * @returns Value or undefined if not found\n */\n get(key: string): Promise<T | undefined>;\n\n /**\n * Set a value with optional TTL\n * @param key - Storage key\n * @param value - Value to store\n * @param ttl - Time to live in seconds (optional)\n */\n set(key: string, value: T, ttl?: number): Promise<void>;\n\n /**\n * Delete a value by key\n * @param key - Storage key\n */\n delete(key: string): Promise<void>;\n\n /**\n * Check if a key exists\n * @param key - Storage key\n */\n has(key: string): Promise<boolean>;\n\n /**\n * Clear all stored values (optional)\n */\n clear?(): Promise<void>;\n\n /**\n * Get all keys (optional, for debugging)\n */\n keys?(): Promise<string[]>;\n\n /**\n * Get storage size/count (optional, for monitoring)\n */\n size?(): Promise<number>;\n}\n\n/**\n * Storage that can atomically consume a value.\n *\n * `take()` MUST read and delete the value as one indivisible operation. A\n * `get()` followed by `delete()` is not equivalent: two replicas could both\n * read the same continuation and advance one seller task twice.\n */\nexport interface AtomicTakeStorage<T> extends Storage<T> {\n /** Atomically create a value only when the key is absent or expired. */\n putIfAbsent(key: string, value: T, ttl?: number): Promise<boolean>;\n take(key: string): Promise<T | undefined>;\n}\n\n/**\n * Agent capabilities for caching\n */\nexport interface AgentCapabilities {\n /** Agent ID */\n agentId: string;\n /** Supported task names */\n supportedTasks: string[];\n /** Task schemas/definitions */\n taskSchemas?: Record<string, any>;\n /** Agent metadata */\n metadata?: {\n version?: string;\n description?: string;\n lastUpdated?: string;\n [key: string]: any;\n };\n /** When capabilities were cached */\n cachedAt: string;\n /** Cache expiration time */\n expiresAt?: string;\n}\n\n/**\n * Conversation state for persistence\n */\nexport interface ConversationState {\n /** Conversation ID */\n conversationId: string;\n /** Agent ID */\n agentId: string;\n /** Message history */\n messages: Array<{\n id: string;\n role: 'user' | 'agent' | 'system';\n content: any;\n timestamp: string;\n metadata?: Record<string, any>;\n }>;\n /** Current task information */\n currentTask?: {\n taskId: string;\n taskName: string;\n status: string;\n params: any;\n };\n /** When conversation was created */\n createdAt: string;\n /** When conversation was last updated */\n updatedAt: string;\n /** Additional metadata */\n metadata?: Record<string, any>;\n}\n\n/**\n * Deferred task state for resumption\n */\nexport interface DeferredTaskState {\n /** Opaque record generation used for atomic claim/replace fencing. */\n continuationVersion: string;\n /** True after the human continuation has been claimed for seller dispatch. */\n continuationClaimed?: boolean;\n /**\n * Renewable owner fence for a committed continuation between human-input\n * admission and the seller protocol call. Only an expired `admission` phase\n * may be reclaimed; `dispatch-committed` is an uncertain-dispatch fence and\n * must never permit the input to be sent again.\n */\n settlementResumeDispatchLease?: {\n ownerId: string;\n phase: 'admission' | 'dispatch-committed';\n expiresAt: number;\n };\n /** Client-minted correlation ID for the original request. */\n taskId: string;\n /** Seller-issued A2A conversation identity, when one was supplied. */\n contextId?: string;\n /** Live A2A transport Task.id used to resume the exact seller task. */\n a2aTaskId: string;\n /** Seller wire generation used for the original task and every continuation. */\n serverVersion: 'v2' | 'v3';\n /** True when the original seller-version decision used the SDK's synthetic fallback. */\n serverVersionSynthetic?: boolean;\n /** Trusted agent identifier resolved through current client configuration. */\n agentId: string;\n /** Task/tool name. */\n taskName: string;\n /** Snapshotted original task parameters. */\n params: any;\n /** Message history through the response that caused the pause. */\n messages: Message[];\n /** Exact resumable pause status retained for crash-safe route discovery. */\n pauseStatus?: 'input-required' | 'auth-required' | 'deferred';\n /** Human-facing prompt retained for crash-safe route discovery. */\n pauseQuestion?: string;\n /** Opaque, serializable owner context. Storage adapters must round-trip it unchanged. */\n clientContext?: unknown;\n /** Trusted committed-mutation route that must durably settle any terminal resume. */\n settlementOperationId?: string;\n /** New-format records whose operation index must fence every state transition. */\n settlementOperationRouteRequired?: true;\n /** Require the owning durable coordinator to authorize this token before sending seller continuation input. */\n settlementResumeAuthorizationRequired?: boolean;\n /** Seller work handle bound by the durable mutation owner before the pause. */\n settlementServerTaskId?: string;\n /** Seller work handle retained while a committed resume remains nonterminal. */\n settlementPendingTaskId?: string;\n /**\n * Opaque terminal observation retained when seller continuation succeeded but\n * committed-mutation settlement has not yet been acknowledged. Storage\n * adapters must round-trip it unchanged so retry never redispatches the\n * seller mutation.\n */\n settlementTerminalResult?: unknown;\n /** Internal renewable active-owner lease for settlement finalization. */\n settlementFinalizationLease?: {\n ownerId: string;\n expiresAt: number;\n };\n /** Exact public result after settlement and completion handlers succeeded. */\n settlementFinalizedResult?: unknown;\n /** Internal fence proving callback publication already invoked the configured completion handler. */\n settlementCompletionHandlerPublished?: boolean;\n /** Epoch milliseconds when this resumable state was stored. */\n createdAt: number;\n /** Epoch milliseconds after which this token must not be resumed. */\n expiresAt: number;\n}\n\n/** Durable deferred-task storage must generation-fence claim and cleanup. */\nexport interface DeferredTaskStorage extends Storage<DeferredTaskState> {\n /** Atomically create a value only when the key is absent or expired. */\n putIfAbsent(key: string, value: DeferredTaskState, ttl?: number): Promise<boolean>;\n /** Atomically replace only the exact record generation currently stored. */\n replaceIfVersion(key: string, expectedVersion: string, value: DeferredTaskState, ttl?: number): Promise<boolean>;\n /** Atomically return and remove only the exact record generation currently stored. */\n takeIfVersion(key: string, expectedVersion: string): Promise<DeferredTaskState | undefined>;\n /**\n * Atomically create a committed continuation and its operation route. The\n * route is the crash-recovery source of truth when the owning coordinator\n * has not yet recorded the opaque token.\n */\n putForSettlementOperationIfAbsent(\n operationId: string,\n key: string,\n value: DeferredTaskState,\n ttl?: number\n ): Promise<boolean>;\n /** Atomically resolve the current committed continuation generation. */\n getBySettlementOperationId(operationId: string): Promise<{ token: string; state: DeferredTaskState } | undefined>;\n /**\n * Atomically replace the exact routed generation. With a distinct\n * replacement key this installs a nested generation and moves the route,\n * retaining the predecessor as a dispatch fence. With the same key it\n * performs an in-place route-fenced state transition (for example, terminal\n * callback checkpointing).\n */\n replaceForSettlementOperationIfVersion(\n operationId: string,\n currentKey: string,\n expectedVersion: string,\n replacementKey: string,\n replacementValue: DeferredTaskState,\n ttl?: number\n ): Promise<boolean>;\n}\n\n/**\n * Storage configuration for different data types\n */\nexport interface StorageConfig {\n /** Storage for agent capabilities caching */\n capabilities?: Storage<AgentCapabilities>;\n\n /** Storage for conversation state persistence */\n conversations?: Storage<ConversationState>;\n\n /** Storage for deferred task tokens */\n tokens?: DeferredTaskStorage;\n\n /** Storage for debug logs (optional) */\n debugLogs?: Storage<any>;\n\n /** Custom storage instances */\n custom?: Record<string, Storage<any>>;\n}\n\n/**\n * Storage factory interface for creating storage instances\n */\nexport interface StorageFactory {\n /**\n * Create durable token storage with the atomic generation-fencing contract.\n */\n createStorage(type: 'tokens', options?: any): DeferredTaskStorage;\n /**\n * Create a storage instance for another data type.\n */\n createStorage<T>(type: string, options?: any): Storage<T>;\n}\n\n/**\n * Utility type for storage middleware/decorators\n */\nexport type StorageMiddleware<T> = (storage: Storage<T>) => Storage<T>;\n\n/**\n * Helper interface for batch operations\n */\nexport interface BatchStorage<T> extends Storage<T> {\n /**\n * Get multiple values at once\n */\n mget(keys: string[]): Promise<(T | undefined)[]>;\n\n /**\n * Set multiple values at once\n */\n mset(entries: Array<{ key: string; value: T; ttl?: number }>): Promise<void>;\n\n /**\n * Delete multiple keys at once\n */\n mdel(keys: string[]): Promise<number>;\n}\n\n/**\n * Helper interface for pattern-based operations\n */\nexport interface PatternStorage<T> extends Storage<T> {\n /**\n * Get keys matching a pattern\n */\n scan(pattern: string): Promise<string[]>;\n\n /**\n * Delete keys matching a pattern\n */\n deletePattern(pattern: string): Promise<number>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -31,6 +31,17 @@ export interface ComplyOptions extends TestOptions {
31
31
  tracks?: ComplianceTrack[];
32
32
  /** Timeout in milliseconds — stops new storyboards from starting when exceeded. */
33
33
  timeout_ms?: number;
34
+ /**
35
+ * Rotate the runnable storyboard list to start at this offset (modulo the
36
+ * list length) before sequential execution. Ordering is otherwise
37
+ * unchanged: the list wraps, so every storyboard still runs when the
38
+ * budget allows. Intended for budget-limited runs (`timeout_ms`): without
39
+ * rotation, consecutive truncated runs re-grade the same prefix and the
40
+ * tail storyboards are never exercised (adcontextprotocol/adcp#6632).
41
+ * Callers distribute coverage by varying the offset between runs (e.g.,
42
+ * a persisted per-agent run counter). Non-negative integer; default 0.
43
+ */
44
+ storyboard_start_offset?: number;
34
45
  /** AbortSignal for external cancellation (e.g., graceful shutdown). */
35
46
  signal?: AbortSignal;
36
47
  /** Original agent alias or identifier (used in fix_command instead of resolved URL). */
@@ -116,6 +127,13 @@ export declare function extractFailures(results: StoryboardResult[], storyboards
116
127
  hostedStableLineAlias?: string;
117
128
  testKitPath?: string;
118
129
  }): ComplianceFailure[];
130
+ /**
131
+ * Rotate a storyboard list to start at `offset % length`, preserving relative
132
+ * order (the head wraps to the tail). Pure and deterministic: offset 0, an
133
+ * offset that is a multiple of the length, or an empty list all return the
134
+ * input order. See `ComplyOptions.storyboard_start_offset`.
135
+ */
136
+ export declare function rotateStoryboardsForOffset<T>(items: readonly T[], offset: number): T[];
119
137
  /**
120
138
  * Detect whether a capability-discovery failure is an auth rejection.
121
139
  * Centralized so the "run security.yaml against 401-happy agents" path and
@@ -31,6 +31,17 @@ export interface ComplyOptions extends TestOptions {
31
31
  tracks?: ComplianceTrack[];
32
32
  /** Timeout in milliseconds — stops new storyboards from starting when exceeded. */
33
33
  timeout_ms?: number;
34
+ /**
35
+ * Rotate the runnable storyboard list to start at this offset (modulo the
36
+ * list length) before sequential execution. Ordering is otherwise
37
+ * unchanged: the list wraps, so every storyboard still runs when the
38
+ * budget allows. Intended for budget-limited runs (`timeout_ms`): without
39
+ * rotation, consecutive truncated runs re-grade the same prefix and the
40
+ * tail storyboards are never exercised (adcontextprotocol/adcp#6632).
41
+ * Callers distribute coverage by varying the offset between runs (e.g.,
42
+ * a persisted per-agent run counter). Non-negative integer; default 0.
43
+ */
44
+ storyboard_start_offset?: number;
34
45
  /** AbortSignal for external cancellation (e.g., graceful shutdown). */
35
46
  signal?: AbortSignal;
36
47
  /** Original agent alias or identifier (used in fix_command instead of resolved URL). */
@@ -116,6 +127,13 @@ export declare function extractFailures(results: StoryboardResult[], storyboards
116
127
  hostedStableLineAlias?: string;
117
128
  testKitPath?: string;
118
129
  }): ComplianceFailure[];
130
+ /**
131
+ * Rotate a storyboard list to start at `offset % length`, preserving relative
132
+ * order (the head wraps to the tail). Pure and deterministic: offset 0, an
133
+ * offset that is a multiple of the length, or an empty list all return the
134
+ * input order. See `ComplyOptions.storyboard_start_offset`.
135
+ */
136
+ export declare function rotateStoryboardsForOffset<T>(items: readonly T[], offset: number): T[];
119
137
  /**
120
138
  * Detect whether a capability-discovery failure is an auth rejection.
121
139
  * Centralized so the "run security.yaml against 401-happy agents" path and
@@ -1 +1 @@
1
- {"version":3,"file":"comply.d.ts","sourceRoot":"","sources":["../../../../src/lib/testing/compliance/comply.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAkB,MAAM,UAAU,CAAC;AAuBtF,OAAO,KAAK,EAGV,UAAU,EAEV,gBAAgB,EAChB,oBAAoB,EAGrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAEV,eAAe,EACf,iBAAiB,EAGjB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AA2C3D;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,UAAU,EAAE,EACrB,OAAO,EAAE,YAAY,GACpB,mBAAmB,EAAE,CAuavB;AAED,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAC3B,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;IAC5D;;;O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