@adcp/sdk 16.0.0-beta.1 → 16.0.0-beta.3

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 (155) hide show
  1. package/README.md +54 -0
  2. package/dist/lib/core/ConversationTypes.d.mts +8 -3
  3. package/dist/lib/core/ConversationTypes.d.ts +8 -3
  4. package/dist/lib/core/SingleAgentClient.d.mts +15 -4
  5. package/dist/lib/core/SingleAgentClient.d.ts +15 -4
  6. package/dist/lib/core/SingleAgentClient.js +29 -8
  7. package/dist/lib/core/SingleAgentClient.mjs +29 -8
  8. package/dist/lib/core/TaskExecutor.js +5 -1
  9. package/dist/lib/core/TaskExecutor.mjs +5 -1
  10. package/dist/lib/errors/index.d.mts +9 -4
  11. package/dist/lib/errors/index.d.ts +9 -4
  12. package/dist/lib/identity-3.3/generated-compat.d.mts +34 -0
  13. package/dist/lib/identity-3.3/generated-compat.d.ts +34 -0
  14. package/dist/lib/identity-3.3/generated-compat.js +16 -0
  15. package/dist/lib/identity-3.3/generated-compat.mjs +0 -0
  16. package/dist/lib/identity-3.3/index.d.mts +2 -2
  17. package/dist/lib/identity-3.3/index.d.ts +2 -2
  18. package/dist/lib/identity-3.3/index.js +4 -0
  19. package/dist/lib/identity-3.3/index.mjs +5 -1
  20. package/dist/lib/identity-3.3/lifecycle.d.mts +17 -5
  21. package/dist/lib/identity-3.3/lifecycle.d.ts +17 -5
  22. package/dist/lib/identity-3.3/lifecycle.js +32 -5
  23. package/dist/lib/identity-3.3/lifecycle.mjs +38 -6
  24. package/dist/lib/identity-3.3/revocation.d.mts +39 -3
  25. package/dist/lib/identity-3.3/revocation.d.ts +39 -3
  26. package/dist/lib/identity-3.3/revocation.js +88 -18
  27. package/dist/lib/identity-3.3/revocation.mjs +89 -19
  28. package/dist/lib/identity-3.3/server.d.mts +12 -0
  29. package/dist/lib/identity-3.3/server.d.ts +12 -0
  30. package/dist/lib/identity-3.3/server.js +103 -43
  31. package/dist/lib/identity-3.3/server.mjs +111 -45
  32. package/dist/lib/identity-3.3/trust.d.mts +62 -1
  33. package/dist/lib/identity-3.3/trust.d.ts +62 -1
  34. package/dist/lib/identity-3.3/trust.js +126 -21
  35. package/dist/lib/identity-3.3/trust.mjs +124 -21
  36. package/dist/lib/identity-3.3/types.d.mts +39 -11
  37. package/dist/lib/identity-3.3/types.d.ts +39 -11
  38. package/dist/lib/index.d.mts +3 -3
  39. package/dist/lib/index.d.ts +3 -3
  40. package/dist/lib/index.js +8 -0
  41. package/dist/lib/index.mjs +9 -1
  42. package/dist/lib/negotiation/types.d.mts +20 -39
  43. package/dist/lib/negotiation/types.d.ts +20 -39
  44. package/dist/lib/protocols/index.d.mts +61 -25
  45. package/dist/lib/protocols/index.d.ts +61 -25
  46. package/dist/lib/protocols/index.js +11 -6
  47. package/dist/lib/protocols/index.mjs +5 -2
  48. package/dist/lib/protocols/mcp-modern.js +1 -0
  49. package/dist/lib/protocols/mcp-modern.mjs +2 -1
  50. package/dist/lib/protocols/mcp.js +1 -0
  51. package/dist/lib/protocols/mcp.mjs +2 -1
  52. package/dist/lib/protocols/responseSizeLimit.d.mts +91 -5
  53. package/dist/lib/protocols/responseSizeLimit.d.ts +91 -5
  54. package/dist/lib/protocols/responseSizeLimit.js +195 -31
  55. package/dist/lib/protocols/responseSizeLimit.mjs +192 -31
  56. package/dist/lib/reporting/bigquery/index.js +8 -0
  57. package/dist/lib/reporting/bigquery/index.mjs +8 -0
  58. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  59. package/dist/lib/server/auth-signature.d.mts +6 -1
  60. package/dist/lib/server/auth-signature.d.ts +6 -1
  61. package/dist/lib/server/auth-signature.js +24 -13
  62. package/dist/lib/server/auth-signature.mjs +29 -13
  63. package/dist/lib/server/auth.d.mts +2 -2
  64. package/dist/lib/server/auth.d.ts +2 -2
  65. package/dist/lib/server/create-adcp-server.js +31 -10
  66. package/dist/lib/server/create-adcp-server.mjs +37 -11
  67. package/dist/lib/signing/crypto.d.mts +15 -0
  68. package/dist/lib/signing/crypto.d.ts +15 -0
  69. package/dist/lib/signing/crypto.js +83 -3
  70. package/dist/lib/signing/crypto.mjs +86 -3
  71. package/dist/lib/signing/fetch-async.js +1 -1
  72. package/dist/lib/signing/fetch-async.mjs +1 -1
  73. package/dist/lib/signing/fetch.js +1 -1
  74. package/dist/lib/signing/fetch.mjs +1 -1
  75. package/dist/lib/signing/middleware.js +9 -0
  76. package/dist/lib/signing/middleware.mjs +14 -0
  77. package/dist/lib/signing/parser.d.mts +8 -5
  78. package/dist/lib/signing/parser.d.ts +8 -5
  79. package/dist/lib/signing/parser.js +77 -61
  80. package/dist/lib/signing/parser.mjs +77 -61
  81. package/dist/lib/signing/revocation.js +3 -0
  82. package/dist/lib/signing/revocation.mjs +3 -0
  83. package/dist/lib/signing/server.d.mts +1 -1
  84. package/dist/lib/signing/server.d.ts +1 -1
  85. package/dist/lib/signing/server.js +2 -0
  86. package/dist/lib/signing/server.mjs +2 -1
  87. package/dist/lib/signing/signer.js +2 -8
  88. package/dist/lib/signing/signer.mjs +3 -9
  89. package/dist/lib/signing/testing.js +2 -6
  90. package/dist/lib/signing/testing.mjs +3 -7
  91. package/dist/lib/signing/verifier.js +3 -3
  92. package/dist/lib/signing/verifier.mjs +4 -4
  93. package/dist/lib/signing/web-bot-auth.d.mts +84 -10
  94. package/dist/lib/signing/web-bot-auth.d.ts +84 -10
  95. package/dist/lib/signing/web-bot-auth.js +278 -88
  96. package/dist/lib/signing/web-bot-auth.mjs +279 -94
  97. package/dist/lib/signing/webhook-verifier.js +3 -3
  98. package/dist/lib/signing/webhook-verifier.mjs +4 -4
  99. package/dist/lib/substitution/compile.js +2 -1
  100. package/dist/lib/substitution/compile.mjs +2 -1
  101. package/dist/lib/substitution/consent-macros.d.mts +4 -0
  102. package/dist/lib/substitution/consent-macros.d.ts +4 -0
  103. package/dist/lib/substitution/consent-macros.js +45 -0
  104. package/dist/lib/substitution/consent-macros.mjs +20 -0
  105. package/dist/lib/substitution/index.d.mts +1 -1
  106. package/dist/lib/substitution/index.d.ts +1 -1
  107. package/dist/lib/substitution/index.js +2 -0
  108. package/dist/lib/substitution/index.mjs +2 -1
  109. package/dist/lib/substitution/translate.d.mts +15 -2
  110. package/dist/lib/substitution/translate.d.ts +15 -2
  111. package/dist/lib/substitution/translate.js +148 -26
  112. package/dist/lib/substitution/translate.mjs +147 -26
  113. package/dist/lib/testing/client.js +2 -1
  114. package/dist/lib/testing/client.mjs +2 -1
  115. package/dist/lib/testing/scenarios/capabilities.js +1 -1
  116. package/dist/lib/testing/scenarios/capabilities.mjs +1 -1
  117. package/dist/lib/testing/storyboard/request-signing/builder.js +2 -5
  118. package/dist/lib/testing/storyboard/request-signing/builder.mjs +3 -6
  119. package/dist/lib/testing/storyboard/signer-grader/grader.js +2 -7
  120. package/dist/lib/testing/storyboard/signer-grader/grader.mjs +2 -7
  121. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  122. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  123. package/dist/lib/types/enums.generated.d.mts +3 -0
  124. package/dist/lib/types/enums.generated.d.ts +3 -0
  125. package/dist/lib/types/enums.generated.js +9 -0
  126. package/dist/lib/types/enums.generated.mjs +6 -0
  127. package/dist/lib/v2/projection/catalog-snapshot.js +3 -1
  128. package/dist/lib/v2/projection/catalog-snapshot.mjs +3 -1
  129. package/dist/lib/v2/projection/creative-delivery.d.mts +31 -9
  130. package/dist/lib/v2/projection/creative-delivery.d.ts +31 -9
  131. package/dist/lib/v2/projection/index.d.mts +1 -1
  132. package/dist/lib/v2/projection/index.d.ts +1 -1
  133. package/dist/lib/v2/projection/index.js +2 -0
  134. package/dist/lib/v2/projection/index.mjs +2 -0
  135. package/dist/lib/v2/projection/legacy-routes.d.mts +10 -0
  136. package/dist/lib/v2/projection/legacy-routes.d.ts +10 -0
  137. package/dist/lib/v2/projection/legacy-routes.js +7 -0
  138. package/dist/lib/v2/projection/legacy-routes.mjs +6 -0
  139. package/dist/lib/validation/schema-loader.js +25 -0
  140. package/dist/lib/validation/schema-loader.mjs +24 -0
  141. package/dist/lib/version.d.mts +3 -3
  142. package/dist/lib/version.d.ts +3 -3
  143. package/dist/lib/version.js +3 -3
  144. package/dist/lib/version.mjs +3 -3
  145. package/docs/TYPE-SUMMARY.md +7 -2
  146. package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +3 -2
  147. package/docs/guides/REPORTING-LEDGER.md +15 -5
  148. package/docs/guides/REPORTING-OPERATIONS.md +17 -11
  149. package/docs/guides/UNIVERSAL-MACRO-COMPILATION.md +38 -0
  150. package/docs/guides/VALIDATE-YOUR-AGENT.md +12 -0
  151. package/docs/llms.txt +2 -2
  152. package/docs/migration-12-to-13.md +8 -0
  153. package/docs/migration-14.x-rc-worksheet.md +4 -4
  154. package/docs/migration-agent-identity-3.3.md +150 -11
  155. package/package.json +4 -1
