@adcp/sdk 17.0.0-beta.1 → 17.0.0-beta.2
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/keyed-account-store.js +1 -1
- package/dist/lib/adapters/keyed-account-store.mjs +1 -1
- 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/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/SingleAgentClient.d.mts +115 -2
- package/dist/lib/core/SingleAgentClient.d.ts +115 -2
- package/dist/lib/core/SingleAgentClient.js +547 -67
- package/dist/lib/core/SingleAgentClient.mjs +534 -54
- package/dist/lib/core/TaskExecutor.d.mts +7 -0
- package/dist/lib/core/TaskExecutor.d.ts +7 -0
- package/dist/lib/core/TaskExecutor.js +18 -5
- package/dist/lib/core/TaskExecutor.mjs +18 -5
- 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/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 +6 -52
- package/dist/lib/index.d.ts +6 -52
- package/dist/lib/index.js +11 -0
- package/dist/lib/index.mjs +7 -0
- package/dist/lib/media-buy/compatibility.js +6 -1
- package/dist/lib/media-buy/compatibility.mjs +6 -1
- package/dist/lib/protocols/mcp-scope.d.mts +3 -0
- package/dist/lib/protocols/mcp-scope.d.ts +3 -0
- package/dist/lib/protocols/mcp-scope.js +8 -3
- package/dist/lib/protocols/mcp-scope.mjs +8 -3
- package/dist/lib/reporting/inspection.js +1 -0
- package/dist/lib/reporting/inspection.mjs +1 -0
- package/dist/lib/reporting/ledger/coverage.d.mts +5 -0
- package/dist/lib/reporting/ledger/coverage.d.ts +5 -0
- package/dist/lib/reporting/ledger/coverage.js +37 -3
- package/dist/lib/reporting/ledger/coverage.mjs +36 -3
- package/dist/lib/reporting/ledger/handler.js +7 -4
- package/dist/lib/reporting/ledger/handler.mjs +7 -4
- package/dist/lib/reporting/ledger/producer.js +215 -69
- package/dist/lib/reporting/ledger/producer.mjs +217 -70
- package/dist/lib/reporting/ledger/schedule.d.mts +2 -2
- package/dist/lib/reporting/ledger/schedule.d.ts +2 -2
- package/dist/lib/reporting/ledger/schedule.js +8 -5
- package/dist/lib/reporting/ledger/schedule.mjs +8 -5
- package/dist/lib/reporting/ledger/status-ingest.d.mts +1 -1
- package/dist/lib/reporting/ledger/status-ingest.d.ts +1 -1
- package/dist/lib/reporting/ledger/status-ingest.js +4 -3
- package/dist/lib/reporting/ledger/status-ingest.mjs +4 -3
- package/dist/lib/reporting/ledger/types.d.mts +36 -1
- package/dist/lib/reporting/ledger/types.d.ts +36 -1
- package/dist/lib/reporting/service/index.d.mts +14 -1
- package/dist/lib/reporting/service/index.d.ts +14 -1
- package/dist/lib/reporting/service/index.js +24 -12
- package/dist/lib/reporting/service/index.mjs +24 -12
- 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 -3
- package/dist/lib/schemas/index.d.ts +5 -3
- 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 +2 -2
- package/dist/lib/server/account-sync-contract.mjs +2 -2
- package/dist/lib/server/create-adcp-server.js +33 -20
- package/dist/lib/server/create-adcp-server.mjs +36 -12
- package/dist/lib/server/decisioning/account.d.mts +36 -10
- package/dist/lib/server/decisioning/account.d.ts +36 -10
- package/dist/lib/server/decisioning/account.js +33 -14
- package/dist/lib/server/decisioning/account.mjs +33 -14
- 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 +4 -4
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +4 -4
- 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/notification-subscriptions/runtime.d.mts +1 -1
- package/dist/lib/server/notification-subscriptions/runtime.d.ts +1 -1
- package/dist/lib/server/notification-subscriptions/runtime.js +4 -0
- package/dist/lib/server/notification-subscriptions/runtime.mjs +4 -0
- package/dist/lib/server/responses.js +9 -1
- package/dist/lib/server/responses.mjs +9 -1
- 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/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/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/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/types/accept-proposal.d.ts +20 -28
- package/dist/lib/types/asset-instances.d.mts +1 -1
- package/dist/lib/types/asset-instances.d.ts +1 -1
- package/dist/lib/types/buy-products.d.ts +20 -28
- package/dist/lib/types/check-governance.d.ts +20 -28
- package/dist/lib/types/comply-test-controller.d.ts +20 -28
- package/dist/lib/types/control-media-buy.d.ts +20 -28
- package/dist/lib/types/core.generated.d.mts +273 -184
- package/dist/lib/types/core.generated.d.ts +273 -184
- package/dist/lib/types/create-media-buy.d.ts +20 -28
- package/dist/lib/types/get-media-buys.d.ts +20 -28
- package/dist/lib/types/get-products.d.ts +20 -28
- package/dist/lib/types/index.d.mts +6 -1
- package/dist/lib/types/index.d.ts +6 -1
- 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/list-products.d.ts +20 -28
- package/dist/lib/types/list-proposals.d.ts +20 -28
- package/dist/lib/types/media-buy-delivery-report.d.mts +6 -0
- package/dist/lib/types/media-buy-delivery-report.d.ts +6 -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/refine-proposals.d.ts +20 -28
- package/dist/lib/types/request-proposals.d.ts +20 -28
- package/dist/lib/types/schemas.generated.d.ts +63113 -127273
- package/dist/lib/types/schemas.generated.js +759 -770
- package/dist/lib/types/schemas.generated.mjs +759 -770
- 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 +109 -0
- package/dist/lib/types/targeting-keys.generated.mjs +84 -0
- package/dist/lib/types/tools.generated.d.mts +2 -68
- package/dist/lib/types/tools.generated.d.ts +2 -68
- package/dist/lib/types/update-media-buy.d.ts +20 -28
- package/dist/lib/utils/adcp-version-config.js +5 -2
- package/dist/lib/utils/adcp-version-config.mjs +5 -2
- package/dist/lib/utils/response-unwrapper.js +6 -1
- package/dist/lib/utils/response-unwrapper.mjs +6 -1
- 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 +104 -29
- package/dist/lib/v2/projection/creative-delivery.mjs +108 -29
- 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/v2/projection/v1-to-v2.d.mts +1 -1
- package/dist/lib/v2/projection/v1-to-v2.d.ts +1 -1
- package/dist/lib/v2/projection/v1-to-v2.js +12 -9
- package/dist/lib/v2/projection/v1-to-v2.mjs +12 -9
- package/dist/lib/validation/budget-allocation.d.mts +3 -3
- package/dist/lib/validation/budget-allocation.d.ts +3 -3
- 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/nonempty-array.d.mts +15 -0
- package/dist/lib/validation/nonempty-array.d.ts +15 -0
- package/dist/lib/validation/nonempty-array.js +41 -0
- package/dist/lib/validation/nonempty-array.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 +135 -42
- package/dist/lib/validation/schema-validator.mjs +139 -43
- package/dist/lib/validation/sync-creatives.d.mts +22 -22
- package/dist/lib/validation/sync-creatives.d.ts +22 -22
- 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/DELIVERY-WEBHOOK-PARSING.md +142 -0
- package/docs/guides/DISCOVERY-CACHE-AND-SESSION-REUSE.md +15 -0
- package/docs/guides/REPORTING-LEDGER.md +93 -0
- package/docs/guides/REPORTING-STABILITY.md +1 -1
- package/docs/guides/TYPED-CLIENT-TOOLS.md +49 -0
- package/docs/llms.txt +2 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/docs/migration-16-to-17.md +191 -14
- package/docs/migration-6.6-to-6.7.md +14 -0
- package/docs/migration-account-change-feed.md +15 -0
- package/docs/recipes/verifying-inbound-webhooks.md +18 -2
- package/package.json +2 -2
|
@@ -24,6 +24,16 @@ import {
|
|
|
24
24
|
import { randomUUID, scryptSync } from "node:crypto";
|
|
25
25
|
const SKIP_PRODUCT_CACHE = /* @__PURE__ */ Symbol("adcp.skipProductCache");
|
|
26
26
|
const SKIP_ACCOUNT_REGISTRY_OBSERVATION = /* @__PURE__ */ Symbol("adcp.skipAccountRegistryObservation");
|
|
27
|
+
const NONTERMINAL_TASK_RESULT_STATUSES = /* @__PURE__ */ new Set([
|
|
28
|
+
"submitted",
|
|
29
|
+
"working",
|
|
30
|
+
"input-required",
|
|
31
|
+
"auth-required",
|
|
32
|
+
"deferred"
|
|
33
|
+
]);
|
|
34
|
+
function isNonterminalTaskResult(result) {
|
|
35
|
+
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);
|
|
36
|
+
}
|
|
27
37
|
import { accountKeySites, naturalAccountKey, reducedFields, valueAt, withReducedKeyAt } from "./account-reduction.mjs";
|
|
28
38
|
import { ADCP_ENVELOPE_FIELDS } from "../types/adcp.mjs";
|
|
29
39
|
import { parseAdcpMajorVersion, toReleasePrecisionVersion } from "../version.mjs";
|
|
@@ -177,6 +187,7 @@ import {
|
|
|
177
187
|
selectListedAccount
|
|
178
188
|
} from "./account-resolution.mjs";
|
|
179
189
|
import { normalizeRequestParams } from "../utils/request-normalizer.mjs";
|
|
190
|
+
import { getCreativeDeliveryDiagnostics } from "../v2/projection/legacy-metadata.mjs";
|
|
180
191
|
import { globalAsyncLocalStorage } from "../utils/global-async-local-storage.mjs";
|
|
181
192
|
import { validateUserAgent } from "../utils/validate-user-agent.mjs";
|
|
182
193
|
import { resolveWebhookUrl, selectWebhookTemplate } from "./webhook-url.mjs";
|
|
@@ -742,10 +753,7 @@ const STANDARD_ADCP_TASK_NAMES = /* @__PURE__ */ new Set([
|
|
|
742
753
|
"list_transformers",
|
|
743
754
|
"preview_creative",
|
|
744
755
|
"build_creative",
|
|
745
|
-
//
|
|
746
|
-
// identity through artifacts, manifests, standards, or rights constraints.
|
|
747
|
-
// They are available only through explicitly named *Legacy APIs until a
|
|
748
|
-
// lossless canonical projection exists.
|
|
756
|
+
// Wire-level creative and content tools also have typed primary methods.
|
|
749
757
|
"list_content_standards",
|
|
750
758
|
"get_content_standards",
|
|
751
759
|
"create_content_standards",
|
|
@@ -1029,7 +1037,19 @@ class SingleAgentClient {
|
|
|
1029
1037
|
adcpVersion: this.resolvedAdcpVersion,
|
|
1030
1038
|
...config.wireAdcpVersion !== void 0 && { wireAdcpVersion: config.wireAdcpVersion },
|
|
1031
1039
|
...config.versionEnvelope !== void 0 && { versionEnvelope: config.versionEnvelope },
|
|
1032
|
-
transport: config.transport
|
|
1040
|
+
transport: config.transport,
|
|
1041
|
+
resolveTaskStatusTool: async (pollAgent, options) => {
|
|
1042
|
+
const client = pollAgent.id === this.normalizedAgent.id ? this : new SingleAgentClient(pollAgent, {
|
|
1043
|
+
adcpVersion: this.resolvedAdcpVersion,
|
|
1044
|
+
wireAdcpVersion: this.config.wireAdcpVersion,
|
|
1045
|
+
versionEnvelope: this.config.versionEnvelope,
|
|
1046
|
+
userAgent: this.config.userAgent,
|
|
1047
|
+
discoveryCache: this.config.discoveryCache,
|
|
1048
|
+
onTransportActivity: this.config.onTransportActivity,
|
|
1049
|
+
transport: options.transport
|
|
1050
|
+
});
|
|
1051
|
+
return await client.advertisesTool("get_task_status", options) ? "get_task_status" : pollAgent.protocol === "mcp" ? "tasks_get" : "tasks/get";
|
|
1052
|
+
}
|
|
1033
1053
|
});
|
|
1034
1054
|
if (config.handlers) {
|
|
1035
1055
|
this.asyncHandler = new AsyncHandler(config.handlers);
|
|
@@ -1837,8 +1857,18 @@ class SingleAgentClient {
|
|
|
1837
1857
|
const agent = this.normalizedAgent.protocol === "a2a" ? await this.ensureCanonicalUrlResolved(snapshot) : await this.ensureEndpointDiscovered(snapshot);
|
|
1838
1858
|
return this.executor.trackTask(agent, snapshot);
|
|
1839
1859
|
}
|
|
1840
|
-
|
|
1841
|
-
|
|
1860
|
+
async getTaskStatus(taskIdOrParams, transportOrHandler, signalOrOptions, wireOptions) {
|
|
1861
|
+
if (typeof taskIdOrParams !== "string") {
|
|
1862
|
+
return this.executeTaskUnprojected(
|
|
1863
|
+
"get_task_status",
|
|
1864
|
+
taskIdOrParams,
|
|
1865
|
+
transportOrHandler,
|
|
1866
|
+
signalOrOptions
|
|
1867
|
+
);
|
|
1868
|
+
}
|
|
1869
|
+
const taskId = taskIdOrParams;
|
|
1870
|
+
const transport = transportOrHandler;
|
|
1871
|
+
const signal = signalOrOptions;
|
|
1842
1872
|
const transportSnapshot = transport === void 0 ? void 0 : { ...transport };
|
|
1843
1873
|
const options = { transport: transportSnapshot, signal };
|
|
1844
1874
|
const agent = this.normalizedAgent.protocol === "a2a" ? await this.ensureCanonicalUrlResolved(options) : await this.ensureEndpointDiscovered(options);
|
|
@@ -2703,6 +2733,33 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
2703
2733
|
};
|
|
2704
2734
|
}
|
|
2705
2735
|
}
|
|
2736
|
+
let reportingAdcpVersion;
|
|
2737
|
+
let artifactPayloadValidator;
|
|
2738
|
+
if (registration?.deliveryKind) {
|
|
2739
|
+
try {
|
|
2740
|
+
if (registration.deliveryKind === "reporting") {
|
|
2741
|
+
const { prepareMediaBuyDeliveryWebhookValidation } = require2("../webhooks/media-buy-delivery");
|
|
2742
|
+
reportingAdcpVersion = prepareMediaBuyDeliveryWebhookValidation(
|
|
2743
|
+
options.adcpVersion ?? this.resolvedAdcpVersion
|
|
2744
|
+
).adcpVersion;
|
|
2745
|
+
} else {
|
|
2746
|
+
const loader = require2("../validation/schema-loader");
|
|
2747
|
+
artifactPayloadValidator = loader.getSchemaValidatorByRef(
|
|
2748
|
+
"content-standards/artifact-webhook-payload.json",
|
|
2749
|
+
this.resolvedAdcpVersion
|
|
2750
|
+
);
|
|
2751
|
+
if (!artifactPayloadValidator)
|
|
2752
|
+
throw new ConfigurationError("Bundled artifact webhook schema is unavailable.");
|
|
2753
|
+
}
|
|
2754
|
+
} catch (cause) {
|
|
2755
|
+
return {
|
|
2756
|
+
ok: false,
|
|
2757
|
+
code: "webhook_verification_unavailable",
|
|
2758
|
+
message: registration.deliveryKind === "reporting" ? "Reporting webhook schema configuration is unavailable." : "Artifact webhook schema configuration is unavailable.",
|
|
2759
|
+
cause
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2706
2763
|
if (registration?.mode === "rfc9421") {
|
|
2707
2764
|
const { verifyWebBotAuth, selectSignatureProfile, WebBotAuthError, WebBotAuthUnavailableError } = loadWebBotAuth();
|
|
2708
2765
|
const requestMethod = options.requestMethod;
|
|
@@ -2872,21 +2929,45 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
2872
2929
|
return parsedPayload;
|
|
2873
2930
|
}
|
|
2874
2931
|
if (registration?.deliveryKind) {
|
|
2875
|
-
|
|
2876
|
-
const body = parsedPayload.payload;
|
|
2932
|
+
let body = parsedPayload.payload;
|
|
2877
2933
|
const isReport = registration.deliveryKind === "reporting";
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
code
|
|
2886
|
-
|
|
2887
|
-
|
|
2934
|
+
let payload;
|
|
2935
|
+
if (isReport) {
|
|
2936
|
+
const { parseMediaBuyDeliveryWebhook } = require2("../webhooks/media-buy-delivery");
|
|
2937
|
+
const report = parseMediaBuyDeliveryWebhook(body, {
|
|
2938
|
+
adcpVersion: reportingAdcpVersion
|
|
2939
|
+
});
|
|
2940
|
+
if (!report.ok) {
|
|
2941
|
+
if (report.code === "webhook_unsupported_payload") {
|
|
2942
|
+
return {
|
|
2943
|
+
...report,
|
|
2944
|
+
message: "Registered reporting delivery requires a media_buy_delivery MCP envelope.",
|
|
2945
|
+
errors: ["Registered reporting delivery requires a media_buy_delivery MCP envelope."]
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2948
|
+
return report;
|
|
2949
|
+
}
|
|
2950
|
+
if (report.wireFormat !== "mcp_envelope") {
|
|
2951
|
+
return {
|
|
2952
|
+
ok: false,
|
|
2953
|
+
code: "webhook_unsupported_payload",
|
|
2954
|
+
message: "Registered reporting delivery requires an MCP envelope."
|
|
2955
|
+
};
|
|
2956
|
+
}
|
|
2957
|
+
body = report.envelope;
|
|
2958
|
+
payload = report.result;
|
|
2959
|
+
} else {
|
|
2960
|
+
payload = body;
|
|
2961
|
+
if (!artifactPayloadValidator || !artifactPayloadValidator(payload)) {
|
|
2962
|
+
return {
|
|
2963
|
+
ok: false,
|
|
2964
|
+
code: "webhook_envelope_invalid",
|
|
2965
|
+
message: "Authenticated delivery does not match its registered payload kind"
|
|
2966
|
+
};
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2888
2969
|
const taskId = isReport && typeof body.task_id === "string" ? body.task_id : typeof body.media_buy_id === "string" ? body.media_buy_id : registration.operationId;
|
|
2889
|
-
const operationId =
|
|
2970
|
+
const operationId = registration.operationId;
|
|
2890
2971
|
const status = isReport && isAdcpStatus(body.status) ? body.status : "completed";
|
|
2891
2972
|
return {
|
|
2892
2973
|
ok: true,
|
|
@@ -3640,18 +3721,26 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
3640
3721
|
}).ok;
|
|
3641
3722
|
}
|
|
3642
3723
|
/** One task owns discovery and dispatch sessions unless the caller already owns reuse. */
|
|
3643
|
-
withConnectionScope(options, run) {
|
|
3724
|
+
withConnectionScope(options, run, preserveSessionOnResult) {
|
|
3644
3725
|
const transport = normalizeTransportOptions(options?.transport ?? this.config.transport);
|
|
3645
3726
|
return withMCPConnectionPolicy(
|
|
3646
3727
|
transport,
|
|
3647
|
-
() => shouldReuseMCPConnection(transport?.trustedFetchFn !== void 0) ? run() : withMCPConnectionScope(run, {
|
|
3728
|
+
() => shouldReuseMCPConnection(transport?.trustedFetchFn !== void 0) ? run() : withMCPConnectionScope(run, {
|
|
3729
|
+
signal: options?.signal,
|
|
3730
|
+
preserveOnInterruption: true,
|
|
3731
|
+
preserveSessionOnResult
|
|
3732
|
+
})
|
|
3648
3733
|
);
|
|
3649
3734
|
}
|
|
3650
3735
|
withTaskConnectionScope(options, run) {
|
|
3651
|
-
return withTaskDeadline(
|
|
3736
|
+
return withTaskDeadline(
|
|
3737
|
+
options,
|
|
3738
|
+
(effective) => this.withConnectionScope(effective, () => run(effective), isNonterminalTaskResult)
|
|
3739
|
+
);
|
|
3652
3740
|
}
|
|
3653
3741
|
/** Execute a task, adapt maintained AdCP 3 releases, and call the completion handler. */
|
|
3654
3742
|
async executeAndHandle(taskType, handlerName, params, inputHandler, options, transformCompletedResponse, legacyFormatConverter, canonicalRequest, projectionCatalogs) {
|
|
3743
|
+
const projectionDrifts = getCreativeDeliveryDiagnostics(params);
|
|
3655
3744
|
const requestParamsSnapshot = structuredClone(params);
|
|
3656
3745
|
const canonicalRequestSnapshot = canonicalRequest === void 0 ? void 0 : structuredClone(canonicalRequest);
|
|
3657
3746
|
const deferredProjectionCatalogs = projectionCatalogs ? structuredClone(projectionCatalogs) : void 0;
|
|
@@ -3667,11 +3756,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
3667
3756
|
transformCompletedResponse,
|
|
3668
3757
|
legacyFormatConverter,
|
|
3669
3758
|
canonicalRequestSnapshot,
|
|
3670
|
-
deferredProjectionCatalogs
|
|
3759
|
+
deferredProjectionCatalogs,
|
|
3760
|
+
projectionDrifts
|
|
3671
3761
|
)
|
|
3672
3762
|
);
|
|
3673
3763
|
}
|
|
3674
|
-
async executeAndHandleWithinDeadline(taskType, handlerName, params, inputHandler, options, transformCompletedResponse, legacyFormatConverter, canonicalRequest, projectionCatalogs) {
|
|
3764
|
+
async executeAndHandleWithinDeadline(taskType, handlerName, params, inputHandler, options, transformCompletedResponse, legacyFormatConverter, canonicalRequest, projectionCatalogs, projectionDrifts = []) {
|
|
3675
3765
|
throwIfAborted(options?.signal);
|
|
3676
3766
|
const canonicalCreativeInvocation = CANONICAL_CREATIVE_ACTIVITY_TASKS.has(taskType) || canonicalRequest !== void 0;
|
|
3677
3767
|
params = await this.applyAccountPolicy(taskType, params, options);
|
|
@@ -3747,7 +3837,15 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
3747
3837
|
if (negotiatedRelease?.downgraded && !options?.skipIdempotencyAutoInject && !options?.skipAccountValidation && !options?.skipRequestValidation) {
|
|
3748
3838
|
this.executor.validateRequest(taskType, adaptedParams, inputSchemaStripLogs, negotiatedRelease.version);
|
|
3749
3839
|
}
|
|
3750
|
-
const adaptationLogs = [
|
|
3840
|
+
const adaptationLogs = [
|
|
3841
|
+
...projectionDrifts.map((drift) => ({
|
|
3842
|
+
...drift,
|
|
3843
|
+
taskName: taskType,
|
|
3844
|
+
clientVersion: this.resolvedAdcpVersion,
|
|
3845
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
3846
|
+
})),
|
|
3847
|
+
...adaptDriftLogs
|
|
3848
|
+
];
|
|
3751
3849
|
if (webhookDriftLog) adaptationLogs.push(webhookDriftLog);
|
|
3752
3850
|
const canonicalInputHandler = this.canonicalCreativeInputHandler(
|
|
3753
3851
|
taskType,
|
|
@@ -4869,8 +4967,15 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
4869
4967
|
* stamps it on the version envelope and validates the response against it.
|
|
4870
4968
|
*/
|
|
4871
4969
|
withNegotiatedRelease(options, negotiated) {
|
|
4872
|
-
if (!negotiated
|
|
4873
|
-
return {
|
|
4970
|
+
if (!negotiated) return options;
|
|
4971
|
+
return {
|
|
4972
|
+
...options ?? {},
|
|
4973
|
+
selectedAdcpVersion: negotiated.version,
|
|
4974
|
+
...negotiated.downgraded && {
|
|
4975
|
+
wireAdcpVersion: negotiated.version,
|
|
4976
|
+
negotiatedAdcpVersion: negotiated.version
|
|
4977
|
+
}
|
|
4978
|
+
};
|
|
4874
4979
|
}
|
|
4875
4980
|
/**
|
|
4876
4981
|
* Refuse a tool the negotiated release does not define (a 3.2-only task
|
|
@@ -5139,8 +5244,9 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
5139
5244
|
const adapterKey = resolveAdapterKey(this.resolvedAdcpVersion, perCallCapabilities ?? this.cachedCapabilities);
|
|
5140
5245
|
if (adapterKey) {
|
|
5141
5246
|
const versionAdapter = getVersionAdapter(adapterKey, taskType);
|
|
5142
|
-
|
|
5143
|
-
|
|
5247
|
+
const adaptRequest = negotiated ? versionAdapter?.adaptRequest : versionAdapter?.adaptUnnegotiatedRequest ?? versionAdapter?.adaptRequest;
|
|
5248
|
+
if (adaptRequest) {
|
|
5249
|
+
const result = adaptRequest(adapted);
|
|
5144
5250
|
adapted = result.params;
|
|
5145
5251
|
if (result.drift) {
|
|
5146
5252
|
driftLogs.push({
|
|
@@ -6113,25 +6219,31 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
6113
6219
|
* Pass an explicit agent via options.agent to override.
|
|
6114
6220
|
*/
|
|
6115
6221
|
async syncPlans(params, inputHandler, options) {
|
|
6222
|
+
if (!options?.agent && !this.config.governance?.campaign?.agent) {
|
|
6223
|
+
return this.executeTaskUnprojected("sync_plans", params, inputHandler, options);
|
|
6224
|
+
}
|
|
6116
6225
|
const agent = options?.agent ?? this.getGovernanceAgent();
|
|
6117
6226
|
this.executor.validateRequest("sync_plans", params);
|
|
6118
6227
|
return this.executor.executeTask(agent, "sync_plans", params, inputHandler, options);
|
|
6119
6228
|
}
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6229
|
+
async getPlanAuditLogs(params, inputHandlerOrOptions, taskOptions) {
|
|
6230
|
+
const inputHandler = typeof inputHandlerOrOptions === "function" ? inputHandlerOrOptions : void 0;
|
|
6231
|
+
const options = inputHandlerOrOptions === void 0 || typeof inputHandlerOrOptions === "function" ? taskOptions : inputHandlerOrOptions;
|
|
6232
|
+
if (!options?.agent && !this.config.governance?.campaign?.agent) {
|
|
6233
|
+
return this.executeTaskUnprojected(
|
|
6234
|
+
"get_plan_audit_logs",
|
|
6235
|
+
params,
|
|
6236
|
+
inputHandler,
|
|
6237
|
+
options
|
|
6238
|
+
);
|
|
6239
|
+
}
|
|
6128
6240
|
const agent = options?.agent ?? this.getGovernanceAgent();
|
|
6129
6241
|
this.executor.validateRequest("get_plan_audit_logs", params);
|
|
6130
6242
|
return this.executor.executeTask(
|
|
6131
6243
|
agent,
|
|
6132
6244
|
"get_plan_audit_logs",
|
|
6133
6245
|
params,
|
|
6134
|
-
|
|
6246
|
+
inputHandler,
|
|
6135
6247
|
options
|
|
6136
6248
|
);
|
|
6137
6249
|
}
|
|
@@ -6169,6 +6281,374 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
6169
6281
|
}
|
|
6170
6282
|
return agent;
|
|
6171
6283
|
}
|
|
6284
|
+
async advertisesTool(taskName, options) {
|
|
6285
|
+
const context = {};
|
|
6286
|
+
const capabilities = await this.getCapabilities({
|
|
6287
|
+
...options,
|
|
6288
|
+
[CAPABILITY_DISCOVERY_CONTEXT]: context
|
|
6289
|
+
});
|
|
6290
|
+
return capabilities.discoveredTools?.includes(taskName) === true || context.toolSchemas?.has(taskName) === true;
|
|
6291
|
+
}
|
|
6292
|
+
/** Accept a committed proposal to create or amend a media buy, or apply a negotiated cancellation. */
|
|
6293
|
+
async acceptProposal(params, inputHandler, options) {
|
|
6294
|
+
return this.executeTaskUnprojected(
|
|
6295
|
+
"accept_proposal",
|
|
6296
|
+
params,
|
|
6297
|
+
inputHandler,
|
|
6298
|
+
options
|
|
6299
|
+
);
|
|
6300
|
+
}
|
|
6301
|
+
/** Execute the AdCP acquire_rights tool. */
|
|
6302
|
+
async acquireRights(params, inputHandler, options) {
|
|
6303
|
+
return this.executeTaskUnprojected(
|
|
6304
|
+
"acquire_rights",
|
|
6305
|
+
params,
|
|
6306
|
+
inputHandler,
|
|
6307
|
+
options
|
|
6308
|
+
);
|
|
6309
|
+
}
|
|
6310
|
+
/** Generate, transform, refine, retrieve, or adapt creative manifests for advertised creative capabilities. */
|
|
6311
|
+
async buildCreative(params, inputHandler, options) {
|
|
6312
|
+
return this.executeTaskUnprojected(
|
|
6313
|
+
"build_creative",
|
|
6314
|
+
params,
|
|
6315
|
+
inputHandler,
|
|
6316
|
+
options
|
|
6317
|
+
);
|
|
6318
|
+
}
|
|
6319
|
+
/** Create a media buy directly from published seller products and record its accepted commercial snapshot. */
|
|
6320
|
+
async buyProducts(params, inputHandler, options) {
|
|
6321
|
+
return this.executeTaskUnprojected("buy_products", params, inputHandler, options);
|
|
6322
|
+
}
|
|
6323
|
+
/** Execute the AdCP calibrate_content tool. */
|
|
6324
|
+
async calibrateContent(params, inputHandler, options) {
|
|
6325
|
+
return this.executeTaskUnprojected(
|
|
6326
|
+
"calibrate_content",
|
|
6327
|
+
params,
|
|
6328
|
+
inputHandler,
|
|
6329
|
+
options
|
|
6330
|
+
);
|
|
6331
|
+
}
|
|
6332
|
+
/** Execute the AdCP check_governance tool. */
|
|
6333
|
+
async checkGovernance(params, inputHandler, options) {
|
|
6334
|
+
return this.executeTaskUnprojected(
|
|
6335
|
+
"check_governance",
|
|
6336
|
+
params,
|
|
6337
|
+
inputHandler,
|
|
6338
|
+
options
|
|
6339
|
+
);
|
|
6340
|
+
}
|
|
6341
|
+
/** Control a seller compliance scenario. Intended for conformance testing. */
|
|
6342
|
+
async complyTestController(params, inputHandler, options) {
|
|
6343
|
+
return this.executeTaskUnprojected(
|
|
6344
|
+
"comply_test_controller",
|
|
6345
|
+
params,
|
|
6346
|
+
inputHandler,
|
|
6347
|
+
options
|
|
6348
|
+
);
|
|
6349
|
+
}
|
|
6350
|
+
/** Rename, pause, resume, cancel, or adjust delivery controls within accepted proposal change rights. */
|
|
6351
|
+
async controlMediaBuy(params, inputHandler, options) {
|
|
6352
|
+
return this.executeTaskUnprojected(
|
|
6353
|
+
"control_media_buy",
|
|
6354
|
+
params,
|
|
6355
|
+
inputHandler,
|
|
6356
|
+
options
|
|
6357
|
+
);
|
|
6358
|
+
}
|
|
6359
|
+
/** Execute the AdCP create_collection_list tool. */
|
|
6360
|
+
async createCollectionList(params, inputHandler, options) {
|
|
6361
|
+
return this.executeTaskUnprojected(
|
|
6362
|
+
"create_collection_list",
|
|
6363
|
+
params,
|
|
6364
|
+
inputHandler,
|
|
6365
|
+
options
|
|
6366
|
+
);
|
|
6367
|
+
}
|
|
6368
|
+
/** Execute the AdCP create_content_standards tool. */
|
|
6369
|
+
async createContentStandards(params, inputHandler, options) {
|
|
6370
|
+
return this.executeTaskUnprojected(
|
|
6371
|
+
"create_content_standards",
|
|
6372
|
+
params,
|
|
6373
|
+
inputHandler,
|
|
6374
|
+
options
|
|
6375
|
+
);
|
|
6376
|
+
}
|
|
6377
|
+
/** Terminally decline one or more proposals and record the buyer's reason. */
|
|
6378
|
+
async declineProposals(params, inputHandler, options) {
|
|
6379
|
+
return this.executeTaskUnprojected(
|
|
6380
|
+
"decline_proposals",
|
|
6381
|
+
params,
|
|
6382
|
+
inputHandler,
|
|
6383
|
+
options
|
|
6384
|
+
);
|
|
6385
|
+
}
|
|
6386
|
+
/** Execute the AdCP delete_collection_list tool. */
|
|
6387
|
+
async deleteCollectionList(params, inputHandler, options) {
|
|
6388
|
+
return this.executeTaskUnprojected(
|
|
6389
|
+
"delete_collection_list",
|
|
6390
|
+
params,
|
|
6391
|
+
inputHandler,
|
|
6392
|
+
options
|
|
6393
|
+
);
|
|
6394
|
+
}
|
|
6395
|
+
/** Retrieve spend, credit or balance status, and invoice history for an operator-billed account. */
|
|
6396
|
+
async getAccountFinancials(params, inputHandler, options) {
|
|
6397
|
+
return this.executeTaskUnprojected(
|
|
6398
|
+
"get_account_financials",
|
|
6399
|
+
params,
|
|
6400
|
+
inputHandler,
|
|
6401
|
+
options
|
|
6402
|
+
);
|
|
6403
|
+
}
|
|
6404
|
+
/** Execute the AdCP get_brand_identity tool. */
|
|
6405
|
+
async getBrandIdentity(params, inputHandler, options) {
|
|
6406
|
+
return this.executeTaskUnprojected(
|
|
6407
|
+
"get_brand_identity",
|
|
6408
|
+
params,
|
|
6409
|
+
inputHandler,
|
|
6410
|
+
options
|
|
6411
|
+
);
|
|
6412
|
+
}
|
|
6413
|
+
/** Execute the AdCP get_collection_list tool. */
|
|
6414
|
+
async getCollectionList(params, inputHandler, options) {
|
|
6415
|
+
return this.executeTaskUnprojected(
|
|
6416
|
+
"get_collection_list",
|
|
6417
|
+
params,
|
|
6418
|
+
inputHandler,
|
|
6419
|
+
options
|
|
6420
|
+
);
|
|
6421
|
+
}
|
|
6422
|
+
/** Execute the AdCP get_content_standards tool. */
|
|
6423
|
+
async getContentStandards(params, inputHandler, options) {
|
|
6424
|
+
return this.executeTaskUnprojected(
|
|
6425
|
+
"get_content_standards",
|
|
6426
|
+
params,
|
|
6427
|
+
inputHandler,
|
|
6428
|
+
options
|
|
6429
|
+
);
|
|
6430
|
+
}
|
|
6431
|
+
/** Evaluate a creative manifest and return scored safety, content, quality, and governance features. */
|
|
6432
|
+
async getCreativeFeatures(params, inputHandler, options) {
|
|
6433
|
+
return this.executeTaskUnprojected(
|
|
6434
|
+
"get_creative_features",
|
|
6435
|
+
params,
|
|
6436
|
+
inputHandler,
|
|
6437
|
+
options
|
|
6438
|
+
);
|
|
6439
|
+
}
|
|
6440
|
+
/** Execute the AdCP get_media_buy_artifacts tool. */
|
|
6441
|
+
async getMediaBuyArtifacts(params, inputHandler, options) {
|
|
6442
|
+
return this.executeTaskUnprojected(
|
|
6443
|
+
"get_media_buy_artifacts",
|
|
6444
|
+
params,
|
|
6445
|
+
inputHandler,
|
|
6446
|
+
options
|
|
6447
|
+
);
|
|
6448
|
+
}
|
|
6449
|
+
/** Check reporting health, enumerate expected periods and all retained revisions, or resolve one exact reporting revision. */
|
|
6450
|
+
async getReportingStatus(params, inputHandler, options) {
|
|
6451
|
+
return this.executeTaskUnprojected(
|
|
6452
|
+
"get_reporting_status",
|
|
6453
|
+
params,
|
|
6454
|
+
inputHandler,
|
|
6455
|
+
options
|
|
6456
|
+
);
|
|
6457
|
+
}
|
|
6458
|
+
/** Execute the AdCP get_rights tool. */
|
|
6459
|
+
async getRights(params, inputHandler, options) {
|
|
6460
|
+
return this.executeTaskUnprojected("get_rights", params, inputHandler, options);
|
|
6461
|
+
}
|
|
6462
|
+
/** Execute the AdCP list_collection_lists tool. */
|
|
6463
|
+
async listCollectionLists(params, inputHandler, options) {
|
|
6464
|
+
return this.executeTaskUnprojected(
|
|
6465
|
+
"list_collection_lists",
|
|
6466
|
+
params,
|
|
6467
|
+
inputHandler,
|
|
6468
|
+
options
|
|
6469
|
+
);
|
|
6470
|
+
}
|
|
6471
|
+
/** Execute the AdCP list_content_standards tool. */
|
|
6472
|
+
async listContentStandards(params, inputHandler, options) {
|
|
6473
|
+
return this.executeTaskUnprojected(
|
|
6474
|
+
"list_content_standards",
|
|
6475
|
+
params,
|
|
6476
|
+
inputHandler,
|
|
6477
|
+
options
|
|
6478
|
+
);
|
|
6479
|
+
}
|
|
6480
|
+
/** Execute the AdCP list_creative_formats tool. */
|
|
6481
|
+
async listCreativeFormats(params, inputHandler, options) {
|
|
6482
|
+
return this.executeTaskUnprojected(
|
|
6483
|
+
"list_creative_formats",
|
|
6484
|
+
params,
|
|
6485
|
+
inputHandler,
|
|
6486
|
+
options
|
|
6487
|
+
);
|
|
6488
|
+
}
|
|
6489
|
+
/** Discover account-scoped creative transformers and their selectable configuration options. */
|
|
6490
|
+
async listTransformers(params, inputHandler, options) {
|
|
6491
|
+
return this.executeTaskUnprojected(
|
|
6492
|
+
"list_transformers",
|
|
6493
|
+
params,
|
|
6494
|
+
inputHandler,
|
|
6495
|
+
options
|
|
6496
|
+
);
|
|
6497
|
+
}
|
|
6498
|
+
/** Log batches of marketing events against a configured event source for measurement and attribution. */
|
|
6499
|
+
async logEvent(params, inputHandler, options) {
|
|
6500
|
+
return this.executeTaskUnprojected("log_event", params, inputHandler, options);
|
|
6501
|
+
}
|
|
6502
|
+
/** Revise draft proposals, finalize them into committed, inventory-held snapshots, or extend a committed hold. */
|
|
6503
|
+
async refineProposals(params, inputHandler, options) {
|
|
6504
|
+
return this.executeTask("refine_proposals", params, inputHandler, options);
|
|
6505
|
+
}
|
|
6506
|
+
/** Execute the AdCP report_plan_adjustment tool. */
|
|
6507
|
+
async reportPlanAdjustment(params, inputHandler, options) {
|
|
6508
|
+
return this.executeTaskUnprojected(
|
|
6509
|
+
"report_plan_adjustment",
|
|
6510
|
+
params,
|
|
6511
|
+
inputHandler,
|
|
6512
|
+
options
|
|
6513
|
+
);
|
|
6514
|
+
}
|
|
6515
|
+
/** Execute the AdCP report_plan_outcome tool. */
|
|
6516
|
+
async reportPlanOutcome(params, inputHandler, options) {
|
|
6517
|
+
return this.executeTaskUnprojected(
|
|
6518
|
+
"report_plan_outcome",
|
|
6519
|
+
params,
|
|
6520
|
+
inputHandler,
|
|
6521
|
+
options
|
|
6522
|
+
);
|
|
6523
|
+
}
|
|
6524
|
+
/** Report vendor-service consumption and final measurements for revenue tracking and billing reconciliation. */
|
|
6525
|
+
async reportUsage(params, inputHandler, options) {
|
|
6526
|
+
return this.executeTaskUnprojected("report_usage", params, inputHandler, options);
|
|
6527
|
+
}
|
|
6528
|
+
/** Ask a seller to create one or more draft media-plan proposals from a campaign brief. */
|
|
6529
|
+
async requestProposals(params, inputHandler, options) {
|
|
6530
|
+
return this.executeTask("request_proposals", params, inputHandler, options);
|
|
6531
|
+
}
|
|
6532
|
+
/** Execute the AdCP search_brands tool. */
|
|
6533
|
+
async searchBrands(params, inputHandler, options) {
|
|
6534
|
+
return this.executeTaskUnprojected("search_brands", params, inputHandler, options);
|
|
6535
|
+
}
|
|
6536
|
+
/** Register, replace, pause, or clear caller-scoped webhooks for agent-level notifications. */
|
|
6537
|
+
async syncAgentNotificationConfigs(params, inputHandler, options) {
|
|
6538
|
+
return this.executeTaskUnprojected(
|
|
6539
|
+
"sync_agent_notification_configs",
|
|
6540
|
+
params,
|
|
6541
|
+
inputHandler,
|
|
6542
|
+
options
|
|
6543
|
+
);
|
|
6544
|
+
}
|
|
6545
|
+
/** List or synchronize buyer-managed account catalog feeds, suppress or restore specific items, and read current availability state. */
|
|
6546
|
+
async syncCatalogs(params, inputHandler, options) {
|
|
6547
|
+
return this.executeTaskUnprojected("sync_catalogs", params, inputHandler, options);
|
|
6548
|
+
}
|
|
6549
|
+
/** List or synchronize account event sources with upsert and optional replacement semantics. */
|
|
6550
|
+
async syncEventSources(params, inputHandler, options) {
|
|
6551
|
+
return this.executeTaskUnprojected(
|
|
6552
|
+
"sync_event_sources",
|
|
6553
|
+
params,
|
|
6554
|
+
inputHandler,
|
|
6555
|
+
options
|
|
6556
|
+
);
|
|
6557
|
+
}
|
|
6558
|
+
/** Bind or replace the governance agent used for approval across specific advertiser accounts. */
|
|
6559
|
+
async syncGovernance(params, inputHandler, options) {
|
|
6560
|
+
return this.executeTaskUnprojected(
|
|
6561
|
+
"sync_governance",
|
|
6562
|
+
params,
|
|
6563
|
+
inputHandler,
|
|
6564
|
+
options
|
|
6565
|
+
);
|
|
6566
|
+
}
|
|
6567
|
+
/** Record a consumer's independently verified reporting totals and destination evidence in the seller ledger. */
|
|
6568
|
+
async syncReportingReceipts(params, inputHandler, options) {
|
|
6569
|
+
return this.executeTaskUnprojected(
|
|
6570
|
+
"sync_reporting_receipts",
|
|
6571
|
+
params,
|
|
6572
|
+
inputHandler,
|
|
6573
|
+
options
|
|
6574
|
+
);
|
|
6575
|
+
}
|
|
6576
|
+
/** Tell a seller whether expected reporting was received, omitted, missing, unreadable, or contradictory. */
|
|
6577
|
+
async syncReportingStatus(params, inputHandler, options) {
|
|
6578
|
+
return this.executeTaskUnprojected(
|
|
6579
|
+
"sync_reporting_status",
|
|
6580
|
+
params,
|
|
6581
|
+
inputHandler,
|
|
6582
|
+
options
|
|
6583
|
+
);
|
|
6584
|
+
}
|
|
6585
|
+
/** Execute the AdCP update_collection_list tool. */
|
|
6586
|
+
async updateCollectionList(params, inputHandler, options) {
|
|
6587
|
+
return this.executeTaskUnprojected(
|
|
6588
|
+
"update_collection_list",
|
|
6589
|
+
params,
|
|
6590
|
+
inputHandler,
|
|
6591
|
+
options
|
|
6592
|
+
);
|
|
6593
|
+
}
|
|
6594
|
+
/** Execute the AdCP update_content_standards tool. */
|
|
6595
|
+
async updateContentStandards(params, inputHandler, options) {
|
|
6596
|
+
return this.executeTaskUnprojected(
|
|
6597
|
+
"update_content_standards",
|
|
6598
|
+
params,
|
|
6599
|
+
inputHandler,
|
|
6600
|
+
options
|
|
6601
|
+
);
|
|
6602
|
+
}
|
|
6603
|
+
/** Execute the AdCP update_rights tool. */
|
|
6604
|
+
async updateRights(params, inputHandler, options) {
|
|
6605
|
+
return this.executeTaskUnprojected("update_rights", params, inputHandler, options);
|
|
6606
|
+
}
|
|
6607
|
+
/** Execute the AdCP validate_content_delivery tool. */
|
|
6608
|
+
async validateContentDelivery(params, inputHandler, options) {
|
|
6609
|
+
return this.executeTaskUnprojected(
|
|
6610
|
+
"validate_content_delivery",
|
|
6611
|
+
params,
|
|
6612
|
+
inputHandler,
|
|
6613
|
+
options
|
|
6614
|
+
);
|
|
6615
|
+
}
|
|
6616
|
+
/** Preflight a creative manifest against canonical formats, products, third-party formats, or agent capabilities. */
|
|
6617
|
+
async validateInput(params, inputHandler, options) {
|
|
6618
|
+
return this.executeTaskUnprojected(
|
|
6619
|
+
"validate_input",
|
|
6620
|
+
params,
|
|
6621
|
+
inputHandler,
|
|
6622
|
+
options
|
|
6623
|
+
);
|
|
6624
|
+
}
|
|
6625
|
+
/** Execute the AdCP validate_property_delivery tool. */
|
|
6626
|
+
async validatePropertyDelivery(params, inputHandler, options) {
|
|
6627
|
+
return this.executeTaskUnprojected(
|
|
6628
|
+
"validate_property_delivery",
|
|
6629
|
+
params,
|
|
6630
|
+
inputHandler,
|
|
6631
|
+
options
|
|
6632
|
+
);
|
|
6633
|
+
}
|
|
6634
|
+
/** Execute the AdCP verify_brand_claim tool. */
|
|
6635
|
+
async verifyBrandClaim(params, inputHandler, options) {
|
|
6636
|
+
return this.executeTaskUnprojected(
|
|
6637
|
+
"verify_brand_claim",
|
|
6638
|
+
params,
|
|
6639
|
+
inputHandler,
|
|
6640
|
+
options
|
|
6641
|
+
);
|
|
6642
|
+
}
|
|
6643
|
+
/** Execute the AdCP verify_brand_claims tool. */
|
|
6644
|
+
async verifyBrandClaims(params, inputHandler, options) {
|
|
6645
|
+
return this.executeTaskUnprojected(
|
|
6646
|
+
"verify_brand_claims",
|
|
6647
|
+
params,
|
|
6648
|
+
inputHandler,
|
|
6649
|
+
options
|
|
6650
|
+
);
|
|
6651
|
+
}
|
|
6172
6652
|
// ====== PROTOCOL TASKS ======
|
|
6173
6653
|
/**
|
|
6174
6654
|
* Get AdCP capabilities
|
|
@@ -6704,6 +7184,12 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
6704
7184
|
return this.getMediaBuyDelivery(params, inputHandler, options);
|
|
6705
7185
|
case "get_creative_delivery":
|
|
6706
7186
|
return this.getCreativeDelivery(params, inputHandler, options);
|
|
7187
|
+
case "preview_creative":
|
|
7188
|
+
return this.previewCreative(params, inputHandler, options);
|
|
7189
|
+
case "sync_plans":
|
|
7190
|
+
return this.syncPlans(params, inputHandler, options);
|
|
7191
|
+
case "get_plan_audit_logs":
|
|
7192
|
+
return this.getPlanAuditLogs(params, inputHandler, options);
|
|
6707
7193
|
case "get_principal":
|
|
6708
7194
|
return this.getPrincipal(params, inputHandler, options);
|
|
6709
7195
|
case "sync_principal":
|
|
@@ -6782,6 +7268,11 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
6782
7268
|
const serverVersion = await this.detectServerVersion(detectionOptions);
|
|
6783
7269
|
detectedServerVersion = serverVersion;
|
|
6784
7270
|
detectedServerVersionSynthetic = capabilityDiscoveryContext.capabilities?._synthetic;
|
|
7271
|
+
if ((taskName === "sync_plans" || taskName === "get_plan_audit_logs") && capabilityDiscoveryContext.capabilities?.discoveredTools?.includes(taskName) !== true && capabilityDiscoveryContext.toolSchemas?.has(taskName) !== true) {
|
|
7272
|
+
throw new ConfigurationError(
|
|
7273
|
+
`No governance agent configured and this agent does not advertise ${taskName}. Pass options.agent or configure governance.campaign.agent.`
|
|
7274
|
+
);
|
|
7275
|
+
}
|
|
6785
7276
|
const negotiatedRelease = this.negotiateCallRelease(capabilityDiscoveryContext.capabilities, options);
|
|
6786
7277
|
this.assertToolAvailableAtRelease(taskName, negotiatedRelease, capabilityDiscoveryContext.toolSchemas);
|
|
6787
7278
|
this.assertRequestSupportedByTargetVersion(
|
|
@@ -7155,21 +7646,10 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
|
|
|
7155
7646
|
});
|
|
7156
7647
|
});
|
|
7157
7648
|
}
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
* @returns Promise resolving to array of task information
|
|
7163
|
-
*
|
|
7164
|
-
* @example
|
|
7165
|
-
* ```typescript
|
|
7166
|
-
* const tasks = await client.listTasks();
|
|
7167
|
-
* tasks.forEach(task => {
|
|
7168
|
-
* console.log(`${task.taskName}: ${task.status}`);
|
|
7169
|
-
* });
|
|
7170
|
-
* ```
|
|
7171
|
-
*/
|
|
7172
|
-
async listTasks() {
|
|
7649
|
+
async listTasks(params, inputHandler, options) {
|
|
7650
|
+
if (params !== void 0) {
|
|
7651
|
+
return this.executeTaskUnprojected("list_tasks", params, inputHandler, options);
|
|
7652
|
+
}
|
|
7173
7653
|
const tasks = await this.executor.getTaskList(this.agent.id);
|
|
7174
7654
|
return tasks.map(
|
|
7175
7655
|
(task) => assertNativeRequestProposalsTask(
|