@adcp/sdk 17.0.0-beta.21 → 17.0.0-beta.23

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 (223) hide show
  1. package/README.md +26 -2
  2. package/dist/lib/adapters/version/index.d.mts +1 -1
  3. package/dist/lib/adapters/version/index.d.ts +1 -1
  4. package/dist/lib/adapters/version/index.js +2 -0
  5. package/dist/lib/adapters/version/index.mjs +2 -0
  6. package/dist/lib/adapters/version/negotiate.d.mts +13 -0
  7. package/dist/lib/adapters/version/negotiate.d.ts +13 -0
  8. package/dist/lib/adapters/version/negotiate.js +6 -0
  9. package/dist/lib/adapters/version/negotiate.mjs +5 -0
  10. package/dist/lib/client/core.d.mts +4 -0
  11. package/dist/lib/client/core.d.ts +4 -0
  12. package/dist/lib/client/core.js +13 -0
  13. package/dist/lib/client/core.mjs +12 -0
  14. package/dist/lib/conformance/property-lists.d.mts +1 -1
  15. package/dist/lib/conformance/property-lists.d.ts +1 -1
  16. package/dist/lib/conformance/property-lists.js +1 -1
  17. package/dist/lib/conformance/property-lists.mjs +1 -1
  18. package/dist/lib/core/SingleAgentClient.d.mts +23 -1
  19. package/dist/lib/core/SingleAgentClient.d.ts +23 -1
  20. package/dist/lib/core/SingleAgentClient.js +102 -18
  21. package/dist/lib/core/SingleAgentClient.mjs +108 -18
  22. package/dist/lib/core/targeting-helpers.d.mts +123 -0
  23. package/dist/lib/core/targeting-helpers.d.ts +123 -0
  24. package/dist/lib/core/targeting-helpers.js +412 -0
  25. package/dist/lib/core/targeting-helpers.mjs +370 -0
  26. package/dist/lib/entrypoints/client-account-changes.d.mts +5 -0
  27. package/dist/lib/entrypoints/client-account-changes.d.ts +5 -0
  28. package/dist/lib/entrypoints/client-account-changes.js +28 -0
  29. package/dist/lib/entrypoints/client-account-changes.mjs +4 -0
  30. package/dist/lib/entrypoints/client-webhook-stores.d.mts +2 -0
  31. package/dist/lib/entrypoints/client-webhook-stores.d.ts +2 -0
  32. package/dist/lib/entrypoints/client-webhook-stores.js +37 -0
  33. package/dist/lib/entrypoints/client-webhook-stores.mjs +16 -0
  34. package/dist/lib/entrypoints/discovery.d.mts +9 -0
  35. package/dist/lib/entrypoints/discovery.d.ts +9 -0
  36. package/dist/lib/entrypoints/discovery.js +72 -0
  37. package/dist/lib/entrypoints/discovery.mjs +56 -0
  38. package/dist/lib/entrypoints/errors.d.mts +11 -0
  39. package/dist/lib/entrypoints/errors.d.ts +11 -0
  40. package/dist/lib/entrypoints/errors.js +159 -0
  41. package/dist/lib/entrypoints/errors.mjs +132 -0
  42. package/dist/lib/entrypoints/media-buy.d.mts +5 -0
  43. package/dist/lib/entrypoints/media-buy.d.ts +5 -0
  44. package/dist/lib/entrypoints/media-buy.js +119 -0
  45. package/dist/lib/entrypoints/media-buy.mjs +100 -0
  46. package/dist/lib/entrypoints/registry.d.mts +5 -0
  47. package/dist/lib/entrypoints/registry.d.ts +5 -0
  48. package/dist/lib/entrypoints/registry.js +61 -0
  49. package/dist/lib/entrypoints/registry.mjs +40 -0
  50. package/dist/lib/entrypoints/utils.d.mts +7 -0
  51. package/dist/lib/entrypoints/utils.d.ts +7 -0
  52. package/dist/lib/entrypoints/utils.js +100 -0
  53. package/dist/lib/entrypoints/utils.mjs +72 -0
  54. package/dist/lib/entrypoints/version.d.mts +3 -0
  55. package/dist/lib/entrypoints/version.d.ts +3 -0
  56. package/dist/lib/entrypoints/version.js +57 -0
  57. package/dist/lib/entrypoints/version.mjs +36 -0
  58. package/dist/lib/index.d.mts +1 -1
  59. package/dist/lib/index.d.ts +1 -1
  60. package/dist/lib/media-buy/action-contracts.js +3 -3
  61. package/dist/lib/media-buy/action-contracts.mjs +1 -1
  62. package/dist/lib/media-buy/creative-start-policy.d.mts +19 -0
  63. package/dist/lib/media-buy/creative-start-policy.d.ts +19 -0
  64. package/dist/lib/media-buy/creative-start-policy.js +59 -0
  65. package/dist/lib/media-buy/creative-start-policy.mjs +31 -0
  66. package/dist/lib/media-buy/valid-actions.d.mts +47 -0
  67. package/dist/lib/media-buy/valid-actions.d.ts +47 -0
  68. package/dist/lib/media-buy/valid-actions.js +42 -0
  69. package/dist/lib/media-buy/valid-actions.mjs +18 -0
  70. package/dist/lib/net/pin-and-bind-fetch.d.mts +121 -0
  71. package/dist/lib/net/pin-and-bind-fetch.d.ts +121 -0
  72. package/dist/lib/net/pin-and-bind-fetch.js +209 -0
  73. package/dist/lib/net/pin-and-bind-fetch.mjs +183 -0
  74. package/dist/lib/protocols/mcp-modern.js +20 -4
  75. package/dist/lib/protocols/mcp-modern.mjs +20 -4
  76. package/dist/lib/registry/types.generated.d.ts +224 -3
  77. package/dist/lib/reporting/ledger/index.d.mts +1 -0
  78. package/dist/lib/reporting/ledger/index.d.ts +1 -0
  79. package/dist/lib/reporting/ledger/index.js +3 -1
  80. package/dist/lib/reporting/ledger/index.mjs +1 -0
  81. package/dist/lib/reporting/ledger/instant.d.mts +5 -0
  82. package/dist/lib/reporting/ledger/instant.d.ts +5 -0
  83. package/dist/lib/reporting/ledger/instant.js +10 -0
  84. package/dist/lib/reporting/ledger/instant.mjs +9 -0
  85. package/dist/lib/reporting/ledger/issue-events.d.mts +333 -0
  86. package/dist/lib/reporting/ledger/issue-events.d.ts +333 -0
  87. package/dist/lib/reporting/ledger/issue-events.js +310 -0
  88. package/dist/lib/reporting/ledger/issue-events.mjs +282 -0
  89. package/dist/lib/reporting/service/index.d.mts +36 -1
  90. package/dist/lib/reporting/service/index.d.ts +36 -1
  91. package/dist/lib/reporting/service/index.js +51 -1
  92. package/dist/lib/reporting/service/index.mjs +52 -2
  93. package/dist/lib/reporting/service/scheduler-support.d.mts +1 -1
  94. package/dist/lib/reporting/service/scheduler-support.d.ts +1 -1
  95. package/dist/lib/reporting/service/scheduler-support.js +1 -1
  96. package/dist/lib/reporting/service/scheduler-support.mjs +1 -1
  97. package/dist/lib/server/capabilities-release-projection.d.mts +43 -0
  98. package/dist/lib/server/capabilities-release-projection.d.ts +43 -0
  99. package/dist/lib/server/capabilities-release-projection.js +128 -0
  100. package/dist/lib/server/capabilities-release-projection.mjs +112 -0
  101. package/dist/lib/server/create-adcp-server.d.mts +29 -5
  102. package/dist/lib/server/create-adcp-server.d.ts +29 -5
  103. package/dist/lib/server/create-adcp-server.js +97 -24
  104. package/dist/lib/server/create-adcp-server.mjs +108 -23
  105. package/dist/lib/server/decisioning/capabilities.d.mts +27 -0
  106. package/dist/lib/server/decisioning/capabilities.d.ts +27 -0
  107. package/dist/lib/server/decisioning/runtime/from-platform.js +99 -27
  108. package/dist/lib/server/decisioning/runtime/from-platform.mjs +103 -27
  109. package/dist/lib/server/declared-input-schema.d.mts +108 -0
  110. package/dist/lib/server/declared-input-schema.d.ts +108 -0
  111. package/dist/lib/server/declared-input-schema.js +167 -0
  112. package/dist/lib/server/declared-input-schema.mjs +137 -0
  113. package/dist/lib/server/envelope-allowlist.d.mts +1 -105
  114. package/dist/lib/server/envelope-allowlist.d.ts +1 -105
  115. package/dist/lib/server/envelope-allowlist.js +3 -79
  116. package/dist/lib/server/envelope-allowlist.mjs +1 -71
  117. package/dist/lib/server/errors.d.mts +1 -186
  118. package/dist/lib/server/errors.d.ts +1 -186
  119. package/dist/lib/server/errors.js +3 -98
  120. package/dist/lib/server/errors.mjs +1 -94
  121. package/dist/lib/server/index.d.mts +1 -1
  122. package/dist/lib/server/index.d.ts +1 -1
  123. package/dist/lib/server/mcp-modern-server.js +21 -4
  124. package/dist/lib/server/mcp-modern-server.mjs +21 -4
  125. package/dist/lib/server/media-buy-action-resolver.d.mts +7 -0
  126. package/dist/lib/server/media-buy-action-resolver.d.ts +7 -0
  127. package/dist/lib/server/media-buy-action-resolver.js +10 -1
  128. package/dist/lib/server/media-buy-action-resolver.mjs +10 -1
  129. package/dist/lib/server/media-buy-helpers.d.mts +1 -47
  130. package/dist/lib/server/media-buy-helpers.d.ts +1 -47
  131. package/dist/lib/server/media-buy-helpers.js +3 -23
  132. package/dist/lib/server/media-buy-helpers.mjs +1 -18
  133. package/dist/lib/server/pick-safe-details.d.mts +1 -89
  134. package/dist/lib/server/pick-safe-details.d.ts +1 -89
  135. package/dist/lib/server/pick-safe-details.js +3 -61
  136. package/dist/lib/server/pick-safe-details.mjs +1 -56
  137. package/dist/lib/server/pin-and-bind-fetch.d.mts +1 -121
  138. package/dist/lib/server/pin-and-bind-fetch.d.ts +1 -121
  139. package/dist/lib/server/pin-and-bind-fetch.js +3 -190
  140. package/dist/lib/server/pin-and-bind-fetch.mjs +1 -183
  141. package/dist/lib/server/targeting-helpers.d.mts +1 -123
  142. package/dist/lib/server/targeting-helpers.d.ts +1 -123
  143. package/dist/lib/server/targeting-helpers.js +3 -393
  144. package/dist/lib/server/targeting-helpers.mjs +1 -370
  145. package/dist/lib/server/test-controller.js +7 -3
  146. package/dist/lib/server/test-controller.mjs +7 -3
  147. package/dist/lib/storage/memory-ledger.js +219 -1
  148. package/dist/lib/storage/memory-ledger.mjs +223 -1
  149. package/dist/lib/testing/client.js +26 -5
  150. package/dist/lib/testing/client.mjs +24 -5
  151. package/dist/lib/testing/compliance/storyboard-tracks.js +0 -4
  152. package/dist/lib/testing/compliance/storyboard-tracks.mjs +0 -4
  153. package/dist/lib/testing/comply-controller.js +7 -2
  154. package/dist/lib/testing/comply-controller.mjs +7 -2
  155. package/dist/lib/testing/storyboard/request-signing/grader.d.mts +21 -0
  156. package/dist/lib/testing/storyboard/request-signing/grader.d.ts +21 -0
  157. package/dist/lib/testing/storyboard/request-signing/grader.js +31 -0
  158. package/dist/lib/testing/storyboard/request-signing/grader.mjs +30 -0
  159. package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js +1 -1
  160. package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs +2 -1
  161. package/dist/lib/testing/storyboard/request-signing/types.d.mts +12 -0
  162. package/dist/lib/testing/storyboard/request-signing/types.d.ts +12 -0
  163. package/dist/lib/testing/storyboard/request-signing/vector-loader.js +7 -2
  164. package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +7 -2
  165. package/dist/lib/testing/storyboard/runner.js +4 -4
  166. package/dist/lib/testing/storyboard/runner.mjs +4 -4
  167. package/dist/lib/testing/storyboard/task-map.js +4 -1
  168. package/dist/lib/testing/storyboard/task-map.mjs +4 -1
  169. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  170. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  171. package/dist/lib/utils/adcp-error-response.d.mts +196 -0
  172. package/dist/lib/utils/adcp-error-response.d.ts +196 -0
  173. package/dist/lib/utils/adcp-error-response.js +118 -0
  174. package/dist/lib/utils/adcp-error-response.mjs +95 -0
  175. package/dist/lib/utils/buyer-retry-policy.js +2 -2
  176. package/dist/lib/utils/buyer-retry-policy.mjs +1 -1
  177. package/dist/lib/utils/capabilities.d.mts +6 -0
  178. package/dist/lib/utils/capabilities.d.ts +6 -0
  179. package/dist/lib/utils/capabilities.js +6 -2
  180. package/dist/lib/utils/capabilities.mjs +6 -2
  181. package/dist/lib/utils/envelope-allowlist.d.mts +105 -0
  182. package/dist/lib/utils/envelope-allowlist.d.ts +105 -0
  183. package/dist/lib/utils/envelope-allowlist.js +98 -0
  184. package/dist/lib/utils/envelope-allowlist.mjs +71 -0
  185. package/dist/lib/utils/pick-safe-details.d.mts +89 -0
  186. package/dist/lib/utils/pick-safe-details.d.ts +89 -0
  187. package/dist/lib/utils/pick-safe-details.js +80 -0
  188. package/dist/lib/utils/pick-safe-details.mjs +56 -0
  189. package/dist/lib/v2/projection/augment-response.d.mts +4 -0
  190. package/dist/lib/v2/projection/augment-response.d.ts +4 -0
  191. package/dist/lib/v2/projection/creative-delivery.d.mts +20 -3
  192. package/dist/lib/v2/projection/creative-delivery.d.ts +20 -3
  193. package/dist/lib/v2/projection/creative-delivery.js +20 -4
  194. package/dist/lib/v2/projection/creative-delivery.mjs +19 -4
  195. package/dist/lib/v2/projection/index.d.mts +2 -2
  196. package/dist/lib/v2/projection/index.d.ts +2 -2
  197. package/dist/lib/v2/projection/index.js +4 -0
  198. package/dist/lib/v2/projection/index.mjs +5 -1
  199. package/dist/lib/v2/projection/legacy-metadata.d.mts +7 -0
  200. package/dist/lib/v2/projection/legacy-metadata.d.ts +7 -0
  201. package/dist/lib/v2/projection/legacy-metadata.js +14 -0
  202. package/dist/lib/v2/projection/legacy-metadata.mjs +12 -0
  203. package/dist/lib/v2/projection/legacy-routes.d.mts +11 -0
  204. package/dist/lib/v2/projection/legacy-routes.d.ts +11 -0
  205. package/dist/lib/v2/projection/legacy-routes.js +2 -1
  206. package/dist/lib/v2/projection/legacy-routes.mjs +7 -2
  207. package/dist/lib/v2/projection/v1-to-v2.d.mts +21 -1
  208. package/dist/lib/v2/projection/v1-to-v2.d.ts +21 -1
  209. package/dist/lib/v2/projection/v1-to-v2.js +18 -11
  210. package/dist/lib/v2/projection/v1-to-v2.mjs +19 -11
  211. package/dist/lib/version.d.mts +3 -3
  212. package/dist/lib/version.d.ts +3 -3
  213. package/dist/lib/version.js +3 -3
  214. package/dist/lib/version.mjs +3 -3
  215. package/docs/TYPE-SUMMARY.md +2 -2
  216. package/docs/guides/CREATIVE-DELIVERY.md +12 -0
  217. package/docs/guides/REPORTING-LEDGER.md +121 -0
  218. package/docs/guides/VALIDATE-YOUR-AGENT.md +1 -0
  219. package/docs/llms.txt +2 -2
  220. package/docs/migration-14.x-rc-worksheet.md +4 -4
  221. package/docs/migration-16-to-17.md +149 -0
  222. package/docs/migration-reporting-storage-package.md +10 -0
  223. package/package.json +106 -1
