@adcp/sdk 16.5.0 → 16.6.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.
- package/dist/lib/adapters/version/3.0/brand-fields.d.mts +7 -1
- package/dist/lib/adapters/version/3.0/brand-fields.d.ts +7 -1
- package/dist/lib/adapters/version/3.0/brand-fields.js +139 -3
- package/dist/lib/adapters/version/3.0/brand-fields.mjs +136 -2
- package/dist/lib/adapters/version/3.0/index.js +6 -0
- package/dist/lib/adapters/version/3.0/index.mjs +7 -1
- package/dist/lib/adapters/version/3.1/bidding.js +1 -1
- package/dist/lib/adapters/version/3.1/bidding.mjs +1 -1
- package/dist/lib/adapters/version/types.d.mts +5 -0
- package/dist/lib/adapters/version/types.d.ts +5 -0
- package/dist/lib/canonical-references/index.js +2 -0
- package/dist/lib/canonical-references/index.mjs +2 -0
- package/dist/lib/client/account-changes.d.mts +3 -1
- package/dist/lib/client/account-changes.d.ts +3 -1
- package/dist/lib/client/account-changes.js +22 -2
- package/dist/lib/client/account-changes.mjs +22 -2
- package/dist/lib/conformance/oracle.js +3 -2
- package/dist/lib/conformance/oracle.mjs +3 -2
- package/dist/lib/core/AgentClient.d.mts +165 -1
- package/dist/lib/core/AgentClient.d.ts +165 -1
- package/dist/lib/core/AgentClient.js +446 -8
- package/dist/lib/core/AgentClient.mjs +446 -8
- package/dist/lib/core/ConversationTypes.d.mts +8 -0
- package/dist/lib/core/ConversationTypes.d.ts +8 -0
- package/dist/lib/core/ProtocolResponseParser.d.mts +1 -1
- package/dist/lib/core/ProtocolResponseParser.d.ts +1 -1
- package/dist/lib/core/ProtocolResponseParser.js +28 -18
- package/dist/lib/core/ProtocolResponseParser.mjs +11 -1
- package/dist/lib/core/ResponseValidator.js +1 -1
- package/dist/lib/core/ResponseValidator.mjs +1 -1
- package/dist/lib/core/SingleAgentClient.d.mts +116 -6
- package/dist/lib/core/SingleAgentClient.d.ts +116 -6
- package/dist/lib/core/SingleAgentClient.js +556 -84
- package/dist/lib/core/SingleAgentClient.mjs +545 -72
- package/dist/lib/core/TaskExecutor.d.mts +7 -0
- package/dist/lib/core/TaskExecutor.d.ts +7 -0
- package/dist/lib/core/TaskExecutor.js +23 -8
- package/dist/lib/core/TaskExecutor.mjs +23 -8
- package/dist/lib/core/task-status.d.mts +2 -0
- package/dist/lib/core/task-status.d.ts +2 -0
- package/dist/lib/core/task-status.js +11 -2
- package/dist/lib/core/task-status.mjs +9 -1
- package/dist/lib/errors/index.d.mts +22 -0
- package/dist/lib/errors/index.d.ts +22 -0
- package/dist/lib/errors/index.js +43 -0
- package/dist/lib/errors/index.mjs +42 -0
- package/dist/lib/identity-3.3/trust.d.mts +1 -4
- package/dist/lib/identity-3.3/trust.d.ts +1 -4
- package/dist/lib/identity-3.3/trust.js +34 -21
- package/dist/lib/identity-3.3/trust.mjs +34 -21
- package/dist/lib/identity-3.3/validation.js +5 -3
- package/dist/lib/identity-3.3/validation.mjs +6 -4
- package/dist/lib/index.d.mts +8 -54
- package/dist/lib/index.d.ts +8 -54
- package/dist/lib/index.js +15 -0
- package/dist/lib/index.mjs +11 -0
- package/dist/lib/media-buy/action-assessment.js +29 -3
- package/dist/lib/media-buy/action-assessment.mjs +32 -4
- package/dist/lib/media-buy/action-contracts.d.mts +3 -0
- package/dist/lib/media-buy/action-contracts.d.ts +3 -0
- package/dist/lib/media-buy/action-contracts.js +24 -1
- package/dist/lib/media-buy/action-contracts.mjs +22 -1
- package/dist/lib/media-buy/compatibility.js +6 -1
- package/dist/lib/media-buy/compatibility.mjs +6 -1
- package/dist/lib/media-buy/preflight.js +1 -1
- package/dist/lib/media-buy/preflight.mjs +3 -2
- package/dist/lib/media-buy/types.d.mts +6 -1
- package/dist/lib/media-buy/types.d.ts +6 -1
- package/dist/lib/protocols/mcp-modern.d.mts +2 -0
- package/dist/lib/protocols/mcp-modern.d.ts +2 -0
- package/dist/lib/protocols/mcp-modern.js +31 -5
- package/dist/lib/protocols/mcp-modern.mjs +31 -5
- package/dist/lib/protocols/mcp-scope.d.mts +6 -1
- package/dist/lib/protocols/mcp-scope.d.ts +6 -1
- package/dist/lib/protocols/mcp-scope.js +25 -3
- package/dist/lib/protocols/mcp-scope.mjs +24 -3
- package/dist/lib/protocols/mcp.js +12 -6
- package/dist/lib/protocols/mcp.mjs +13 -6
- package/dist/lib/reporting/inspection.js +1 -0
- package/dist/lib/reporting/inspection.mjs +1 -0
- package/dist/lib/schemas/browser.d.mts +2 -0
- package/dist/lib/schemas/browser.d.ts +2 -0
- package/dist/lib/schemas/browser.js +3 -0
- package/dist/lib/schemas/browser.mjs +2 -0
- package/dist/lib/schemas/index.d.mts +5 -2
- package/dist/lib/schemas/index.d.ts +5 -2
- package/dist/lib/schemas/index.js +5 -0
- package/dist/lib/schemas/index.mjs +4 -0
- package/dist/lib/server/account-response-identity.d.mts +17 -0
- package/dist/lib/server/account-response-identity.d.ts +17 -0
- package/dist/lib/server/account-response-identity.js +52 -0
- package/dist/lib/server/account-response-identity.mjs +28 -0
- package/dist/lib/server/account-sync-contract.js +1 -0
- package/dist/lib/server/account-sync-contract.mjs +1 -0
- package/dist/lib/server/create-adcp-server.js +32 -19
- package/dist/lib/server/create-adcp-server.mjs +36 -12
- package/dist/lib/server/decisioning/account.d.mts +13 -6
- package/dist/lib/server/decisioning/account.d.ts +13 -6
- package/dist/lib/server/decisioning/account.js +37 -15
- package/dist/lib/server/decisioning/account.mjs +37 -15
- package/dist/lib/server/decisioning/runtime/from-platform.d.mts +5 -5
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts +5 -5
- package/dist/lib/server/decisioning/runtime/from-platform.js +6 -6
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +6 -6
- package/dist/lib/server/index.d.mts +1 -1
- package/dist/lib/server/index.d.ts +1 -1
- package/dist/lib/server/index.js +2 -0
- package/dist/lib/server/index.mjs +2 -0
- package/dist/lib/server/media-buy-action-resolver.d.mts +3 -0
- package/dist/lib/server/media-buy-action-resolver.d.ts +3 -0
- package/dist/lib/server/media-buy-action-resolver.js +32 -0
- package/dist/lib/server/media-buy-action-resolver.mjs +32 -0
- package/dist/lib/server/media-buy-store.d.mts +26 -12
- package/dist/lib/server/media-buy-store.d.ts +26 -12
- package/dist/lib/server/media-buy-store.js +69 -21
- package/dist/lib/server/media-buy-store.mjs +69 -21
- package/dist/lib/server/responses.js +9 -1
- package/dist/lib/server/responses.mjs +9 -1
- package/dist/lib/server/state-machine.d.mts +10 -11
- package/dist/lib/server/state-machine.d.ts +10 -11
- package/dist/lib/server/state-machine.js +20 -5
- package/dist/lib/server/state-machine.mjs +19 -5
- package/dist/lib/signing/agent-fetch.d.mts +1 -1
- package/dist/lib/signing/agent-fetch.d.ts +1 -1
- package/dist/lib/signing/agent-fetch.js +3 -3
- package/dist/lib/signing/agent-fetch.mjs +3 -3
- package/dist/lib/testing/client.d.mts +1 -0
- package/dist/lib/testing/client.d.ts +1 -0
- package/dist/lib/testing/client.js +6 -5
- package/dist/lib/testing/client.mjs +6 -5
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.js +60 -14
- package/dist/lib/testing/storyboard/canonical-format-satisfaction.mjs +60 -14
- package/dist/lib/testing/storyboard/compliance.d.mts +2 -5
- package/dist/lib/testing/storyboard/compliance.d.ts +2 -5
- package/dist/lib/testing/storyboard/compliance.js +62 -13
- package/dist/lib/testing/storyboard/compliance.mjs +63 -14
- package/dist/lib/testing/storyboard/context.d.mts +13 -3
- package/dist/lib/testing/storyboard/context.d.ts +13 -3
- package/dist/lib/testing/storyboard/context.js +15 -10
- package/dist/lib/testing/storyboard/context.mjs +15 -10
- package/dist/lib/testing/storyboard/default-invariants.js +10 -8
- package/dist/lib/testing/storyboard/default-invariants.mjs +11 -9
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.mts +2 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.d.ts +2 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.js +11 -0
- package/dist/lib/testing/storyboard/request-signing/vector-loader.mjs +10 -0
- package/dist/lib/testing/storyboard/runner.js +23 -10
- package/dist/lib/testing/storyboard/runner.mjs +23 -10
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/testing/storyboard/validations.js +4 -1
- package/dist/lib/testing/storyboard/validations.mjs +4 -1
- package/dist/lib/testing/test-controller.js +3 -0
- package/dist/lib/testing/test-controller.mjs +3 -0
- package/dist/lib/types/asset-instances.d.mts +1 -1
- package/dist/lib/types/asset-instances.d.ts +1 -1
- package/dist/lib/types/index.d.mts +5 -0
- package/dist/lib/types/index.d.ts +5 -0
- package/dist/lib/types/index.js +6 -1
- package/dist/lib/types/index.mjs +4 -1
- package/dist/lib/types/inline-enums.generated.d.mts +30 -4
- package/dist/lib/types/inline-enums.generated.d.ts +30 -4
- package/dist/lib/types/inline-enums.generated.js +41 -2
- package/dist/lib/types/inline-enums.generated.mjs +28 -2
- package/dist/lib/types/media-buy-delivery-report.d.mts +4 -0
- package/dist/lib/types/media-buy-delivery-report.d.ts +4 -0
- package/dist/lib/types/media-buy-delivery-report.js +16 -0
- package/dist/lib/types/media-buy-delivery-report.mjs +0 -0
- package/dist/lib/types/schemas.generated.d.ts +20 -69
- package/dist/lib/types/schemas.generated.js +29 -46
- package/dist/lib/types/schemas.generated.mjs +29 -46
- package/dist/lib/types/targeting-keys.generated.d.mts +4 -0
- package/dist/lib/types/targeting-keys.generated.d.ts +4 -0
- package/dist/lib/types/targeting-keys.generated.js +105 -0
- package/dist/lib/types/targeting-keys.generated.mjs +80 -0
- package/dist/lib/utils/adcp-version-config.js +5 -2
- package/dist/lib/utils/adcp-version-config.mjs +5 -2
- package/dist/lib/utils/envelope-status-compat.d.mts +18 -1
- package/dist/lib/utils/envelope-status-compat.d.ts +18 -1
- package/dist/lib/utils/envelope-status-compat.js +11 -5
- package/dist/lib/utils/envelope-status-compat.mjs +11 -5
- package/dist/lib/utils/response-unwrapper.js +18 -10
- package/dist/lib/utils/response-unwrapper.mjs +18 -10
- package/dist/lib/v2/format-schema/resolver.js +1 -1
- package/dist/lib/v2/format-schema/resolver.mjs +1 -1
- package/dist/lib/v2/projection/creative-delivery.js +123 -30
- package/dist/lib/v2/projection/creative-delivery.mjs +127 -30
- package/dist/lib/v2/projection/index.d.mts +1 -0
- package/dist/lib/v2/projection/index.d.ts +1 -0
- package/dist/lib/v2/projection/index.js +3 -0
- package/dist/lib/v2/projection/index.mjs +2 -0
- package/dist/lib/v2/projection/legacy-metadata.d.mts +19 -0
- package/dist/lib/v2/projection/legacy-metadata.d.ts +19 -0
- package/dist/lib/v2/projection/legacy-metadata.js +91 -0
- package/dist/lib/v2/projection/legacy-metadata.mjs +86 -0
- package/dist/lib/validation/compact-schema.d.mts +27 -0
- package/dist/lib/validation/compact-schema.d.ts +27 -0
- package/dist/lib/validation/compact-schema.js +276 -0
- package/dist/lib/validation/compact-schema.mjs +250 -0
- package/dist/lib/validation/media-buy-delivery-report.d.mts +8 -0
- package/dist/lib/validation/media-buy-delivery-report.d.ts +8 -0
- package/dist/lib/validation/media-buy-delivery-report.js +31 -0
- package/dist/lib/validation/media-buy-delivery-report.mjs +7 -0
- package/dist/lib/validation/schema-diagnostic-origins.d.mts +21 -0
- package/dist/lib/validation/schema-diagnostic-origins.d.ts +21 -0
- package/dist/lib/validation/schema-diagnostic-origins.js +193 -0
- package/dist/lib/validation/schema-diagnostic-origins.mjs +169 -0
- package/dist/lib/validation/schema-loader.js +86 -16
- package/dist/lib/validation/schema-loader.mjs +82 -16
- package/dist/lib/validation/schema-validator.d.mts +10 -19
- package/dist/lib/validation/schema-validator.d.ts +10 -19
- package/dist/lib/validation/schema-validator.js +136 -43
- package/dist/lib/validation/schema-validator.mjs +140 -44
- 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/dist/lib/webhooks/index.d.mts +3 -0
- package/dist/lib/webhooks/index.d.ts +3 -0
- package/dist/lib/webhooks/index.js +3 -0
- package/dist/lib/webhooks/index.mjs +2 -0
- package/dist/lib/webhooks/media-buy-delivery.d.mts +43 -0
- package/dist/lib/webhooks/media-buy-delivery.d.ts +43 -0
- package/dist/lib/webhooks/media-buy-delivery.js +119 -0
- package/dist/lib/webhooks/media-buy-delivery.mjs +94 -0
- package/docs/TYPE-SUMMARY.md +2 -2
- package/docs/guides/BUILD-AN-AGENT.md +9 -1
- package/docs/guides/DELIVERY-WEBHOOK-PARSING.md +135 -0
- package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +15 -0
- package/docs/guides/TYPED-CLIENT-TOOLS.md +49 -0
- package/docs/llms.txt +3 -3
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-6.6-to-6.7.md +14 -0
- package/docs/migration-account-change-feed.md +19 -0
- package/docs/releases/sdk-16.6-adoption-fixes.md +33 -0
- package/package.json +2 -2
|
@@ -35,6 +35,7 @@ __export(SingleAgentClient_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(SingleAgentClient_exports);
|
|
37
37
|
var import_mcp_connection_policy = require('../protocols/mcp-connection-policy.js');
|
|
38
|
+
var import_mcp_scope = require('../protocols/mcp-scope.js');
|
|
38
39
|
var import_protocol_methods = require('../signing/protocol-methods.js');
|
|
39
40
|
var import_pricing_adapter = require('../utils/pricing-adapter.js');
|
|
40
41
|
var import_creative_adapter = require('../utils/creative-adapter.js');
|
|
@@ -83,6 +84,7 @@ var import_errors3 = require('../errors/index.js');
|
|
|
83
84
|
var import_buyer_account_registry = require('./buyer-account-registry.js');
|
|
84
85
|
var import_account_resolution = require('./account-resolution.js');
|
|
85
86
|
var import_request_normalizer = require('../utils/request-normalizer.js');
|
|
87
|
+
var import_legacy_metadata = require('../v2/projection/legacy-metadata.js');
|
|
86
88
|
var import_global_async_local_storage = require('../utils/global-async-local-storage.js');
|
|
87
89
|
var import_validate_user_agent = require('../utils/validate-user-agent.js');
|
|
88
90
|
var import_webhook_url = require('./webhook-url.js');
|
|
@@ -92,7 +94,7 @@ var import_creative_delivery = require('../v2/projection/creative-delivery.js');
|
|
|
92
94
|
var import_legacy_routes = require('../v2/projection/legacy-routes.js');
|
|
93
95
|
var import_catalog_snapshot = require('../v2/projection/catalog-snapshot.js');
|
|
94
96
|
var import_augment_response = require('../v2/projection/augment-response.js');
|
|
95
|
-
var
|
|
97
|
+
var import_legacy_metadata2 = require('../v2/projection/legacy-metadata.js');
|
|
96
98
|
var import_types = require('../v2/projection/types.js');
|
|
97
99
|
var import_jcs = require('../utils/jcs.js');
|
|
98
100
|
function loadWebBotAuth() {
|
|
@@ -100,6 +102,16 @@ function loadWebBotAuth() {
|
|
|
100
102
|
}
|
|
101
103
|
const SKIP_PRODUCT_CACHE = /* @__PURE__ */ Symbol("adcp.skipProductCache");
|
|
102
104
|
const SKIP_ACCOUNT_REGISTRY_OBSERVATION = /* @__PURE__ */ Symbol("adcp.skipAccountRegistryObservation");
|
|
105
|
+
const NONTERMINAL_TASK_RESULT_STATUSES = /* @__PURE__ */ new Set([
|
|
106
|
+
"submitted",
|
|
107
|
+
"working",
|
|
108
|
+
"input-required",
|
|
109
|
+
"auth-required",
|
|
110
|
+
"deferred"
|
|
111
|
+
]);
|
|
112
|
+
function isNonterminalTaskResult(result) {
|
|
113
|
+
return result !== null && typeof result === "object" && "success" in result && result.success === true && "status" in result && typeof result.status === "string" && NONTERMINAL_TASK_RESULT_STATUSES.has(result.status);
|
|
114
|
+
}
|
|
103
115
|
function presentedStaticTransportCredential(authToken, headers, authProvider) {
|
|
104
116
|
if (authProvider) return false;
|
|
105
117
|
if (authToken) return true;
|
|
@@ -626,10 +638,7 @@ const STANDARD_ADCP_TASK_NAMES = /* @__PURE__ */ new Set([
|
|
|
626
638
|
"list_transformers",
|
|
627
639
|
"preview_creative",
|
|
628
640
|
"build_creative",
|
|
629
|
-
//
|
|
630
|
-
// identity through artifacts, manifests, standards, or rights constraints.
|
|
631
|
-
// They are available only through explicitly named *Legacy APIs until a
|
|
632
|
-
// lossless canonical projection exists.
|
|
641
|
+
// Wire-level creative and content tools also have typed primary methods.
|
|
633
642
|
"list_content_standards",
|
|
634
643
|
"get_content_standards",
|
|
635
644
|
"create_content_standards",
|
|
@@ -913,7 +922,19 @@ class SingleAgentClient {
|
|
|
913
922
|
adcpVersion: this.resolvedAdcpVersion,
|
|
914
923
|
...config.wireAdcpVersion !== void 0 && { wireAdcpVersion: config.wireAdcpVersion },
|
|
915
924
|
...config.versionEnvelope !== void 0 && { versionEnvelope: config.versionEnvelope },
|
|
916
|
-
transport: config.transport
|
|
925
|
+
transport: config.transport,
|
|
926
|
+
resolveTaskStatusTool: async (pollAgent, options) => {
|
|
927
|
+
const client = pollAgent.id === this.normalizedAgent.id ? this : new SingleAgentClient(pollAgent, {
|
|
928
|
+
adcpVersion: this.resolvedAdcpVersion,
|
|
929
|
+
wireAdcpVersion: this.config.wireAdcpVersion,
|
|
930
|
+
versionEnvelope: this.config.versionEnvelope,
|
|
931
|
+
userAgent: this.config.userAgent,
|
|
932
|
+
discoveryCache: this.config.discoveryCache,
|
|
933
|
+
onTransportActivity: this.config.onTransportActivity,
|
|
934
|
+
transport: options.transport
|
|
935
|
+
});
|
|
936
|
+
return await client.advertisesTool("get_task_status", options) ? "get_task_status" : pollAgent.protocol === "mcp" ? "tasks_get" : "tasks/get";
|
|
937
|
+
}
|
|
917
938
|
});
|
|
918
939
|
if (config.handlers) {
|
|
919
940
|
this.asyncHandler = new import_AsyncHandler.AsyncHandler(config.handlers);
|
|
@@ -1461,18 +1482,18 @@ class SingleAgentClient {
|
|
|
1461
1482
|
publisher_domain: option.publisher_domain,
|
|
1462
1483
|
format_option_id: option.format_option_id
|
|
1463
1484
|
} : { scope: "product", format_option_id: option.format_option_id };
|
|
1464
|
-
const refs = (0,
|
|
1465
|
-
const declared = declaredOptions ? declaredOptions.get(product.product_id)?.some((declaredRef) => this.sameCanonicalOptionRef(declaredRef, ref)) : (0,
|
|
1466
|
-
if (declared !== void 0) (0,
|
|
1485
|
+
const refs = (0, import_legacy_metadata2.legacyFormatRefsForDeclaration)(option);
|
|
1486
|
+
const declared = declaredOptions ? declaredOptions.get(product.product_id)?.some((declaredRef) => this.sameCanonicalOptionRef(declaredRef, ref)) : (0, import_legacy_metadata2.sellerDeclaredFormatOption)(option);
|
|
1487
|
+
if (declared !== void 0) (0, import_legacy_metadata2.rememberSellerDeclaredFormatOption)(option, declared);
|
|
1467
1488
|
if (declared === true && evidence)
|
|
1468
|
-
(0,
|
|
1489
|
+
(0, import_legacy_metadata2.rememberSellerFormatEvidence)(option, { ...evidence, productId: product.product_id });
|
|
1469
1490
|
this.rememberCanonicalLegacyRoute(this.canonicalLegacyRouteKey(account, product.product_id, ref), {
|
|
1470
1491
|
kind: "product",
|
|
1471
1492
|
accountScope,
|
|
1472
1493
|
productId: product.product_id,
|
|
1473
1494
|
optionRef: ref,
|
|
1474
1495
|
refs,
|
|
1475
|
-
...declared === true && (0,
|
|
1496
|
+
...declared === true && (0, import_legacy_metadata2.sellerFormatEvidence)(option) ? { declaration: (0, import_legacy_metadata2.structuredCloneWithLegacyCreativeMetadata)(option) } : {},
|
|
1476
1497
|
...declared === false ? { undeclaredSelector: (0, import_legacy_routes.undeclaredFormatOptionSelector)(option) } : {}
|
|
1477
1498
|
});
|
|
1478
1499
|
}
|
|
@@ -1721,8 +1742,18 @@ class SingleAgentClient {
|
|
|
1721
1742
|
const agent = this.normalizedAgent.protocol === "a2a" ? await this.ensureCanonicalUrlResolved(snapshot) : await this.ensureEndpointDiscovered(snapshot);
|
|
1722
1743
|
return this.executor.trackTask(agent, snapshot);
|
|
1723
1744
|
}
|
|
1724
|
-
|
|
1725
|
-
|
|
1745
|
+
async getTaskStatus(taskIdOrParams, transportOrHandler, signalOrOptions, wireOptions) {
|
|
1746
|
+
if (typeof taskIdOrParams !== "string") {
|
|
1747
|
+
return this.executeTaskUnprojected(
|
|
1748
|
+
"get_task_status",
|
|
1749
|
+
taskIdOrParams,
|
|
1750
|
+
transportOrHandler,
|
|
1751
|
+
signalOrOptions
|
|
1752
|
+
);
|
|
1753
|
+
}
|
|
1754
|
+
const taskId = taskIdOrParams;
|
|
1755
|
+
const transport = transportOrHandler;
|
|
1756
|
+
const signal = signalOrOptions;
|
|
1726
1757
|
const transportSnapshot = transport === void 0 ? void 0 : { ...transport };
|
|
1727
1758
|
const options = { transport: transportSnapshot, signal };
|
|
1728
1759
|
const agent = this.normalizedAgent.protocol === "a2a" ? await this.ensureCanonicalUrlResolved(options) : await this.ensureEndpointDiscovered(options);
|
|
@@ -2195,6 +2226,9 @@ class SingleAgentClient {
|
|
|
2195
2226
|
* - A validated MCP protected-resource metadata chain yields NeedsAuthorizationError
|
|
2196
2227
|
* - Otherwise AuthenticationRequiredError carries the advertised challenge
|
|
2197
2228
|
*
|
|
2229
|
+
* Rate limiting (429, or 503 with Retry-After) stops probing at that URL and
|
|
2230
|
+
* throws AgentRateLimitedError carrying the status and Retry-After.
|
|
2231
|
+
*
|
|
2198
2232
|
* Note: This is async and called lazily on first agent interaction
|
|
2199
2233
|
*/
|
|
2200
2234
|
async discoverMCPEndpoint(providedUri, options) {
|
|
@@ -2205,8 +2239,8 @@ class SingleAgentClient {
|
|
|
2205
2239
|
}
|
|
2206
2240
|
async discoverMCPEndpointWithConnectionPolicy(providedUri, options) {
|
|
2207
2241
|
(0, import_abort2.throwIfAborted)(options?.signal);
|
|
2208
|
-
const { connectMCPWithFallback } = await import("../protocols/mcp.js");
|
|
2209
|
-
const { probeModernMCPConnection } = await import("../protocols/mcp-modern.js");
|
|
2242
|
+
const { connectMCPWithFallback, withScopedLegacyConnection } = await import("../protocols/mcp.js");
|
|
2243
|
+
const { probeModernMCPConnection, retryAfterOf } = await import("../protocols/mcp-modern.js");
|
|
2210
2244
|
const transport = (0, import_protocols.normalizeTransportOptions)(options?.transport ?? this.config.transport);
|
|
2211
2245
|
const usesScopedFetch = this.usesScopedDiscoveryTransport(options);
|
|
2212
2246
|
const endpointEpoch = this.discoveryEpochSnapshot(options);
|
|
@@ -2236,19 +2270,35 @@ class SingleAgentClient {
|
|
|
2236
2270
|
}
|
|
2237
2271
|
return { success: true };
|
|
2238
2272
|
}
|
|
2239
|
-
const
|
|
2240
|
-
new URL(url),
|
|
2241
|
-
authHeaders,
|
|
2242
|
-
[],
|
|
2243
|
-
"endpoint discovery",
|
|
2244
|
-
transport?.trustedFetchFn,
|
|
2273
|
+
const shared = await withScopedLegacyConnection(
|
|
2245
2274
|
{
|
|
2275
|
+
agentUrl: url,
|
|
2276
|
+
authToken,
|
|
2277
|
+
customHeaders: agentHeaders,
|
|
2278
|
+
authProvider,
|
|
2246
2279
|
signal: options?.signal,
|
|
2247
2280
|
requestTimeoutMs: transport?.requestTimeoutMs,
|
|
2281
|
+
fetchFn: transport?.trustedFetchFn,
|
|
2248
2282
|
allowPrivateIp: transport?.allowPrivateIp
|
|
2249
|
-
}
|
|
2283
|
+
},
|
|
2284
|
+
"endpoint discovery",
|
|
2285
|
+
async () => void 0
|
|
2250
2286
|
);
|
|
2251
|
-
|
|
2287
|
+
if (!shared) {
|
|
2288
|
+
const client = await connectMCPWithFallback(
|
|
2289
|
+
new URL(url),
|
|
2290
|
+
authHeaders,
|
|
2291
|
+
[],
|
|
2292
|
+
"endpoint discovery",
|
|
2293
|
+
transport?.trustedFetchFn,
|
|
2294
|
+
{
|
|
2295
|
+
signal: options?.signal,
|
|
2296
|
+
requestTimeoutMs: transport?.requestTimeoutMs,
|
|
2297
|
+
allowPrivateIp: transport?.allowPrivateIp
|
|
2298
|
+
}
|
|
2299
|
+
);
|
|
2300
|
+
await client.close();
|
|
2301
|
+
}
|
|
2252
2302
|
if (mayRetain()) {
|
|
2253
2303
|
this.discoveredMcpEra = "legacy";
|
|
2254
2304
|
this.discoveredMcpEraAt = Date.now();
|
|
@@ -2265,7 +2315,8 @@ class SingleAgentClient {
|
|
|
2265
2315
|
}
|
|
2266
2316
|
const errObj = error;
|
|
2267
2317
|
const status = errObj?.status || errObj?.response?.status || errObj?.cause?.status;
|
|
2268
|
-
|
|
2318
|
+
const retryAfter = retryAfterOf(error);
|
|
2319
|
+
return { success: false, status, ...retryAfter !== void 0 && { retryAfter }, error };
|
|
2269
2320
|
}
|
|
2270
2321
|
};
|
|
2271
2322
|
const urlsToTry = [];
|
|
@@ -2288,6 +2339,9 @@ class SingleAgentClient {
|
|
|
2288
2339
|
firstWorkingUrl = url;
|
|
2289
2340
|
break;
|
|
2290
2341
|
}
|
|
2342
|
+
if (result.status === 429 || result.status === 503 && result.retryAfter !== void 0) {
|
|
2343
|
+
throw new import_errors.AgentRateLimitedError(url, result.status, result.retryAfter, result.error);
|
|
2344
|
+
}
|
|
2291
2345
|
if (result.status === 401) {
|
|
2292
2346
|
got401 = true;
|
|
2293
2347
|
first401Error ??= result.error;
|
|
@@ -2564,6 +2618,24 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
2564
2618
|
};
|
|
2565
2619
|
}
|
|
2566
2620
|
}
|
|
2621
|
+
let artifactPayloadValidator;
|
|
2622
|
+
if (registration?.deliveryKind === "artifact") {
|
|
2623
|
+
try {
|
|
2624
|
+
const loader = require('../validation/schema-loader.js');
|
|
2625
|
+
artifactPayloadValidator = loader.getSchemaValidatorByRef(
|
|
2626
|
+
"content-standards/artifact-webhook-payload.json",
|
|
2627
|
+
this.resolvedAdcpVersion
|
|
2628
|
+
);
|
|
2629
|
+
if (!artifactPayloadValidator) throw new import_errors.ConfigurationError("Bundled artifact webhook schema is unavailable.");
|
|
2630
|
+
} catch (cause) {
|
|
2631
|
+
return {
|
|
2632
|
+
ok: false,
|
|
2633
|
+
code: "webhook_verification_unavailable",
|
|
2634
|
+
message: "Artifact webhook schema configuration is unavailable.",
|
|
2635
|
+
cause
|
|
2636
|
+
};
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2567
2639
|
if (registration?.mode === "rfc9421") {
|
|
2568
2640
|
const { verifyWebBotAuth, selectSignatureProfile, WebBotAuthError, WebBotAuthUnavailableError } = loadWebBotAuth();
|
|
2569
2641
|
const requestMethod = options.requestMethod;
|
|
@@ -2738,7 +2810,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
2738
2810
|
const isReport = registration.deliveryKind === "reporting";
|
|
2739
2811
|
const payload = isReport ? body.result : body;
|
|
2740
2812
|
const schemaRef = isReport ? "media-buy/media-buy-delivery-webhook-result.json" : "content-standards/artifact-webhook-payload.json";
|
|
2741
|
-
const validator = loader.getSchemaValidatorByRef(schemaRef, this.resolvedAdcpVersion);
|
|
2813
|
+
const validator = isReport ? loader.getSchemaValidatorByRef(schemaRef, this.resolvedAdcpVersion) : artifactPayloadValidator;
|
|
2742
2814
|
const envelopeValidator = isReport ? loader.getSchemaValidatorByRef("core/mcp-webhook-payload.json", this.resolvedAdcpVersion) : void 0;
|
|
2743
2815
|
if (!validator || !validator(payload) || isReport && (!envelopeValidator || !envelopeValidator(body) || body.task_type !== "media_buy_delivery"))
|
|
2744
2816
|
return {
|
|
@@ -3500,17 +3572,32 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
3500
3572
|
timestamp
|
|
3501
3573
|
}).ok;
|
|
3502
3574
|
}
|
|
3503
|
-
/**
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3575
|
+
/** One task owns discovery and dispatch sessions unless the caller already owns reuse. */
|
|
3576
|
+
withConnectionScope(options, run, preserveSessionOnResult) {
|
|
3577
|
+
const transport = (0, import_protocols.normalizeTransportOptions)(options?.transport ?? this.config.transport);
|
|
3578
|
+
return (0, import_mcp_connection_policy.withMCPConnectionPolicy)(
|
|
3579
|
+
transport,
|
|
3580
|
+
() => (0, import_mcp_connection_policy.shouldReuseMCPConnection)(transport?.trustedFetchFn !== void 0) ? run() : (0, import_mcp_scope.withMCPConnectionScope)(run, {
|
|
3581
|
+
signal: options?.signal,
|
|
3582
|
+
preserveOnInterruption: true,
|
|
3583
|
+
preserveSessionOnResult
|
|
3584
|
+
})
|
|
3585
|
+
);
|
|
3586
|
+
}
|
|
3587
|
+
withTaskConnectionScope(options, run) {
|
|
3588
|
+
return (0, import_task_deadline.withTaskDeadline)(
|
|
3589
|
+
options,
|
|
3590
|
+
(effective) => this.withConnectionScope(effective, () => run(effective), isNonterminalTaskResult)
|
|
3591
|
+
);
|
|
3592
|
+
}
|
|
3593
|
+
/** Execute a task, adapt maintained AdCP 3 releases, and call the completion handler. */
|
|
3508
3594
|
async executeAndHandle(taskType, handlerName, params, inputHandler, options, transformCompletedResponse, legacyFormatConverter, canonicalRequest, projectionCatalogs) {
|
|
3595
|
+
const projectionDrifts = (0, import_legacy_metadata.getCreativeDeliveryDiagnostics)(params);
|
|
3509
3596
|
const requestParamsSnapshot = structuredClone(params);
|
|
3510
3597
|
const canonicalRequestSnapshot = canonicalRequest === void 0 ? void 0 : structuredClone(canonicalRequest);
|
|
3511
3598
|
const deferredProjectionCatalogs = projectionCatalogs ? structuredClone(projectionCatalogs) : void 0;
|
|
3512
3599
|
const taskOptionsSnapshot = snapshotTaskOptions(options);
|
|
3513
|
-
return
|
|
3600
|
+
return this.withTaskConnectionScope(
|
|
3514
3601
|
taskOptionsSnapshot,
|
|
3515
3602
|
(effectiveOptions) => this.executeAndHandleWithinDeadline(
|
|
3516
3603
|
taskType,
|
|
@@ -3521,11 +3608,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
3521
3608
|
transformCompletedResponse,
|
|
3522
3609
|
legacyFormatConverter,
|
|
3523
3610
|
canonicalRequestSnapshot,
|
|
3524
|
-
deferredProjectionCatalogs
|
|
3611
|
+
deferredProjectionCatalogs,
|
|
3612
|
+
projectionDrifts
|
|
3525
3613
|
)
|
|
3526
3614
|
);
|
|
3527
3615
|
}
|
|
3528
|
-
async executeAndHandleWithinDeadline(taskType, handlerName, params, inputHandler, options, transformCompletedResponse, legacyFormatConverter, canonicalRequest, projectionCatalogs) {
|
|
3616
|
+
async executeAndHandleWithinDeadline(taskType, handlerName, params, inputHandler, options, transformCompletedResponse, legacyFormatConverter, canonicalRequest, projectionCatalogs, projectionDrifts = []) {
|
|
3529
3617
|
(0, import_abort2.throwIfAborted)(options?.signal);
|
|
3530
3618
|
const canonicalCreativeInvocation = CANONICAL_CREATIVE_ACTIVITY_TASKS.has(taskType) || canonicalRequest !== void 0;
|
|
3531
3619
|
params = await this.applyAccountPolicy(taskType, params, options);
|
|
@@ -3601,7 +3689,15 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
3601
3689
|
if (negotiatedRelease?.downgraded && !options?.skipIdempotencyAutoInject && !options?.skipAccountValidation && !options?.skipRequestValidation) {
|
|
3602
3690
|
this.executor.validateRequest(taskType, adaptedParams, inputSchemaStripLogs, negotiatedRelease.version);
|
|
3603
3691
|
}
|
|
3604
|
-
const adaptationLogs = [
|
|
3692
|
+
const adaptationLogs = [
|
|
3693
|
+
...projectionDrifts.map((drift) => ({
|
|
3694
|
+
...drift,
|
|
3695
|
+
taskName: taskType,
|
|
3696
|
+
clientVersion: this.resolvedAdcpVersion,
|
|
3697
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
3698
|
+
})),
|
|
3699
|
+
...adaptDriftLogs
|
|
3700
|
+
];
|
|
3605
3701
|
if (webhookDriftLog) adaptationLogs.push(webhookDriftLog);
|
|
3606
3702
|
const canonicalInputHandler = this.canonicalCreativeInputHandler(
|
|
3607
3703
|
taskType,
|
|
@@ -4710,8 +4806,15 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
4710
4806
|
* stamps it on the version envelope and validates the response against it.
|
|
4711
4807
|
*/
|
|
4712
4808
|
withNegotiatedRelease(options, negotiated) {
|
|
4713
|
-
if (!negotiated
|
|
4714
|
-
return {
|
|
4809
|
+
if (!negotiated) return options;
|
|
4810
|
+
return {
|
|
4811
|
+
...options ?? {},
|
|
4812
|
+
selectedAdcpVersion: negotiated.version,
|
|
4813
|
+
...negotiated.downgraded && {
|
|
4814
|
+
wireAdcpVersion: negotiated.version,
|
|
4815
|
+
negotiatedAdcpVersion: negotiated.version
|
|
4816
|
+
}
|
|
4817
|
+
};
|
|
4715
4818
|
}
|
|
4716
4819
|
/**
|
|
4717
4820
|
* Refuse a tool the negotiated release does not define (a 3.2-only task
|
|
@@ -4980,8 +5083,9 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
4980
5083
|
const adapterKey = (0, import_version2.resolveAdapterKey)(this.resolvedAdcpVersion, perCallCapabilities ?? this.cachedCapabilities);
|
|
4981
5084
|
if (adapterKey) {
|
|
4982
5085
|
const versionAdapter = (0, import_version2.getVersionAdapter)(adapterKey, taskType);
|
|
4983
|
-
|
|
4984
|
-
|
|
5086
|
+
const adaptRequest = negotiated ? versionAdapter?.adaptRequest : versionAdapter?.adaptUnnegotiatedRequest ?? versionAdapter?.adaptRequest;
|
|
5087
|
+
if (adaptRequest) {
|
|
5088
|
+
const result = adaptRequest(adapted);
|
|
4985
5089
|
adapted = result.params;
|
|
4986
5090
|
if (result.drift) {
|
|
4987
5091
|
driftLogs.push({
|
|
@@ -5043,7 +5147,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5043
5147
|
legacyFormatConverter,
|
|
5044
5148
|
projectionCatalogs ?? this.config.projectionCatalogs
|
|
5045
5149
|
);
|
|
5046
|
-
return
|
|
5150
|
+
return this.withTaskConnectionScope(snapshotTaskOptions(taskOptions), async (effectiveOptions) => {
|
|
5047
5151
|
this.assertRequestSupportedByConfiguredVersion("get_products", params, effectiveOptions);
|
|
5048
5152
|
let request = await this.applyAccountPolicy("get_products", params, effectiveOptions);
|
|
5049
5153
|
const legacyAccountId = request.account_id;
|
|
@@ -5226,13 +5330,13 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5226
5330
|
async createMediaBuy(params, inputHandler, options) {
|
|
5227
5331
|
assertRawMethodForGovernedPayload("create_media_buy", options);
|
|
5228
5332
|
this.assertDurableProjectionOverrideSupported(options?.legacyFormatConverter);
|
|
5229
|
-
const requestSnapshot = (0,
|
|
5333
|
+
const requestSnapshot = (0, import_legacy_metadata2.structuredCloneWithLegacyCreativeMetadata)(params);
|
|
5230
5334
|
const projectionCatalogs = options?.projectionCatalogs ? structuredClone(options.projectionCatalogs) : void 0;
|
|
5231
5335
|
const snapshottedOptions = {
|
|
5232
5336
|
...snapshotTaskOptions(options),
|
|
5233
5337
|
...projectionCatalogs !== void 0 && { projectionCatalogs }
|
|
5234
5338
|
};
|
|
5235
|
-
return
|
|
5339
|
+
return this.withTaskConnectionScope(
|
|
5236
5340
|
snapshottedOptions,
|
|
5237
5341
|
(effectiveOptions) => this.createMediaBuyWithinDeadline(requestSnapshot, inputHandler, effectiveOptions)
|
|
5238
5342
|
);
|
|
@@ -5385,13 +5489,13 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5385
5489
|
async updateMediaBuy(params, inputHandler, options) {
|
|
5386
5490
|
assertRawMethodForGovernedPayload("update_media_buy", options);
|
|
5387
5491
|
this.assertDurableProjectionOverrideSupported(options?.legacyFormatConverter);
|
|
5388
|
-
const requestSnapshot = (0,
|
|
5492
|
+
const requestSnapshot = (0, import_legacy_metadata2.structuredCloneWithLegacyCreativeMetadata)(params);
|
|
5389
5493
|
const projectionCatalogs = options?.projectionCatalogs ? structuredClone(options.projectionCatalogs) : void 0;
|
|
5390
5494
|
const snapshottedOptions = {
|
|
5391
5495
|
...snapshotTaskOptions(options),
|
|
5392
5496
|
...projectionCatalogs !== void 0 && { projectionCatalogs }
|
|
5393
5497
|
};
|
|
5394
|
-
return
|
|
5498
|
+
return this.withTaskConnectionScope(
|
|
5395
5499
|
snapshottedOptions,
|
|
5396
5500
|
(effectiveOptions) => this.updateMediaBuyWithinDeadline(requestSnapshot, inputHandler, effectiveOptions)
|
|
5397
5501
|
);
|
|
@@ -5467,12 +5571,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5467
5571
|
this.assertDurableProjectionOverrideSupported(
|
|
5468
5572
|
options?.creativeFormatProjection?.legacyFormatConverter ?? options?.legacyFormatConverter
|
|
5469
5573
|
);
|
|
5470
|
-
const requestSnapshot = (0,
|
|
5574
|
+
const requestSnapshot = (0, import_legacy_metadata2.structuredCloneWithLegacyCreativeMetadata)(params);
|
|
5471
5575
|
const projectionCatalogs = options?.projectionCatalogs ? structuredClone(options.projectionCatalogs) : void 0;
|
|
5472
5576
|
const creativeFormatProjection = options?.creativeFormatProjection ? {
|
|
5473
5577
|
...options.creativeFormatProjection,
|
|
5474
5578
|
...options.creativeFormatProjection.selectorContainers !== void 0 && {
|
|
5475
|
-
selectorContainers: (0,
|
|
5579
|
+
selectorContainers: (0, import_legacy_metadata2.structuredCloneWithLegacyCreativeMetadata)(
|
|
5476
5580
|
options.creativeFormatProjection.selectorContainers
|
|
5477
5581
|
)
|
|
5478
5582
|
}
|
|
@@ -5482,7 +5586,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5482
5586
|
...projectionCatalogs !== void 0 && { projectionCatalogs },
|
|
5483
5587
|
...creativeFormatProjection !== void 0 && { creativeFormatProjection }
|
|
5484
5588
|
};
|
|
5485
|
-
return
|
|
5589
|
+
return this.withTaskConnectionScope(
|
|
5486
5590
|
snapshottedOptions,
|
|
5487
5591
|
(effectiveOptions) => this.syncCreativesWithinDeadline(requestSnapshot, inputHandler, effectiveOptions)
|
|
5488
5592
|
);
|
|
@@ -5640,10 +5744,10 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5640
5744
|
const creativeRef = isPlainRecord(creative) ? optionRef(creative.format_option_ref) : void 0;
|
|
5641
5745
|
if (isPlainRecord(creative) && creative.format_option_ref !== void 0 && !creativeRef) return false;
|
|
5642
5746
|
const isSellerDeclaration = (value) => {
|
|
5643
|
-
if (!isPlainRecord(value) || (0,
|
|
5747
|
+
if (!isPlainRecord(value) || (0, import_legacy_metadata2.sellerDeclaredFormatOption)(value) !== true || (0, import_legacy_metadata2.isSynthesizedFormatOption)(value)) {
|
|
5644
5748
|
return false;
|
|
5645
5749
|
}
|
|
5646
|
-
const evidence2 = (0,
|
|
5750
|
+
const evidence2 = (0, import_legacy_metadata2.sellerFormatEvidence)(value);
|
|
5647
5751
|
if (!evidence2 || evidence2.scopeKey !== scopeKey || typeof container.product_id === "string" && evidence2.productId !== container.product_id || evidence2.expiresAt <= Date.now() || evidence2.accountScope !== accountScope && evidence2.accountScope !== "none")
|
|
5648
5752
|
return false;
|
|
5649
5753
|
const ref = optionRef(value);
|
|
@@ -5657,7 +5761,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5657
5761
|
};
|
|
5658
5762
|
const declarations = [
|
|
5659
5763
|
...(Array.isArray(container.format_options) ? container.format_options : []).filter(isSellerDeclaration),
|
|
5660
|
-
...(0,
|
|
5764
|
+
...(0, import_legacy_metadata2.selectedFormatOptions)(container).filter(isSellerDeclaration)
|
|
5661
5765
|
];
|
|
5662
5766
|
if (typeof container.product_id === "string") {
|
|
5663
5767
|
for (const ref of [...refs, ...creativeRef ? [creativeRef] : []]) {
|
|
@@ -5934,25 +6038,31 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5934
6038
|
* Pass an explicit agent via options.agent to override.
|
|
5935
6039
|
*/
|
|
5936
6040
|
async syncPlans(params, inputHandler, options) {
|
|
6041
|
+
if (!options?.agent && !this.config.governance?.campaign?.agent) {
|
|
6042
|
+
return this.executeTaskUnprojected("sync_plans", params, inputHandler, options);
|
|
6043
|
+
}
|
|
5937
6044
|
const agent = options?.agent ?? this.getGovernanceAgent();
|
|
5938
6045
|
this.executor.validateRequest("sync_plans", params);
|
|
5939
6046
|
return this.executor.executeTask(agent, "sync_plans", params, inputHandler, options);
|
|
5940
6047
|
}
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
6048
|
+
async getPlanAuditLogs(params, inputHandlerOrOptions, taskOptions) {
|
|
6049
|
+
const inputHandler = typeof inputHandlerOrOptions === "function" ? inputHandlerOrOptions : void 0;
|
|
6050
|
+
const options = inputHandlerOrOptions === void 0 || typeof inputHandlerOrOptions === "function" ? taskOptions : inputHandlerOrOptions;
|
|
6051
|
+
if (!options?.agent && !this.config.governance?.campaign?.agent) {
|
|
6052
|
+
return this.executeTaskUnprojected(
|
|
6053
|
+
"get_plan_audit_logs",
|
|
6054
|
+
params,
|
|
6055
|
+
inputHandler,
|
|
6056
|
+
options
|
|
6057
|
+
);
|
|
6058
|
+
}
|
|
5949
6059
|
const agent = options?.agent ?? this.getGovernanceAgent();
|
|
5950
6060
|
this.executor.validateRequest("get_plan_audit_logs", params);
|
|
5951
6061
|
return this.executor.executeTask(
|
|
5952
6062
|
agent,
|
|
5953
6063
|
"get_plan_audit_logs",
|
|
5954
6064
|
params,
|
|
5955
|
-
|
|
6065
|
+
inputHandler,
|
|
5956
6066
|
options
|
|
5957
6067
|
);
|
|
5958
6068
|
}
|
|
@@ -5990,6 +6100,374 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5990
6100
|
}
|
|
5991
6101
|
return agent;
|
|
5992
6102
|
}
|
|
6103
|
+
async advertisesTool(taskName, options) {
|
|
6104
|
+
const context = {};
|
|
6105
|
+
const capabilities = await this.getCapabilities({
|
|
6106
|
+
...options,
|
|
6107
|
+
[CAPABILITY_DISCOVERY_CONTEXT]: context
|
|
6108
|
+
});
|
|
6109
|
+
return capabilities.discoveredTools?.includes(taskName) === true || context.toolSchemas?.has(taskName) === true;
|
|
6110
|
+
}
|
|
6111
|
+
/** Accept a committed proposal to create or amend a media buy, or apply a negotiated cancellation. */
|
|
6112
|
+
async acceptProposal(params, inputHandler, options) {
|
|
6113
|
+
return this.executeTaskUnprojected(
|
|
6114
|
+
"accept_proposal",
|
|
6115
|
+
params,
|
|
6116
|
+
inputHandler,
|
|
6117
|
+
options
|
|
6118
|
+
);
|
|
6119
|
+
}
|
|
6120
|
+
/** Execute the AdCP acquire_rights tool. */
|
|
6121
|
+
async acquireRights(params, inputHandler, options) {
|
|
6122
|
+
return this.executeTaskUnprojected(
|
|
6123
|
+
"acquire_rights",
|
|
6124
|
+
params,
|
|
6125
|
+
inputHandler,
|
|
6126
|
+
options
|
|
6127
|
+
);
|
|
6128
|
+
}
|
|
6129
|
+
/** Generate, transform, refine, retrieve, or adapt creative manifests for advertised creative capabilities. */
|
|
6130
|
+
async buildCreative(params, inputHandler, options) {
|
|
6131
|
+
return this.executeTaskUnprojected(
|
|
6132
|
+
"build_creative",
|
|
6133
|
+
params,
|
|
6134
|
+
inputHandler,
|
|
6135
|
+
options
|
|
6136
|
+
);
|
|
6137
|
+
}
|
|
6138
|
+
/** Create a media buy directly from published seller products and record its accepted commercial snapshot. */
|
|
6139
|
+
async buyProducts(params, inputHandler, options) {
|
|
6140
|
+
return this.executeTaskUnprojected("buy_products", params, inputHandler, options);
|
|
6141
|
+
}
|
|
6142
|
+
/** Execute the AdCP calibrate_content tool. */
|
|
6143
|
+
async calibrateContent(params, inputHandler, options) {
|
|
6144
|
+
return this.executeTaskUnprojected(
|
|
6145
|
+
"calibrate_content",
|
|
6146
|
+
params,
|
|
6147
|
+
inputHandler,
|
|
6148
|
+
options
|
|
6149
|
+
);
|
|
6150
|
+
}
|
|
6151
|
+
/** Execute the AdCP check_governance tool. */
|
|
6152
|
+
async checkGovernance(params, inputHandler, options) {
|
|
6153
|
+
return this.executeTaskUnprojected(
|
|
6154
|
+
"check_governance",
|
|
6155
|
+
params,
|
|
6156
|
+
inputHandler,
|
|
6157
|
+
options
|
|
6158
|
+
);
|
|
6159
|
+
}
|
|
6160
|
+
/** Control a seller compliance scenario. Intended for conformance testing. */
|
|
6161
|
+
async complyTestController(params, inputHandler, options) {
|
|
6162
|
+
return this.executeTaskUnprojected(
|
|
6163
|
+
"comply_test_controller",
|
|
6164
|
+
params,
|
|
6165
|
+
inputHandler,
|
|
6166
|
+
options
|
|
6167
|
+
);
|
|
6168
|
+
}
|
|
6169
|
+
/** Rename, pause, resume, cancel, or adjust delivery controls within accepted proposal change rights. */
|
|
6170
|
+
async controlMediaBuy(params, inputHandler, options) {
|
|
6171
|
+
return this.executeTaskUnprojected(
|
|
6172
|
+
"control_media_buy",
|
|
6173
|
+
params,
|
|
6174
|
+
inputHandler,
|
|
6175
|
+
options
|
|
6176
|
+
);
|
|
6177
|
+
}
|
|
6178
|
+
/** Execute the AdCP create_collection_list tool. */
|
|
6179
|
+
async createCollectionList(params, inputHandler, options) {
|
|
6180
|
+
return this.executeTaskUnprojected(
|
|
6181
|
+
"create_collection_list",
|
|
6182
|
+
params,
|
|
6183
|
+
inputHandler,
|
|
6184
|
+
options
|
|
6185
|
+
);
|
|
6186
|
+
}
|
|
6187
|
+
/** Execute the AdCP create_content_standards tool. */
|
|
6188
|
+
async createContentStandards(params, inputHandler, options) {
|
|
6189
|
+
return this.executeTaskUnprojected(
|
|
6190
|
+
"create_content_standards",
|
|
6191
|
+
params,
|
|
6192
|
+
inputHandler,
|
|
6193
|
+
options
|
|
6194
|
+
);
|
|
6195
|
+
}
|
|
6196
|
+
/** Terminally decline one or more proposals and record the buyer's reason. */
|
|
6197
|
+
async declineProposals(params, inputHandler, options) {
|
|
6198
|
+
return this.executeTaskUnprojected(
|
|
6199
|
+
"decline_proposals",
|
|
6200
|
+
params,
|
|
6201
|
+
inputHandler,
|
|
6202
|
+
options
|
|
6203
|
+
);
|
|
6204
|
+
}
|
|
6205
|
+
/** Execute the AdCP delete_collection_list tool. */
|
|
6206
|
+
async deleteCollectionList(params, inputHandler, options) {
|
|
6207
|
+
return this.executeTaskUnprojected(
|
|
6208
|
+
"delete_collection_list",
|
|
6209
|
+
params,
|
|
6210
|
+
inputHandler,
|
|
6211
|
+
options
|
|
6212
|
+
);
|
|
6213
|
+
}
|
|
6214
|
+
/** Retrieve spend, credit or balance status, and invoice history for an operator-billed account. */
|
|
6215
|
+
async getAccountFinancials(params, inputHandler, options) {
|
|
6216
|
+
return this.executeTaskUnprojected(
|
|
6217
|
+
"get_account_financials",
|
|
6218
|
+
params,
|
|
6219
|
+
inputHandler,
|
|
6220
|
+
options
|
|
6221
|
+
);
|
|
6222
|
+
}
|
|
6223
|
+
/** Execute the AdCP get_brand_identity tool. */
|
|
6224
|
+
async getBrandIdentity(params, inputHandler, options) {
|
|
6225
|
+
return this.executeTaskUnprojected(
|
|
6226
|
+
"get_brand_identity",
|
|
6227
|
+
params,
|
|
6228
|
+
inputHandler,
|
|
6229
|
+
options
|
|
6230
|
+
);
|
|
6231
|
+
}
|
|
6232
|
+
/** Execute the AdCP get_collection_list tool. */
|
|
6233
|
+
async getCollectionList(params, inputHandler, options) {
|
|
6234
|
+
return this.executeTaskUnprojected(
|
|
6235
|
+
"get_collection_list",
|
|
6236
|
+
params,
|
|
6237
|
+
inputHandler,
|
|
6238
|
+
options
|
|
6239
|
+
);
|
|
6240
|
+
}
|
|
6241
|
+
/** Execute the AdCP get_content_standards tool. */
|
|
6242
|
+
async getContentStandards(params, inputHandler, options) {
|
|
6243
|
+
return this.executeTaskUnprojected(
|
|
6244
|
+
"get_content_standards",
|
|
6245
|
+
params,
|
|
6246
|
+
inputHandler,
|
|
6247
|
+
options
|
|
6248
|
+
);
|
|
6249
|
+
}
|
|
6250
|
+
/** Evaluate a creative manifest and return scored safety, content, quality, and governance features. */
|
|
6251
|
+
async getCreativeFeatures(params, inputHandler, options) {
|
|
6252
|
+
return this.executeTaskUnprojected(
|
|
6253
|
+
"get_creative_features",
|
|
6254
|
+
params,
|
|
6255
|
+
inputHandler,
|
|
6256
|
+
options
|
|
6257
|
+
);
|
|
6258
|
+
}
|
|
6259
|
+
/** Execute the AdCP get_media_buy_artifacts tool. */
|
|
6260
|
+
async getMediaBuyArtifacts(params, inputHandler, options) {
|
|
6261
|
+
return this.executeTaskUnprojected(
|
|
6262
|
+
"get_media_buy_artifacts",
|
|
6263
|
+
params,
|
|
6264
|
+
inputHandler,
|
|
6265
|
+
options
|
|
6266
|
+
);
|
|
6267
|
+
}
|
|
6268
|
+
/** Check reporting health, enumerate expected periods and all retained revisions, or resolve one exact reporting revision. */
|
|
6269
|
+
async getReportingStatus(params, inputHandler, options) {
|
|
6270
|
+
return this.executeTaskUnprojected(
|
|
6271
|
+
"get_reporting_status",
|
|
6272
|
+
params,
|
|
6273
|
+
inputHandler,
|
|
6274
|
+
options
|
|
6275
|
+
);
|
|
6276
|
+
}
|
|
6277
|
+
/** Execute the AdCP get_rights tool. */
|
|
6278
|
+
async getRights(params, inputHandler, options) {
|
|
6279
|
+
return this.executeTaskUnprojected("get_rights", params, inputHandler, options);
|
|
6280
|
+
}
|
|
6281
|
+
/** Execute the AdCP list_collection_lists tool. */
|
|
6282
|
+
async listCollectionLists(params, inputHandler, options) {
|
|
6283
|
+
return this.executeTaskUnprojected(
|
|
6284
|
+
"list_collection_lists",
|
|
6285
|
+
params,
|
|
6286
|
+
inputHandler,
|
|
6287
|
+
options
|
|
6288
|
+
);
|
|
6289
|
+
}
|
|
6290
|
+
/** Execute the AdCP list_content_standards tool. */
|
|
6291
|
+
async listContentStandards(params, inputHandler, options) {
|
|
6292
|
+
return this.executeTaskUnprojected(
|
|
6293
|
+
"list_content_standards",
|
|
6294
|
+
params,
|
|
6295
|
+
inputHandler,
|
|
6296
|
+
options
|
|
6297
|
+
);
|
|
6298
|
+
}
|
|
6299
|
+
/** Execute the AdCP list_creative_formats tool. */
|
|
6300
|
+
async listCreativeFormats(params, inputHandler, options) {
|
|
6301
|
+
return this.executeTaskUnprojected(
|
|
6302
|
+
"list_creative_formats",
|
|
6303
|
+
params,
|
|
6304
|
+
inputHandler,
|
|
6305
|
+
options
|
|
6306
|
+
);
|
|
6307
|
+
}
|
|
6308
|
+
/** Discover account-scoped creative transformers and their selectable configuration options. */
|
|
6309
|
+
async listTransformers(params, inputHandler, options) {
|
|
6310
|
+
return this.executeTaskUnprojected(
|
|
6311
|
+
"list_transformers",
|
|
6312
|
+
params,
|
|
6313
|
+
inputHandler,
|
|
6314
|
+
options
|
|
6315
|
+
);
|
|
6316
|
+
}
|
|
6317
|
+
/** Log batches of marketing events against a configured event source for measurement and attribution. */
|
|
6318
|
+
async logEvent(params, inputHandler, options) {
|
|
6319
|
+
return this.executeTaskUnprojected("log_event", params, inputHandler, options);
|
|
6320
|
+
}
|
|
6321
|
+
/** Revise draft proposals, finalize them into committed, inventory-held snapshots, or extend a committed hold. */
|
|
6322
|
+
async refineProposals(params, inputHandler, options) {
|
|
6323
|
+
return this.executeTask("refine_proposals", params, inputHandler, options);
|
|
6324
|
+
}
|
|
6325
|
+
/** Execute the AdCP report_plan_adjustment tool. */
|
|
6326
|
+
async reportPlanAdjustment(params, inputHandler, options) {
|
|
6327
|
+
return this.executeTaskUnprojected(
|
|
6328
|
+
"report_plan_adjustment",
|
|
6329
|
+
params,
|
|
6330
|
+
inputHandler,
|
|
6331
|
+
options
|
|
6332
|
+
);
|
|
6333
|
+
}
|
|
6334
|
+
/** Execute the AdCP report_plan_outcome tool. */
|
|
6335
|
+
async reportPlanOutcome(params, inputHandler, options) {
|
|
6336
|
+
return this.executeTaskUnprojected(
|
|
6337
|
+
"report_plan_outcome",
|
|
6338
|
+
params,
|
|
6339
|
+
inputHandler,
|
|
6340
|
+
options
|
|
6341
|
+
);
|
|
6342
|
+
}
|
|
6343
|
+
/** Report vendor-service consumption and final measurements for revenue tracking and billing reconciliation. */
|
|
6344
|
+
async reportUsage(params, inputHandler, options) {
|
|
6345
|
+
return this.executeTaskUnprojected("report_usage", params, inputHandler, options);
|
|
6346
|
+
}
|
|
6347
|
+
/** Ask a seller to create one or more draft media-plan proposals from a campaign brief. */
|
|
6348
|
+
async requestProposals(params, inputHandler, options) {
|
|
6349
|
+
return this.executeTask("request_proposals", params, inputHandler, options);
|
|
6350
|
+
}
|
|
6351
|
+
/** Execute the AdCP search_brands tool. */
|
|
6352
|
+
async searchBrands(params, inputHandler, options) {
|
|
6353
|
+
return this.executeTaskUnprojected("search_brands", params, inputHandler, options);
|
|
6354
|
+
}
|
|
6355
|
+
/** Register, replace, pause, or clear caller-scoped webhooks for agent-level notifications. */
|
|
6356
|
+
async syncAgentNotificationConfigs(params, inputHandler, options) {
|
|
6357
|
+
return this.executeTaskUnprojected(
|
|
6358
|
+
"sync_agent_notification_configs",
|
|
6359
|
+
params,
|
|
6360
|
+
inputHandler,
|
|
6361
|
+
options
|
|
6362
|
+
);
|
|
6363
|
+
}
|
|
6364
|
+
/** List or synchronize buyer-managed account catalog feeds, suppress or restore specific items, and read current availability state. */
|
|
6365
|
+
async syncCatalogs(params, inputHandler, options) {
|
|
6366
|
+
return this.executeTaskUnprojected("sync_catalogs", params, inputHandler, options);
|
|
6367
|
+
}
|
|
6368
|
+
/** List or synchronize account event sources with upsert and optional replacement semantics. */
|
|
6369
|
+
async syncEventSources(params, inputHandler, options) {
|
|
6370
|
+
return this.executeTaskUnprojected(
|
|
6371
|
+
"sync_event_sources",
|
|
6372
|
+
params,
|
|
6373
|
+
inputHandler,
|
|
6374
|
+
options
|
|
6375
|
+
);
|
|
6376
|
+
}
|
|
6377
|
+
/** Bind or replace the governance agent used for approval across specific advertiser accounts. */
|
|
6378
|
+
async syncGovernance(params, inputHandler, options) {
|
|
6379
|
+
return this.executeTaskUnprojected(
|
|
6380
|
+
"sync_governance",
|
|
6381
|
+
params,
|
|
6382
|
+
inputHandler,
|
|
6383
|
+
options
|
|
6384
|
+
);
|
|
6385
|
+
}
|
|
6386
|
+
/** Record a consumer's independently verified reporting totals and destination evidence in the seller ledger. */
|
|
6387
|
+
async syncReportingReceipts(params, inputHandler, options) {
|
|
6388
|
+
return this.executeTaskUnprojected(
|
|
6389
|
+
"sync_reporting_receipts",
|
|
6390
|
+
params,
|
|
6391
|
+
inputHandler,
|
|
6392
|
+
options
|
|
6393
|
+
);
|
|
6394
|
+
}
|
|
6395
|
+
/** Tell a seller whether expected reporting was received, omitted, missing, unreadable, or contradictory. */
|
|
6396
|
+
async syncReportingStatus(params, inputHandler, options) {
|
|
6397
|
+
return this.executeTaskUnprojected(
|
|
6398
|
+
"sync_reporting_status",
|
|
6399
|
+
params,
|
|
6400
|
+
inputHandler,
|
|
6401
|
+
options
|
|
6402
|
+
);
|
|
6403
|
+
}
|
|
6404
|
+
/** Execute the AdCP update_collection_list tool. */
|
|
6405
|
+
async updateCollectionList(params, inputHandler, options) {
|
|
6406
|
+
return this.executeTaskUnprojected(
|
|
6407
|
+
"update_collection_list",
|
|
6408
|
+
params,
|
|
6409
|
+
inputHandler,
|
|
6410
|
+
options
|
|
6411
|
+
);
|
|
6412
|
+
}
|
|
6413
|
+
/** Execute the AdCP update_content_standards tool. */
|
|
6414
|
+
async updateContentStandards(params, inputHandler, options) {
|
|
6415
|
+
return this.executeTaskUnprojected(
|
|
6416
|
+
"update_content_standards",
|
|
6417
|
+
params,
|
|
6418
|
+
inputHandler,
|
|
6419
|
+
options
|
|
6420
|
+
);
|
|
6421
|
+
}
|
|
6422
|
+
/** Execute the AdCP update_rights tool. */
|
|
6423
|
+
async updateRights(params, inputHandler, options) {
|
|
6424
|
+
return this.executeTaskUnprojected("update_rights", params, inputHandler, options);
|
|
6425
|
+
}
|
|
6426
|
+
/** Execute the AdCP validate_content_delivery tool. */
|
|
6427
|
+
async validateContentDelivery(params, inputHandler, options) {
|
|
6428
|
+
return this.executeTaskUnprojected(
|
|
6429
|
+
"validate_content_delivery",
|
|
6430
|
+
params,
|
|
6431
|
+
inputHandler,
|
|
6432
|
+
options
|
|
6433
|
+
);
|
|
6434
|
+
}
|
|
6435
|
+
/** Preflight a creative manifest against canonical formats, products, third-party formats, or agent capabilities. */
|
|
6436
|
+
async validateInput(params, inputHandler, options) {
|
|
6437
|
+
return this.executeTaskUnprojected(
|
|
6438
|
+
"validate_input",
|
|
6439
|
+
params,
|
|
6440
|
+
inputHandler,
|
|
6441
|
+
options
|
|
6442
|
+
);
|
|
6443
|
+
}
|
|
6444
|
+
/** Execute the AdCP validate_property_delivery tool. */
|
|
6445
|
+
async validatePropertyDelivery(params, inputHandler, options) {
|
|
6446
|
+
return this.executeTaskUnprojected(
|
|
6447
|
+
"validate_property_delivery",
|
|
6448
|
+
params,
|
|
6449
|
+
inputHandler,
|
|
6450
|
+
options
|
|
6451
|
+
);
|
|
6452
|
+
}
|
|
6453
|
+
/** Execute the AdCP verify_brand_claim tool. */
|
|
6454
|
+
async verifyBrandClaim(params, inputHandler, options) {
|
|
6455
|
+
return this.executeTaskUnprojected(
|
|
6456
|
+
"verify_brand_claim",
|
|
6457
|
+
params,
|
|
6458
|
+
inputHandler,
|
|
6459
|
+
options
|
|
6460
|
+
);
|
|
6461
|
+
}
|
|
6462
|
+
/** Execute the AdCP verify_brand_claims tool. */
|
|
6463
|
+
async verifyBrandClaims(params, inputHandler, options) {
|
|
6464
|
+
return this.executeTaskUnprojected(
|
|
6465
|
+
"verify_brand_claims",
|
|
6466
|
+
params,
|
|
6467
|
+
inputHandler,
|
|
6468
|
+
options
|
|
6469
|
+
);
|
|
6470
|
+
}
|
|
5993
6471
|
// ====== PROTOCOL TASKS ======
|
|
5994
6472
|
/**
|
|
5995
6473
|
* Get AdCP capabilities
|
|
@@ -5999,7 +6477,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5999
6477
|
* @param options - Task execution options
|
|
6000
6478
|
*/
|
|
6001
6479
|
async getAdcpCapabilities(params, inputHandler, options) {
|
|
6002
|
-
return
|
|
6480
|
+
return this.withTaskConnectionScope(
|
|
6003
6481
|
snapshotTaskOptions(options),
|
|
6004
6482
|
(effectiveOptions) => this.getAdcpCapabilitiesWithinDeadline(params, inputHandler, effectiveOptions)
|
|
6005
6483
|
);
|
|
@@ -6081,7 +6559,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
6081
6559
|
);
|
|
6082
6560
|
}
|
|
6083
6561
|
async resolveAccount(hints = {}, options, onTaskResult) {
|
|
6084
|
-
return
|
|
6562
|
+
return this.withTaskConnectionScope(snapshotTaskOptions(options), async (effectiveOptions) => {
|
|
6085
6563
|
const capabilities = await this.getCapabilities(effectiveOptions);
|
|
6086
6564
|
if (capabilities._synthetic || !capabilities.account) {
|
|
6087
6565
|
throw new import_errors3.AccountRequiredError(
|
|
@@ -6521,6 +6999,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
6521
6999
|
return this.getMediaBuyDelivery(params, inputHandler, options);
|
|
6522
7000
|
case "get_creative_delivery":
|
|
6523
7001
|
return this.getCreativeDelivery(params, inputHandler, options);
|
|
7002
|
+
case "preview_creative":
|
|
7003
|
+
return this.previewCreative(params, inputHandler, options);
|
|
7004
|
+
case "sync_plans":
|
|
7005
|
+
return this.syncPlans(params, inputHandler, options);
|
|
7006
|
+
case "get_plan_audit_logs":
|
|
7007
|
+
return this.getPlanAuditLogs(params, inputHandler, options);
|
|
6524
7008
|
case "get_principal":
|
|
6525
7009
|
return this.getPrincipal(params, inputHandler, options);
|
|
6526
7010
|
case "sync_principal":
|
|
@@ -6557,7 +7041,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
6557
7041
|
async executeTaskUnprojected(taskName, params, inputHandler, options, handlerName, beforeDispatch) {
|
|
6558
7042
|
const requestParamsSnapshot = structuredClone(params);
|
|
6559
7043
|
const taskOptionsSnapshot = snapshotTaskOptions(options);
|
|
6560
|
-
return
|
|
7044
|
+
return this.withTaskConnectionScope(taskOptionsSnapshot, async (effectiveOptions) => {
|
|
6561
7045
|
const result = await this.executeTaskUnprojectedWithinDeadline(
|
|
6562
7046
|
taskName,
|
|
6563
7047
|
requestParamsSnapshot,
|
|
@@ -6599,6 +7083,11 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
6599
7083
|
const serverVersion = await this.detectServerVersion(detectionOptions);
|
|
6600
7084
|
detectedServerVersion = serverVersion;
|
|
6601
7085
|
detectedServerVersionSynthetic = capabilityDiscoveryContext.capabilities?._synthetic;
|
|
7086
|
+
if ((taskName === "sync_plans" || taskName === "get_plan_audit_logs") && capabilityDiscoveryContext.capabilities?.discoveredTools?.includes(taskName) !== true && capabilityDiscoveryContext.toolSchemas?.has(taskName) !== true) {
|
|
7087
|
+
throw new import_errors.ConfigurationError(
|
|
7088
|
+
`No governance agent configured and this agent does not advertise ${taskName}. Pass options.agent or configure governance.campaign.agent.`
|
|
7089
|
+
);
|
|
7090
|
+
}
|
|
6602
7091
|
const negotiatedRelease = this.negotiateCallRelease(capabilityDiscoveryContext.capabilities, options);
|
|
6603
7092
|
this.assertToolAvailableAtRelease(taskName, negotiatedRelease, capabilityDiscoveryContext.toolSchemas);
|
|
6604
7093
|
this.assertRequestSupportedByTargetVersion(
|
|
@@ -6972,21 +7461,10 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
6972
7461
|
});
|
|
6973
7462
|
});
|
|
6974
7463
|
}
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
* @returns Promise resolving to array of task information
|
|
6980
|
-
*
|
|
6981
|
-
* @example
|
|
6982
|
-
* ```typescript
|
|
6983
|
-
* const tasks = await client.listTasks();
|
|
6984
|
-
* tasks.forEach(task => {
|
|
6985
|
-
* console.log(`${task.taskName}: ${task.status}`);
|
|
6986
|
-
* });
|
|
6987
|
-
* ```
|
|
6988
|
-
*/
|
|
6989
|
-
async listTasks() {
|
|
7464
|
+
async listTasks(params, inputHandler, options) {
|
|
7465
|
+
if (params !== void 0) {
|
|
7466
|
+
return this.executeTaskUnprojected("list_tasks", params, inputHandler, options);
|
|
7467
|
+
}
|
|
6990
7468
|
const tasks = await this.executor.getTaskList(this.agent.id);
|
|
6991
7469
|
return tasks.map(
|
|
6992
7470
|
(task) => (0, import_request_proposals_guard.assertNativeRequestProposalsTask)(
|
|
@@ -7136,10 +7614,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
7136
7614
|
* ```
|
|
7137
7615
|
*/
|
|
7138
7616
|
async getAgentInfo(options) {
|
|
7139
|
-
return (
|
|
7140
|
-
(0, import_protocols.normalizeTransportOptions)(options?.transport ?? this.config.transport),
|
|
7141
|
-
() => this.getAgentInfoWithConnectionPolicy(options)
|
|
7142
|
-
);
|
|
7617
|
+
return this.withConnectionScope(options, () => this.getAgentInfoWithConnectionPolicy(options));
|
|
7143
7618
|
}
|
|
7144
7619
|
async getAgentInfoWithConnectionPolicy(options) {
|
|
7145
7620
|
(0, import_abort2.throwIfAborted)(options?.signal);
|
|
@@ -7390,10 +7865,7 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
7390
7865
|
* ```
|
|
7391
7866
|
*/
|
|
7392
7867
|
async getCapabilities(options) {
|
|
7393
|
-
return (
|
|
7394
|
-
(0, import_protocols.normalizeTransportOptions)(options?.transport ?? this.config.transport),
|
|
7395
|
-
() => this.getCapabilitiesWithConnectionPolicy(options)
|
|
7396
|
-
);
|
|
7868
|
+
return this.withConnectionScope(options, () => this.getCapabilitiesWithConnectionPolicy(options));
|
|
7397
7869
|
}
|
|
7398
7870
|
async getCapabilitiesWithConnectionPolicy(options) {
|
|
7399
7871
|
(0, import_abort2.throwIfAborted)(options?.signal);
|