@adcp/sdk 16.0.0-beta.2 → 16.0.0-beta.4
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.
- package/README.md +54 -0
- package/dist/lib/auth/oauth/diagnose.js +3 -11
- package/dist/lib/auth/oauth/diagnose.mjs +4 -12
- package/dist/lib/auth/oauth/diagnostics.d.mts +2 -1
- package/dist/lib/auth/oauth/diagnostics.d.ts +2 -1
- package/dist/lib/auth/oauth/diagnostics.js +8 -10
- package/dist/lib/auth/oauth/diagnostics.mjs +7 -10
- package/dist/lib/core/ConversationTypes.d.mts +8 -3
- package/dist/lib/core/ConversationTypes.d.ts +8 -3
- package/dist/lib/core/SingleAgentClient.d.mts +5 -3
- package/dist/lib/core/SingleAgentClient.d.ts +5 -3
- package/dist/lib/core/TaskExecutor.js +5 -1
- package/dist/lib/core/TaskExecutor.mjs +5 -1
- package/dist/lib/errors/index.d.mts +9 -4
- package/dist/lib/errors/index.d.ts +9 -4
- package/dist/lib/index.d.mts +3 -3
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.js +8 -0
- package/dist/lib/index.mjs +14 -2
- package/dist/lib/negotiation/types.d.mts +20 -39
- package/dist/lib/negotiation/types.d.ts +20 -39
- package/dist/lib/protocols/index.d.mts +60 -24
- package/dist/lib/protocols/index.d.ts +60 -24
- package/dist/lib/protocols/index.js +9 -4
- package/dist/lib/protocols/index.mjs +3 -0
- package/dist/lib/protocols/mcp-modern.js +1 -0
- package/dist/lib/protocols/mcp-modern.mjs +2 -1
- package/dist/lib/protocols/mcp.js +1 -0
- package/dist/lib/protocols/mcp.mjs +2 -1
- package/dist/lib/protocols/responseSizeLimit.d.mts +91 -5
- package/dist/lib/protocols/responseSizeLimit.d.ts +91 -5
- package/dist/lib/protocols/responseSizeLimit.js +195 -31
- package/dist/lib/protocols/responseSizeLimit.mjs +192 -31
- package/dist/lib/reporting/consumer-runtime.js +2 -1
- package/dist/lib/reporting/consumer-runtime.mjs +2 -1
- package/dist/lib/reporting/ledger/handler.js +50 -11
- package/dist/lib/reporting/ledger/handler.mjs +50 -12
- package/dist/lib/reporting/ledger/index.d.mts +17 -14
- package/dist/lib/reporting/ledger/index.d.ts +17 -14
- package/dist/lib/reporting/ledger/index.js +32 -20
- package/dist/lib/reporting/ledger/index.mjs +21 -10
- package/dist/lib/reporting/ledger/offering-validation.d.mts +9 -0
- package/dist/lib/reporting/ledger/offering-validation.d.ts +9 -0
- package/dist/lib/reporting/{gcs/bucket-policy.js → ledger/offering-validation.js} +9 -8
- package/dist/lib/reporting/ledger/offering-validation.mjs +8 -0
- package/dist/lib/reporting/ledger/receipts.d.mts +48 -0
- package/dist/lib/reporting/ledger/receipts.d.ts +48 -0
- package/dist/lib/reporting/ledger/receipts.js +186 -0
- package/dist/lib/reporting/ledger/receipts.mjs +161 -0
- package/dist/lib/reporting/ledger/status-ingest.js +3 -3
- package/dist/lib/reporting/ledger/status-ingest.mjs +4 -5
- package/dist/lib/reporting/ledger/types.d.mts +43 -0
- package/dist/lib/reporting/ledger/types.d.ts +43 -0
- package/dist/lib/reporting/ledger/types.js +31 -2
- package/dist/lib/reporting/ledger/types.mjs +26 -1
- package/dist/lib/reporting/pagination.d.mts +6 -0
- package/dist/lib/reporting/pagination.d.ts +6 -0
- package/dist/lib/reporting/{gcs/errors.js → pagination.js} +12 -17
- package/dist/lib/reporting/pagination.mjs +12 -0
- package/dist/lib/reporting/reconciliation.d.mts +1 -0
- package/dist/lib/reporting/reconciliation.d.ts +1 -0
- package/dist/lib/reporting/reconciliation.js +3 -2
- package/dist/lib/reporting/reconciliation.mjs +3 -2
- package/dist/lib/reporting/service/index.d.mts +79 -153
- package/dist/lib/reporting/service/index.d.ts +79 -153
- package/dist/lib/reporting/service/index.js +34 -491
- package/dist/lib/reporting/service/index.mjs +36 -510
- package/dist/lib/reporting/service/scheduler-support.d.mts +43 -0
- package/dist/lib/reporting/service/scheduler-support.d.ts +43 -0
- package/dist/lib/reporting/service/scheduler-support.js +125 -0
- package/dist/lib/reporting/service/scheduler-support.mjs +96 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/signing/canonicalize.d.mts +4 -0
- package/dist/lib/signing/canonicalize.d.ts +4 -0
- package/dist/lib/signing/canonicalize.js +14 -8
- package/dist/lib/signing/canonicalize.mjs +14 -8
- package/dist/lib/signing/content-digest.d.mts +8 -0
- package/dist/lib/signing/content-digest.d.ts +8 -0
- package/dist/lib/signing/content-digest.js +11 -5
- package/dist/lib/signing/content-digest.mjs +10 -5
- package/dist/lib/signing/crypto.d.mts +15 -0
- package/dist/lib/signing/crypto.d.ts +15 -0
- package/dist/lib/signing/crypto.js +75 -3
- package/dist/lib/signing/crypto.mjs +78 -3
- package/dist/lib/signing/server.d.mts +1 -1
- package/dist/lib/signing/server.d.ts +1 -1
- package/dist/lib/signing/server.js +2 -0
- package/dist/lib/signing/server.mjs +2 -1
- package/dist/lib/signing/signer.js +11 -14
- package/dist/lib/signing/signer.mjs +13 -16
- package/dist/lib/signing/testing.js +2 -6
- package/dist/lib/signing/testing.mjs +3 -7
- package/dist/lib/signing/verifier.js +2 -2
- package/dist/lib/signing/verifier.mjs +3 -3
- package/dist/lib/signing/web-bot-auth.js +122 -43
- package/dist/lib/signing/web-bot-auth.mjs +128 -44
- package/dist/lib/signing/webhook-verifier.js +2 -2
- package/dist/lib/signing/webhook-verifier.mjs +3 -3
- package/dist/lib/substitution/compile.js +2 -1
- package/dist/lib/substitution/compile.mjs +2 -1
- package/dist/lib/substitution/consent-macros.d.mts +4 -0
- package/dist/lib/substitution/consent-macros.d.ts +4 -0
- package/dist/lib/substitution/consent-macros.js +45 -0
- package/dist/lib/substitution/consent-macros.mjs +20 -0
- package/dist/lib/substitution/index.d.mts +1 -1
- package/dist/lib/substitution/index.d.ts +1 -1
- package/dist/lib/substitution/index.js +2 -0
- package/dist/lib/substitution/index.mjs +2 -1
- package/dist/lib/substitution/translate.d.mts +15 -2
- package/dist/lib/substitution/translate.d.ts +15 -2
- package/dist/lib/substitution/translate.js +148 -26
- package/dist/lib/substitution/translate.mjs +147 -26
- package/dist/lib/testing/client.js +2 -1
- package/dist/lib/testing/client.mjs +2 -1
- package/dist/lib/testing/scenarios/capabilities.js +1 -1
- package/dist/lib/testing/scenarios/capabilities.mjs +1 -1
- package/dist/lib/testing/storyboard/junit.js +16 -3
- package/dist/lib/testing/storyboard/junit.mjs +16 -3
- package/dist/lib/testing/storyboard/request-signing/builder.js +12 -14
- package/dist/lib/testing/storyboard/request-signing/builder.mjs +13 -15
- package/dist/lib/testing/storyboard/runner.js +94 -25
- package/dist/lib/testing/storyboard/runner.mjs +94 -25
- package/dist/lib/testing/storyboard/signer-grader/grader.js +2 -7
- package/dist/lib/testing/storyboard/signer-grader/grader.mjs +2 -7
- package/dist/lib/testing/storyboard/types.d.mts +6 -0
- package/dist/lib/testing/storyboard/types.d.ts +6 -0
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/types/enums.generated.d.mts +3 -0
- package/dist/lib/types/enums.generated.d.ts +3 -0
- package/dist/lib/types/enums.generated.js +9 -0
- package/dist/lib/types/enums.generated.mjs +6 -0
- package/dist/lib/validation/schema-loader.js +25 -0
- package/dist/lib/validation/schema-loader.mjs +24 -0
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +28 -5
- package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +3 -2
- package/docs/guides/REPORTING-GCS-FENCE.md +3 -3
- package/docs/guides/REPORTING-GCS-MANAGED.md +4 -4
- package/docs/guides/REPORTING-LEDGER-CUTOVER.md +7 -7
- package/docs/guides/REPORTING-LEDGER.md +107 -51
- package/docs/guides/REPORTING-OPERATIONS.md +66 -5
- package/docs/guides/REPORTING-STABILITY.md +36 -32
- package/docs/guides/UNIVERSAL-MACRO-COMPILATION.md +38 -0
- package/docs/guides/VALIDATE-YOUR-AGENT.md +12 -0
- package/docs/llms.txt +4 -3
- package/docs/migration-14.x-rc-worksheet.md +4 -7
- package/docs/migration-reporting-storage-package.md +186 -0
- package/examples/README.md +1 -1
- package/package.json +14 -78
- package/dist/lib/reporting/azure/index.d.mts +0 -31
- package/dist/lib/reporting/azure/index.d.ts +0 -31
- package/dist/lib/reporting/azure/index.js +0 -266
- package/dist/lib/reporting/azure/index.mjs +0 -249
- package/dist/lib/reporting/bigquery/index.d.mts +0 -246
- package/dist/lib/reporting/bigquery/index.d.ts +0 -246
- package/dist/lib/reporting/bigquery/index.js +0 -633
- package/dist/lib/reporting/bigquery/index.mjs +0 -594
- package/dist/lib/reporting/gcs/adapter.d.mts +0 -38
- package/dist/lib/reporting/gcs/adapter.d.ts +0 -38
- package/dist/lib/reporting/gcs/adapter.js +0 -342
- package/dist/lib/reporting/gcs/adapter.mjs +0 -325
- package/dist/lib/reporting/gcs/bucket-policy.d.mts +0 -3
- package/dist/lib/reporting/gcs/bucket-policy.d.ts +0 -3
- package/dist/lib/reporting/gcs/bucket-policy.mjs +0 -7
- package/dist/lib/reporting/gcs/errors.d.mts +0 -11
- package/dist/lib/reporting/gcs/errors.d.ts +0 -11
- package/dist/lib/reporting/gcs/errors.mjs +0 -16
- package/dist/lib/reporting/gcs/fence.d.mts +0 -41
- package/dist/lib/reporting/gcs/fence.d.ts +0 -41
- package/dist/lib/reporting/gcs/fence.js +0 -250
- package/dist/lib/reporting/gcs/fence.mjs +0 -230
- package/dist/lib/reporting/gcs/index.d.mts +0 -18
- package/dist/lib/reporting/gcs/index.d.ts +0 -18
- package/dist/lib/reporting/gcs/index.js +0 -44
- package/dist/lib/reporting/gcs/index.mjs +0 -14
- package/dist/lib/reporting/gcs/io.d.mts +0 -7
- package/dist/lib/reporting/gcs/io.d.ts +0 -7
- package/dist/lib/reporting/gcs/io.js +0 -95
- package/dist/lib/reporting/gcs/io.mjs +0 -69
- package/dist/lib/reporting/gcs/reader.d.mts +0 -67
- package/dist/lib/reporting/gcs/reader.d.ts +0 -67
- package/dist/lib/reporting/gcs/reader.js +0 -193
- package/dist/lib/reporting/gcs/reader.mjs +0 -169
- package/dist/lib/reporting/gcs/row-provider.d.mts +0 -39
- package/dist/lib/reporting/gcs/row-provider.d.ts +0 -39
- package/dist/lib/reporting/gcs/row-provider.js +0 -225
- package/dist/lib/reporting/gcs/row-provider.mjs +0 -208
- package/dist/lib/reporting/gcs/validation.d.mts +0 -5
- package/dist/lib/reporting/gcs/validation.d.ts +0 -5
- package/dist/lib/reporting/gcs/validation.js +0 -49
- package/dist/lib/reporting/gcs/validation.mjs +0 -25
- package/dist/lib/reporting/ledger/change-feed.d.mts +0 -69
- package/dist/lib/reporting/ledger/change-feed.d.ts +0 -69
- package/dist/lib/reporting/ledger/change-feed.js +0 -107
- package/dist/lib/reporting/ledger/change-feed.mjs +0 -80
- package/dist/lib/reporting/ledger/managed-postgres.d.mts +0 -293
- package/dist/lib/reporting/ledger/managed-postgres.d.ts +0 -293
- package/dist/lib/reporting/ledger/managed-postgres.js +0 -2346
- package/dist/lib/reporting/ledger/managed-postgres.mjs +0 -2332
- package/dist/lib/reporting/ledger/managed-router.d.mts +0 -148
- package/dist/lib/reporting/ledger/managed-router.d.ts +0 -148
- package/dist/lib/reporting/ledger/managed-router.js +0 -280
- package/dist/lib/reporting/ledger/managed-router.mjs +0 -258
- package/dist/lib/reporting/ledger/managed.d.mts +0 -535
- package/dist/lib/reporting/ledger/managed.d.ts +0 -535
- package/dist/lib/reporting/ledger/managed.js +0 -761
- package/dist/lib/reporting/ledger/managed.mjs +0 -729
- package/dist/lib/reporting/ledger/notification-activity.d.mts +0 -332
- package/dist/lib/reporting/ledger/notification-activity.d.ts +0 -332
- package/dist/lib/reporting/ledger/notification-activity.js +0 -1366
- package/dist/lib/reporting/ledger/notification-activity.mjs +0 -1337
- package/dist/lib/reporting/ledger/object-writes.d.mts +0 -128
- package/dist/lib/reporting/ledger/object-writes.d.ts +0 -128
- package/dist/lib/reporting/ledger/object-writes.js +0 -147
- package/dist/lib/reporting/ledger/object-writes.mjs +0 -114
- package/dist/lib/reporting/ledger/postgres.d.mts +0 -689
- package/dist/lib/reporting/ledger/postgres.d.ts +0 -689
- package/dist/lib/reporting/ledger/postgres.js +0 -4462
- package/dist/lib/reporting/ledger/postgres.mjs +0 -4462
- package/dist/lib/reporting/ledger/row-storage-migration.d.mts +0 -59
- package/dist/lib/reporting/ledger/row-storage-migration.d.ts +0 -59
- package/dist/lib/reporting/ledger/row-storage-migration.js +0 -365
- package/dist/lib/reporting/ledger/row-storage-migration.mjs +0 -339
- package/dist/lib/reporting/ledger/row-storage-object.d.mts +0 -203
- package/dist/lib/reporting/ledger/row-storage-object.d.ts +0 -203
- package/dist/lib/reporting/ledger/row-storage-object.js +0 -379
- package/dist/lib/reporting/ledger/row-storage-object.mjs +0 -335
- package/dist/lib/reporting/ledger/row-storage-provider-io.d.mts +0 -44
- package/dist/lib/reporting/ledger/row-storage-provider-io.d.ts +0 -44
- package/dist/lib/reporting/ledger/row-storage-provider-io.js +0 -142
- package/dist/lib/reporting/ledger/row-storage-provider-io.mjs +0 -111
- package/dist/lib/reporting/ledger/row-storage.d.mts +0 -316
- package/dist/lib/reporting/ledger/row-storage.d.ts +0 -316
- package/dist/lib/reporting/ledger/row-storage.js +0 -812
- package/dist/lib/reporting/ledger/row-storage.mjs +0 -802
- package/dist/lib/reporting/s3/index.d.mts +0 -34
- package/dist/lib/reporting/s3/index.d.ts +0 -34
- package/dist/lib/reporting/s3/index.js +0 -347
- package/dist/lib/reporting/s3/index.mjs +0 -340
- package/dist/lib/reporting/service/maintenance.d.mts +0 -148
- package/dist/lib/reporting/service/maintenance.d.ts +0 -148
- package/dist/lib/reporting/service/maintenance.js +0 -185
- package/dist/lib/reporting/service/maintenance.mjs +0 -159
- package/examples/reliable-reporting-service/README.md +0 -169
package/dist/lib/index.mjs
CHANGED
|
@@ -295,7 +295,12 @@ export * from "./reporting/index.mjs";
|
|
|
295
295
|
export * from "./types/index.mjs";
|
|
296
296
|
import { BrandJsonSchema, AdagentsJsonSchema } from "./types/wellknown-schemas.generated.mjs";
|
|
297
297
|
import { PlacementPresentationDocumentSchema, PlacementPresentationReferenceSchema } from "./types/schemas.generated.mjs";
|
|
298
|
-
import {
|
|
298
|
+
import {
|
|
299
|
+
STANDARD_ERROR_CODES,
|
|
300
|
+
isStandardErrorCode,
|
|
301
|
+
getErrorRecovery,
|
|
302
|
+
DEFAULT_UNKNOWN_ERROR_RECOVERY
|
|
303
|
+
} from "./types/error-codes.mjs";
|
|
299
304
|
import {
|
|
300
305
|
adcpError,
|
|
301
306
|
legacyCapabilitiesResponse,
|
|
@@ -465,7 +470,9 @@ import {
|
|
|
465
470
|
BODY_SNIPPET_TIMEOUT_MS,
|
|
466
471
|
OBSERVER_FLUSH_TIMEOUT_MS,
|
|
467
472
|
sanitizeTransportHeaders,
|
|
468
|
-
sanitizeTransportUrl
|
|
473
|
+
sanitizeTransportUrl,
|
|
474
|
+
DEFAULT_MAX_RESPONSE_BYTES,
|
|
475
|
+
SSE_CUMULATIVE_BUDGET_MULTIPLIER
|
|
469
476
|
} from "./protocols/index.mjs";
|
|
470
477
|
import { toReleasePrecisionWire, validateAdcpVersionWire } from "./validation/schema-loader.mjs";
|
|
471
478
|
import { bundleSupportsAdcpVersionField as _isSupported } from "./protocols/index.mjs";
|
|
@@ -785,6 +792,7 @@ import {
|
|
|
785
792
|
divergenceOffset,
|
|
786
793
|
translateUniversalMacros,
|
|
787
794
|
UnsafeNativeMappingError,
|
|
795
|
+
MultipleVendorConsentMacrosError,
|
|
788
796
|
compileUniversalMacroTemplate
|
|
789
797
|
} from "./substitution/index.mjs";
|
|
790
798
|
import {
|
|
@@ -879,9 +887,11 @@ export {
|
|
|
879
887
|
CreativeFormatCapabilityError,
|
|
880
888
|
CreativeFormatProjectionError,
|
|
881
889
|
DEFAULT_MACRO_PROHIBITED_PATTERN,
|
|
890
|
+
DEFAULT_MAX_RESPONSE_BYTES,
|
|
882
891
|
DEFAULT_MAX_SSE_FRAME_BYTES,
|
|
883
892
|
DEFAULT_REPORTING_CAPABILITIES,
|
|
884
893
|
DEFAULT_SSRF_POLICY,
|
|
894
|
+
DEFAULT_UNKNOWN_ERROR_RECOVERY,
|
|
885
895
|
DISCOVERY_ARM_SCENARIOS,
|
|
886
896
|
DeferredSettlementOwnershipError,
|
|
887
897
|
DeferredTaskError,
|
|
@@ -945,6 +955,7 @@ export {
|
|
|
945
955
|
MemoryStorage,
|
|
946
956
|
MissingEnvSecretError,
|
|
947
957
|
MissingInputHandlerError,
|
|
958
|
+
MultipleVendorConsentMacrosError,
|
|
948
959
|
NeedsAuthorizationError,
|
|
949
960
|
NetworkConsistencyChecker,
|
|
950
961
|
OBSERVER_FLUSH_TIMEOUT_MS,
|
|
@@ -987,6 +998,7 @@ export {
|
|
|
987
998
|
SIErrorCodes,
|
|
988
999
|
SIGNALS_TOOLS,
|
|
989
1000
|
SISessionManager,
|
|
1001
|
+
SSE_CUMULATIVE_BUDGET_MULTIPLIER,
|
|
990
1002
|
SSRF_TRANSIENT_CODES,
|
|
991
1003
|
STANDARD_CREATIVE_AGENTS,
|
|
992
1004
|
STANDARD_ERROR_CODES,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Public AdCP proposal-negotiation types (introduced by the 3.2 contract). */
|
|
2
|
-
import type { AcceptanceContext,
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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,
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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`.
|
|
40
|
-
* matches the underlying MCP / A2A transport defaults.
|
|
40
|
+
* with `ResponseTooLargeError`.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
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
|
-
*
|
|
50
|
-
*
|
|
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
|
-
* **
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
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
|
-
* **
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
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
|
|
@@ -11,6 +11,7 @@ export { withMCPConnectionScope };
|
|
|
11
11
|
export type { MCPCallOptions, MCPConnectionResult } from './mcp';
|
|
12
12
|
export { callA2ATool, createA2AClientFromCardUrl } from './a2a';
|
|
13
13
|
export { DEFAULT_REQUEST_TIMEOUT_MS } from './abort';
|
|
14
|
+
export { DEFAULT_MAX_RESPONSE_BYTES, SSE_CUMULATIVE_BUDGET_MULTIPLIER } from './responseSizeLimit';
|
|
14
15
|
export { callMCPToolWithTasks, getMCPTaskStatus, getMCPTaskResult, listMCPTasks, cancelMCPTask, mapMCPTaskStatus, serverSupportsTasks, } from './mcp-tasks';
|
|
15
16
|
import type { AgentConfig, DebugLogEntry } from '../types';
|
|
16
17
|
import type { PushNotificationConfig } from '../types/tools.generated';
|
|
@@ -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`.
|
|
40
|
-
* matches the underlying MCP / A2A transport defaults.
|
|
40
|
+
* with `ResponseTooLargeError`.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
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
|
-
*
|
|
50
|
-
*
|
|
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
|
-
* **
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
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
|
-
* **
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
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
|
|
@@ -19,9 +19,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var protocols_exports = {};
|
|
20
20
|
__export(protocols_exports, {
|
|
21
21
|
BODY_SNIPPET_TIMEOUT_MS: () => import_transportDiagnostics2.BODY_SNIPPET_TIMEOUT_MS,
|
|
22
|
+
DEFAULT_MAX_RESPONSE_BYTES: () => import_responseSizeLimit.DEFAULT_MAX_RESPONSE_BYTES,
|
|
22
23
|
DEFAULT_REQUEST_TIMEOUT_MS: () => import_abort.DEFAULT_REQUEST_TIMEOUT_MS,
|
|
23
24
|
OBSERVER_FLUSH_TIMEOUT_MS: () => import_transportDiagnostics2.OBSERVER_FLUSH_TIMEOUT_MS,
|
|
24
25
|
ProtocolClient: () => ProtocolClient,
|
|
26
|
+
SSE_CUMULATIVE_BUDGET_MULTIPLIER: () => import_responseSizeLimit.SSE_CUMULATIVE_BUDGET_MULTIPLIER,
|
|
25
27
|
UnauthorizedError: () => import_mcp.UnauthorizedError,
|
|
26
28
|
applyVersionEnvelope: () => applyVersionEnvelope,
|
|
27
29
|
bundleSupportsAdcpVersionField: () => bundleSupportsAdcpVersionField,
|
|
@@ -59,6 +61,7 @@ var import_a2a = require('./a2a.js');
|
|
|
59
61
|
var import_node_crypto = require("node:crypto");
|
|
60
62
|
var import_a2a2 = require('./a2a.js');
|
|
61
63
|
var import_abort = require('./abort.js');
|
|
64
|
+
var import_responseSizeLimit = require('./responseSizeLimit.js');
|
|
62
65
|
var import_mcp_tasks = require('./mcp-tasks.js');
|
|
63
66
|
var import_mcp_tasks2 = require('./mcp-tasks.js');
|
|
64
67
|
var import_mcp3 = require('./mcp.js');
|
|
@@ -76,7 +79,7 @@ var import_version = require('../version.js');
|
|
|
76
79
|
var import_errors2 = require('../errors/index.js');
|
|
77
80
|
var import_schema_loader = require('../validation/schema-loader.js');
|
|
78
81
|
var import_client = require('../signing/client.js');
|
|
79
|
-
var
|
|
82
|
+
var import_responseSizeLimit2 = require('./responseSizeLimit.js');
|
|
80
83
|
var import_prepared_call_context = require('./prepared-call-context.js');
|
|
81
84
|
var import_adcp_version_config = require('../utils/adcp-version-config.js');
|
|
82
85
|
var import_transportDiagnostics = require('./transportDiagnostics.js');
|
|
@@ -259,7 +262,7 @@ class ProtocolClient {
|
|
|
259
262
|
wireAdcpVersion,
|
|
260
263
|
versionEnvelope: versionEnvelopeMode
|
|
261
264
|
});
|
|
262
|
-
return (0,
|
|
265
|
+
return (0, import_responseSizeLimit2.withResponseSizeLimit)(
|
|
263
266
|
transport?.maxResponseBytes,
|
|
264
267
|
() => (0, import_transportDiagnostics.withTransportDiagnostics)(
|
|
265
268
|
{
|
|
@@ -523,7 +526,7 @@ const createMCPClient = (agentUrl, authToken, headers, serverVersion, adcpVersio
|
|
|
523
526
|
transport = normalizeTransportOptions(transport);
|
|
524
527
|
const versionEnvelope = buildVersionEnvelopeForMode(versionEnvelopeMode, adcpVersion, serverVersion);
|
|
525
528
|
return {
|
|
526
|
-
callTool: (toolName, args, debugLogs) => (0,
|
|
529
|
+
callTool: (toolName, args, debugLogs) => (0, import_responseSizeLimit2.withResponseSizeLimit)(
|
|
527
530
|
transport?.maxResponseBytes,
|
|
528
531
|
() => (0, import_mcp_tasks2.callMCPToolWithTasks)(
|
|
529
532
|
agentUrl,
|
|
@@ -545,7 +548,7 @@ const createA2AClient = (agentUrl, authToken, headers, serverVersion, adcpVersio
|
|
|
545
548
|
transport = normalizeTransportOptions(transport);
|
|
546
549
|
const versionEnvelope = buildVersionEnvelopeForMode(versionEnvelopeMode, adcpVersion, serverVersion);
|
|
547
550
|
return {
|
|
548
|
-
callTool: (toolName, parameters, debugLogs) => (0,
|
|
551
|
+
callTool: (toolName, parameters, debugLogs) => (0, import_responseSizeLimit2.withResponseSizeLimit)(
|
|
549
552
|
transport?.maxResponseBytes,
|
|
550
553
|
() => (0, import_a2a3.callA2ATool)(
|
|
551
554
|
agentUrl,
|
|
@@ -569,9 +572,11 @@ const createA2AClient = (agentUrl, authToken, headers, serverVersion, adcpVersio
|
|
|
569
572
|
// Annotate the CommonJS export names for ESM import in node:
|
|
570
573
|
0 && (module.exports = {
|
|
571
574
|
BODY_SNIPPET_TIMEOUT_MS,
|
|
575
|
+
DEFAULT_MAX_RESPONSE_BYTES,
|
|
572
576
|
DEFAULT_REQUEST_TIMEOUT_MS,
|
|
573
577
|
OBSERVER_FLUSH_TIMEOUT_MS,
|
|
574
578
|
ProtocolClient,
|
|
579
|
+
SSE_CUMULATIVE_BUDGET_MULTIPLIER,
|
|
575
580
|
UnauthorizedError,
|
|
576
581
|
applyVersionEnvelope,
|
|
577
582
|
bundleSupportsAdcpVersionField,
|
|
@@ -31,6 +31,7 @@ async function closeScopedConnections(protocol = "mcp") {
|
|
|
31
31
|
}
|
|
32
32
|
import { callA2ATool, createA2AClientFromCardUrl } from "./a2a.mjs";
|
|
33
33
|
import { DEFAULT_REQUEST_TIMEOUT_MS } from "./abort.mjs";
|
|
34
|
+
import { DEFAULT_MAX_RESPONSE_BYTES, SSE_CUMULATIVE_BUDGET_MULTIPLIER } from "./responseSizeLimit.mjs";
|
|
34
35
|
import {
|
|
35
36
|
callMCPToolWithTasks,
|
|
36
37
|
getMCPTaskStatus,
|
|
@@ -548,9 +549,11 @@ const createA2AClient = (agentUrl, authToken, headers, serverVersion, adcpVersio
|
|
|
548
549
|
};
|
|
549
550
|
export {
|
|
550
551
|
BODY_SNIPPET_TIMEOUT_MS,
|
|
552
|
+
DEFAULT_MAX_RESPONSE_BYTES,
|
|
551
553
|
DEFAULT_REQUEST_TIMEOUT_MS,
|
|
552
554
|
OBSERVER_FLUSH_TIMEOUT_MS,
|
|
553
555
|
ProtocolClient,
|
|
556
|
+
SSE_CUMULATIVE_BUDGET_MULTIPLIER,
|
|
554
557
|
UnauthorizedError,
|
|
555
558
|
applyVersionEnvelope,
|
|
556
559
|
bundleSupportsAdcpVersionField,
|
|
@@ -102,6 +102,7 @@ function connectionCacheKey(agentUrl, headers, signingCacheKey, authProvider, fe
|
|
|
102
102
|
if (fetchKey) parts.push(fetchKey);
|
|
103
103
|
if (handleLegacy !== void 0) parts.push(`handle-legacy:${handleLegacy}`);
|
|
104
104
|
if (allowPrivateIp !== void 0) parts.push(`allow-private-ip:${allowPrivateIp}`);
|
|
105
|
+
parts.push((0, import_responseSizeLimit.responseSizeCapCacheKey)());
|
|
105
106
|
const scopeKey = (0, import_mcp_scope.currentMCPConnectionScopeKey)();
|
|
106
107
|
if (scopeKey) parts.push(scopeKey);
|
|
107
108
|
return parts.join("::");
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
} from "./abort.mjs";
|
|
44
44
|
import { wrapFetchWithCapture } from "./rawResponseCapture.mjs";
|
|
45
45
|
import { wrapFetchWithSignedRequestRejection } from "./signedRequestRejection.mjs";
|
|
46
|
-
import { wrapFetchWithSizeLimit } from "./responseSizeLimit.mjs";
|
|
46
|
+
import { responseSizeCapCacheKey, wrapFetchWithSizeLimit } from "./responseSizeLimit.mjs";
|
|
47
47
|
import { wrapFetchWithTransportDiagnostics } from "./transportDiagnostics.mjs";
|
|
48
48
|
import { createAgentTransportFetch } from "../net/agent-transport-fetch.mjs";
|
|
49
49
|
const modernConnections = /* @__PURE__ */ new Map();
|
|
@@ -109,6 +109,7 @@ function connectionCacheKey(agentUrl, headers, signingCacheKey, authProvider, fe
|
|
|
109
109
|
if (fetchKey) parts.push(fetchKey);
|
|
110
110
|
if (handleLegacy !== void 0) parts.push(`handle-legacy:${handleLegacy}`);
|
|
111
111
|
if (allowPrivateIp !== void 0) parts.push(`allow-private-ip:${allowPrivateIp}`);
|
|
112
|
+
parts.push(responseSizeCapCacheKey());
|
|
112
113
|
const scopeKey = currentMCPConnectionScopeKey();
|
|
113
114
|
if (scopeKey) parts.push(scopeKey);
|
|
114
115
|
return parts.join("::");
|
|
@@ -89,6 +89,7 @@ function connectionCacheKey(agentUrl, authToken, signingCacheKey, authHeaders, t
|
|
|
89
89
|
if (signingCacheKey) parts.push(signingCacheKey);
|
|
90
90
|
if (transportFetch) parts.push(`fetch:${getTransportFetchFnDisambiguator(transportFetch)}`);
|
|
91
91
|
if (allowPrivateIp !== void 0) parts.push(`allow-private-ip:${allowPrivateIp}`);
|
|
92
|
+
parts.push((0, import_responseSizeLimit.responseSizeCapCacheKey)());
|
|
92
93
|
const scopeKey = (0, import_mcp_scope.currentMCPConnectionScopeKey)();
|
|
93
94
|
if (scopeKey) parts.push(scopeKey);
|
|
94
95
|
return parts.join("::");
|
|
@@ -19,7 +19,7 @@ import { buildAgentSigningFetch, signingContextStorage } from "../signing/client
|
|
|
19
19
|
import { redactArgsForLog } from "../utils/redact-args.mjs";
|
|
20
20
|
import { wrapFetchWithCapture } from "./rawResponseCapture.mjs";
|
|
21
21
|
import { getSignedRequestRejection, wrapFetchWithSignedRequestRejection } from "./signedRequestRejection.mjs";
|
|
22
|
-
import { wrapFetchWithSizeLimit } from "./responseSizeLimit.mjs";
|
|
22
|
+
import { responseSizeCapCacheKey, wrapFetchWithSizeLimit } from "./responseSizeLimit.mjs";
|
|
23
23
|
import { sanitizeTransportUrl, wrapFetchWithTransportDiagnostics } from "./transportDiagnostics.mjs";
|
|
24
24
|
import {
|
|
25
25
|
isAbortOrTimeoutError,
|
|
@@ -88,6 +88,7 @@ function connectionCacheKey(agentUrl, authToken, signingCacheKey, authHeaders, t
|
|
|
88
88
|
if (signingCacheKey) parts.push(signingCacheKey);
|
|
89
89
|
if (transportFetch) parts.push(`fetch:${getTransportFetchFnDisambiguator(transportFetch)}`);
|
|
90
90
|
if (allowPrivateIp !== void 0) parts.push(`allow-private-ip:${allowPrivateIp}`);
|
|
91
|
+
parts.push(responseSizeCapCacheKey());
|
|
91
92
|
const scopeKey = currentMCPConnectionScopeKey();
|
|
92
93
|
if (scopeKey) parts.push(scopeKey);
|
|
93
94
|
return parts.join("::");
|