package/README.md CHANGED
@@ -81,17 +81,41 @@ const health = EventSourceHealthSchema.parse(rawHealth);
81
81
 
82
82
  The browser entry also exports `GetProductsRequestSchema` and `LegacyGetProductsRequestSchema`, `BiddingPolicySchema`, `CanonicalBudgetAllocationSchema`, and the strict `SyncCreatives*` validators, with the same validation behavior as the Node entry. It has no Node built-ins in its import graph (runtime or type declarations). JSON Schema loading and tool registration helpers remain available from `@adcp/sdk/schemas`. The generated schemas still initialize together, so importing one schema can retain the full generated module in a browser bundle; per-schema tree-shaking is tracked in [#3178](https://github.com/adcontextprotocol/adcp-client/issues/3178).
83
83
 
84
- ### Focused client runtime (`@adcp/sdk/client/core`)
84
+ ### Focused client runtime (`@adcp/sdk/client/core` and friends)
85
85
 
86
86
  Applications that only call AdCP agents can avoid evaluating the SDK's server,
87
87
  compliance, testing, and unrelated protocol surfaces:
88
88
 
89
89
  ```ts
90
90
  import { ADCPMultiAgentClient, InMemoryWebhookRegistrationStore } from '@adcp/sdk/client/core';
91
+ import { AuthenticationRequiredError, decideRetry } from '@adcp/sdk/errors';
92
+ import { ADCP_VERSION } from '@adcp/sdk/version';
91
93
  ```
92
94
 
95
+ The package root still loads the server and testing helpers, because it
96
+ re-exports them. These subpaths don't:
97
+
98
+ | Subpath | What it carries |
99
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100
+ | `@adcp/sdk/client/core` | The clients (`ADCPMultiAgentClient`, `AgentClient`, `SingleAgentClient`, `CreativeAgentClient`), the in-memory webhook-registration store, `createInMemoryAgentDiscoveryCache`, `ADCP_STATUS`, `InputRequiredError` |
101
+ | `@adcp/sdk/client/account-changes` | The account change feed: `streamAccountChanges`, `restoreAccountChangeCursor`, `buildAccountChangeSubscriptionRequest`, change-recorded wake-up parsing |
102
+ | `@adcp/sdk/client/webhook-stores` | Durable webhook-registration stores: `pgWebhookRegistrationStore`, `cleanupExpiredWebhookRegistrations`, `redisWebhookRegistrationStore` |
103
+ | `@adcp/sdk/errors` | Typed errors (`AuthenticationRequiredError`, `IdempotencyConflictError`, `ADCPValidationError`, ...), `adcpErrorToTypedError`, `isErrorOfType`, `STANDARD_ERROR_CODES`, `extractAdcpErrorInfo`, `decideRetry` |
104
+ | `@adcp/sdk/version` | `ADCP_VERSION`, `LIBRARY_VERSION`, `COMPATIBLE_ADCP_VERSIONS`, `parseAdcpMajorVersion`, `resolveAdcpVersion` |
105
+ | `@adcp/sdk/registry` | `RegistryClient`, `RegistrySync`, `PropertyRegistry`, the feed-stream reader and `sanitizeStreamText` |
106
+ | `@adcp/sdk/utils` | `canonicalize`, `canonicalJsonSha256`, `unwrapProtocolResponse`, media-buy status helpers, `parseCapabilitiesResponse` and the `*_TOOLS` lists, `brandManifestToBrandReference` |
107
+ | `@adcp/sdk/discovery` | `validateAdAgents`, `resolveAgentProperties`, `canonicalizeAgentUrl`, the publisher property selector helpers, `PropertyIndex` |
108
+ | `@adcp/sdk/media-buy` | `preflightUpdateMediaBuy`, the `can*` checks, `getAvailableActions`, `MediaBuyLifecycleCoordinator` |
109
+
110
+ Every name on these subpaths is the same export as on the package root: the
111
+ same class (so `instanceof` agrees across entry points) and the same type. Some
112
+ root type names are aliases: the root's `CreateMediaBuyRequest`, `Product` and
113
+ `PackageRequest` are the canonical types from `@adcp/sdk/v2/projection`, while
114
+ `@adcp/sdk/types` exports different shapes under those names. The subpaths
115
+ above never re-export a root name with a different meaning.
116
+
93
117
  The existing `@adcp/sdk/client` path remains an alias of the package root for
94
- compatibility. Use `/client/core` when cold import and test-worker startup time
118
+ compatibility. Use the subpaths when cold import and test-worker startup time
95
119
  matter.
96
120
 
97
121
  For application monorepos, keep `skipLibCheck: true` unless you are intentionally auditing SDK declarations. If a package only needs request/response types for a few tools, prefer the per-tool slices over importing generated types through the root package or the broad `@adcp/sdk/types` barrel.
@@ -22,7 +22,7 @@ import { type AccountIdentityDowngrade, type RequestTranslation, type ResponseTr
22
22
  export type { VersionAdapter, VersionDrift } from './types.mjs';
23
23
  export type { AccountIdentityDowngrade, RequestTranslation, ResponseTranslation, TranslationStep } from './translate.mjs';
24
24
  export { translationSteps } from './translate.mjs';
25
- export { negotiateAdcpRelease, isNegotiationFailure, parseAdcpRelease, adcpMinorLine, compareAdcpMinorLines, } from './negotiate.mjs';
25
+ export { capabilityDiscoveryEnvelope, negotiateAdcpRelease, isNegotiationFailure, parseAdcpRelease, adcpMinorLine, compareAdcpMinorLines, } from './negotiate.mjs';
26
26
  export type { NegotiatedAdcpRelease, AdcpNegotiationFailure, AdcpNegotiationSource } from './negotiate.mjs';
27
27
  export { projectToolPayload, releaseDefinesTool } from './schema-projection.mjs';
28
28
  export type { ProjectionDrop, ProjectionResult } from './schema-projection.mjs';
@@ -22,7 +22,7 @@ import { type AccountIdentityDowngrade, type RequestTranslation, type ResponseTr
22
22
  export type { VersionAdapter, VersionDrift } from './types';
23
23
  export type { AccountIdentityDowngrade, RequestTranslation, ResponseTranslation, TranslationStep } from './translate';
24
24
  export { translationSteps } from './translate';
25
- export { negotiateAdcpRelease, isNegotiationFailure, parseAdcpRelease, adcpMinorLine, compareAdcpMinorLines, } from './negotiate';
25
+ export { capabilityDiscoveryEnvelope, negotiateAdcpRelease, isNegotiationFailure, parseAdcpRelease, adcpMinorLine, compareAdcpMinorLines, } from './negotiate';
26
26
  export type { NegotiatedAdcpRelease, AdcpNegotiationFailure, AdcpNegotiationSource } from './negotiate';
27
27
  export { projectToolPayload, releaseDefinesTool } from './schema-projection';
28
28
  export type { ProjectionDrop, ProjectionResult } from './schema-projection';
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var version_exports = {};
20
20
  __export(version_exports, {
21
21
  adcpMinorLine: () => import_negotiate2.adcpMinorLine,
22
+ capabilityDiscoveryEnvelope: () => import_negotiate2.capabilityDiscoveryEnvelope,
22
23
  compareAdcpMinorLines: () => import_negotiate2.compareAdcpMinorLines,
23
24
  convertRequest: () => convertRequest,
24
25
  convertResponse: () => convertResponse,
@@ -93,6 +94,7 @@ function projectResponseForRelease(toolName, payload, servedAdcpVersion, fromVer
93
94
  // Annotate the CommonJS export names for ESM import in node:
94
95
  0 && (module.exports = {
95
96
  adcpMinorLine,
97
+ capabilityDiscoveryEnvelope,
96
98
  compareAdcpMinorLines,
97
99
  convertRequest,
98
100
  convertResponse,
@@ -13,6 +13,7 @@ import {
13
13
  } from "./translate.mjs";
14
14
  import { translationSteps } from "./translate.mjs";
15
15
  import {
16
+ capabilityDiscoveryEnvelope,
16
17
  negotiateAdcpRelease,
17
18
  isNegotiationFailure,
18
19
  parseAdcpRelease as parseAdcpRelease2,
@@ -65,6 +66,7 @@ function projectResponseForRelease(toolName, payload, servedAdcpVersion, fromVer
65
66
  }
66
67
  export {
67
68
  adcpMinorLine,
69
+ capabilityDiscoveryEnvelope,
68
70
  compareAdcpMinorLines,
69
71
  convertRequest,
70
72
  convertResponse,
@@ -7,6 +7,7 @@
7
7
  * release both sides support. Requests are then converted down to that
8
8
  * release and responses converted back up (see `translate.ts`).
9
9
  */
10
+ import type { VersionEnvelopeMode } from '../../protocols/index.mjs';
10
11
  import type { AdcpCapabilities } from '../../utils/capabilities.mjs';
11
12
  export interface ParsedAdcpRelease {
12
13
  major: number;
@@ -67,5 +68,17 @@ type NegotiationCapabilities = Pick<AdcpCapabilities, 'supportedVersions' | 'ser
67
68
  * shape matches only itself, and the SDK ships GA bundles for older lines.
68
69
  */
69
70
  export declare function negotiateAdcpRelease(clientVersion: string, capabilities: NegotiationCapabilities | undefined): NegotiatedAdcpRelease | AdcpNegotiationFailure | undefined;
71
+ /**
72
+ * Version envelope for a `get_adcp_capabilities` call, or `undefined` for the
73
+ * default envelope.
74
+ *
75
+ * A preview pin is sent only to a seller that advertises that exact release,
76
+ * and discovery is how the buyer learns what a seller advertises. So when the
77
+ * release the envelope would carry (`wirePin`: the wire override, else the
78
+ * client release) is a preview, discovery goes out unpinned. An `explicit`
79
+ * envelope, from the caller or the client config, always wins: conformance
80
+ * harnesses pin discovery on purpose.
81
+ */
82
+ export declare function capabilityDiscoveryEnvelope(explicit: VersionEnvelopeMode | undefined, wirePin: string | undefined): VersionEnvelopeMode | undefined;
70
83
  export declare function isNegotiationFailure(value: NegotiatedAdcpRelease | AdcpNegotiationFailure | undefined): value is AdcpNegotiationFailure;
71
84
  export {};
@@ -7,6 +7,7 @@
7
7
  * release both sides support. Requests are then converted down to that
8
8
  * release and responses converted back up (see `translate.ts`).
9
9
  */
10
+ import type { VersionEnvelopeMode } from '../../protocols';
10
11
  import type { AdcpCapabilities } from '../../utils/capabilities';
11
12
  export interface ParsedAdcpRelease {
12
13
  major: number;
@@ -67,5 +68,17 @@ type NegotiationCapabilities = Pick<AdcpCapabilities, 'supportedVersions' | 'ser
67
68
  * shape matches only itself, and the SDK ships GA bundles for older lines.
68
69
  */
69
70
  export declare function negotiateAdcpRelease(clientVersion: string, capabilities: NegotiationCapabilities | undefined): NegotiatedAdcpRelease | AdcpNegotiationFailure | undefined;
71
+ /**
72
+ * Version envelope for a `get_adcp_capabilities` call, or `undefined` for the
73
+ * default envelope.
74
+ *
75
+ * A preview pin is sent only to a seller that advertises that exact release,
76
+ * and discovery is how the buyer learns what a seller advertises. So when the
77
+ * release the envelope would carry (`wirePin`: the wire override, else the
78
+ * client release) is a preview, discovery goes out unpinned. An `explicit`
79
+ * envelope, from the caller or the client config, always wins: conformance
80
+ * harnesses pin discovery on purpose.
81
+ */
82
+ export declare function capabilityDiscoveryEnvelope(explicit: VersionEnvelopeMode | undefined, wirePin: string | undefined): VersionEnvelopeMode | undefined;
70
83
  export declare function isNegotiationFailure(value: NegotiatedAdcpRelease | AdcpNegotiationFailure | undefined): value is AdcpNegotiationFailure;
71
84
  export {};
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var negotiate_exports = {};
20
20
  __export(negotiate_exports, {
21
21
  adcpMinorLine: () => adcpMinorLine,
22
+ capabilityDiscoveryEnvelope: () => capabilityDiscoveryEnvelope,
22
23
  compareAdcpMinorLines: () => compareAdcpMinorLines,
23
24
  isNegotiationFailure: () => isNegotiationFailure,
24
25
  negotiateAdcpRelease: () => negotiateAdcpRelease,
@@ -94,12 +95,17 @@ function negotiateAdcpRelease(clientVersion, capabilities) {
94
95
  }
95
96
  return client.prerelease ? { reason: "no_common_version", advertised: [] } : void 0;
96
97
  }
98
+ function capabilityDiscoveryEnvelope(explicit, wirePin) {
99
+ if (explicit !== void 0) return explicit;
100
+ return wirePin !== void 0 && parseAdcpRelease(wirePin)?.prerelease !== void 0 ? "none" : void 0;
101
+ }
97
102
  function isNegotiationFailure(value) {
98
103
  return value !== void 0 && "reason" in value;
99
104
  }
100
105
  // Annotate the CommonJS export names for ESM import in node:
101
106
  0 && (module.exports = {
102
107
  adcpMinorLine,
108
+ capabilityDiscoveryEnvelope,
103
109
  compareAdcpMinorLines,
104
110
  isNegotiationFailure,
105
111
  negotiateAdcpRelease,
@@ -67,11 +67,16 @@ function negotiateAdcpRelease(clientVersion, capabilities) {
67
67
  }
68
68
  return client.prerelease ? { reason: "no_common_version", advertised: [] } : void 0;
69
69
  }
70
+ function capabilityDiscoveryEnvelope(explicit, wirePin) {
71
+ if (explicit !== void 0) return explicit;
72
+ return wirePin !== void 0 && parseAdcpRelease(wirePin)?.prerelease !== void 0 ? "none" : void 0;
73
+ }
70
74
  function isNegotiationFailure(value) {
71
75
  return value !== void 0 && "reason" in value;
72
76
  }
73
77
  export {
74
78
  adcpMinorLine,
79
+ capabilityDiscoveryEnvelope,
75
80
  compareAdcpMinorLines,
76
81
  isNegotiationFailure,
77
82
  negotiateAdcpRelease,
@@ -4,6 +4,10 @@ export { ADCPMultiAgentClient, createADCPMultiAgentClient, type MultiAgentWebhoo
4
4
  export { CreativeAgentClient, createCreativeAgentClient, STANDARD_CREATIVE_AGENTS, type CreativeAgentClientConfig, type CreativeAgentListTaskOptions, type LegacyCreativeFormat, } from '../core/CreativeAgentClient.mjs';
5
5
  export { ConfigurationManager } from '../core/ConfigurationManager.mjs';
6
6
  export { InMemoryWebhookRegistrationStore, type InMemoryWebhookRegistrationStoreOptions, type WebhookAuthenticationMode, type WebhookRegistration, type WebhookRegistrationStore, } from '../core/webhook-registration.mjs';
7
+ export { createInMemoryAgentDiscoveryCache } from '../core/agent-discovery-cache.mjs';
8
+ export type { AgentDiscoveryCache, AgentDiscoveryCacheConfig, AgentDiscoveryEntry, InMemoryAgentDiscoveryCache, InMemoryAgentDiscoveryCacheOptions, } from '../core/agent-discovery-cache.mjs';
9
+ export { ADCP_STATUS, type ADCPStatus } from '../core/ProtocolResponseParser.mjs';
10
+ export { InputRequiredError, DeferredSettlementOwnershipError, DirectContinuationRecoveryError, type DirectContinuationRecoveryFailure, } from '../core/TaskExecutor.mjs';
7
11
  export type { ConversationConfig, ConversationContext, InputHandler, InputHandlerResponse, InputRequest, Message, TaskInfo, TaskOptions, TrackTaskRequest, TrackedTask, SubmittedContinuation, TaskResult, TaskResultCompleted, TaskResultFailure, TaskResultIntermediate, TaskResultMetadata, } from '../core/ConversationTypes.mjs';
8
12
  export type { AgentConfig } from '../types/adcp.mjs';
9
13
  export type { ResolveAccountOptions, ResolveAccountResult, ListedAccount } from '../core/account-resolution.mjs';
@@ -4,6 +4,10 @@ export { ADCPMultiAgentClient, createADCPMultiAgentClient, type MultiAgentWebhoo
4
4
  export { CreativeAgentClient, createCreativeAgentClient, STANDARD_CREATIVE_AGENTS, type CreativeAgentClientConfig, type CreativeAgentListTaskOptions, type LegacyCreativeFormat, } from '../core/CreativeAgentClient';
5
5
  export { ConfigurationManager } from '../core/ConfigurationManager';
6
6
  export { InMemoryWebhookRegistrationStore, type InMemoryWebhookRegistrationStoreOptions, type WebhookAuthenticationMode, type WebhookRegistration, type WebhookRegistrationStore, } from '../core/webhook-registration';
7
+ export { createInMemoryAgentDiscoveryCache } from '../core/agent-discovery-cache';
8
+ export type { AgentDiscoveryCache, AgentDiscoveryCacheConfig, AgentDiscoveryEntry, InMemoryAgentDiscoveryCache, InMemoryAgentDiscoveryCacheOptions, } from '../core/agent-discovery-cache';
9
+ export { ADCP_STATUS, type ADCPStatus } from '../core/ProtocolResponseParser';
10
+ export { InputRequiredError, DeferredSettlementOwnershipError, DirectContinuationRecoveryError, type DirectContinuationRecoveryFailure, } from '../core/TaskExecutor';
7
11
  export type { ConversationConfig, ConversationContext, InputHandler, InputHandlerResponse, InputRequest, Message, TaskInfo, TaskOptions, TrackTaskRequest, TrackedTask, SubmittedContinuation, TaskResult, TaskResultCompleted, TaskResultFailure, TaskResultIntermediate, TaskResultMetadata, } from '../core/ConversationTypes';
8
12
  export type { AgentConfig } from '../types/adcp';
9
13
  export type { ResolveAccountOptions, ResolveAccountResult, ListedAccount } from '../core/account-resolution';
@@ -19,17 +19,22 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var core_exports = {};
20
20
  __export(core_exports, {
21
21
  ADCPMultiAgentClient: () => import_ADCPMultiAgentClient.ADCPMultiAgentClient,
22
+ ADCP_STATUS: () => import_ProtocolResponseParser.ADCP_STATUS,
22
23
  AgentClient: () => import_AgentClient.AgentClient,
23
24
  CapabilityPreflightError: () => import_AgentClient.CapabilityPreflightError,
24
25
  ConfigurationManager: () => import_ConfigurationManager.ConfigurationManager,
25
26
  CreativeAgentClient: () => import_CreativeAgentClient.CreativeAgentClient,
27
+ DeferredSettlementOwnershipError: () => import_TaskExecutor.DeferredSettlementOwnershipError,
28
+ DirectContinuationRecoveryError: () => import_TaskExecutor.DirectContinuationRecoveryError,
26
29
  InMemoryWebhookRegistrationStore: () => import_webhook_registration.InMemoryWebhookRegistrationStore,
30
+ InputRequiredError: () => import_TaskExecutor.InputRequiredError,
27
31
  STANDARD_CREATIVE_AGENTS: () => import_CreativeAgentClient.STANDARD_CREATIVE_AGENTS,
28
32
  SingleAgentClient: () => import_SingleAgentClient.SingleAgentClient,
29
33
  UnsupportedFeatureError: () => import_SingleAgentClient.UnsupportedFeatureError,
30
34
  WebhookDispatchError: () => import_SingleAgentClient.WebhookDispatchError,
31
35
  createADCPMultiAgentClient: () => import_ADCPMultiAgentClient.createADCPMultiAgentClient,
32
36
  createCreativeAgentClient: () => import_CreativeAgentClient.createCreativeAgentClient,
37
+ createInMemoryAgentDiscoveryCache: () => import_agent_discovery_cache.createInMemoryAgentDiscoveryCache,
33
38
  createSingleAgentClient: () => import_SingleAgentClient.createSingleAgentClient
34
39
  });
35
40
  module.exports = __toCommonJS(core_exports);
@@ -39,19 +44,27 @@ var import_ADCPMultiAgentClient = require('../core/ADCPMultiAgentClient.js');
39
44
  var import_CreativeAgentClient = require('../core/CreativeAgentClient.js');
40
45
  var import_ConfigurationManager = require('../core/ConfigurationManager.js');
41
46
  var import_webhook_registration = require('../core/webhook-registration.js');
47
+ var import_agent_discovery_cache = require('../core/agent-discovery-cache.js');
48
+ var import_ProtocolResponseParser = require('../core/ProtocolResponseParser.js');
49
+ var import_TaskExecutor = require('../core/TaskExecutor.js');
42
50
  // Annotate the CommonJS export names for ESM import in node:
43
51
  0 && (module.exports = {
44
52
  ADCPMultiAgentClient,
53
+ ADCP_STATUS,
45
54
  AgentClient,
46
55
  CapabilityPreflightError,
47
56
  ConfigurationManager,
48
57
  CreativeAgentClient,
58
+ DeferredSettlementOwnershipError,
59
+ DirectContinuationRecoveryError,
49
60
  InMemoryWebhookRegistrationStore,
61
+ InputRequiredError,
50
62
  STANDARD_CREATIVE_AGENTS,
51
63
  SingleAgentClient,
52
64
  UnsupportedFeatureError,
53
65
  WebhookDispatchError,
54
66
  createADCPMultiAgentClient,
55
67
  createCreativeAgentClient,
68
+ createInMemoryAgentDiscoveryCache,
56
69
  createSingleAgentClient
57
70
  });
@@ -21,18 +21,30 @@ import { ConfigurationManager } from "../core/ConfigurationManager.mjs";
21
21
  import {
22
22
  InMemoryWebhookRegistrationStore
23
23
  } from "../core/webhook-registration.mjs";
24
+ import { createInMemoryAgentDiscoveryCache } from "../core/agent-discovery-cache.mjs";
25
+ import { ADCP_STATUS } from "../core/ProtocolResponseParser.mjs";
26
+ import {
27
+ InputRequiredError,
28
+ DeferredSettlementOwnershipError,
29
+ DirectContinuationRecoveryError
30
+ } from "../core/TaskExecutor.mjs";
24
31
  export {
25
32
  ADCPMultiAgentClient,
33
+ ADCP_STATUS,
26
34
  AgentClient,
27
35
  CapabilityPreflightError,
28
36
  ConfigurationManager,
29
37
  CreativeAgentClient,
38
+ DeferredSettlementOwnershipError,
39
+ DirectContinuationRecoveryError,
30
40
  InMemoryWebhookRegistrationStore,
41
+ InputRequiredError,
31
42
  STANDARD_CREATIVE_AGENTS,
32
43
  SingleAgentClient,
33
44
  UnsupportedFeatureError,
34
45
  WebhookDispatchError,
35
46
  createADCPMultiAgentClient,
36
47
  createCreativeAgentClient,
48
+ createInMemoryAgentDiscoveryCache,
37
49
  createSingleAgentClient
38
50
  };
@@ -1,5 +1,5 @@
1
1
  import type { PropertyListReference } from '../types/tools.generated.mjs';
2
- import { type ResolveListOptions } from '../server/targeting-helpers.mjs';
2
+ import { type ResolveListOptions } from '../core/targeting-helpers.mjs';
3
3
  export interface PropertyListConformanceReport {
4
4
  totalRuns: number;
5
5
  totalFailures: number;
@@ -1,5 +1,5 @@
1
1
  import type { PropertyListReference } from '../types/tools.generated';
2
- import { type ResolveListOptions } from '../server/targeting-helpers';
2
+ import { type ResolveListOptions } from '../core/targeting-helpers';
3
3
  export interface PropertyListConformanceReport {
4
4
  totalRuns: number;
5
5
  totalFailures: number;
@@ -21,7 +21,7 @@ __export(property_lists_exports, {
21
21
  runPropertyListConformance: () => runPropertyListConformance
22
22
  });
23
23
  module.exports = __toCommonJS(property_lists_exports);
24
- var import_targeting_helpers = require('../server/targeting-helpers.js');
24
+ var import_targeting_helpers = require('../core/targeting-helpers.js');
25
25
  async function runPropertyListConformance(references, options = {}) {
26
26
  const results = [];
27
27
  for (const [index, reference] of references.entries()) {
@@ -1,4 +1,4 @@
1
- import { resolvePropertyList } from "../server/targeting-helpers.mjs";
1
+ import { resolvePropertyList } from "../core/targeting-helpers.mjs";
2
2
  async function runPropertyListConformance(references, options = {}) {
3
3
  const results = [];
4
4
  for (const [index, reference] of references.entries()) {
@@ -24,7 +24,7 @@ import { BuyerAccountRegistry, type AccountPolicy, type BuyerAccountStorage } fr
24
24
  import type { ProductCache } from './product-cache.mjs';
25
25
  import { type ResolveAccountOptions, type ResolveAccountResult } from './account-resolution.mjs';
26
26
  import { type BuyerPropertyPolicy, type ProductPolicyResolvedProperty, type ProductPropertyPolicyMode } from '../media-buy/property-policy.mjs';
27
- import { type ResolveListOptions } from '../server/targeting-helpers.mjs';
27
+ import { type ResolveListOptions } from './targeting-helpers.mjs';
28
28
  import { type CanonicalCreateMediaBuyInput, type CanonicalCreativeResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsResponse, type CanonicalListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalSyncCreativesRequest, type CanonicalUpdateMediaBuyRequest, type CreativeFormatWireMode, type SyncCreativeFormatProjection } from '../v2/projection/creative-delivery.mjs';
29
29
  import type { LegacyFormatConverter } from '../v2/projection/v1-to-v2.mjs';
30
30
  import { type ProjectionCatalogSnapshot } from '../v2/projection/catalog-snapshot.mjs';
@@ -1341,6 +1341,19 @@ export declare class SingleAgentClient {
1341
1341
  */
1342
1342
  getAdcpCapabilities(params: GetAdCPCapabilitiesRequest, inputHandler?: InputHandler, options?: TaskOptions): Promise<TaskResult<GetAdCPCapabilitiesResponse>>;
1343
1343
  private getAdcpCapabilitiesWithinDeadline;
1344
+ /**
1345
+ * Dispatch `get_adcp_capabilities` under the discovery version rule.
1346
+ *
1347
+ * A preview pin goes out unpinned (see {@link capabilityDiscoveryEnvelope}),
1348
+ * and a pinned discovery the seller refuses with `VERSION_UNSUPPORTED` is
1349
+ * retried once unpinned. Neither applies when the caller chose the pin, with
1350
+ * version fields in `params` or an `explicitEnvelope`: the seller's refusal,
1351
+ * carrying its `supported_versions` in `adcpError.details`, is the answer.
1352
+ * A caller `operationId` also skips the retry, which would need an id of its
1353
+ * own. Only a successful retry replaces the pinned refusal, whose diagnostics
1354
+ * name the release actually sent.
1355
+ */
1356
+ private executeCapabilityDiscovery;
1344
1357
  /**
1345
1358
  * Build a creative through the legacy named-format protocol.
1346
1359
  * @deprecated Migration-only access to `target_format_id`-based creative building.
@@ -1983,6 +1996,15 @@ export declare class SingleAgentClient {
1983
1996
  * reaches here.
1984
1997
  */
1985
1998
  private suppressPre31DiscoveryWebhook;
1999
+ /**
2000
+ * AdCP 3.3: buyers MUST NOT send `packages[].start_requires_all_creatives_approved:
2001
+ * true` on `control_media_buy` to a seller that does not declare
2002
+ * `media_buy.features.creative_start_policy: true` (#3649). Refuses only when
2003
+ * discovery is authoritative; with synthetic or missing capabilities the
2004
+ * request is sent and the seller decides. `false`, omission and calls below
2005
+ * 3.3 are unaffected. The vocabulary matches the seller's own refusal.
2006
+ */
2007
+ private assertCreativeStartPolicyDeclared;
1986
2008
  /**
1987
2009
  * Reject shape-changing 3.1 requests after seller capability discovery.
1988
2010
  * This second gate covers a modern client talking to a 3.0 seller on the
@@ -24,7 +24,7 @@ import { BuyerAccountRegistry, type AccountPolicy, type BuyerAccountStorage } fr
24
24
  import type { ProductCache } from './product-cache';
25
25
  import { type ResolveAccountOptions, type ResolveAccountResult } from './account-resolution';
26
26
  import { type BuyerPropertyPolicy, type ProductPolicyResolvedProperty, type ProductPropertyPolicyMode } from '../media-buy/property-policy';
27
- import { type ResolveListOptions } from '../server/targeting-helpers';
27
+ import { type ResolveListOptions } from './targeting-helpers';
28
28
  import { type CanonicalCreateMediaBuyInput, type CanonicalCreativeResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsResponse, type CanonicalListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalSyncCreativesRequest, type CanonicalUpdateMediaBuyRequest, type CreativeFormatWireMode, type SyncCreativeFormatProjection } from '../v2/projection/creative-delivery';
29
29
  import type { LegacyFormatConverter } from '../v2/projection/v1-to-v2';
30
30
  import { type ProjectionCatalogSnapshot } from '../v2/projection/catalog-snapshot';
@@ -1341,6 +1341,19 @@ export declare class SingleAgentClient {
1341
1341
  */
1342
1342
  getAdcpCapabilities(params: GetAdCPCapabilitiesRequest, inputHandler?: InputHandler, options?: TaskOptions): Promise<TaskResult<GetAdCPCapabilitiesResponse>>;
1343
1343
  private getAdcpCapabilitiesWithinDeadline;
1344
+ /**
1345
+ * Dispatch `get_adcp_capabilities` under the discovery version rule.
1346
+ *
1347
+ * A preview pin goes out unpinned (see {@link capabilityDiscoveryEnvelope}),
1348
+ * and a pinned discovery the seller refuses with `VERSION_UNSUPPORTED` is
1349
+ * retried once unpinned. Neither applies when the caller chose the pin, with
1350
+ * version fields in `params` or an `explicitEnvelope`: the seller's refusal,
1351
+ * carrying its `supported_versions` in `adcpError.details`, is the answer.
1352
+ * A caller `operationId` also skips the retry, which would need an id of its
1353
+ * own. Only a successful retry replaces the pinned refusal, whose diagnostics
1354
+ * name the release actually sent.
1355
+ */
1356
+ private executeCapabilityDiscovery;
1344
1357
  /**
1345
1358
  * Build a creative through the legacy named-format protocol.
1346
1359
  * @deprecated Migration-only access to `target_format_id`-based creative building.
@@ -1983,6 +1996,15 @@ export declare class SingleAgentClient {
1983
1996
  * reaches here.
1984
1997
  */
1985
1998
  private suppressPre31DiscoveryWebhook;
1999
+ /**
2000
+ * AdCP 3.3: buyers MUST NOT send `packages[].start_requires_all_creatives_approved:
2001
+ * true` on `control_media_buy` to a seller that does not declare
2002
+ * `media_buy.features.creative_start_policy: true` (#3649). Refuses only when
2003
+ * discovery is authoritative; with synthetic or missing capabilities the
2004
+ * request is sent and the seller decides. `false`, omission and calls below
2005
+ * 3.3 are unaffected. The vocabulary matches the seller's own refusal.
2006
+ */
2007
+ private assertCreativeStartPolicyDeclared;
1986
2008
  /**
1987
2009
  * Reject shape-changing 3.1 requests after seller capability discovery.
1988
2010
  * This second gate covers a modern client talking to a 3.0 seller on the