@adcp/sdk 14.1.0 → 14.3.0

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 (139) hide show
  1. package/dist/lib/core/SingleAgentClient.d.mts +4 -1
  2. package/dist/lib/core/SingleAgentClient.d.ts +4 -1
  3. package/dist/lib/core/SingleAgentClient.js +25 -4
  4. package/dist/lib/core/SingleAgentClient.mjs +25 -4
  5. package/dist/lib/core/TaskExecutor.d.mts +3 -1
  6. package/dist/lib/core/TaskExecutor.d.ts +3 -1
  7. package/dist/lib/core/TaskExecutor.js +15 -11
  8. package/dist/lib/core/TaskExecutor.mjs +15 -11
  9. package/dist/lib/core/buyer-account-registry.d.mts +30 -2
  10. package/dist/lib/core/buyer-account-registry.d.ts +30 -2
  11. package/dist/lib/core/buyer-account-registry.js +126 -42
  12. package/dist/lib/core/buyer-account-registry.mjs +127 -43
  13. package/dist/lib/index.d.mts +3 -2
  14. package/dist/lib/index.d.ts +3 -2
  15. package/dist/lib/index.js +9 -0
  16. package/dist/lib/index.mjs +12 -1
  17. package/dist/lib/net/agent-transport-fetch.d.mts +4 -0
  18. package/dist/lib/net/agent-transport-fetch.d.ts +4 -0
  19. package/dist/lib/net/agent-transport-fetch.js +18 -5
  20. package/dist/lib/net/agent-transport-fetch.mjs +17 -5
  21. package/dist/lib/reporting/inspection.d.mts +3 -3
  22. package/dist/lib/reporting/inspection.d.ts +3 -3
  23. package/dist/lib/reporting/inspection.js +229 -84
  24. package/dist/lib/reporting/inspection.mjs +229 -84
  25. package/dist/lib/reporting/ledger/status-ingest.js +3 -19
  26. package/dist/lib/reporting/ledger/status-ingest.mjs +2 -18
  27. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  28. package/dist/lib/server/create-adcp-server.js +5 -2
  29. package/dist/lib/server/create-adcp-server.mjs +5 -2
  30. package/dist/lib/signing/agent-resolver/errors.d.mts +2 -0
  31. package/dist/lib/signing/agent-resolver/errors.d.ts +2 -0
  32. package/dist/lib/signing/agent-resolver/errors.js +6 -0
  33. package/dist/lib/signing/agent-resolver/errors.mjs +6 -0
  34. package/dist/lib/signing/agent-resolver/fetch-helpers.d.mts +9 -0
  35. package/dist/lib/signing/agent-resolver/fetch-helpers.d.ts +9 -0
  36. package/dist/lib/signing/agent-resolver/fetch-helpers.js +35 -1
  37. package/dist/lib/signing/agent-resolver/fetch-helpers.mjs +38 -2
  38. package/dist/lib/signing/agent-resolver/legacy-brand.js +1 -1
  39. package/dist/lib/signing/agent-resolver/legacy-brand.mjs +2 -2
  40. package/dist/lib/signing/agent-resolver/resolve-agent.d.mts +1 -1
  41. package/dist/lib/signing/agent-resolver/resolve-agent.d.ts +1 -1
  42. package/dist/lib/signing/agent-resolver/resolve-agent.js +47 -5
  43. package/dist/lib/signing/agent-resolver/resolve-agent.mjs +55 -6
  44. package/dist/lib/signing/brand-jwks.d.mts +2 -0
  45. package/dist/lib/signing/brand-jwks.d.ts +2 -0
  46. package/dist/lib/signing/brand-jwks.js +10 -2
  47. package/dist/lib/signing/brand-jwks.mjs +10 -2
  48. package/dist/lib/signing/canonicalize.d.mts +2 -0
  49. package/dist/lib/signing/canonicalize.d.ts +2 -0
  50. package/dist/lib/signing/canonicalize.js +1 -1
  51. package/dist/lib/signing/canonicalize.mjs +1 -1
  52. package/dist/lib/signing/errors.d.mts +4 -2
  53. package/dist/lib/signing/errors.d.ts +4 -2
  54. package/dist/lib/signing/errors.js +3 -1
  55. package/dist/lib/signing/errors.mjs +3 -1
  56. package/dist/lib/signing/verifier.js +2 -2
  57. package/dist/lib/signing/verifier.mjs +2 -2
  58. package/dist/lib/signing/webhook-verifier.js +2 -2
  59. package/dist/lib/signing/webhook-verifier.mjs +3 -3
  60. package/dist/lib/testing/storyboard/request-signing/builder.js +13 -1
  61. package/dist/lib/testing/storyboard/request-signing/builder.mjs +13 -1
  62. package/dist/lib/testing/storyboard/request-signing/grader.js +1 -0
  63. package/dist/lib/testing/storyboard/request-signing/grader.mjs +1 -0
  64. package/dist/lib/testing/storyboard/request-signing/vector-loader.js +1 -1
  65. package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +1 -1
  66. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  67. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  68. package/dist/lib/types/accept-proposal.d.ts +19 -1
  69. package/dist/lib/types/buy-products.d.ts +19 -1
  70. package/dist/lib/types/check-governance.d.ts +19 -1
  71. package/dist/lib/types/comply-test-controller.d.ts +19 -1
  72. package/dist/lib/types/control-media-buy.d.ts +19 -1
  73. package/dist/lib/types/core.generated.d.mts +14 -1
  74. package/dist/lib/types/core.generated.d.ts +14 -1
  75. package/dist/lib/types/create-media-buy.d.ts +14 -1
  76. package/dist/lib/types/get-media-buys.d.ts +14 -1
  77. package/dist/lib/types/get-products.d.ts +19 -1
  78. package/dist/lib/types/list-products.d.ts +19 -1
  79. package/dist/lib/types/refine-proposals.d.ts +19 -1
  80. package/dist/lib/types/request-proposals.d.ts +19 -1
  81. package/dist/lib/types/schemas.generated.d.ts +12 -3
  82. package/dist/lib/types/schemas.generated.js +4 -1
  83. package/dist/lib/types/schemas.generated.mjs +4 -1
  84. package/dist/lib/types/tools.generated.d.mts +14 -1
  85. package/dist/lib/types/tools.generated.d.ts +14 -1
  86. package/dist/lib/types/update-media-buy.d.ts +14 -1
  87. package/dist/lib/utils/pointer-utils.d.mts +2 -0
  88. package/dist/lib/utils/pointer-utils.d.ts +2 -0
  89. package/dist/lib/utils/pointer-utils.js +43 -0
  90. package/dist/lib/utils/pointer-utils.mjs +19 -0
  91. package/dist/lib/validation/diagnostic-limits.d.mts +4 -0
  92. package/dist/lib/validation/diagnostic-limits.d.ts +4 -0
  93. package/dist/lib/validation/diagnostic-limits.js +57 -0
  94. package/dist/lib/validation/diagnostic-limits.mjs +32 -0
  95. package/dist/lib/validation/schema-errors.d.mts +3 -1
  96. package/dist/lib/validation/schema-errors.d.ts +3 -1
  97. package/dist/lib/validation/schema-errors.js +18 -3
  98. package/dist/lib/validation/schema-errors.mjs +18 -3
  99. package/dist/lib/validation/schema-validator.js +56 -4
  100. package/dist/lib/validation/schema-validator.mjs +56 -4
  101. package/dist/lib/version.d.mts +3 -3
  102. package/dist/lib/version.d.ts +3 -3
  103. package/dist/lib/version.js +3 -3
  104. package/dist/lib/version.mjs +3 -3
  105. package/dist/lib/webhooks/index.d.mts +24 -0
  106. package/dist/lib/webhooks/index.d.ts +24 -0
  107. package/dist/lib/webhooks/index.js +50 -24
  108. package/dist/lib/webhooks/index.mjs +49 -24
  109. package/dist/lib/wholesale-feed-sync/index.d.mts +2 -0
  110. package/dist/lib/wholesale-feed-sync/index.d.ts +2 -0
  111. package/dist/lib/wholesale-feed-sync/index.js +7 -0
  112. package/dist/lib/wholesale-feed-sync/index.mjs +4 -0
  113. package/dist/lib/wholesale-feed-sync/mirror.d.mts +97 -0
  114. package/dist/lib/wholesale-feed-sync/mirror.d.ts +97 -0
  115. package/dist/lib/wholesale-feed-sync/mirror.js +350 -0
  116. package/dist/lib/wholesale-feed-sync/mirror.mjs +322 -0
  117. package/dist/lib/wholesale-feed-sync/sync.d.mts +12 -29
  118. package/dist/lib/wholesale-feed-sync/sync.d.ts +12 -29
  119. package/dist/lib/wholesale-feed-sync/sync.js +153 -297
  120. package/dist/lib/wholesale-feed-sync/sync.mjs +158 -297
  121. package/docs/README.md +6 -0
  122. package/docs/TYPE-SUMMARY.md +2 -2
  123. package/docs/guides/BUYER-STORAGE.md +3 -0
  124. package/docs/guides/FIRST-CALL-TO-A-SELLER.md +3 -1
  125. package/docs/guides/account-resolution.md +46 -10
  126. package/docs/llms.txt +2 -2
  127. package/docs/migration-14.0-to-14.1.md +85 -0
  128. package/docs/migration-14.x-rc-worksheet.md +4 -4
  129. package/docs/migration-agent-resolution-3.3.md +5 -3
  130. package/docs/recipes/verifying-inbound-webhooks.md +4 -0
  131. package/package.json +3 -2
  132. package/skills/call-adcp-agent/SKILL.md +4 -1
  133. package/skills/adcp-brand.previous/SKILL.md +0 -200
  134. package/skills/adcp-creative.previous/SKILL.md +0 -305
  135. package/skills/adcp-governance.previous/SKILL.md +0 -566
  136. package/skills/adcp-measurement.previous/SKILL.md +0 -136
  137. package/skills/adcp-media-buy.previous/SKILL.md +0 -556
  138. package/skills/adcp-si.previous/SKILL.md +0 -206
  139. package/skills/adcp-signals.previous/SKILL.md +0 -204
