@adcp/sdk 14.0.0-beta.0 → 14.0.0-beta.1
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/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/get-account-financials-request.json +610 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/get-account-financials-response.json +1055 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/list-accounts-request.json +629 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/list-accounts-response.json +1558 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/report-usage-request.json +702 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/report-usage-response.json +309 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/sync-accounts-request.json +1113 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/sync-accounts-response.json +1567 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/sync-governance-request.json +662 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/account/sync-governance-response.json +921 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/creative/list-creatives-request.json +992 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/creative/list-creatives-response.json +5965 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/creative/sync-creatives-request.json +3936 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/creative/sync-creatives-response.json +3859 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/manifest.json +206 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/accept-proposal-request.json +601 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/accept-proposal-response.json +4799 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/buy-products-request.json +4107 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/buy-products-response.json +4799 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/control-media-buy-request.json +3365 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/control-media-buy-response.json +656 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/decline-proposals-request.json +334 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/decline-proposals-response.json +271 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/get-media-buy-delivery-request.json +1236 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/get-media-buy-delivery-response.json +2861 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/get-media-buys-request.json +678 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/get-media-buys-response.json +10861 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/list-products-request.json +4229 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/list-products-response.json +3824 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/log-event-request.json +421 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/log-event-response.json +394 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/media-buy-delivery-webhook-result.json +1366 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/provide-performance-feedback-request.json +884 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/provide-performance-feedback-response.json +422 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/refine-proposals-request.json +4335 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/refine-proposals-response.json +7328 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/request-proposals-request.json +4307 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/request-proposals-response.json +7105 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-audiences-request.json +760 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-audiences-response.json +541 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-catalogs-request.json +1142 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-catalogs-response.json +1153 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-event-sources-request.json +743 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/media-buy/sync-event-sources-response.json +619 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/account/get-account-financials-request.json +544 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/account/list-accounts-request.json +557 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/account/report-usage-request.json +617 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/account/sync-accounts-request.json +984 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/account/sync-governance-request.json +581 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/creative/list-creatives-request.json +878 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/creative/sync-creatives-request.json +3456 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/manifest.json +175 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/accept-proposal-request.json +498 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/buy-products-request.json +3675 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/control-media-buy-request.json +3030 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/decline-proposals-request.json +282 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/get-media-buy-delivery-request.json +1136 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/get-media-buys-request.json +597 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/list-products-request.json +3780 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/log-event-request.json +386 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/provide-performance-feedback-request.json +784 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/refine-proposals-request.json +3878 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/request-proposals-request.json +3852 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/sync-audiences-request.json +682 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/sync-catalogs-request.json +1016 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/media-buy/sync-event-sources-request.json +660 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/protocol/get-adcp-capabilities-request.json +51 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/protocol/get-task-status-request.json +534 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/protocol/list-tasks-request.json +692 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/model-context/protocol/sync-agent-notification-configs-request.json +129 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/get-adcp-capabilities-request.json +58 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/get-adcp-capabilities-response.json +8069 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/get-task-status-request.json +601 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/get-task-status-response.json +612 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/list-tasks-request.json +775 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/list-tasks-response.json +483 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/sync-agent-notification-configs-request.json +155 -0
- package/dist/lib/schemas-data/3.2.0-beta.0/mcp/2026-07-28/profiles/media-buy/protocol/sync-agent-notification-configs-response.json +382 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/create-adcp-server.d.mts +27 -0
- package/dist/lib/server/create-adcp-server.d.ts +27 -0
- package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
- package/dist/lib/server/create-adcp-server.js +120 -4
- package/dist/lib/server/create-adcp-server.js.map +1 -1
- package/dist/lib/server/create-adcp-server.mjs +121 -6
- package/dist/lib/server/create-adcp-server.mjs.map +1 -1
- package/dist/lib/server/decisioning/context.d.mts +6 -0
- package/dist/lib/server/decisioning/context.d.ts +6 -0
- package/dist/lib/server/decisioning/context.d.ts.map +1 -1
- package/dist/lib/server/decisioning/context.js.map +1 -1
- package/dist/lib/server/decisioning/index.d.mts +1 -1
- package/dist/lib/server/decisioning/index.d.ts +1 -1
- package/dist/lib/server/decisioning/index.d.ts.map +1 -1
- package/dist/lib/server/decisioning/index.js.map +1 -1
- package/dist/lib/server/decisioning/index.mjs.map +1 -1
- package/dist/lib/server/decisioning/platform.d.mts +21 -6
- package/dist/lib/server/decisioning/platform.d.ts +21 -6
- package/dist/lib/server/decisioning/platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.js +201 -18
- package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +203 -19
- package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
- package/dist/lib/server/decisioning/runtime/to-context.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/to-context.js +6 -0
- package/dist/lib/server/decisioning/runtime/to-context.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/to-context.mjs +6 -0
- package/dist/lib/server/decisioning/runtime/to-context.mjs.map +1 -1
- package/dist/lib/server/decisioning/runtime/validate-platform.d.ts.map +1 -1
- package/dist/lib/server/decisioning/runtime/validate-platform.js +35 -4
- package/dist/lib/server/decisioning/runtime/validate-platform.js.map +1 -1
- package/dist/lib/server/decisioning/runtime/validate-platform.mjs +35 -4
- package/dist/lib/server/decisioning/runtime/validate-platform.mjs.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sales.d.mts +39 -0
- package/dist/lib/server/decisioning/specialisms/sales.d.ts +39 -0
- package/dist/lib/server/decisioning/specialisms/sales.d.ts.map +1 -1
- package/dist/lib/server/decisioning/specialisms/sales.js.map +1 -1
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/validation/schema-loader.d.mts +2 -0
- package/dist/lib/validation/schema-loader.d.ts +2 -0
- package/dist/lib/validation/schema-loader.d.ts.map +1 -1
- package/dist/lib/validation/schema-loader.js +31 -0
- package/dist/lib/validation/schema-loader.js.map +1 -1
- package/dist/lib/validation/schema-loader.mjs +30 -0
- package/dist/lib/validation/schema-loader.mjs.map +1 -1
- 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.js.map +1 -1
- package/dist/lib/version.mjs +3 -3
- package/dist/lib/version.mjs.map +1 -1
- package/docs/guides/BUILD-AN-AGENT.md +10 -1
- package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +119 -0
- package/docs/llms.txt +1 -1
- package/docs/migration-12-to-14.md +8 -0
- package/docs/migration-13-to-14.md +30 -4
- package/docs/releases/14.0.0-beta.0.md +19 -1
- package/package.json +2 -1
|
@@ -22,6 +22,8 @@ __export(create_adcp_server_exports, {
|
|
|
22
22
|
ADCP_INSTRUCTIONS_RESOLVER: () => ADCP_INSTRUCTIONS_RESOLVER,
|
|
23
23
|
ADCP_PRE_TRANSPORT: () => ADCP_PRE_TRANSPORT,
|
|
24
24
|
ADCP_SIGNED_REQUESTS_STATE: () => ADCP_SIGNED_REQUESTS_STATE,
|
|
25
|
+
COMPACT_MEDIA_BUY_MUTATION_TOOLS: () => COMPACT_MEDIA_BUY_MUTATION_TOOLS,
|
|
26
|
+
MEDIA_BUY_MCP_TOOL_PROFILE: () => MEDIA_BUY_MCP_TOOL_PROFILE,
|
|
25
27
|
createAdcpServer: () => createAdcpServer,
|
|
26
28
|
requireSessionKey: () => requireSessionKey
|
|
27
29
|
});
|
|
@@ -87,6 +89,33 @@ const ADCP_PRE_TRANSPORT = /* @__PURE__ */ Symbol.for("@adcp/client.preTransport
|
|
|
87
89
|
const ADCP_SIGNED_REQUESTS_STATE = /* @__PURE__ */ Symbol.for("@adcp/client.signedRequestsState");
|
|
88
90
|
const ADCP_INSTRUCTIONS_FN = /* @__PURE__ */ Symbol.for("@adcp/client.instructionsFn");
|
|
89
91
|
const ADCP_INSTRUCTIONS_RESOLVER = /* @__PURE__ */ Symbol.for("@adcp/client.instructionsResolver");
|
|
92
|
+
const MEDIA_BUY_MCP_TOOL_PROFILE = [
|
|
93
|
+
"accept_proposal",
|
|
94
|
+
"buy_products",
|
|
95
|
+
"control_media_buy",
|
|
96
|
+
"decline_proposals",
|
|
97
|
+
"get_account_financials",
|
|
98
|
+
"get_adcp_capabilities",
|
|
99
|
+
"get_media_buy_delivery",
|
|
100
|
+
"get_media_buys",
|
|
101
|
+
"get_task_status",
|
|
102
|
+
"list_accounts",
|
|
103
|
+
"list_creatives",
|
|
104
|
+
"list_products",
|
|
105
|
+
"list_tasks",
|
|
106
|
+
"log_event",
|
|
107
|
+
"provide_performance_feedback",
|
|
108
|
+
"refine_proposals",
|
|
109
|
+
"report_usage",
|
|
110
|
+
"request_proposals",
|
|
111
|
+
"sync_accounts",
|
|
112
|
+
"sync_agent_notification_configs",
|
|
113
|
+
"sync_audiences",
|
|
114
|
+
"sync_catalogs",
|
|
115
|
+
"sync_creatives",
|
|
116
|
+
"sync_event_sources",
|
|
117
|
+
"sync_governance"
|
|
118
|
+
];
|
|
90
119
|
function clampReplayTtl(seconds) {
|
|
91
120
|
const MIN = 3600;
|
|
92
121
|
const MAX = 604800;
|
|
@@ -411,6 +440,15 @@ function taskBelongsToCaller(task, accountId, ownerScope) {
|
|
|
411
440
|
if (task.ownerScope === void 0) return ownerScope === `account:${accountId}`;
|
|
412
441
|
return task.ownerScope === ownerScope;
|
|
413
442
|
}
|
|
443
|
+
function authenticatedPrincipalForContext(authInfo, agent) {
|
|
444
|
+
if (agent?.agent_url) return `agent:${agent.agent_url}`;
|
|
445
|
+
const credential = authInfo?.credential;
|
|
446
|
+
if (credential?.kind === "http_sig") return `http_sig:${credential.agent_url}`;
|
|
447
|
+
if (credential?.kind === "oauth") return `oauth:${credential.client_id}`;
|
|
448
|
+
if (credential?.kind === "api_key") return `api_key:${credential.key_id}`;
|
|
449
|
+
if (typeof authInfo?.clientId === "string" && authInfo.clientId.length > 0) return `client:${authInfo.clientId}`;
|
|
450
|
+
return void 0;
|
|
451
|
+
}
|
|
414
452
|
function taskOwnerScopeForContext(authInfo, sessionKey, agent, accountId) {
|
|
415
453
|
if (sessionKey !== void 0) return `session:${sessionKey}`;
|
|
416
454
|
if (agent?.agent_url) return `agent:${agent.agent_url}`;
|
|
@@ -639,6 +677,14 @@ const COMPACT_MEDIA_BUY_LIFECYCLE_TOOLS = [
|
|
|
639
677
|
"accept_proposal",
|
|
640
678
|
"control_media_buy"
|
|
641
679
|
];
|
|
680
|
+
const COMPACT_MEDIA_BUY_MUTATION_TOOLS = /* @__PURE__ */ new Set([
|
|
681
|
+
"request_proposals",
|
|
682
|
+
"refine_proposals",
|
|
683
|
+
"decline_proposals",
|
|
684
|
+
"buy_products",
|
|
685
|
+
"accept_proposal",
|
|
686
|
+
"control_media_buy"
|
|
687
|
+
]);
|
|
642
688
|
const MEDIA_BUY_ENTRIES = [
|
|
643
689
|
{ handlerKey: "getProducts", toolName: "get_products" },
|
|
644
690
|
{ handlerKey: "listProducts", toolName: "list_products" },
|
|
@@ -1325,6 +1371,8 @@ function createAdcpServer(config) {
|
|
|
1325
1371
|
name,
|
|
1326
1372
|
version,
|
|
1327
1373
|
adcpVersion: configuredAdcpVersion,
|
|
1374
|
+
mcpToolProfile = "auto",
|
|
1375
|
+
requireCompactMutationAccountScope = false,
|
|
1328
1376
|
resolveAccount,
|
|
1329
1377
|
resolveAccountFromAuth,
|
|
1330
1378
|
resolveSessionKey,
|
|
@@ -1347,6 +1395,11 @@ function createAdcpServer(config) {
|
|
|
1347
1395
|
testController: testControllerBridge,
|
|
1348
1396
|
responseEnhancer
|
|
1349
1397
|
} = config;
|
|
1398
|
+
if (!["auto", "media-buy", "all"].includes(mcpToolProfile)) {
|
|
1399
|
+
throw new Error(
|
|
1400
|
+
`createAdcpServer: mcpToolProfile must be "auto", "media-buy", or "all"; got ${JSON.stringify(mcpToolProfile)}`
|
|
1401
|
+
);
|
|
1402
|
+
}
|
|
1350
1403
|
const notificationHandlerConfigured = typeof config.protocol?.syncAgentNotificationConfigs === "function";
|
|
1351
1404
|
const notificationCapabilitySupported = capConfig?.capability_changes?.notifications?.supported === true;
|
|
1352
1405
|
if (notificationHandlerConfigured !== notificationCapabilitySupported) {
|
|
@@ -1416,6 +1469,7 @@ function createAdcpServer(config) {
|
|
|
1416
1469
|
);
|
|
1417
1470
|
}
|
|
1418
1471
|
const protocolBundleKey = (0, import_schema_loader.resolveBundleKey)(adcpVersion);
|
|
1472
|
+
const frameworkToolMeta = { adcp_version: adcpVersion };
|
|
1419
1473
|
const servedAdcpVersion = (() => {
|
|
1420
1474
|
const bundleKey = protocolBundleKey;
|
|
1421
1475
|
return (0, import_protocols.bundleSupportsAdcpVersionField)(bundleKey) ? bundleKey : void 0;
|
|
@@ -2272,6 +2326,22 @@ function createAdcpServer(config) {
|
|
|
2272
2326
|
);
|
|
2273
2327
|
}
|
|
2274
2328
|
}
|
|
2329
|
+
if (COMPACT_MEDIA_BUY_MUTATION_TOOLS.has(toolName)) {
|
|
2330
|
+
if (authenticatedPrincipalForContext(ctx.authInfo, ctx.agent) === void 0) {
|
|
2331
|
+
return finalize(
|
|
2332
|
+
(0, import_errors.adcpError)("AUTH_MISSING", {
|
|
2333
|
+
message: `${toolName} requires an authenticated buyer principal`
|
|
2334
|
+
})
|
|
2335
|
+
);
|
|
2336
|
+
}
|
|
2337
|
+
if (requireCompactMutationAccountScope && ctx.account == null) {
|
|
2338
|
+
return finalize(
|
|
2339
|
+
(0, import_errors.adcpError)("ACCOUNT_NOT_FOUND", {
|
|
2340
|
+
message: `${toolName} requires a resolved account scope`
|
|
2341
|
+
})
|
|
2342
|
+
);
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2275
2345
|
if (toolName === "refine_proposals") {
|
|
2276
2346
|
if (ctx.authInfo === void 0 && ctx.agent === void 0) {
|
|
2277
2347
|
return finalize(
|
|
@@ -2962,7 +3032,8 @@ function createAdcpServer(config) {
|
|
|
2962
3032
|
toolName,
|
|
2963
3033
|
{
|
|
2964
3034
|
inputSchema: frameworkInputSchemaFor(toolName),
|
|
2965
|
-
...meta?.annotations != null && { annotations: meta.annotations }
|
|
3035
|
+
...meta?.annotations != null && { annotations: meta.annotations },
|
|
3036
|
+
_meta: frameworkToolMeta
|
|
2966
3037
|
},
|
|
2967
3038
|
toolHandler
|
|
2968
3039
|
);
|
|
@@ -2974,7 +3045,8 @@ function createAdcpServer(config) {
|
|
|
2974
3045
|
"get_task_status",
|
|
2975
3046
|
{
|
|
2976
3047
|
inputSchema: frameworkInputSchemaFor("get_task_status"),
|
|
2977
|
-
annotations: RO
|
|
3048
|
+
annotations: RO,
|
|
3049
|
+
_meta: frameworkToolMeta
|
|
2978
3050
|
},
|
|
2979
3051
|
(async (params, extra) => {
|
|
2980
3052
|
const credentialError = taskToolCredentialPolicyError("get_task_status", params ?? {}, extra);
|
|
@@ -3050,7 +3122,8 @@ function createAdcpServer(config) {
|
|
|
3050
3122
|
"list_tasks",
|
|
3051
3123
|
{
|
|
3052
3124
|
inputSchema: frameworkInputSchemaFor("list_tasks"),
|
|
3053
|
-
annotations: RO
|
|
3125
|
+
annotations: RO,
|
|
3126
|
+
_meta: frameworkToolMeta
|
|
3054
3127
|
},
|
|
3055
3128
|
(async (params, extra) => {
|
|
3056
3129
|
const credentialError = taskToolCredentialPolicyError("list_tasks", params ?? {}, extra);
|
|
@@ -3298,7 +3371,8 @@ function createAdcpServer(config) {
|
|
|
3298
3371
|
"get_adcp_capabilities",
|
|
3299
3372
|
{
|
|
3300
3373
|
inputSchema: frameworkInputSchemaFor("get_adcp_capabilities"),
|
|
3301
|
-
annotations: { readOnlyHint: true }
|
|
3374
|
+
annotations: { readOnlyHint: true },
|
|
3375
|
+
_meta: frameworkToolMeta
|
|
3302
3376
|
},
|
|
3303
3377
|
(async (params, extra = {}) => {
|
|
3304
3378
|
const requestParams = isPlainObject(params) ? params : {};
|
|
@@ -3450,6 +3524,46 @@ function createAdcpServer(config) {
|
|
|
3450
3524
|
})
|
|
3451
3525
|
);
|
|
3452
3526
|
registeredToolNames.add("get_adcp_capabilities");
|
|
3527
|
+
const configuredRelease = parseAdcpRelease(protocolBundleKey);
|
|
3528
|
+
const serves32OrNewer = configuredRelease !== void 0 && (configuredRelease.major > 3 || configuredRelease.major === 3 && configuredRelease.minor >= 2);
|
|
3529
|
+
if (mcpToolProfile === "media-buy" && !serves32OrNewer) {
|
|
3530
|
+
throw new Error('createAdcpServer: mcpToolProfile="media-buy" requires adcpVersion 3.2 or newer');
|
|
3531
|
+
}
|
|
3532
|
+
const activeMcpToolProfile = mcpToolProfile === "media-buy" || mcpToolProfile === "auto" && serves32OrNewer && compactLifecycleTools.length > 0 ? "media-buy" : "all";
|
|
3533
|
+
const mediaBuyProfileTools = new Set(MEDIA_BUY_MCP_TOOL_PROFILE);
|
|
3534
|
+
const wrappedToolsList = (0, import_adcp_server.wrapSdkRequestHandler)(server, "tools/list", async (original, request, extra) => {
|
|
3535
|
+
const response = await original(request, extra);
|
|
3536
|
+
if (response == null || typeof response !== "object") return response;
|
|
3537
|
+
const tools = response.tools;
|
|
3538
|
+
if (!Array.isArray(tools)) return response;
|
|
3539
|
+
const visibleTools = tools.filter((tool) => {
|
|
3540
|
+
const toolName = tool?.name;
|
|
3541
|
+
if (typeof toolName !== "string") return true;
|
|
3542
|
+
if (!serves32OrNewer && COMPACT_MEDIA_BUY_LIFECYCLE_TOOLS.includes(toolName)) return false;
|
|
3543
|
+
return activeMcpToolProfile === "all" || mediaBuyProfileTools.has(toolName);
|
|
3544
|
+
});
|
|
3545
|
+
const projectedTools = visibleTools.map((tool) => {
|
|
3546
|
+
if (activeMcpToolProfile !== "media-buy") return tool;
|
|
3547
|
+
const toolName = tool?.name;
|
|
3548
|
+
if (typeof toolName !== "string") return tool;
|
|
3549
|
+
const inputSchema = (0, import_schema_loader.getMcpProfileInputSchema)(toolName, "media-buy", adcpVersion);
|
|
3550
|
+
return inputSchema ? { ...tool, inputSchema } : tool;
|
|
3551
|
+
});
|
|
3552
|
+
return {
|
|
3553
|
+
...response,
|
|
3554
|
+
tools: projectedTools,
|
|
3555
|
+
_meta: {
|
|
3556
|
+
...response._meta ?? {},
|
|
3557
|
+
adcp_version: adcpVersion,
|
|
3558
|
+
adcp_profile: activeMcpToolProfile
|
|
3559
|
+
}
|
|
3560
|
+
};
|
|
3561
|
+
});
|
|
3562
|
+
if (!wrappedToolsList) {
|
|
3563
|
+
throw new Error(
|
|
3564
|
+
"createAdcpServer: failed to install MCP tools/list profile filtering; the MCP SDK request-handler internals may have changed"
|
|
3565
|
+
);
|
|
3566
|
+
}
|
|
3453
3567
|
(0, import_credential_policy.validateCredentialPolicy)(credentialPolicy, registeredToolNames);
|
|
3454
3568
|
const compliance = {
|
|
3455
3569
|
async reset({
|
|
@@ -3545,6 +3659,8 @@ function createAdcpServer(config) {
|
|
|
3545
3659
|
ADCP_INSTRUCTIONS_RESOLVER,
|
|
3546
3660
|
ADCP_PRE_TRANSPORT,
|
|
3547
3661
|
ADCP_SIGNED_REQUESTS_STATE,
|
|
3662
|
+
COMPACT_MEDIA_BUY_MUTATION_TOOLS,
|
|
3663
|
+
MEDIA_BUY_MCP_TOOL_PROFILE,
|
|
3548
3664
|
createAdcpServer,
|
|
3549
3665
|
requireSessionKey
|
|
3550
3666
|
});
|