@@ -1,9 +1,9 @@
1
1
  /** Experimental drafts; the released SDK wire/schema pin remains 3.2.4. */
2
- export type AgentOnboardingMode = 'open' | 'application' | 'invite_only';
2
+ import type { GeneratedAccountCapabilities, ResolveAgentOnboarding } from './generated-compat';
3
3
  export type BillingParty = 'operator' | 'agent' | 'advertiser';
4
- export type AgentOnboardingRequirementKind = 'agent_identity' | 'grant' | 'billing_entity' | 'contract' | 'credit_application' | 'aao_verified' | 'storyboard' | 'sandbox' | 'experimental_feature';
5
- export interface AgentOnboardingRequirement {
6
- kind: AgentOnboardingRequirementKind | (string & {});
4
+ type DraftAgentOnboardingRequirementKind = 'agent_identity' | 'grant' | 'billing_entity' | 'contract' | 'credit_application' | 'aao_verified' | 'storyboard' | 'sandbox' | 'experimental_feature';
5
+ interface DraftAgentOnboardingRequirement {
6
+ kind: DraftAgentOnboardingRequirementKind;
7
7
  role?: string;
8
8
  verification_modes?: string[];
9
9
  specialisms?: string[];
@@ -11,23 +11,50 @@ export interface AgentOnboardingRequirement {
11
11
  id?: string;
12
12
  ext?: Record<string, unknown>;
13
13
  }
14
- export interface AgentOnboardingTier {
15
- mode: AgentOnboardingMode;
14
+ interface DraftAgentOnboardingTier {
15
+ mode: 'open' | 'application' | 'invite_only';
16
16
  url?: string;
17
- requirements?: AgentOnboardingRequirement[];
17
+ requirements?: DraftAgentOnboardingRequirement[];
18
18
  ext?: Record<string, unknown>;
19
19
  }
20
- export interface AgentOnboarding {
21
- sandbox?: AgentOnboardingTier;
22
- billing?: Partial<Record<BillingParty, AgentOnboardingTier>>;
20
+ interface DraftAgentOnboarding {
21
+ sandbox?: DraftAgentOnboardingTier;
22
+ billing?: Partial<Record<BillingParty, DraftAgentOnboardingTier>>;
23
23
  url?: string;
24
24
  documentation_url?: string;
25
25
  message?: string;
26
26
  ext?: Record<string, unknown>;
27
27
  }
28
+ /** `get_adcp_capabilities.account.agent_onboarding`: how a seller onboards buyer agents. */
29
+ export type AgentOnboarding = ResolveAgentOnboarding<GeneratedAccountCapabilities, DraftAgentOnboarding>;
30
+ type AgentOnboardingBilling = NonNullable<AgentOnboarding['billing']>;
31
+ /** The onboarding mode for sandbox access or for one billing party. */
32
+ export type AgentOnboardingTier = NonNullable<AgentOnboarding['sandbox']> | NonNullable<AgentOnboardingBilling[keyof AgentOnboardingBilling]>;
33
+ export type AgentOnboardingMode = AgentOnboardingTier['mode'];
34
+ /** One requirement an onboarding mode imposes, discriminated by `kind`. */
35
+ export type AgentOnboardingRequirement = NonNullable<AgentOnboardingTier['requirements']>[number];
36
+ export type AgentOnboardingRequirementKind = AgentOnboardingRequirement['kind'];
37
+ /**
38
+ * A requirement as an evaluator sees it. `kind` accepts any string because a
39
+ * counterparty on a newer revision may publish kinds this SDK does not know,
40
+ * and readers MUST treat those as unsatisfiable rather than reject the
41
+ * posture. Structural on purpose: every {@link AgentOnboardingRequirement} is
42
+ * assignable to it, whichever shape the pinned schemas give that type.
43
+ * `verified_specialisms` is the revised #8170 name for `specialisms`.
44
+ */
45
+ export interface ObservedAgentOnboardingRequirement {
46
+ kind: AgentOnboardingRequirementKind | (string & {});
47
+ role?: string;
48
+ verification_modes?: readonly string[];
49
+ specialisms?: readonly string[];
50
+ verified_specialisms?: readonly string[];
51
+ adcp_version?: string;
52
+ id?: string;
53
+ ext?: Record<string, unknown>;
54
+ }
28
55
  export interface BuyerOnboardingPosture {
29
56
  mode: 'considers_unsolicited' | 'application' | 'invite_only';
30
- requirements?: AgentOnboardingRequirement[];
57
+ requirements?: ObservedAgentOnboardingRequirement[];
31
58
  url?: string;
32
59
  documentation_url?: string;
33
60
  message?: string;
@@ -125,3 +152,4 @@ export type Identity33GetPrincipalResponse = Omit<import('../types/tools.generat
125
152
  kind: 'failed';
126
153
  }>;
127
154
  };
155
+ export {};
@@ -190,7 +190,7 @@ export { runAuthDiagnosis, AUTH_DIAGNOSIS_SCHEMA_VERSION, type DiagnoseOptions,
190
190
  export { NeedsAuthorizationError, discoverAuthorizationRequirements, hasValidatedMcpAuthorizationRequirements, createFileOAuthStorage, bindAgentStorage, getAgentStorage, unbindAgentStorage, type AuthorizationRequirements, type DiscoverAuthorizationOptions, type FileOAuthStorageOptions, } from './auth/oauth/index.mjs';
191
191
  export { exchangeClientCredentials, ensureClientCredentialsTokens, ClientCredentialsExchangeError, MissingEnvSecretError, resolveSecret, isEnvSecretReference, toEnvSecretReference, extractEnvSecretName, type ExchangeClientCredentialsOptions, type EnsureClientCredentialsOptions, type AgentOAuthClientCredentials, AgentOAuthClientCredentialsSchema, } from './auth/oauth/index.mjs';
192
192
  export { validateAgentUrl, validateAdCPResponse, getExpectedSchema, handleAdCPResponse } from './validation/index.mjs';
193
- export { ProtocolClient, callMCPTool, callA2ATool, createA2AClientFromCardUrl, createMCPClient, createA2AClient, closeMCPConnections, closeOAuthConnections, closeScopedConnections, withMCPConnectionScope, bundleSupportsAdcpVersionField, BODY_SNIPPET_TIMEOUT_MS, OBSERVER_FLUSH_TIMEOUT_MS, sanitizeTransportHeaders, sanitizeTransportUrl, } from './protocols/index.mjs';
193
+ export { ProtocolClient, callMCPTool, callA2ATool, createA2AClientFromCardUrl, createMCPClient, createA2AClient, closeMCPConnections, closeOAuthConnections, closeScopedConnections, withMCPConnectionScope, bundleSupportsAdcpVersionField, BODY_SNIPPET_TIMEOUT_MS, OBSERVER_FLUSH_TIMEOUT_MS, sanitizeTransportHeaders, sanitizeTransportUrl, DEFAULT_MAX_RESPONSE_BYTES, SSE_CUMULATIVE_BUDGET_MULTIPLIER, } from './protocols/index.mjs';
194
194
  export { toReleasePrecisionWire, validateAdcpVersionWire } from './validation/schema-loader.mjs';
195
195
  export type { CallToolOptions, TransportActivity, TransportActivityContext, TransportActivityHandler, TransportActivityType, TransportResponseOutcome, TransportOptions, A2ALegacyCompatOptions, } from './protocols/index.mjs';
196
196
  import { bundleSupportsAdcpVersionField as _isSupported } from './protocols/index.mjs';
@@ -216,7 +216,7 @@ export { FormatAsset, imageAssetSlot, videoAssetSlot, audioAssetSlot, textAssetS
216
216
  export { Render, urlRender, htmlRender, bothRender } from './utils/render-builders.mjs';
217
217
  export { FormatRender, displayRender, parameterizedRender, templateRender, type DimensionsRender, type ParameterizedRender, type RenderItem, } from './utils/format-render-builders.mjs';
218
218
  export { CanonicalFormat, canonicalFormatDeclaration, type CanonicalFormatDeclaration, type CanonicalFormatDeclaration as Format, type CanonicalFormatDeclarationFields, type CanonicalFormatKind, type CanonicalFormatParams, type ProductCardDetailedFields, type ProductCardFields, } from './v2/projection/index.mjs';
219
- export { toCanonicalFormatOptionsWithRoutes, toAdditiveCanonicalProduct, withAdditiveCanonicalFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, packageRefsForFormatOptions, FormatOptionRefsLookupError, CreativeFormatCapabilityError, CreativeFormatProjectionError, type CreativeFormatWireMode, type LegacyFormatConversionContext, type LegacyFormatConverter, type LegacyFormatResolutionContext, type LegacyFormatResolver, legacyFormatConverterFromCatalogSnapshots, canonicalFormatLegacyResolverFromCatalogSnapshots, canonicalFormatLegacyResolverFromRoutes, legacyRoutesForProduct, projectionAdaptersFromCatalogSnapshots, type ProjectionCatalogAdapters, type ProjectionCatalogSnapshot, type ProjectionCatalogSource, type CanonicalFormatLegacyResolver, type CanonicalFormatLegacyResolutionContext, type CanonicalFormatLegacyRoute, type LegacyRoutesForProductOptions, type AdditiveCanonicalProduct, type CanonicalOnlyProduct, type CanonicalCreativeAsset, type CanonicalCreativeAsset as CreativeAsset, type CanonicalSyncCreativeAsset, type CanonicalCreateMediaBuyInput, type CanonicalCreateMediaBuyRequest, type CanonicalCreateMediaBuyRequest as CreateMediaBuyRequest, type CanonicalCreateMediaBuyResponse, type CanonicalCreateMediaBuyResponse as CreateMediaBuyResponse, type CanonicalCreativeResponse, type CanonicalCreativeFilters, type CanonicalCreativeFilters as CreativeFilters, type CanonicalGetCreativeDeliveryResponse, type CanonicalGetCreativeDeliveryResponse as GetCreativeDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse as GetMediaBuyDeliveryResponse, type CanonicalGetMediaBuysResponse, type CanonicalGetMediaBuysResponse as GetMediaBuysResponse, type CanonicalGetProductsResponse as GetProductsResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsRequest as GetProductsRequest, type CanonicalListCreativesRequest, type CanonicalListCreativesRequest as ListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalListCreativesResponse as ListCreativesResponse, type CanonicalListedCreative, type CanonicalPackageRequest, type CanonicalPackageRequest as PackageRequest, type CanonicalPackageUpdate, type CanonicalPackageUpdate as PackageUpdate, type CanonicalPackage, type CanonicalPackage as Package, type CanonicalPlacement, type CanonicalPlacement as Placement, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeRequest as PreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalPreviewCreativeResponse as PreviewCreativeResponse, type CanonicalProduct, type CanonicalProduct as Product, type CanonicalProjectedCreative, type CanonicalSyncCreativesRequest, type CanonicalSyncCreativesRequest as SyncCreativesRequest, type CanonicalSyncCreativesResponse, type CanonicalSyncCreativesResponse as SyncCreativesResponse, type CanonicalUpdateMediaBuyRequest, type CanonicalUpdateMediaBuyRequest as UpdateMediaBuyRequest, type CanonicalUpdateMediaBuyResponse, type CanonicalUpdateMediaBuyResponse as UpdateMediaBuyResponse, type LegacyCreativeAsset, type CanonicalCreativeFormatSelectorContainer, type PackageFormatRefs, type ProjectionDiagnostic, type SyncCreativeFormatProjection, } from './v2/projection/index.mjs';
219
+ export { toCanonicalFormatOptionsWithRoutes, toAdditiveCanonicalProduct, withAdditiveCanonicalFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, packageRefsForFormatOptions, FormatOptionRefsLookupError, CreativeFormatCapabilityError, CreativeFormatProjectionError, type CreativeFormatWireMode, type LegacyFormatConversionContext, type LegacyFormatConverter, type LegacyFormatResolutionContext, type LegacyFormatResolver, legacyFormatConverterFromCatalogSnapshots, canonicalFormatLegacyResolverFromCatalogSnapshots, canonicalFormatLegacyResolverFromRoutes, carryFormatOptionOrigins, legacyRoutesForProduct, projectionAdaptersFromCatalogSnapshots, type ProjectionCatalogAdapters, type ProjectionCatalogSnapshot, type ProjectionCatalogSource, type CanonicalFormatLegacyResolver, type CanonicalFormatLegacyResolutionContext, type CanonicalFormatLegacyRoute, type LegacyRoutesForProductOptions, type AdditiveCanonicalProduct, type CanonicalOnlyProduct, type CanonicalCreativeAsset, type CanonicalCreativeAsset as CreativeAsset, type CanonicalSyncCreativeAsset, type CanonicalCreateMediaBuyInput, type CanonicalCreateMediaBuyRequest, type CanonicalCreateMediaBuyRequest as CreateMediaBuyRequest, type CanonicalCreateMediaBuyResponse, type CanonicalCreateMediaBuyResponse as CreateMediaBuyResponse, type CanonicalCreativeResponse, type CanonicalCreativeFilters, type CanonicalCreativeFilters as CreativeFilters, type CanonicalGetCreativeDeliveryResponse, type CanonicalGetCreativeDeliveryResponse as GetCreativeDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse as GetMediaBuyDeliveryResponse, type CanonicalGetMediaBuysResponse, type CanonicalGetMediaBuysResponse as GetMediaBuysResponse, type CanonicalGetProductsResponse as GetProductsResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsRequest as GetProductsRequest, type CanonicalListCreativesRequest, type CanonicalListCreativesRequest as ListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalListCreativesResponse as ListCreativesResponse, type CanonicalListedCreative, type CanonicalPackageRequest, type CanonicalPackageRequest as PackageRequest, type CanonicalPackageUpdate, type CanonicalPackageUpdate as PackageUpdate, type CanonicalPackage, type CanonicalPackage as Package, type CanonicalPlacement, type CanonicalPlacement as Placement, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeRequest as PreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalPreviewCreativeResponse as PreviewCreativeResponse, type CanonicalProduct, type CanonicalProduct as Product, type CanonicalProjectedCreative, type CanonicalSyncCreativesRequest, type CanonicalSyncCreativesRequest as SyncCreativesRequest, type CanonicalSyncCreativesResponse, type CanonicalSyncCreativesResponse as SyncCreativesResponse, type CanonicalUpdateMediaBuyRequest, type CanonicalUpdateMediaBuyRequest as UpdateMediaBuyRequest, type CanonicalUpdateMediaBuyResponse, type CanonicalUpdateMediaBuyResponse as UpdateMediaBuyResponse, type LegacyCreativeAsset, type CanonicalCreativeFormatSelectorContainer, type PackageFormatRefs, type ProjectionDiagnostic, type SyncCreativeFormatProjection, } from './v2/projection/index.mjs';
220
220
  export { activationKey, segmentIdActivationKey, keyValueActivationKey } from './utils/activation-key-builders.mjs';
221
221
  export { signalId, catalogSignalId, agentSignalId, getSignalId, getSignalIssuer } from './utils/signal-id-builders.mjs';
222
222
  export { buildActivateSignalRequest, getSignalActivationId, getSignalPricingOptionIds, normalizeDiscoveredSignal, } from './utils/signal-discovery-helpers.mjs';
@@ -261,7 +261,7 @@ export declare function createAdCPClient(agents?: AgentConfig[]): ADCPMultiAgent
261
261
  * @deprecated Use ADCPMultiAgentClient.fromEnv() instead
262
262
  */
263
263
  export declare function createAdCPClientFromEnv(): ADCPMultiAgentClient;
264
- export { SubstitutionObserver, SubstitutionEncoder, PreviewFetchError, MacroInRawValueError, CATALOG_MACRO_VECTORS, getCatalogMacroVector, extractTrackerUrls, matchBindings, assertRfc3986Safe, assertUnreservedOnly, assertNoNestedExpansion, assertSchemePreserved, DEFAULT_MACRO_PROHIBITED_PATTERN, enforceSsrfPolicy, enforceSsrfPolicyResolved, DEFAULT_SSRF_POLICY, encodeUnreserved, equalUnderHexCasePolicy, isUnreservedOnly, divergenceOffset, translateUniversalMacros, UnsafeNativeMappingError, compileUniversalMacroTemplate, } from './substitution/index.mjs';
264
+ export { SubstitutionObserver, SubstitutionEncoder, PreviewFetchError, MacroInRawValueError, CATALOG_MACRO_VECTORS, getCatalogMacroVector, extractTrackerUrls, matchBindings, assertRfc3986Safe, assertUnreservedOnly, assertNoNestedExpansion, assertSchemePreserved, DEFAULT_MACRO_PROHIBITED_PATTERN, enforceSsrfPolicy, enforceSsrfPolicyResolved, DEFAULT_SSRF_POLICY, encodeUnreserved, equalUnderHexCasePolicy, isUnreservedOnly, divergenceOffset, translateUniversalMacros, UnsafeNativeMappingError, MultipleVendorConsentMacrosError, compileUniversalMacroTemplate, } from './substitution/index.mjs';
265
265
  export type { ObserverFetchOptions, ObserverDispatcher, CatalogMacroVectorName, AssertionOptions as SubstitutionAssertionOptions, AssertionResult as SubstitutionAssertionResult, BindingMatch, CatalogBinding, CatalogMacroVector, PolicyResult as SubstitutionPolicyResult, SsrfPolicy, TrackerUrlRecord, MacroMapping, TranslateResult, BuiltInSourceMacroSyntax, CompileUniversalMacroTemplateInput, CompileUniversalMacroTemplateResult, CustomSourceMacroSyntax, MacroDocumentationReference, SourceMacroMapping, SourceMacroRequirement, SourceMacroRequirementSatisfaction, SourceMacroSyntax, SourceMacroSyntaxDeclaration, UniversalMacroCompileDiagnostic, UniversalMacroOccurrence, } from './substitution/index.mjs';
266
266
  export { testAgent, testAgentA2A, testAgentClient, createTestAgent, TEST_AGENT_TOKEN, TEST_AGENT_MCP_CONFIG, TEST_AGENT_A2A_CONFIG, testAgentNoAuth, testAgentNoAuthA2A, TEST_AGENT_NO_AUTH_MCP_CONFIG, TEST_AGENT_NO_AUTH_A2A_CONFIG, creativeAgent, testBrandRightsFlow, hasBrandRightsTools, expectControllerError, expectControllerSuccess, RateLimitTripObserver, RATE_LIMIT_TRIP_CONTRACT, RATE_LIMIT_TRIP_DEFAULT_REPLAY_MAX_WAIT_SECONDS, RATE_LIMIT_TRIP_MAX_ATTEMPTS_MAX, RATE_LIMIT_TRIP_MAX_ATTEMPTS_MIN, validateRateLimitTripSpec, } from './testing/index.mjs';
267
267
  export type { ControllerErrorWithDetail, TestClient, RateLimitTripSpec, RateLimitTripClient, RateLimitTripFailureCode, RateLimitTripObservation, RateLimitTripObserverOptions, RateLimitTripResponseSnapshot, RateLimitTripStructuredResult, RateLimitTripTaskOptions, } from './testing/index.mjs';
@@ -190,7 +190,7 @@ export { runAuthDiagnosis, AUTH_DIAGNOSIS_SCHEMA_VERSION, type DiagnoseOptions,
190
190
  export { NeedsAuthorizationError, discoverAuthorizationRequirements, hasValidatedMcpAuthorizationRequirements, createFileOAuthStorage, bindAgentStorage, getAgentStorage, unbindAgentStorage, type AuthorizationRequirements, type DiscoverAuthorizationOptions, type FileOAuthStorageOptions, } from './auth/oauth';
191
191
  export { exchangeClientCredentials, ensureClientCredentialsTokens, ClientCredentialsExchangeError, MissingEnvSecretError, resolveSecret, isEnvSecretReference, toEnvSecretReference, extractEnvSecretName, type ExchangeClientCredentialsOptions, type EnsureClientCredentialsOptions, type AgentOAuthClientCredentials, AgentOAuthClientCredentialsSchema, } from './auth/oauth';
192
192
  export { validateAgentUrl, validateAdCPResponse, getExpectedSchema, handleAdCPResponse } from './validation';
193
- export { ProtocolClient, callMCPTool, callA2ATool, createA2AClientFromCardUrl, createMCPClient, createA2AClient, closeMCPConnections, closeOAuthConnections, closeScopedConnections, withMCPConnectionScope, bundleSupportsAdcpVersionField, BODY_SNIPPET_TIMEOUT_MS, OBSERVER_FLUSH_TIMEOUT_MS, sanitizeTransportHeaders, sanitizeTransportUrl, } from './protocols';
193
+ export { ProtocolClient, callMCPTool, callA2ATool, createA2AClientFromCardUrl, createMCPClient, createA2AClient, closeMCPConnections, closeOAuthConnections, closeScopedConnections, withMCPConnectionScope, bundleSupportsAdcpVersionField, BODY_SNIPPET_TIMEOUT_MS, OBSERVER_FLUSH_TIMEOUT_MS, sanitizeTransportHeaders, sanitizeTransportUrl, DEFAULT_MAX_RESPONSE_BYTES, SSE_CUMULATIVE_BUDGET_MULTIPLIER, } from './protocols';
194
194
  export { toReleasePrecisionWire, validateAdcpVersionWire } from './validation/schema-loader';
195
195
  export type { CallToolOptions, TransportActivity, TransportActivityContext, TransportActivityHandler, TransportActivityType, TransportResponseOutcome, TransportOptions, A2ALegacyCompatOptions, } from './protocols';
196
196
  import { bundleSupportsAdcpVersionField as _isSupported } from './protocols';
@@ -216,7 +216,7 @@ export { FormatAsset, imageAssetSlot, videoAssetSlot, audioAssetSlot, textAssetS
216
216
  export { Render, urlRender, htmlRender, bothRender } from './utils/render-builders';
217
217
  export { FormatRender, displayRender, parameterizedRender, templateRender, type DimensionsRender, type ParameterizedRender, type RenderItem, } from './utils/format-render-builders';
218
218
  export { CanonicalFormat, canonicalFormatDeclaration, type CanonicalFormatDeclaration, type CanonicalFormatDeclaration as Format, type CanonicalFormatDeclarationFields, type CanonicalFormatKind, type CanonicalFormatParams, type ProductCardDetailedFields, type ProductCardFields, } from './v2/projection';
219
- export { toCanonicalFormatOptionsWithRoutes, toAdditiveCanonicalProduct, withAdditiveCanonicalFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, packageRefsForFormatOptions, FormatOptionRefsLookupError, CreativeFormatCapabilityError, CreativeFormatProjectionError, type CreativeFormatWireMode, type LegacyFormatConversionContext, type LegacyFormatConverter, type LegacyFormatResolutionContext, type LegacyFormatResolver, legacyFormatConverterFromCatalogSnapshots, canonicalFormatLegacyResolverFromCatalogSnapshots, canonicalFormatLegacyResolverFromRoutes, legacyRoutesForProduct, projectionAdaptersFromCatalogSnapshots, type ProjectionCatalogAdapters, type ProjectionCatalogSnapshot, type ProjectionCatalogSource, type CanonicalFormatLegacyResolver, type CanonicalFormatLegacyResolutionContext, type CanonicalFormatLegacyRoute, type LegacyRoutesForProductOptions, type AdditiveCanonicalProduct, type CanonicalOnlyProduct, type CanonicalCreativeAsset, type CanonicalCreativeAsset as CreativeAsset, type CanonicalSyncCreativeAsset, type CanonicalCreateMediaBuyInput, type CanonicalCreateMediaBuyRequest, type CanonicalCreateMediaBuyRequest as CreateMediaBuyRequest, type CanonicalCreateMediaBuyResponse, type CanonicalCreateMediaBuyResponse as CreateMediaBuyResponse, type CanonicalCreativeResponse, type CanonicalCreativeFilters, type CanonicalCreativeFilters as CreativeFilters, type CanonicalGetCreativeDeliveryResponse, type CanonicalGetCreativeDeliveryResponse as GetCreativeDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse as GetMediaBuyDeliveryResponse, type CanonicalGetMediaBuysResponse, type CanonicalGetMediaBuysResponse as GetMediaBuysResponse, type CanonicalGetProductsResponse as GetProductsResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsRequest as GetProductsRequest, type CanonicalListCreativesRequest, type CanonicalListCreativesRequest as ListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalListCreativesResponse as ListCreativesResponse, type CanonicalListedCreative, type CanonicalPackageRequest, type CanonicalPackageRequest as PackageRequest, type CanonicalPackageUpdate, type CanonicalPackageUpdate as PackageUpdate, type CanonicalPackage, type CanonicalPackage as Package, type CanonicalPlacement, type CanonicalPlacement as Placement, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeRequest as PreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalPreviewCreativeResponse as PreviewCreativeResponse, type CanonicalProduct, type CanonicalProduct as Product, type CanonicalProjectedCreative, type CanonicalSyncCreativesRequest, type CanonicalSyncCreativesRequest as SyncCreativesRequest, type CanonicalSyncCreativesResponse, type CanonicalSyncCreativesResponse as SyncCreativesResponse, type CanonicalUpdateMediaBuyRequest, type CanonicalUpdateMediaBuyRequest as UpdateMediaBuyRequest, type CanonicalUpdateMediaBuyResponse, type CanonicalUpdateMediaBuyResponse as UpdateMediaBuyResponse, type LegacyCreativeAsset, type CanonicalCreativeFormatSelectorContainer, type PackageFormatRefs, type ProjectionDiagnostic, type SyncCreativeFormatProjection, } from './v2/projection';
219
+ export { toCanonicalFormatOptionsWithRoutes, toAdditiveCanonicalProduct, withAdditiveCanonicalFormatOptions, toCanonicalOnlyProduct, toCanonicalOnlyResponse, packageRefsForFormatOptions, FormatOptionRefsLookupError, CreativeFormatCapabilityError, CreativeFormatProjectionError, type CreativeFormatWireMode, type LegacyFormatConversionContext, type LegacyFormatConverter, type LegacyFormatResolutionContext, type LegacyFormatResolver, legacyFormatConverterFromCatalogSnapshots, canonicalFormatLegacyResolverFromCatalogSnapshots, canonicalFormatLegacyResolverFromRoutes, carryFormatOptionOrigins, legacyRoutesForProduct, projectionAdaptersFromCatalogSnapshots, type ProjectionCatalogAdapters, type ProjectionCatalogSnapshot, type ProjectionCatalogSource, type CanonicalFormatLegacyResolver, type CanonicalFormatLegacyResolutionContext, type CanonicalFormatLegacyRoute, type LegacyRoutesForProductOptions, type AdditiveCanonicalProduct, type CanonicalOnlyProduct, type CanonicalCreativeAsset, type CanonicalCreativeAsset as CreativeAsset, type CanonicalSyncCreativeAsset, type CanonicalCreateMediaBuyInput, type CanonicalCreateMediaBuyRequest, type CanonicalCreateMediaBuyRequest as CreateMediaBuyRequest, type CanonicalCreateMediaBuyResponse, type CanonicalCreateMediaBuyResponse as CreateMediaBuyResponse, type CanonicalCreativeResponse, type CanonicalCreativeFilters, type CanonicalCreativeFilters as CreativeFilters, type CanonicalGetCreativeDeliveryResponse, type CanonicalGetCreativeDeliveryResponse as GetCreativeDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse, type CanonicalGetMediaBuyDeliveryResponse as GetMediaBuyDeliveryResponse, type CanonicalGetMediaBuysResponse, type CanonicalGetMediaBuysResponse as GetMediaBuysResponse, type CanonicalGetProductsResponse as GetProductsResponse, type CanonicalGetProductsRequest, type CanonicalGetProductsRequest as GetProductsRequest, type CanonicalListCreativesRequest, type CanonicalListCreativesRequest as ListCreativesRequest, type CanonicalListCreativesResponse, type CanonicalListCreativesResponse as ListCreativesResponse, type CanonicalListedCreative, type CanonicalPackageRequest, type CanonicalPackageRequest as PackageRequest, type CanonicalPackageUpdate, type CanonicalPackageUpdate as PackageUpdate, type CanonicalPackage, type CanonicalPackage as Package, type CanonicalPlacement, type CanonicalPlacement as Placement, type CanonicalPreviewCreativeRequest, type CanonicalPreviewCreativeRequest as PreviewCreativeRequest, type CanonicalPreviewCreativeResponse, type CanonicalPreviewCreativeResponse as PreviewCreativeResponse, type CanonicalProduct, type CanonicalProduct as Product, type CanonicalProjectedCreative, type CanonicalSyncCreativesRequest, type CanonicalSyncCreativesRequest as SyncCreativesRequest, type CanonicalSyncCreativesResponse, type CanonicalSyncCreativesResponse as SyncCreativesResponse, type CanonicalUpdateMediaBuyRequest, type CanonicalUpdateMediaBuyRequest as UpdateMediaBuyRequest, type CanonicalUpdateMediaBuyResponse, type CanonicalUpdateMediaBuyResponse as UpdateMediaBuyResponse, type LegacyCreativeAsset, type CanonicalCreativeFormatSelectorContainer, type PackageFormatRefs, type ProjectionDiagnostic, type SyncCreativeFormatProjection, } from './v2/projection';
220
220
  export { activationKey, segmentIdActivationKey, keyValueActivationKey } from './utils/activation-key-builders';
221
221
  export { signalId, catalogSignalId, agentSignalId, getSignalId, getSignalIssuer } from './utils/signal-id-builders';
222
222
  export { buildActivateSignalRequest, getSignalActivationId, getSignalPricingOptionIds, normalizeDiscoveredSignal, } from './utils/signal-discovery-helpers';
@@ -261,7 +261,7 @@ export declare function createAdCPClient(agents?: AgentConfig[]): ADCPMultiAgent
261
261
  * @deprecated Use ADCPMultiAgentClient.fromEnv() instead
262
262
  */
263
263
  export declare function createAdCPClientFromEnv(): ADCPMultiAgentClient;
264
- export { SubstitutionObserver, SubstitutionEncoder, PreviewFetchError, MacroInRawValueError, CATALOG_MACRO_VECTORS, getCatalogMacroVector, extractTrackerUrls, matchBindings, assertRfc3986Safe, assertUnreservedOnly, assertNoNestedExpansion, assertSchemePreserved, DEFAULT_MACRO_PROHIBITED_PATTERN, enforceSsrfPolicy, enforceSsrfPolicyResolved, DEFAULT_SSRF_POLICY, encodeUnreserved, equalUnderHexCasePolicy, isUnreservedOnly, divergenceOffset, translateUniversalMacros, UnsafeNativeMappingError, compileUniversalMacroTemplate, } from './substitution';
264
+ export { SubstitutionObserver, SubstitutionEncoder, PreviewFetchError, MacroInRawValueError, CATALOG_MACRO_VECTORS, getCatalogMacroVector, extractTrackerUrls, matchBindings, assertRfc3986Safe, assertUnreservedOnly, assertNoNestedExpansion, assertSchemePreserved, DEFAULT_MACRO_PROHIBITED_PATTERN, enforceSsrfPolicy, enforceSsrfPolicyResolved, DEFAULT_SSRF_POLICY, encodeUnreserved, equalUnderHexCasePolicy, isUnreservedOnly, divergenceOffset, translateUniversalMacros, UnsafeNativeMappingError, MultipleVendorConsentMacrosError, compileUniversalMacroTemplate, } from './substitution';
265
265
  export type { ObserverFetchOptions, ObserverDispatcher, CatalogMacroVectorName, AssertionOptions as SubstitutionAssertionOptions, AssertionResult as SubstitutionAssertionResult, BindingMatch, CatalogBinding, CatalogMacroVector, PolicyResult as SubstitutionPolicyResult, SsrfPolicy, TrackerUrlRecord, MacroMapping, TranslateResult, BuiltInSourceMacroSyntax, CompileUniversalMacroTemplateInput, CompileUniversalMacroTemplateResult, CustomSourceMacroSyntax, MacroDocumentationReference, SourceMacroMapping, SourceMacroRequirement, SourceMacroRequirementSatisfaction, SourceMacroSyntax, SourceMacroSyntaxDeclaration, UniversalMacroCompileDiagnostic, UniversalMacroOccurrence, } from './substitution';
266
266
  export { testAgent, testAgentA2A, testAgentClient, createTestAgent, TEST_AGENT_TOKEN, TEST_AGENT_MCP_CONFIG, TEST_AGENT_A2A_CONFIG, testAgentNoAuth, testAgentNoAuthA2A, TEST_AGENT_NO_AUTH_MCP_CONFIG, TEST_AGENT_NO_AUTH_A2A_CONFIG, creativeAgent, testBrandRightsFlow, hasBrandRightsTools, expectControllerError, expectControllerSuccess, RateLimitTripObserver, RATE_LIMIT_TRIP_CONTRACT, RATE_LIMIT_TRIP_DEFAULT_REPLAY_MAX_WAIT_SECONDS, RATE_LIMIT_TRIP_MAX_ATTEMPTS_MAX, RATE_LIMIT_TRIP_MAX_ATTEMPTS_MIN, validateRateLimitTripSpec, } from './testing/index';
267
267
  export type { ControllerErrorWithDetail, TestClient, RateLimitTripSpec, RateLimitTripClient, RateLimitTripFailureCode, RateLimitTripObservation, RateLimitTripObserverOptions, RateLimitTripResponseSnapshot, RateLimitTripStructuredResult, RateLimitTripTaskOptions, } from './testing/index';
package/dist/lib/index.js CHANGED
@@ -75,6 +75,7 @@ __export(index_exports, {
75
75
  CreativeFormatCapabilityError: () => import_projection2.CreativeFormatCapabilityError,
76
76
  CreativeFormatProjectionError: () => import_projection2.CreativeFormatProjectionError,
77
77
  DEFAULT_MACRO_PROHIBITED_PATTERN: () => import_substitution.DEFAULT_MACRO_PROHIBITED_PATTERN,
78
+ DEFAULT_MAX_RESPONSE_BYTES: () => import_protocols.DEFAULT_MAX_RESPONSE_BYTES,
78
79
  DEFAULT_MAX_SSE_FRAME_BYTES: () => import_registry2.DEFAULT_MAX_SSE_FRAME_BYTES,
79
80
  DEFAULT_REPORTING_CAPABILITIES: () => import_server.DEFAULT_REPORTING_CAPABILITIES,
80
81
  DEFAULT_SSRF_POLICY: () => import_substitution.DEFAULT_SSRF_POLICY,
@@ -141,6 +142,7 @@ __export(index_exports, {
141
142
  MemoryStorage: () => import_MemoryStorage.MemoryStorage,
142
143
  MissingEnvSecretError: () => import_oauth4.MissingEnvSecretError,
143
144
  MissingInputHandlerError: () => import_errors.MissingInputHandlerError,
145
+ MultipleVendorConsentMacrosError: () => import_substitution.MultipleVendorConsentMacrosError,
144
146
  NeedsAuthorizationError: () => import_oauth3.NeedsAuthorizationError,
145
147
  NetworkConsistencyChecker: () => import_network_consistency_checker.NetworkConsistencyChecker,
146
148
  OBSERVER_FLUSH_TIMEOUT_MS: () => import_protocols.OBSERVER_FLUSH_TIMEOUT_MS,
@@ -183,6 +185,7 @@ __export(index_exports, {
183
185
  SIErrorCodes: () => import_adapters.SIErrorCodes,
184
186
  SIGNALS_TOOLS: () => import_capabilities.SIGNALS_TOOLS,
185
187
  SISessionManager: () => import_adapters.SISessionManager,
188
+ SSE_CUMULATIVE_BUDGET_MULTIPLIER: () => import_protocols.SSE_CUMULATIVE_BUDGET_MULTIPLIER,
186
189
  SSRF_TRANSIENT_CODES: () => import_net.SSRF_TRANSIENT_CODES,
187
190
  STANDARD_CREATIVE_AGENTS: () => import_CreativeAgentClient.STANDARD_CREATIVE_AGENTS,
188
191
  STANDARD_ERROR_CODES: () => import_error_codes.STANDARD_ERROR_CODES,
@@ -286,6 +289,7 @@ __export(index_exports, {
286
289
  canonicalReferenceCacheKey: () => import_canonical_references.canonicalReferenceCacheKey,
287
290
  canonicalize: () => import_jcs.canonicalize,
288
291
  canonicalizeAgentUrl: () => import_resolve_agent_properties.canonicalizeAgentUrl,
292
+ carryFormatOptionOrigins: () => import_projection2.carryFormatOptionOrigins,
289
293
  catalogAssetSlot: () => import_format_asset_slot_builders.catalogAssetSlot,
290
294
  catalogSignalId: () => import_signal_id_builders.catalogSignalId,
291
295
  checkGovernance: () => import_server.checkGovernance,
@@ -920,6 +924,7 @@ function createAdCPClientFromEnv() {
920
924
  CreativeFormatCapabilityError,
921
925
  CreativeFormatProjectionError,
922
926
  DEFAULT_MACRO_PROHIBITED_PATTERN,
927
+ DEFAULT_MAX_RESPONSE_BYTES,
923
928
  DEFAULT_MAX_SSE_FRAME_BYTES,
924
929
  DEFAULT_REPORTING_CAPABILITIES,
925
930
  DEFAULT_SSRF_POLICY,
@@ -986,6 +991,7 @@ function createAdCPClientFromEnv() {
986
991
  MemoryStorage,
987
992
  MissingEnvSecretError,
988
993
  MissingInputHandlerError,
994
+ MultipleVendorConsentMacrosError,
989
995
  NeedsAuthorizationError,
990
996
  NetworkConsistencyChecker,
991
997
  OBSERVER_FLUSH_TIMEOUT_MS,
@@ -1028,6 +1034,7 @@ function createAdCPClientFromEnv() {
1028
1034
  SIErrorCodes,
1029
1035
  SIGNALS_TOOLS,
1030
1036
  SISessionManager,
1037
+ SSE_CUMULATIVE_BUDGET_MULTIPLIER,
1031
1038
  SSRF_TRANSIENT_CODES,
1032
1039
  STANDARD_CREATIVE_AGENTS,
1033
1040
  STANDARD_ERROR_CODES,
@@ -1131,6 +1138,7 @@ function createAdCPClientFromEnv() {
1131
1138
  canonicalReferenceCacheKey,
1132
1139
  canonicalize,
1133
1140
  canonicalizeAgentUrl,
1141
+ carryFormatOptionOrigins,
1134
1142
  catalogAssetSlot,
1135
1143
  catalogSignalId,
1136
1144
  checkGovernance,
@@ -465,7 +465,9 @@ import {
465
465
  BODY_SNIPPET_TIMEOUT_MS,
466
466
  OBSERVER_FLUSH_TIMEOUT_MS,
467
467
  sanitizeTransportHeaders,
468
- sanitizeTransportUrl
468
+ sanitizeTransportUrl,
469
+ DEFAULT_MAX_RESPONSE_BYTES,
470
+ SSE_CUMULATIVE_BUDGET_MULTIPLIER
469
471
  } from "./protocols/index.mjs";
470
472
  import { toReleasePrecisionWire, validateAdcpVersionWire } from "./validation/schema-loader.mjs";
471
473
  import { bundleSupportsAdcpVersionField as _isSupported } from "./protocols/index.mjs";
@@ -575,6 +577,7 @@ import {
575
577
  legacyFormatConverterFromCatalogSnapshots,
576
578
  canonicalFormatLegacyResolverFromCatalogSnapshots,
577
579
  canonicalFormatLegacyResolverFromRoutes,
580
+ carryFormatOptionOrigins,
578
581
  legacyRoutesForProduct,
579
582
  projectionAdaptersFromCatalogSnapshots
580
583
  } from "./v2/projection/index.mjs";
@@ -784,6 +787,7 @@ import {
784
787
  divergenceOffset,
785
788
  translateUniversalMacros,
786
789
  UnsafeNativeMappingError,
790
+ MultipleVendorConsentMacrosError,
787
791
  compileUniversalMacroTemplate
788
792
  } from "./substitution/index.mjs";
789
793
  import {
@@ -878,6 +882,7 @@ export {
878
882
  CreativeFormatCapabilityError,
879
883
  CreativeFormatProjectionError,
880
884
  DEFAULT_MACRO_PROHIBITED_PATTERN,
885
+ DEFAULT_MAX_RESPONSE_BYTES,
881
886
  DEFAULT_MAX_SSE_FRAME_BYTES,
882
887
  DEFAULT_REPORTING_CAPABILITIES,
883
888
  DEFAULT_SSRF_POLICY,
@@ -944,6 +949,7 @@ export {
944
949
  MemoryStorage,
945
950
  MissingEnvSecretError,
946
951
  MissingInputHandlerError,
952
+ MultipleVendorConsentMacrosError,
947
953
  NeedsAuthorizationError,
948
954
  NetworkConsistencyChecker,
949
955
  OBSERVER_FLUSH_TIMEOUT_MS,
@@ -986,6 +992,7 @@ export {
986
992
  SIErrorCodes,
987
993
  SIGNALS_TOOLS,
988
994
  SISessionManager,
995
+ SSE_CUMULATIVE_BUDGET_MULTIPLIER,
989
996
  SSRF_TRANSIENT_CODES,
990
997
  STANDARD_CREATIVE_AGENTS,
991
998
  STANDARD_ERROR_CODES,
@@ -1089,6 +1096,7 @@ export {
1089
1096
  canonicalReferenceCacheKey,
1090
1097
  canonicalize,
1091
1098
  canonicalizeAgentUrl,
1099
+ carryFormatOptionOrigins,
1092
1100
  catalogAssetSlot,
1093
1101
  catalogSignalId,
1094
1102
  checkGovernance,
@@ -1,5 +1,5 @@
1
1
  /** Public AdCP proposal-negotiation types (introduced by the 3.2 contract). */
2
- import type { AcceptanceContext, CanonicalDeliveryForecast, CanonicalProposal as GeneratedCanonicalProposal, MediaBuyFrequencyCap, OutcomeTarget, ProductMediaBuySupportRequirements, ProductPurchase as GeneratedProductPurchase } from '../types/core.generated.mjs';
2
+ import type { AcceptanceContext, CanonicalProposal as GeneratedCanonicalProposal, MediaBuyFrequencyCap, OutcomeTarget, ProductMediaBuySupportRequirements, ProductPurchase as GeneratedProductPurchase } from '../types/core.generated.mjs';
3
3
  export type { AcceptanceContext, CanonicalDeliveryForecast, CanonicalForecastPoint, MediaBuyFrequencyCap, OutcomeTarget, ProductMediaBuySupportRequirements, } from '../types/core.generated.mjs';
4
4
  export declare const PROPOSAL_REFINEMENT_DIMENSIONS: readonly ["total_budget", "cpm", "impressions", "flight", "product_changes", "alternatives", "criteria"];
5
5
  export type ProposalRefinementDimension = (typeof PROPOSAL_REFINEMENT_DIMENSIONS)[number];
@@ -109,31 +109,17 @@ export interface ProposalResolvedPricing {
109
109
  min_spend_per_package?: number;
110
110
  commission_rate?: number;
111
111
  }
112
- export interface ProposalPurchase {
113
- product_id: string;
114
- pricing_option_id: string;
112
+ /**
113
+ * A purchase inside proposal commercial terms. Every field comes from the
114
+ * generated `ProductPurchase` wire type, so fields the pinned schemas add reach
115
+ * this type without edits here. Only `pricing` is widened.
116
+ */
117
+ export interface ProposalPurchase extends Omit<GeneratedProductPurchase, ProposalPurchaseOverriddenKey> {
115
118
  /** Resolved pricing is required in accepted snapshots but optional on direct-purchase inputs. */
116
119
  pricing?: ProposalResolvedPricing | GeneratedProductPurchase['pricing'];
117
- format_option_refs?: GeneratedProductPurchase['format_option_refs'];
118
- catalog_ids?: GeneratedProductPurchase['catalog_ids'];
119
- budget?: GeneratedProductPurchase['budget'];
120
- daily_budget_cap?: GeneratedProductPurchase['daily_budget_cap'];
121
- min_spend_target?: GeneratedProductPurchase['min_spend_target'];
122
- impressions?: number;
123
- start_time?: string;
124
- end_time?: string;
125
- pacing?: GeneratedProductPurchase['pacing'];
126
- bidding?: GeneratedProductPurchase['bidding'];
127
- targeting_overlay?: GeneratedProductPurchase['targeting_overlay'];
128
- optimization_goals?: GeneratedProductPurchase['optimization_goals'];
129
- audience_evidence_requirements?: GeneratedProductPurchase['audience_evidence_requirements'];
130
- audience_evidence_pins?: GeneratedProductPurchase['audience_evidence_pins'];
131
- agency_estimate_number?: GeneratedProductPurchase['agency_estimate_number'];
132
- context?: GeneratedProductPurchase['context'];
133
- ext?: GeneratedProductPurchase['ext'];
134
- measurement_terms?: GeneratedProductPurchase['measurement_terms'];
135
- performance_standards?: GeneratedProductPurchase['performance_standards'];
136
120
  }
121
+ /** Generated `ProductPurchase` fields whose SDK type is intentionally wider. */
122
+ type ProposalPurchaseOverriddenKey = 'pricing';
137
123
  export interface ProposalCommercialTerms<TPurchase extends ProposalPurchase = ProposalPurchase> {
138
124
  /** Keep the legacy open object while accepting the generated compact BrandKey. */
139
125
  brand: Record<string, unknown> | GeneratedCanonicalProposal['commercial_terms']['brand'];
@@ -145,25 +131,20 @@ export interface ProposalCommercialTerms<TPurchase extends ProposalPurchase = Pr
145
131
  currency: string;
146
132
  };
147
133
  }
148
- export interface CanonicalProposal<TTerms extends ProposalCommercialTerms = ProposalCommercialTerms> {
149
- proposal_id: string;
150
- proposal_kind: 'new_media_buy' | 'media_buy_update' | 'media_buy_cancellation';
151
- parent_proposal_id?: string;
152
- media_buy_id?: string;
153
- base_media_buy_revision?: number;
154
- opportunity_id?: string;
155
- proposal_status: 'draft' | 'committed' | 'accepted';
156
- accepted_at?: string;
157
- expires_at?: string;
158
- name: string;
159
- description?: string;
160
- brief_alignment?: string;
134
+ /**
135
+ * A canonical proposal snapshot. Every field comes from the generated
136
+ * `CanonicalProposal` wire type (including fields such as `hold_policy` and
137
+ * `hold_placed_at` once the pinned schemas define them), so the SDK type tracks
138
+ * spec revisions without edits here. Only two fields are re-declared:
139
+ * `commercial_terms` is generic over the caller's terms type and `insertion_order` keeps the
140
+ * legacy open object.
141
+ */
142
+ export interface CanonicalProposal<TTerms extends ProposalCommercialTerms = ProposalCommercialTerms> extends Omit<GeneratedCanonicalProposal, CanonicalProposalOverriddenKey> {
161
143
  commercial_terms: TTerms;
162
- terms_digest: string;
163
144
  insertion_order?: Record<string, unknown> | GeneratedCanonicalProposal['insertion_order'];
164
- total_budget_guidance?: GeneratedCanonicalProposal['total_budget_guidance'];
165
- forecast?: CanonicalDeliveryForecast;
166
145
  }
146
+ /** Generated `CanonicalProposal` fields whose SDK type is intentionally re-declared. */
147
+ type CanonicalProposalOverriddenKey = 'commercial_terms' | 'insertion_order';
167
148
  export type ProposalRefinementReason = 'commercially_declined' | 'constraint_unsatisfiable' | 'unsupported_dimension' | 'uninterpreted' | 'alternatives_unavailable' | 'source_unavailable' | 'hold_unavailable' | 'batch_aborted';
168
149
  export interface RefinedProposalResult<TProposal extends CanonicalProposal = CanonicalProposal> {
169
150
  source_proposal_id: string;
@@ -1,5 +1,5 @@
1
1
  /** Public AdCP proposal-negotiation types (introduced by the 3.2 contract). */
2
- import type { AcceptanceContext, CanonicalDeliveryForecast, CanonicalProposal as GeneratedCanonicalProposal, MediaBuyFrequencyCap, OutcomeTarget, ProductMediaBuySupportRequirements, ProductPurchase as GeneratedProductPurchase } from '../types/core.generated';
2
+ import type { AcceptanceContext, CanonicalProposal as GeneratedCanonicalProposal, MediaBuyFrequencyCap, OutcomeTarget, ProductMediaBuySupportRequirements, ProductPurchase as GeneratedProductPurchase } from '../types/core.generated';
3
3
  export type { AcceptanceContext, CanonicalDeliveryForecast, CanonicalForecastPoint, MediaBuyFrequencyCap, OutcomeTarget, ProductMediaBuySupportRequirements, } from '../types/core.generated';
4
4
  export declare const PROPOSAL_REFINEMENT_DIMENSIONS: readonly ["total_budget", "cpm", "impressions", "flight", "product_changes", "alternatives", "criteria"];
5
5
  export type ProposalRefinementDimension = (typeof PROPOSAL_REFINEMENT_DIMENSIONS)[number];
@@ -109,31 +109,17 @@ export interface ProposalResolvedPricing {
109
109
  min_spend_per_package?: number;
110
110
  commission_rate?: number;
111
111
  }
112
- export interface ProposalPurchase {
113
- product_id: string;
114
- pricing_option_id: string;
112
+ /**
113
+ * A purchase inside proposal commercial terms. Every field comes from the
114
+ * generated `ProductPurchase` wire type, so fields the pinned schemas add reach
115
+ * this type without edits here. Only `pricing` is widened.
116
+ */
117
+ export interface ProposalPurchase extends Omit<GeneratedProductPurchase, ProposalPurchaseOverriddenKey> {
115
118
  /** Resolved pricing is required in accepted snapshots but optional on direct-purchase inputs. */
116
119
  pricing?: ProposalResolvedPricing | GeneratedProductPurchase['pricing'];
117
- format_option_refs?: GeneratedProductPurchase['format_option_refs'];
118
- catalog_ids?: GeneratedProductPurchase['catalog_ids'];
119
- budget?: GeneratedProductPurchase['budget'];
120
- daily_budget_cap?: GeneratedProductPurchase['daily_budget_cap'];
121
- min_spend_target?: GeneratedProductPurchase['min_spend_target'];
122
- impressions?: number;
123
- start_time?: string;
124
- end_time?: string;
125
- pacing?: GeneratedProductPurchase['pacing'];
126
- bidding?: GeneratedProductPurchase['bidding'];
127
- targeting_overlay?: GeneratedProductPurchase['targeting_overlay'];
128
- optimization_goals?: GeneratedProductPurchase['optimization_goals'];
129
- audience_evidence_requirements?: GeneratedProductPurchase['audience_evidence_requirements'];
130
- audience_evidence_pins?: GeneratedProductPurchase['audience_evidence_pins'];
131
- agency_estimate_number?: GeneratedProductPurchase['agency_estimate_number'];
132
- context?: GeneratedProductPurchase['context'];
133
- ext?: GeneratedProductPurchase['ext'];
134
- measurement_terms?: GeneratedProductPurchase['measurement_terms'];
135
- performance_standards?: GeneratedProductPurchase['performance_standards'];
136
120
  }
121
+ /** Generated `ProductPurchase` fields whose SDK type is intentionally wider. */
122
+ type ProposalPurchaseOverriddenKey = 'pricing';
137
123
  export interface ProposalCommercialTerms<TPurchase extends ProposalPurchase = ProposalPurchase> {
138
124
  /** Keep the legacy open object while accepting the generated compact BrandKey. */
139
125
  brand: Record<string, unknown> | GeneratedCanonicalProposal['commercial_terms']['brand'];
@@ -145,25 +131,20 @@ export interface ProposalCommercialTerms<TPurchase extends ProposalPurchase = Pr
145
131
  currency: string;
146
132
  };
147
133
  }
148
- export interface CanonicalProposal<TTerms extends ProposalCommercialTerms = ProposalCommercialTerms> {
149
- proposal_id: string;
150
- proposal_kind: 'new_media_buy' | 'media_buy_update' | 'media_buy_cancellation';
151
- parent_proposal_id?: string;
152
- media_buy_id?: string;
153
- base_media_buy_revision?: number;
154
- opportunity_id?: string;
155
- proposal_status: 'draft' | 'committed' | 'accepted';
156
- accepted_at?: string;
157
- expires_at?: string;
158
- name: string;
159
- description?: string;
160
- brief_alignment?: string;
134
+ /**
135
+ * A canonical proposal snapshot. Every field comes from the generated
136
+ * `CanonicalProposal` wire type (including fields such as `hold_policy` and
137
+ * `hold_placed_at` once the pinned schemas define them), so the SDK type tracks
138
+ * spec revisions without edits here. Only two fields are re-declared:
139
+ * `commercial_terms` is generic over the caller's terms type and `insertion_order` keeps the
140
+ * legacy open object.
141
+ */
142
+ export interface CanonicalProposal<TTerms extends ProposalCommercialTerms = ProposalCommercialTerms> extends Omit<GeneratedCanonicalProposal, CanonicalProposalOverriddenKey> {
161
143
  commercial_terms: TTerms;
162
- terms_digest: string;
163
144
  insertion_order?: Record<string, unknown> | GeneratedCanonicalProposal['insertion_order'];
164
- total_budget_guidance?: GeneratedCanonicalProposal['total_budget_guidance'];
165
- forecast?: CanonicalDeliveryForecast;
166
145
  }
146
+ /** Generated `CanonicalProposal` fields whose SDK type is intentionally re-declared. */
147
+ type CanonicalProposalOverriddenKey = 'commercial_terms' | 'insertion_order';
167
148
  export type ProposalRefinementReason = 'commercially_declined' | 'constraint_unsatisfiable' | 'unsupported_dimension' | 'uninterpreted' | 'alternatives_unavailable' | 'source_unavailable' | 'hold_unavailable' | 'batch_aborted';
168
149
  export interface RefinedProposalResult<TProposal extends CanonicalProposal = CanonicalProposal> {
169
150
  source_proposal_id: string;
@@ -11,6 +11,7 @@ export { withMCPConnectionScope };
11
11
  export type { MCPCallOptions, MCPConnectionResult } from './mcp.mjs';
12
12
  export { callA2ATool, createA2AClientFromCardUrl } from './a2a.mjs';
13
13
  export { DEFAULT_REQUEST_TIMEOUT_MS } from './abort.mjs';
14
+ export { DEFAULT_MAX_RESPONSE_BYTES, SSE_CUMULATIVE_BUDGET_MULTIPLIER } from './responseSizeLimit.mjs';
14
15
  export { callMCPToolWithTasks, getMCPTaskStatus, getMCPTaskResult, listMCPTasks, cancelMCPTask, mapMCPTaskStatus, serverSupportsTasks, } from './mcp-tasks.mjs';
15
16
  import type { AgentConfig, DebugLogEntry } from '../types/index.mjs';
16
17
  import type { PushNotificationConfig } from '../types/tools.generated.mjs';
@@ -36,36 +37,71 @@ export declare function bundleSupportsAdcpVersionField(bundleKey: string): boole
36
37
  export interface TransportOptions {
37
38
  /**
38
39
  * Maximum response body size (in octets) the SDK will read before aborting
39
- * with `ResponseTooLargeError`. When unset, the SDK does not impose a cap —
40
- * matches the underlying MCP / A2A transport defaults.
40
+ * with `ResponseTooLargeError`.
41
41
  *
42
- * Set this when crawling **untrusted** agents (registries, federated
43
- * discovery layers, monitoring tools) to prevent a hostile vendor from
44
- * buffering a large reply before any application-layer schema validation
45
- * runs. Counted across response chunks; pre-cancels when `Content-Length`
46
- * exceeds the cap. Applies to A2A agent-card discovery
47
- * (`/.well-known/agent.json`) on the same call as well.
42
+ * **Defaults to 4 MiB** (`DEFAULT_MAX_RESPONSE_BYTES`). Agent responses are
43
+ * untrusted input, so the cap is on by default on every MCP and A2A call
44
+ * path — tool calls, endpoint discovery, `tools/list`, and A2A agent-card
45
+ * lookup (`/.well-known/agent.json`). Counted across response chunks as
46
+ * they arrive; pre-cancels when `Content-Length` already exceeds the cap.
48
47
  *
49
- * Per-call override (`TaskOptions.transport.maxResponseBytes`) beats the
50
- * value set on the client constructor (`SingleAgentClientConfig.transport`).
48
+ * Raise it for an agent that legitimately publishes a large catalog; lower
49
+ * it when crawling **untrusted** agents (registries, federated discovery
50
+ * layers, monitoring tools). Set it to exactly `0` to opt out of
51
+ * enforcement entirely — an explicit opt-out, never the default. `Infinity`
52
+ * and negative values are *not* opt-outs: they fall back to the 4 MiB
53
+ * default, because they almost always arrive from a misparsed env var or a
54
+ * budget subtraction rather than an intention. Use `0`.
55
+ *
56
+ * Per-call `transport` **replaces** the client constructor's `transport`
57
+ * object rather than merging field by field
58
+ * (`TaskOptions.transport` ?? `SingleAgentClientConfig.transport`), so a
59
+ * per-call object that omits `maxResponseBytes` gets the default back, not
60
+ * the constructor's value. Repeat the field when you override the object.
61
+ *
62
+ * Cached MCP connections are keyed on the cap, so varying it per call opens
63
+ * a separate connection (and MCP session) per distinct value against the
64
+ * same agent. That is deliberate — a connection established under one
65
+ * policy must not serve a call that configured another — but it means
66
+ * raising the cap for one tool is not free. Prefer a single client-level
67
+ * value where you can, or pin the session explicitly with
68
+ * `withMCPConnectionScope` when continuity matters.
51
69
  *
52
70
  * @remarks
53
- * **Safe to set on all calls.** SSE responses (`text/event-stream`) are
54
- * passed through unchanged — a single tool call legitimately emits N status
55
- * frames + a final result, bounded by protocol-level framing rather than
56
- * cumulative byte counts. The cap applies to one-shot JSON responses
57
- * (`get_adcp_capabilities`, agent-card lookup, tool result payloads on
58
- * non-streaming transports) where the body is bounded by definition.
71
+ * **SSE is covered too.** `text/event-stream` responses used to be exempt,
72
+ * which let any peer opt itself out of the cap by changing one response
73
+ * header. They now carry two bounds: no single event frame may exceed
74
+ * `maxResponseBytes` (the memory bound — an SSE consumer buffers one frame
75
+ * at a time), and the cumulative event-stream octets read during one call
76
+ * may not exceed `maxResponseBytes * 2`
77
+ * (`SSE_CUMULATIVE_BUDGET_MULTIPLIER`, the liveness bound that stops an
78
+ * endless drip of individually legal frames). Both failures raise the same
79
+ * `ResponseTooLargeError`; nothing is silently truncated.
80
+ *
81
+ * A long-lived `GET` event-stream — MCP's standalone notification listener,
82
+ * the legacy SSE transport — outlives the call that opened it, so it meters
83
+ * its cumulative allowance per *connection* instead of per call. That makes
84
+ * the cumulative number a memory bound there, not a liveness bound: a peer
85
+ * that keeps tripping it gets a reconnect cycle at a bounded cost per
86
+ * cycle. Cached connections are keyed on the cap in effect, so a listener
87
+ * is only ever reused by calls that configured the same policy as the call
88
+ * that opened it.
59
89
  *
60
90
  * @remarks
61
- * **Hostile-peer note:** A peer can opt itself out of this cap by responding
62
- * with `Content-Type: text/event-stream`. SSE is bypassed because cumulative
63
- * event-frame bytes are unbounded by spec — MCP and A2A both stream tool
64
- * responses this way. The MCP/A2A SDKs consume SSE incrementally and frame
65
- * termination bounds memory in practice, so this is not a memory-bomb risk
66
- * for well-formed transports. Adopters relying on `maxResponseBytes` as a
67
- * hostile-server defense should treat it as best-effort for non-SSE
68
- * responses only.
91
+ * **Compression and streaming failures.** The byte counter runs downstream
92
+ * of the runtime's content-decoder, so it measures decompressed octets: a
93
+ * small gzip blob that inflates to gigabytes still trips the cap after
94
+ * `maxResponseBytes` of output. The `Content-Length` pre-check, by
95
+ * contrast, sees the compressed length and is therefore only a fast path,
96
+ * not the guarantee.
97
+ *
98
+ * On a streaming transport the cap errors the response body. Some
99
+ * transports classify that as a stream disconnect and retry rather than
100
+ * propagating it, so the call would otherwise run out its deadline: the SDK
101
+ * records the violation and, if the call then fails, raises
102
+ * `ResponseTooLargeError` with the transport's own error as `cause` instead
103
+ * of the timeout. A buyer never gets a timeout for what is really an
104
+ * over-cap response.
69
105
  *
70
106
  * @remarks
71
107
  * Future hardening knobs (DNS-rebind defense, scheme allow-list, request
@@ -197,7 +233,7 @@ export interface PreparedProtocolToolCall {
197
233
  args: Record<string, unknown>;
198
234
  /** Native A2A TaskPushNotificationConfig retained independently of AdCP registration. */
199
235
  pushNotificationConfig?: PushNotificationConfig;
200
- /** Stable operation ID generated for a beta.5 application webhook registration. */
236
+ /** Stable operation ID generated for an AdCP 3.1+ application webhook registration. */
201
237
  operationId?: string;
202
238
  }
203
239
  /**