@@ -237,7 +237,8 @@ export { resolvePreviewAuthority, type PlacementPreviewCandidate, type PreviewAu
237
237
  export { isStatusCompleted, isStatusWorking, isStatusInputRequired, isStatusSubmitted, isStatusFailed, isStatusRejected, isGetProductsCompleted, isGetProductsWorking, isGetProductsInputRequired, isGetProductsSubmitted, isGetProductsFailed, isCreateMediaBuyCompleted, isCreateMediaBuyWorking, isCreateMediaBuyInputRequired, isCreateMediaBuySubmitted, isCreateMediaBuyFailed, isUpdateMediaBuyCompleted, isUpdateMediaBuyWorking, isUpdateMediaBuyInputRequired, isUpdateMediaBuySubmitted, isUpdateMediaBuyFailed, isSyncCreativesCompleted, isSyncCreativesWorking, isSyncCreativesInputRequired, isSyncCreativesSubmitted, isSyncCreativesFailed, } from './utils/typeGuards.mjs';
238
238
  export { getAdcpVersion, getLibraryVersion, isCompatibleWith, getCompatibleVersions, parseAdcpMajorVersion, ADCP_VERSION, ADCP_MAJOR_VERSION, LIBRARY_VERSION, COMPATIBLE_ADCP_VERSIONS, VERSION_INFO, } from './version.mjs';
239
239
  export type { AdcpVersion } from './version.mjs';
240
- export { listBundledAdcpVersions, resolveAdcpVersion } from './utils/adcp-version-config.mjs';
240
+ export { listBundledAdcpVersions, resolveAdcpVersion, isAdcpVersionAtLeast, sellerAdvertises31, shouldOmit31Fields, } from './utils/adcp-version-config.mjs';
241
+ export { redactSecrets } from './utils/redact-secrets.mjs';
241
242
  export { getTracer, isTracingEnabled, injectTraceHeaders, withSpan, addSpanAttributes, recordSpanException, } from './observability/index.mjs';
242
243
  export { Agent as LegacyAgent, AgentCollection as LegacyAgentCollection } from './agents/index.generated.mjs';
243
244
  export { LegacyContentStandardsAdapter, type LegacyIContentStandardsAdapter, type LegacyContentEvaluationResult, LegacyContentStandardsErrorCodes, isLegacyContentStandardsError, legacyDefaultContentStandardsAdapter, PropertyListAdapter, type IPropertyListAdapter, type ResolvedProperty, PropertyListErrorCodes, isPropertyListError, defaultPropertyListAdapter, SISessionManager, AISISessionManager, type ISISessionManager, type SISession, SIErrorCodes, defaultSISessionManager, GovernanceAdapter, defaultGovernanceAdapter, type IGovernanceAdapter, type GovernanceAdapterConfig, type GovernanceAdapterErrorCode, type CommittedCheckRequest, type LegacyCommittedCheckRequest, type ModernCommittedCheckRequest, GovernanceAdapterError, GovernanceAdapterErrorCodes, isGovernanceAdapterError, InMemoryImplicitAccountStore, defaultImplicitKeyFn, type ImplicitAccountStoreOptions, createOAuthPassthroughResolver, type OAuthPassthroughResolverOptions, createRosterAccountStore, type RosterAccountStoreOptions, createDerivedAccountStore, type DerivedAccountStoreOptions, type DerivedAccountStoreBaseOptions, type DerivedSingletonAccountStoreOptions, type DerivedRosterAccountStoreOptions, } from './adapters/index.mjs';
@@ -272,5 +273,5 @@ export { mediaBuyActionResolver } from './server/media-buy-action-resolver.mjs';
272
273
  export type { SellerActionDecision, SellerActionResolutionOptions, SellerActionResolution, } from './server/media-buy-action-resolver.mjs';
273
274
  export * from './supply-path/index.mjs';
274
275
  export type { AuthorizationCollectionSelector, ProductCollectionSelector, CollectionDistribution, DiscoveryCollection, } from './discovery/types.mjs';
275
- export { BuyerAccountRegistry, type AccountPolicy, type BuyerAccountStorage, type BuyerAccountRegistryOptions, type EnsureAccountOptions, type ProvisionedAccount, } from './core/buyer-account-registry.mjs';
276
+ export { BuyerAccountRegistry, type AccountPolicy, type BuyerAccountStorage, type BuyerAccountRegistryOptions, type BuyerAccountDispatch, type BuyerAccountProvisioningDispatch, type EnsureAccountOptions, type ProvisionedAccount, } from './core/buyer-account-registry.mjs';
276
277
  export { createProductCache, ProductCache, type ProductCacheOptions } from './core/product-cache.mjs';
@@ -237,7 +237,8 @@ export { resolvePreviewAuthority, type PlacementPreviewCandidate, type PreviewAu
237
237
  export { isStatusCompleted, isStatusWorking, isStatusInputRequired, isStatusSubmitted, isStatusFailed, isStatusRejected, isGetProductsCompleted, isGetProductsWorking, isGetProductsInputRequired, isGetProductsSubmitted, isGetProductsFailed, isCreateMediaBuyCompleted, isCreateMediaBuyWorking, isCreateMediaBuyInputRequired, isCreateMediaBuySubmitted, isCreateMediaBuyFailed, isUpdateMediaBuyCompleted, isUpdateMediaBuyWorking, isUpdateMediaBuyInputRequired, isUpdateMediaBuySubmitted, isUpdateMediaBuyFailed, isSyncCreativesCompleted, isSyncCreativesWorking, isSyncCreativesInputRequired, isSyncCreativesSubmitted, isSyncCreativesFailed, } from './utils/typeGuards';
238
238
  export { getAdcpVersion, getLibraryVersion, isCompatibleWith, getCompatibleVersions, parseAdcpMajorVersion, ADCP_VERSION, ADCP_MAJOR_VERSION, LIBRARY_VERSION, COMPATIBLE_ADCP_VERSIONS, VERSION_INFO, } from './version';
239
239
  export type { AdcpVersion } from './version';
240
- export { listBundledAdcpVersions, resolveAdcpVersion } from './utils/adcp-version-config';
240
+ export { listBundledAdcpVersions, resolveAdcpVersion, isAdcpVersionAtLeast, sellerAdvertises31, shouldOmit31Fields, } from './utils/adcp-version-config';
241
+ export { redactSecrets } from './utils/redact-secrets';
241
242
  export { getTracer, isTracingEnabled, injectTraceHeaders, withSpan, addSpanAttributes, recordSpanException, } from './observability';
242
243
  export { Agent as LegacyAgent, AgentCollection as LegacyAgentCollection } from './agents/index.generated';
243
244
  export { LegacyContentStandardsAdapter, type LegacyIContentStandardsAdapter, type LegacyContentEvaluationResult, LegacyContentStandardsErrorCodes, isLegacyContentStandardsError, legacyDefaultContentStandardsAdapter, PropertyListAdapter, type IPropertyListAdapter, type ResolvedProperty, PropertyListErrorCodes, isPropertyListError, defaultPropertyListAdapter, SISessionManager, AISISessionManager, type ISISessionManager, type SISession, SIErrorCodes, defaultSISessionManager, GovernanceAdapter, defaultGovernanceAdapter, type IGovernanceAdapter, type GovernanceAdapterConfig, type GovernanceAdapterErrorCode, type CommittedCheckRequest, type LegacyCommittedCheckRequest, type ModernCommittedCheckRequest, GovernanceAdapterError, GovernanceAdapterErrorCodes, isGovernanceAdapterError, InMemoryImplicitAccountStore, defaultImplicitKeyFn, type ImplicitAccountStoreOptions, createOAuthPassthroughResolver, type OAuthPassthroughResolverOptions, createRosterAccountStore, type RosterAccountStoreOptions, createDerivedAccountStore, type DerivedAccountStoreOptions, type DerivedAccountStoreBaseOptions, type DerivedSingletonAccountStoreOptions, type DerivedRosterAccountStoreOptions, } from './adapters';
@@ -272,5 +273,5 @@ export { mediaBuyActionResolver } from './server/media-buy-action-resolver';
272
273
  export type { SellerActionDecision, SellerActionResolutionOptions, SellerActionResolution, } from './server/media-buy-action-resolver';
273
274
  export * from './supply-path';
274
275
  export type { AuthorizationCollectionSelector, ProductCollectionSelector, CollectionDistribution, DiscoveryCollection, } from './discovery/types';
275
- export { BuyerAccountRegistry, type AccountPolicy, type BuyerAccountStorage, type BuyerAccountRegistryOptions, type EnsureAccountOptions, type ProvisionedAccount, } from './core/buyer-account-registry';
276
+ export { BuyerAccountRegistry, type AccountPolicy, type BuyerAccountStorage, type BuyerAccountRegistryOptions, type BuyerAccountDispatch, type BuyerAccountProvisioningDispatch, type EnsureAccountOptions, type ProvisionedAccount, } from './core/buyer-account-registry';
276
277
  export { createProductCache, ProductCache, type ProductCacheOptions } from './core/product-cache';
package/dist/lib/index.js CHANGED
@@ -453,6 +453,7 @@ __export(index_exports, {
453
453
  isADCPError: () => import_errors.isADCPError,
454
454
  isAdcpError: () => import_utils.isAdcpError,
455
455
  isAdcpSuccess: () => import_utils.isAdcpSuccess,
456
+ isAdcpVersionAtLeast: () => import_adcp_version_config.isAdcpVersionAtLeast,
456
457
  isAgentCardPath: () => import_utils6.isAgentCardPath,
457
458
  isAlwaysBlocked: () => import_net.isAlwaysBlocked,
458
459
  isCPAPricing: () => import_utils7.isCPAPricing,
@@ -600,6 +601,7 @@ __export(index_exports, {
600
601
  recordSpanException: () => import_observability.recordSpanException,
601
602
  recoveryForModeMismatch: () => import_media_buy.recoveryForModeMismatch,
602
603
  redactIdempotencyKey: () => import_idempotency.redactIdempotencyKey,
604
+ redactSecrets: () => import_redact_secrets.redactSecrets,
603
605
  redisBackend: () => import_server.redisBackend,
604
606
  redisWebhookRegistrationStore: () => import_redis_webhook_registration_store.redisWebhookRegistrationStore,
605
607
  registerAdcpTaskTool: () => import_server.registerAdcpTaskTool,
@@ -638,7 +640,9 @@ __export(index_exports, {
638
640
  scopedStore: () => import_server.scopedStore,
639
641
  segmentIdActivationKey: () => import_activation_key_builders.segmentIdActivationKey,
640
642
  selectLogoForSlot: () => import_brand.selectLogoForSlot,
643
+ sellerAdvertises31: () => import_adcp_version_config.sellerAdvertises31,
641
644
  serve: () => import_server.serve,
645
+ shouldOmit31Fields: () => import_adcp_version_config.shouldOmit31Fields,
642
646
  signalId: () => import_signal_id_builders.signalId,
643
647
  singleBuildCreativeReturn: () => import_build_creative_return_builders.singleBuildCreativeReturn,
644
648
  singleEnvelopedBuildCreativeReturn: () => import_build_creative_return_builders.singleEnvelopedBuildCreativeReturn,
@@ -825,6 +829,7 @@ var import_preview_authority = require('./utils/preview-authority.js');
825
829
  var import_typeGuards = require('./utils/typeGuards.js');
826
830
  var import_version = require('./version.js');
827
831
  var import_adcp_version_config = require('./utils/adcp-version-config.js');
832
+ var import_redact_secrets = require('./utils/redact-secrets.js');
828
833
  var import_observability = require('./observability/index.js');
829
834
  var import_agents = require('./agents/index.generated.js');
830
835
  var import_adapters = require('./adapters/index.js');
@@ -1288,6 +1293,7 @@ function createAdCPClientFromEnv() {
1288
1293
  isADCPError,
1289
1294
  isAdcpError,
1290
1295
  isAdcpSuccess,
1296
+ isAdcpVersionAtLeast,
1291
1297
  isAgentCardPath,
1292
1298
  isAlwaysBlocked,
1293
1299
  isCPAPricing,
@@ -1435,6 +1441,7 @@ function createAdCPClientFromEnv() {
1435
1441
  recordSpanException,
1436
1442
  recoveryForModeMismatch,
1437
1443
  redactIdempotencyKey,
1444
+ redactSecrets,
1438
1445
  redisBackend,
1439
1446
  redisWebhookRegistrationStore,
1440
1447
  registerAdcpTaskTool,
@@ -1473,7 +1480,9 @@ function createAdCPClientFromEnv() {
1473
1480
  scopedStore,
1474
1481
  segmentIdActivationKey,
1475
1482
  selectLogoForSlot,
1483
+ sellerAdvertises31,
1476
1484
  serve,
1485
+ shouldOmit31Fields,
1477
1486
  signalId,
1478
1487
  singleBuildCreativeReturn,
1479
1488
  singleEnvelopedBuildCreativeReturn,
@@ -708,7 +708,14 @@ import {
708
708
  COMPATIBLE_ADCP_VERSIONS,
709
709
  VERSION_INFO
710
710
  } from "./version.mjs";
711
- import { listBundledAdcpVersions, resolveAdcpVersion } from "./utils/adcp-version-config.mjs";
711
+ import {
712
+ listBundledAdcpVersions,
713
+ resolveAdcpVersion,
714
+ isAdcpVersionAtLeast,
715
+ sellerAdvertises31,
716
+ shouldOmit31Fields
717
+ } from "./utils/adcp-version-config.mjs";
718
+ import { redactSecrets } from "./utils/redact-secrets.mjs";
712
719
  import {
713
720
  getTracer,
714
721
  isTracingEnabled,
@@ -1245,6 +1252,7 @@ export {
1245
1252
  isADCPError,
1246
1253
  isAdcpError,
1247
1254
  isAdcpSuccess,
1255
+ isAdcpVersionAtLeast,
1248
1256
  isAgentCardPath,
1249
1257
  isAlwaysBlocked,
1250
1258
  isCPAPricing,
@@ -1392,6 +1400,7 @@ export {
1392
1400
  recordSpanException,
1393
1401
  recoveryForModeMismatch,
1394
1402
  redactIdempotencyKey,
1403
+ redactSecrets,
1395
1404
  redisBackend,
1396
1405
  redisWebhookRegistrationStore,
1397
1406
  registerAdcpTaskTool,
@@ -1430,7 +1439,9 @@ export {
1430
1439
  scopedStore,
1431
1440
  segmentIdActivationKey,
1432
1441
  selectLogoForSlot,
1442
+ sellerAdvertises31,
1433
1443
  serve,
1444
+ shouldOmit31Fields,
1434
1445
  signalId,
1435
1446
  singleBuildCreativeReturn,
1436
1447
  singleEnvelopedBuildCreativeReturn,
@@ -1,3 +1,7 @@
1
+ export declare class AgentTransportPolicyError extends TypeError {
2
+ readonly code = "agent_transport_policy_refused";
3
+ constructor(message: string);
4
+ }
1
5
  type ResolvedAddress = {
2
6
  address: string;
3
7
  family: number;
@@ -1,3 +1,7 @@
1
+ export declare class AgentTransportPolicyError extends TypeError {
2
+ readonly code = "agent_transport_policy_refused";
3
+ constructor(message: string);
4
+ }
1
5
  type ResolvedAddress = {
2
6
  address: string;
3
7
  family: number;
@@ -18,6 +18,7 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var agent_transport_fetch_exports = {};
20
20
  __export(agent_transport_fetch_exports, {
21
+ AgentTransportPolicyError: () => AgentTransportPolicyError,
21
22
  createAgentTransportFetch: () => createAgentTransportFetch
22
23
  });
23
24
  module.exports = __toCommonJS(agent_transport_fetch_exports);
@@ -25,14 +26,21 @@ var import_promises = require("node:dns/promises");
25
26
  var import_node_net = require("node:net");
26
27
  var import_undici = require("undici");
27
28
  var import_address_guards = require('./address-guards.js');
29
+ class AgentTransportPolicyError extends TypeError {
30
+ code = "agent_transport_policy_refused";
31
+ constructor(message) {
32
+ super(message);
33
+ this.name = "AgentTransportPolicyError";
34
+ }
35
+ }
28
36
  const REDIRECT_STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
29
37
  const SENSITIVE_REDIRECT_HEADERS = ["authorization", "cookie", "proxy-authorization", "x-adcp-auth"];
30
38
  function createAgentTransportFetch(agentUrl, options = {}) {
31
39
  const lookup = options.lookup ?? ((hostname) => (0, import_promises.lookup)(hostname, { all: true }));
32
40
  const maxRedirects = options.maxRedirects ?? 5;
33
41
  const initialUrl = new URL(agentUrl);
34
- const allowPrivateEverywhere = options.allowPrivateIp === true || process.env.ADCP_ALLOW_INTERNAL_PROBES === "1" || process.env.ADCP_ALLOW_PRIVATE_AGENT_URL === "1";
35
- const allowPrivateInitialOrigin = (0, import_address_guards.isLikelyPrivateUrl)(initialUrl.toString());
42
+ const allowPrivateEverywhere = options.allowPrivateIp === true || options.allowPrivateInitialOrigin !== false && (process.env.ADCP_ALLOW_INTERNAL_PROBES === "1" || process.env.ADCP_ALLOW_PRIVATE_AGENT_URL === "1");
43
+ const allowPrivateInitialOrigin = options.allowPrivateInitialOrigin !== false && (0, import_address_guards.isLikelyPrivateUrl)(initialUrl.toString());
36
44
  const dispatchers = /* @__PURE__ */ new Map();
37
45
  const privateIpAllowedFor = (url) => allowPrivateEverywhere || allowPrivateInitialOrigin && url.origin === initialUrl.origin;
38
46
  const dispatcherFor = (url) => {
@@ -57,6 +65,8 @@ function createAgentTransportFetch(agentUrl, options = {}) {
57
65
  const redirectMode = init?.redirect ?? request?.redirect ?? "follow";
58
66
  for (let redirects = 0; ; redirects++) {
59
67
  assertTransportScheme(url);
68
+ if (options.requireHttps && url.protocol !== "https:" && !options.allowPrivateIp)
69
+ throw new AgentTransportPolicyError("Signing discovery requires HTTPS.");
60
70
  const hostname = url.hostname.replace(/^\[|\]$/g, "");
61
71
  if ((0, import_node_net.isIP)(hostname) !== 0) assertAgentAddressAllowed(hostname, hostname, privateIpAllowedFor(url), false);
62
72
  const headerRecord = {};
@@ -124,19 +134,22 @@ async function resolveAndCreateDispatcher(url, lookup, allowPrivateIp) {
124
134
  function assertAgentAddressAllowed(address, hostname, allowPrivateIp, resolved) {
125
135
  const relationship = resolved ? "resolves to" : "is";
126
136
  if ((0, import_address_guards.isAlwaysBlocked)(address)) {
127
- throw new Error(`Agent host ${hostname} ${relationship} an always-blocked address`);
137
+ throw new AgentTransportPolicyError(`Agent host ${hostname} ${relationship} an always-blocked address`);
128
138
  }
129
139
  if (!allowPrivateIp && (0, import_address_guards.isPrivateIp)(address)) {
130
140
  const guidance = resolved ? "set transport.allowPrivateIp=true for an explicitly trusted private agent, or provide a trustedFetchFn that enforces its own hostname address policy" : "set transport.allowPrivateIp=true for an explicitly trusted private agent";
131
- throw new Error(`Agent host ${hostname} ${relationship} a private or loopback address; ` + guidance);
141
+ throw new AgentTransportPolicyError(
142
+ `Agent host ${hostname} ${relationship} a private or loopback address; ` + guidance
143
+ );
132
144
  }
133
145
  }
134
146
  function assertTransportScheme(url) {
135
147
  if (url.protocol !== "http:" && url.protocol !== "https:") {
136
- throw new TypeError(`Agent transport does not allow ${url.protocol} URLs`);
148
+ throw new AgentTransportPolicyError(`Agent transport does not allow ${url.protocol} URLs`);
137
149
  }
138
150
  }
139
151
  // Annotate the CommonJS export names for ESM import in node:
140
152
  0 && (module.exports = {
153
+ AgentTransportPolicyError,
141
154
  createAgentTransportFetch
142
155
  });
@@ -2,14 +2,21 @@ import { lookup as dnsLookup } from "node:dns/promises";
2
2
  import { isIP } from "node:net";
3
3
  import { Agent, fetch as undiciFetch } from "undici";
4
4
  import { isAlwaysBlocked, isLikelyPrivateUrl, isPrivateIp } from "./address-guards.mjs";
5
+ class AgentTransportPolicyError extends TypeError {
6
+ code = "agent_transport_policy_refused";
7
+ constructor(message) {
8
+ super(message);
9
+ this.name = "AgentTransportPolicyError";
10
+ }
11
+ }
5
12
  const REDIRECT_STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
6
13
  const SENSITIVE_REDIRECT_HEADERS = ["authorization", "cookie", "proxy-authorization", "x-adcp-auth"];
7
14
  function createAgentTransportFetch(agentUrl, options = {}) {
8
15
  const lookup = options.lookup ?? ((hostname) => dnsLookup(hostname, { all: true }));
9
16
  const maxRedirects = options.maxRedirects ?? 5;
10
17
  const initialUrl = new URL(agentUrl);
11
- const allowPrivateEverywhere = options.allowPrivateIp === true || process.env.ADCP_ALLOW_INTERNAL_PROBES === "1" || process.env.ADCP_ALLOW_PRIVATE_AGENT_URL === "1";
12
- const allowPrivateInitialOrigin = isLikelyPrivateUrl(initialUrl.toString());
18
+ const allowPrivateEverywhere = options.allowPrivateIp === true || options.allowPrivateInitialOrigin !== false && (process.env.ADCP_ALLOW_INTERNAL_PROBES === "1" || process.env.ADCP_ALLOW_PRIVATE_AGENT_URL === "1");
19
+ const allowPrivateInitialOrigin = options.allowPrivateInitialOrigin !== false && isLikelyPrivateUrl(initialUrl.toString());
13
20
  const dispatchers = /* @__PURE__ */ new Map();
14
21
  const privateIpAllowedFor = (url) => allowPrivateEverywhere || allowPrivateInitialOrigin && url.origin === initialUrl.origin;
15
22
  const dispatcherFor = (url) => {
@@ -34,6 +41,8 @@ function createAgentTransportFetch(agentUrl, options = {}) {
34
41
  const redirectMode = init?.redirect ?? request?.redirect ?? "follow";
35
42
  for (let redirects = 0; ; redirects++) {
36
43
  assertTransportScheme(url);
44
+ if (options.requireHttps && url.protocol !== "https:" && !options.allowPrivateIp)
45
+ throw new AgentTransportPolicyError("Signing discovery requires HTTPS.");
37
46
  const hostname = url.hostname.replace(/^\[|\]$/g, "");
38
47
  if (isIP(hostname) !== 0) assertAgentAddressAllowed(hostname, hostname, privateIpAllowedFor(url), false);
39
48
  const headerRecord = {};
@@ -101,18 +110,21 @@ async function resolveAndCreateDispatcher(url, lookup, allowPrivateIp) {
101
110
  function assertAgentAddressAllowed(address, hostname, allowPrivateIp, resolved) {
102
111
  const relationship = resolved ? "resolves to" : "is";
103
112
  if (isAlwaysBlocked(address)) {
104
- throw new Error(`Agent host ${hostname} ${relationship} an always-blocked address`);
113
+ throw new AgentTransportPolicyError(`Agent host ${hostname} ${relationship} an always-blocked address`);
105
114
  }
106
115
  if (!allowPrivateIp && isPrivateIp(address)) {
107
116
  const guidance = resolved ? "set transport.allowPrivateIp=true for an explicitly trusted private agent, or provide a trustedFetchFn that enforces its own hostname address policy" : "set transport.allowPrivateIp=true for an explicitly trusted private agent";
108
- throw new Error(`Agent host ${hostname} ${relationship} a private or loopback address; ` + guidance);
117
+ throw new AgentTransportPolicyError(
118
+ `Agent host ${hostname} ${relationship} a private or loopback address; ` + guidance
119
+ );
109
120
  }
110
121
  }
111
122
  function assertTransportScheme(url) {
112
123
  if (url.protocol !== "http:" && url.protocol !== "https:") {
113
- throw new TypeError(`Agent transport does not allow ${url.protocol} URLs`);
124
+ throw new AgentTransportPolicyError(`Agent transport does not allow ${url.protocol} URLs`);
114
125
  }
115
126
  }
116
127
  export {
128
+ AgentTransportPolicyError,
117
129
  createAgentTransportFetch
118
130
  };
@@ -2,7 +2,7 @@ import { type CanonicalReferenceResolver } from '../canonical-references/index.m
2
2
  import { type SsrfFetchOptions } from '../net/ssrf-fetch.mjs';
3
3
  import type { ReportingControlTotal } from '../types/tools.generated.mjs';
4
4
  import type { ReportingInspectionContext, ReportingObservation } from './reconciliation.mjs';
5
- export type ReportingInspectionErrorCode = 'UNSUPPORTED_RESOURCE' | 'RESOURCE_READ_FAILED' | 'RESOURCE_NOT_READY' | 'RESOURCE_TOO_LARGE' | 'INSPECTION_TIMEOUT' | 'MANIFEST_DIGEST_MISMATCH' | 'MANIFEST_INVALID' | 'MANIFEST_INCOMPLETE' | 'MANIFEST_IDENTITY_MISMATCH' | 'MANIFEST_TOTAL_MISMATCH' | 'OBJECT_DUPLICATE' | 'OBJECT_SIZE_MISMATCH' | 'OBJECT_DIGEST_MISMATCH' | 'OBJECT_ROW_COUNT_MISMATCH' | 'FORMAT_UNSUPPORTED' | 'COMPRESSION_UNSUPPORTED' | 'ROW_SCHEMA_FETCH_FAILED' | 'ROW_SCHEMA_INVALID' | 'ROW_SCHEMA_VIOLATION' | 'REPORT_DEFINITION_FETCH_FAILED' | 'REPORT_DEFINITION_INVALID' | 'CANONICALIZATION_FETCH_FAILED' | 'CANONICALIZATION_INVALID' | 'ROW_COUNT_MISMATCH' | 'CONTROL_TOTAL_UNSUPPORTED' | 'CONTROL_TOTAL_MISMATCH' | 'CANONICAL_DIGEST_MISMATCH';
5
+ export type ReportingInspectionErrorCode = 'CONSUMER_COMMIT_FAILED' | 'UNSUPPORTED_RESOURCE' | 'RESOURCE_READ_FAILED' | 'RESOURCE_NOT_READY' | 'RESOURCE_TOO_LARGE' | 'INSPECTION_TIMEOUT' | 'MANIFEST_DIGEST_MISMATCH' | 'MANIFEST_INVALID' | 'MANIFEST_INCOMPLETE' | 'MANIFEST_IDENTITY_MISMATCH' | 'MANIFEST_TOTAL_MISMATCH' | 'OBJECT_DUPLICATE' | 'OBJECT_SIZE_MISMATCH' | 'OBJECT_DIGEST_MISMATCH' | 'OBJECT_ROW_COUNT_MISMATCH' | 'FORMAT_UNSUPPORTED' | 'COMPRESSION_UNSUPPORTED' | 'ROW_SCHEMA_FETCH_FAILED' | 'ROW_SCHEMA_INVALID' | 'ROW_SCHEMA_VIOLATION' | 'REPORT_DEFINITION_FETCH_FAILED' | 'REPORT_DEFINITION_INVALID' | 'CANONICALIZATION_FETCH_FAILED' | 'CANONICALIZATION_INVALID' | 'ROW_COUNT_MISMATCH' | 'CONTROL_TOTAL_UNSUPPORTED' | 'CONTROL_TOTAL_MISMATCH' | 'CANONICAL_DIGEST_MISMATCH';
6
6
  export declare class ReportingInspectionError extends Error {
7
7
  readonly code: ReportingInspectionErrorCode;
8
8
  readonly retryable: boolean;
@@ -78,9 +78,9 @@ export interface ReportingManifestInspectorOptions<TCredential = unknown> {
78
78
  maxFiles?: number;
79
79
  maxRows?: number;
80
80
  maxRowBytes?: number;
81
- /** Hard wall-clock budget for one inspection attempt, including custom adapters. */
81
+ /** Aggregate deadline for async work, checked cooperatively during synchronous work. Synchronous callbacks cannot be preempted. */
82
82
  maxInspectionMs?: number;
83
- /** Maximum wall-clock time permitted for synchronous row-schema compilation. */
83
+ /** Reject synchronous schema compilation overruns after compilation returns. */
84
84
  maxSchemaCompileMs?: number;
85
85
  }
86
86
  /** Build the SDK-managed manifest/file inspector used by reconcileReporting. */
@@ -2,7 +2,7 @@ import { type CanonicalReferenceResolver } from '../canonical-references';
2
2
  import { type SsrfFetchOptions } from '../net/ssrf-fetch';
3
3
  import type { ReportingControlTotal } from '../types/tools.generated';
4
4
  import type { ReportingInspectionContext, ReportingObservation } from './reconciliation';
5
- export type ReportingInspectionErrorCode = 'UNSUPPORTED_RESOURCE' | 'RESOURCE_READ_FAILED' | 'RESOURCE_NOT_READY' | 'RESOURCE_TOO_LARGE' | 'INSPECTION_TIMEOUT' | 'MANIFEST_DIGEST_MISMATCH' | 'MANIFEST_INVALID' | 'MANIFEST_INCOMPLETE' | 'MANIFEST_IDENTITY_MISMATCH' | 'MANIFEST_TOTAL_MISMATCH' | 'OBJECT_DUPLICATE' | 'OBJECT_SIZE_MISMATCH' | 'OBJECT_DIGEST_MISMATCH' | 'OBJECT_ROW_COUNT_MISMATCH' | 'FORMAT_UNSUPPORTED' | 'COMPRESSION_UNSUPPORTED' | 'ROW_SCHEMA_FETCH_FAILED' | 'ROW_SCHEMA_INVALID' | 'ROW_SCHEMA_VIOLATION' | 'REPORT_DEFINITION_FETCH_FAILED' | 'REPORT_DEFINITION_INVALID' | 'CANONICALIZATION_FETCH_FAILED' | 'CANONICALIZATION_INVALID' | 'ROW_COUNT_MISMATCH' | 'CONTROL_TOTAL_UNSUPPORTED' | 'CONTROL_TOTAL_MISMATCH' | 'CANONICAL_DIGEST_MISMATCH';
5
+ export type ReportingInspectionErrorCode = 'CONSUMER_COMMIT_FAILED' | 'UNSUPPORTED_RESOURCE' | 'RESOURCE_READ_FAILED' | 'RESOURCE_NOT_READY' | 'RESOURCE_TOO_LARGE' | 'INSPECTION_TIMEOUT' | 'MANIFEST_DIGEST_MISMATCH' | 'MANIFEST_INVALID' | 'MANIFEST_INCOMPLETE' | 'MANIFEST_IDENTITY_MISMATCH' | 'MANIFEST_TOTAL_MISMATCH' | 'OBJECT_DUPLICATE' | 'OBJECT_SIZE_MISMATCH' | 'OBJECT_DIGEST_MISMATCH' | 'OBJECT_ROW_COUNT_MISMATCH' | 'FORMAT_UNSUPPORTED' | 'COMPRESSION_UNSUPPORTED' | 'ROW_SCHEMA_FETCH_FAILED' | 'ROW_SCHEMA_INVALID' | 'ROW_SCHEMA_VIOLATION' | 'REPORT_DEFINITION_FETCH_FAILED' | 'REPORT_DEFINITION_INVALID' | 'CANONICALIZATION_FETCH_FAILED' | 'CANONICALIZATION_INVALID' | 'ROW_COUNT_MISMATCH' | 'CONTROL_TOTAL_UNSUPPORTED' | 'CONTROL_TOTAL_MISMATCH' | 'CANONICAL_DIGEST_MISMATCH';
6
6
  export declare class ReportingInspectionError extends Error {
7
7
  readonly code: ReportingInspectionErrorCode;
8
8
  readonly retryable: boolean;
@@ -78,9 +78,9 @@ export interface ReportingManifestInspectorOptions<TCredential = unknown> {
78
78
  maxFiles?: number;
79
79
  maxRows?: number;
80
80
  maxRowBytes?: number;
81
- /** Hard wall-clock budget for one inspection attempt, including custom adapters. */
81
+ /** Aggregate deadline for async work, checked cooperatively during synchronous work. Synchronous callbacks cannot be preempted. */
82
82
  maxInspectionMs?: number;
83
- /** Maximum wall-clock time permitted for synchronous row-schema compilation. */
83
+ /** Reject synchronous schema compilation overruns after compilation returns. */
84
84
  maxSchemaCompileMs?: number;
85
85
  }
86
86
  /** Build the SDK-managed manifest/file inspector used by reconcileReporting. */