@agent-native/core 0.145.2 → 0.145.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +10 -8
- package/corpus/templates/assets/server/plugins/agent-chat.ts +1 -1
- package/corpus/templates/calendar/server/plugins/agent-chat.ts +1 -1
- package/corpus/templates/clips/desktop/src/lib/media-capture-constraints.ts +22 -1
- package/corpus/templates/mail/server/plugins/agent-chat.ts +1 -1
- package/corpus/templates/plan/server/lib/plan-framework-tools.ts +11 -0
- package/corpus/templates/plan/server/plugins/00-mcp.ts +25 -68
- package/corpus/templates/plan/server/plugins/agent-chat.ts +8 -2
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/framework-tools.d.ts +33 -1
- package/dist/framework-tools.js +88 -4
- package/dist/mcp/build-server.d.ts +15 -0
- package/dist/mcp/build-server.js +94 -30
- package/dist/mcp/oauth-client-metadata.js +6 -2
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/provider-api.d.ts +2 -2
- package/dist/server/action-discovery.d.ts +3 -18
- package/dist/server/action-discovery.js +9 -65
- package/dist/server/agent-chat/action-filters-a2a.d.ts +14 -2
- package/dist/server/agent-chat/action-filters-a2a.js +1 -1
- package/dist/server/agent-chat/mcp-options.d.ts +106 -0
- package/dist/server/agent-chat/mcp-options.js +50 -0
- package/dist/server/agent-chat/plugin-options.d.ts +17 -26
- package/dist/server/agent-chat-plugin.js +21 -11
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +7 -0
- package/dist/server/poll.d.ts +11 -0
- package/dist/server/poll.js +7 -4
- package/dist/server/realtime-token.js +8 -0
- package/dist/server/short-lived-token.d.ts +8 -0
- package/dist/server/short-lived-token.js +12 -0
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/package.json +1 -1
package/corpus/README.md
CHANGED
|
@@ -907,14 +907,16 @@ export default createAgentChatPlugin({
|
|
|
907
907
|
durableBackgroundRuns: true,
|
|
908
908
|
runSoftTimeoutMs: ANALYTICS_BACKGROUND_RUN_SOFT_TIMEOUT_MS,
|
|
909
909
|
runNoProgressTimeoutMs: ANALYTICS_BACKGROUND_RUN_NO_PROGRESS_TIMEOUT_MS,
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
910
|
+
mcp: {
|
|
911
|
+
connectorCatalog: [...ANALYTICS_CONNECTOR_CATALOG],
|
|
912
|
+
externalAgents: {
|
|
913
|
+
// Keep the direct MCP surface deliberately curated. External agents
|
|
914
|
+
// should use ask_app by default; cataloged actions are optional stable
|
|
915
|
+
// semantic reads for callers with an exact, fully known contract. They
|
|
916
|
+
// are never a fallback for slow or failed delegation.
|
|
917
|
+
authenticatedReads: "off",
|
|
918
|
+
writes: "ask_app_only",
|
|
919
|
+
},
|
|
918
920
|
},
|
|
919
921
|
resolveOrgId: async (event) => {
|
|
920
922
|
const ctx = await getOrgContext(event);
|
|
@@ -90,7 +90,7 @@ export default createAgentChatPlugin({
|
|
|
90
90
|
// background worker, as content, slides and analytics already do.
|
|
91
91
|
durableBackgroundRuns: true,
|
|
92
92
|
initialToolNames: INITIAL_TOOL_NAMES,
|
|
93
|
-
connectorCatalog: [...CALENDAR_CONNECTOR_CATALOG],
|
|
93
|
+
mcp: { connectorCatalog: [...CALENDAR_CONNECTOR_CATALOG] },
|
|
94
94
|
// Enable sandboxed JavaScript execution so Calendar agents can fetch,
|
|
95
95
|
// paginate, and reduce provider data through providerFetch() without us
|
|
96
96
|
// hardcoding one action per Google Calendar / CRM endpoint.
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
chooseFallbackAudioInput,
|
|
3
3
|
enumerateAudioInputDevices,
|
|
4
4
|
isLikelyPhoneMicLabel,
|
|
5
|
+
normalizedMediaDeviceId,
|
|
5
6
|
type AudioInputFallback,
|
|
6
7
|
} from "../../../shared/media-device-selection";
|
|
7
8
|
|
|
@@ -204,7 +205,27 @@ export async function getAudioStreamWithFallback(
|
|
|
204
205
|
const stream = await getVoiceFocusedAudioStream(id);
|
|
205
206
|
return id ? stream : replacePhoneDefaultMicIfPossible(stream);
|
|
206
207
|
} catch (err) {
|
|
207
|
-
|
|
208
|
+
let deviceGone = false;
|
|
209
|
+
if (id && err instanceof DOMException && err.name === "NotAllowedError") {
|
|
210
|
+
try {
|
|
211
|
+
deviceGone = !(await enumerateAudioInputDevices()).some(
|
|
212
|
+
(device) => normalizedMediaDeviceId(device.deviceId) === id,
|
|
213
|
+
);
|
|
214
|
+
} catch (enumerateErr) {
|
|
215
|
+
console.warn(
|
|
216
|
+
"[clips-recorder] could not confirm saved mic is still present after NotAllowedError",
|
|
217
|
+
enumerateErr,
|
|
218
|
+
);
|
|
219
|
+
deviceGone = true;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (deviceGone) {
|
|
223
|
+
console.warn(
|
|
224
|
+
"[clips-recorder] saved mic no longer enumerated after NotAllowedError; falling back",
|
|
225
|
+
{ deviceId: id },
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
if (!isMediaConstraintFailure(err) && !deviceGone) throw err;
|
|
208
229
|
if (id) {
|
|
209
230
|
const fallback = await tryFallbackAudioInput(savedLabel, [id]);
|
|
210
231
|
if (fallback) return fallback;
|
|
@@ -40,7 +40,7 @@ export default createAgentChatPlugin({
|
|
|
40
40
|
// background worker, as content, slides and analytics already do.
|
|
41
41
|
durableBackgroundRuns: true,
|
|
42
42
|
initialToolNames: INITIAL_TOOL_NAMES,
|
|
43
|
-
connectorCatalog: [...MAIL_CONNECTOR_CATALOG],
|
|
43
|
+
mcp: { connectorCatalog: [...MAIL_CONNECTOR_CATALOG] },
|
|
44
44
|
resolveOrgId: async (event) => {
|
|
45
45
|
const ctx = await getOrgContext(event);
|
|
46
46
|
return ctx.orgId;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FrameworkToolsConfig } from "@agent-native/core/server";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Framework tool policy shared by Plan's two mounts.
|
|
5
|
+
*
|
|
6
|
+
* Plan serves MCP from a dedicated early plugin (`plugins/00-mcp.ts`) rather
|
|
7
|
+
* than the agent-chat plugin, so the policy has to live somewhere both can
|
|
8
|
+
* read. Setting it in only one place is how an app ends up advertising a tool
|
|
9
|
+
* over MCP that its own agent no longer has.
|
|
10
|
+
*/
|
|
11
|
+
export const PLAN_FRAMEWORK_TOOLS: FrameworkToolsConfig = {};
|
|
@@ -1,77 +1,16 @@
|
|
|
1
1
|
import { mountMCP } from "@agent-native/core/mcp";
|
|
2
2
|
import {
|
|
3
|
+
attachToolSearch,
|
|
4
|
+
filterFrameworkToolGroups,
|
|
3
5
|
loadActionsFromStaticRegistry,
|
|
4
|
-
|
|
6
|
+
resolveFrameworkTools,
|
|
5
7
|
} from "@agent-native/core/server";
|
|
6
8
|
import { getRequestUserEmail } from "@agent-native/core/server/request-context";
|
|
7
9
|
import { createAutomationToolEntries } from "@agent-native/core/triggers";
|
|
8
10
|
|
|
9
11
|
import actionsRegistry from "../../.generated/actions-registry.js";
|
|
10
12
|
import { PLAN_CONNECTOR_CATALOG } from "../lib/plan-connector-catalog.js";
|
|
11
|
-
|
|
12
|
-
const TOOL_SEARCH_ACTION_NAME = "tool-search";
|
|
13
|
-
|
|
14
|
-
function attachPlanToolSearch(
|
|
15
|
-
registry: Record<string, ActionEntry>,
|
|
16
|
-
): Record<string, ActionEntry> {
|
|
17
|
-
const searchableNames = new Set(PLAN_CONNECTOR_CATALOG);
|
|
18
|
-
registry[TOOL_SEARCH_ACTION_NAME] = {
|
|
19
|
-
tool: {
|
|
20
|
-
description:
|
|
21
|
-
"Discover callable Plan MCP tools by name and description. Omit query to list the visible Plan connector surface; pass query to filter by capability.",
|
|
22
|
-
parameters: {
|
|
23
|
-
type: "object",
|
|
24
|
-
properties: {
|
|
25
|
-
query: {
|
|
26
|
-
type: "string",
|
|
27
|
-
description:
|
|
28
|
-
"Optional search text, e.g. create plan, share resource, or comments.",
|
|
29
|
-
},
|
|
30
|
-
limit: {
|
|
31
|
-
type: "number",
|
|
32
|
-
description: "Maximum results to return. Defaults to 8.",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
http: false,
|
|
38
|
-
readOnly: true,
|
|
39
|
-
run: async (args: { query?: unknown; limit?: unknown } = {}) => {
|
|
40
|
-
const query = String(args.query ?? "")
|
|
41
|
-
.trim()
|
|
42
|
-
.toLowerCase();
|
|
43
|
-
const rawLimit = Number(args.limit);
|
|
44
|
-
const limit =
|
|
45
|
-
Number.isFinite(rawLimit) && rawLimit > 0
|
|
46
|
-
? Math.min(Math.floor(rawLimit), 25)
|
|
47
|
-
: 8;
|
|
48
|
-
const results = Object.entries(registry)
|
|
49
|
-
.filter(([name, entry]) => {
|
|
50
|
-
if (name === TOOL_SEARCH_ACTION_NAME) return false;
|
|
51
|
-
if (!searchableNames.has(name)) return false;
|
|
52
|
-
const description = entry.tool.description ?? "";
|
|
53
|
-
if (!query) return true;
|
|
54
|
-
return `${name} ${description}`.toLowerCase().includes(query);
|
|
55
|
-
})
|
|
56
|
-
.slice(0, query ? limit : 100)
|
|
57
|
-
.map(([name, entry]) => ({
|
|
58
|
-
name,
|
|
59
|
-
description: entry.tool.description ?? name,
|
|
60
|
-
readOnly: entry.readOnly === true,
|
|
61
|
-
}));
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
query,
|
|
65
|
-
totalTools: Object.keys(registry).filter((name) =>
|
|
66
|
-
searchableNames.has(name),
|
|
67
|
-
).length,
|
|
68
|
-
count: results.length,
|
|
69
|
-
results,
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
return registry;
|
|
74
|
-
}
|
|
13
|
+
import { PLAN_FRAMEWORK_TOOLS } from "../lib/plan-framework-tools.js";
|
|
75
14
|
|
|
76
15
|
function requireMcpOwner(operation: string): string {
|
|
77
16
|
const owner = getRequestUserEmail();
|
|
@@ -84,11 +23,29 @@ function requireMcpOwner(operation: string): string {
|
|
|
84
23
|
}
|
|
85
24
|
|
|
86
25
|
export default function planMcpPlugin(nitroApp: any) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
26
|
+
// This mount deliberately bypasses the agent-chat plugin so the external
|
|
27
|
+
// connector does not wait on chat initialization — which means it has to
|
|
28
|
+
// apply the framework tool policy itself. Reading the same
|
|
29
|
+
// `PLAN_FRAMEWORK_TOOLS` the chat plugin does is what keeps the two mounts
|
|
30
|
+
// from disagreeing about which tools exist.
|
|
31
|
+
const frameworkTools = resolveFrameworkTools({
|
|
32
|
+
frameworkTools: PLAN_FRAMEWORK_TOOLS,
|
|
90
33
|
});
|
|
91
34
|
|
|
35
|
+
const actions = attachToolSearch(
|
|
36
|
+
filterFrameworkToolGroups(
|
|
37
|
+
{
|
|
38
|
+
...loadActionsFromStaticRegistry(actionsRegistry),
|
|
39
|
+
...(frameworkTools.isEnabled("automation")
|
|
40
|
+
? createAutomationToolEntries(() =>
|
|
41
|
+
requireMcpOwner("manage automations"),
|
|
42
|
+
)
|
|
43
|
+
: {}),
|
|
44
|
+
},
|
|
45
|
+
frameworkTools.disabledGroups,
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
|
|
92
49
|
mountMCP(nitroApp, {
|
|
93
50
|
name: "Plan",
|
|
94
51
|
title: "Agent-Native Plan",
|
|
@@ -8,6 +8,7 @@ import { z } from "zod";
|
|
|
8
8
|
|
|
9
9
|
import actionsRegistry from "../../.generated/actions-registry.js";
|
|
10
10
|
import { PLAN_CONNECTOR_CATALOG } from "../lib/plan-connector-catalog.js";
|
|
11
|
+
import { PLAN_FRAMEWORK_TOOLS } from "../lib/plan-framework-tools.js";
|
|
11
12
|
import { resolvePlanAnonymousOwner } from "../lib/public-plans.js";
|
|
12
13
|
|
|
13
14
|
const PLAN_BACKGROUND_RUN_SOFT_TIMEOUT_MS = 13 * 60_000;
|
|
@@ -130,8 +131,13 @@ const planAgentChatOptions = {
|
|
|
130
131
|
initialToolNames: INITIAL_TOOL_NAMES,
|
|
131
132
|
anonymousOwner: resolvePlanAnonymousOwner,
|
|
132
133
|
resolveOrgId: async (event) => (await getOrgContext(event)).orgId,
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
frameworkTools: PLAN_FRAMEWORK_TOOLS,
|
|
135
|
+
mcp: {
|
|
136
|
+
// Plan mounts MCP from a dedicated early plugin (`00-mcp.ts`) so its
|
|
137
|
+
// external connector does not wait on chat plugin initialization.
|
|
138
|
+
enabled: false,
|
|
139
|
+
connectorCatalog: PLAN_CONNECTOR_CATALOG,
|
|
140
|
+
},
|
|
135
141
|
durableBackgroundRuns: true,
|
|
136
142
|
runSoftTimeoutMs: PLAN_BACKGROUND_RUN_SOFT_TIMEOUT_MS,
|
|
137
143
|
};
|
|
@@ -62,11 +62,11 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
62
62
|
error: string;
|
|
63
63
|
states?: undefined;
|
|
64
64
|
} | {
|
|
65
|
+
error?: undefined;
|
|
65
66
|
states: {
|
|
66
67
|
clientId: number;
|
|
67
68
|
state: string;
|
|
68
69
|
}[];
|
|
69
|
-
error?: undefined;
|
|
70
70
|
}>>;
|
|
71
71
|
/**
|
|
72
72
|
* GET /_agent-native/collab/:docId/users
|
|
@@ -77,9 +77,9 @@ export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("
|
|
|
77
77
|
error: string;
|
|
78
78
|
users?: undefined;
|
|
79
79
|
} | {
|
|
80
|
+
error?: undefined;
|
|
80
81
|
users: {
|
|
81
82
|
clientId: number;
|
|
82
83
|
lastSeen: number;
|
|
83
84
|
}[];
|
|
84
|
-
error?: undefined;
|
|
85
85
|
}>>;
|
package/dist/collab/routes.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
|
|
|
26
26
|
* Body: { update: string (base64), requestSource?: string }
|
|
27
27
|
*/
|
|
28
28
|
export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
29
|
-
ok?: undefined;
|
|
30
29
|
error: string;
|
|
30
|
+
ok?: undefined;
|
|
31
31
|
} | {
|
|
32
32
|
error?: undefined;
|
|
33
33
|
ok: boolean;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* Body: { json: any, fieldName?: string, type?: "map"|"array", requestSource?: string }
|
|
14
14
|
*/
|
|
15
15
|
export declare const postCollabJson: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
16
|
-
ok?: undefined;
|
|
17
16
|
error: string;
|
|
17
|
+
ok?: undefined;
|
|
18
18
|
} | {
|
|
19
19
|
error?: undefined;
|
|
20
20
|
ok: boolean;
|
|
@@ -103,18 +103,50 @@ export interface ResolvedFrameworkTools {
|
|
|
103
103
|
* "why can't the agent see db-query" report ends up unexplainable.
|
|
104
104
|
*/
|
|
105
105
|
export declare function resolveFrameworkTools(input: FrameworkToolsInput | undefined): ResolvedFrameworkTools;
|
|
106
|
+
/**
|
|
107
|
+
* Which `frameworkTools` switch owns each framework action kit.
|
|
108
|
+
*
|
|
109
|
+
* This map is the authority. `ActionEntry.frameworkGroup` is an optional
|
|
110
|
+
* pre-resolved copy of the same answer, not a requirement: it is stamped only
|
|
111
|
+
* by `mergeCoreSharingActions`, which runs against the ungated `httpActions`
|
|
112
|
+
* registry, so for a year every app loading core kits through
|
|
113
|
+
* `loadActionsFromStaticRegistry` or its own actions directory carried
|
|
114
|
+
* untagged entries and silently ignored eight of the `frameworkTools`
|
|
115
|
+
* switches. Resolve by name and the switch works no matter how the action was
|
|
116
|
+
* registered.
|
|
117
|
+
*
|
|
118
|
+
* Membership does two jobs: one filter subtracts a whole kit from every agent
|
|
119
|
+
* tool surface at once (the plugin spreads these registries at thirteen
|
|
120
|
+
* composition sites), and it keeps these ~45 schemas out of the DEFAULT
|
|
121
|
+
* first-request tool list. They stay reachable through `tool-search`.
|
|
122
|
+
*
|
|
123
|
+
* Anything absent from this map is always-on and must be listed in
|
|
124
|
+
* `ALWAYS_ON_CORE_ACTIONS` instead. `action-discovery.spec.ts` fails when a new
|
|
125
|
+
* core action appears in neither, so "always-on" stays a decision someone made
|
|
126
|
+
* rather than the default that happens when a map goes un-updated.
|
|
127
|
+
*/
|
|
128
|
+
export declare const CORE_ACTION_GROUPS: Record<string, FrameworkToolGroup>;
|
|
106
129
|
/** Structural view of the one field these helpers read, so tagging utilities
|
|
107
130
|
* stay free of an import cycle with `ActionEntry`. */
|
|
108
131
|
interface FrameworkGrouped {
|
|
109
132
|
frameworkGroup?: FrameworkToolGroup;
|
|
110
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Which group owns an action, by name first and tag second.
|
|
136
|
+
*
|
|
137
|
+
* Name first because the name is present on every registration path, while the
|
|
138
|
+
* tag is stamped on exactly one — an app is not less entitled to its
|
|
139
|
+
* `frameworkTools` switches because it loaded core kits from a generated
|
|
140
|
+
* registry instead of `autoDiscoverActions`.
|
|
141
|
+
*/
|
|
142
|
+
export declare function resolveFrameworkGroup(name: string, entry: FrameworkGrouped | undefined): FrameworkToolGroup | undefined;
|
|
111
143
|
/**
|
|
112
144
|
* Drop every action belonging to a disabled group. Returns the input untouched
|
|
113
145
|
* when nothing is disabled so the default path allocates nothing.
|
|
114
146
|
*/
|
|
115
147
|
export declare function filterFrameworkToolGroups<T extends FrameworkGrouped>(actions: Record<string, T>, disabledGroups: ReadonlySet<FrameworkToolGroup>): Record<string, T>;
|
|
116
148
|
/** True for actions the framework contributes rather than the app's own. */
|
|
117
|
-
export declare function isFrameworkGroupedAction(entry: FrameworkGrouped): boolean;
|
|
149
|
+
export declare function isFrameworkGroupedAction(name: string, entry: FrameworkGrouped | undefined): boolean;
|
|
118
150
|
/**
|
|
119
151
|
* Whether a group is live, for prompt builders that only receive the disabled
|
|
120
152
|
* set. Prompt text and tool schemas must agree: a prompt that names a tool the
|
package/dist/framework-tools.js
CHANGED
|
@@ -88,6 +88,88 @@ export function resolveFrameworkTools(input) {
|
|
|
88
88
|
isEnabled: (group) => !disabledGroups.has(group),
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Which `frameworkTools` switch owns each framework action kit.
|
|
93
|
+
*
|
|
94
|
+
* This map is the authority. `ActionEntry.frameworkGroup` is an optional
|
|
95
|
+
* pre-resolved copy of the same answer, not a requirement: it is stamped only
|
|
96
|
+
* by `mergeCoreSharingActions`, which runs against the ungated `httpActions`
|
|
97
|
+
* registry, so for a year every app loading core kits through
|
|
98
|
+
* `loadActionsFromStaticRegistry` or its own actions directory carried
|
|
99
|
+
* untagged entries and silently ignored eight of the `frameworkTools`
|
|
100
|
+
* switches. Resolve by name and the switch works no matter how the action was
|
|
101
|
+
* registered.
|
|
102
|
+
*
|
|
103
|
+
* Membership does two jobs: one filter subtracts a whole kit from every agent
|
|
104
|
+
* tool surface at once (the plugin spreads these registries at thirteen
|
|
105
|
+
* composition sites), and it keeps these ~45 schemas out of the DEFAULT
|
|
106
|
+
* first-request tool list. They stay reachable through `tool-search`.
|
|
107
|
+
*
|
|
108
|
+
* Anything absent from this map is always-on and must be listed in
|
|
109
|
+
* `ALWAYS_ON_CORE_ACTIONS` instead. `action-discovery.spec.ts` fails when a new
|
|
110
|
+
* core action appears in neither, so "always-on" stays a decision someone made
|
|
111
|
+
* rather than the default that happens when a map goes un-updated.
|
|
112
|
+
*/
|
|
113
|
+
export const CORE_ACTION_GROUPS = {
|
|
114
|
+
"share-resource": "sharing",
|
|
115
|
+
"unshare-resource": "sharing",
|
|
116
|
+
"list-resource-shares": "sharing",
|
|
117
|
+
"set-resource-visibility": "sharing",
|
|
118
|
+
"create-agent-resource-link": "sharing",
|
|
119
|
+
"get-feature-flags": "featureFlags",
|
|
120
|
+
"list-feature-flags": "featureFlags",
|
|
121
|
+
"set-feature-flag": "featureFlags",
|
|
122
|
+
"list-recurring-jobs": "automation",
|
|
123
|
+
"manage-recurring-job": "automation",
|
|
124
|
+
"run-automation-now": "automation",
|
|
125
|
+
"list-automation-runs": "automation",
|
|
126
|
+
"list-automations": "automation",
|
|
127
|
+
"manage-automation": "automation",
|
|
128
|
+
"context-manifest-get": "contextXray",
|
|
129
|
+
"context-preview-get": "contextXray",
|
|
130
|
+
"context-pin": "contextXray",
|
|
131
|
+
"context-evict": "contextXray",
|
|
132
|
+
"context-restore": "contextXray",
|
|
133
|
+
"context-report": "contextXray",
|
|
134
|
+
"get-localization-preference": "localization",
|
|
135
|
+
"set-localization-preference": "localization",
|
|
136
|
+
// Profile, credentials, and appearance share one switch: an app that hides
|
|
137
|
+
// its profile surface from the agent hides password management with it.
|
|
138
|
+
"get-user-profile": "userProfile",
|
|
139
|
+
"update-user-profile": "userProfile",
|
|
140
|
+
"get-auth-methods": "userProfile",
|
|
141
|
+
"set-password": "userProfile",
|
|
142
|
+
"change-password": "userProfile",
|
|
143
|
+
"change-appearance": "userProfile",
|
|
144
|
+
"list-audit-events": "audit",
|
|
145
|
+
"get-audit-event": "audit",
|
|
146
|
+
"export-audit-events": "audit",
|
|
147
|
+
"create-resource-version": "history",
|
|
148
|
+
"list-resource-versions": "history",
|
|
149
|
+
"get-resource-version": "history",
|
|
150
|
+
"restore-resource-version": "history",
|
|
151
|
+
"list-resource-history": "history",
|
|
152
|
+
"list-review-comments": "review",
|
|
153
|
+
"create-review-comment": "review",
|
|
154
|
+
"reply-review-comment": "review",
|
|
155
|
+
"resolve-review-thread": "review",
|
|
156
|
+
"delete-review-comment": "review",
|
|
157
|
+
"consume-review-feedback": "review",
|
|
158
|
+
"get-review-feedback": "review",
|
|
159
|
+
"set-review-status": "review",
|
|
160
|
+
"send-review-thread-to-agent": "review",
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Which group owns an action, by name first and tag second.
|
|
164
|
+
*
|
|
165
|
+
* Name first because the name is present on every registration path, while the
|
|
166
|
+
* tag is stamped on exactly one — an app is not less entitled to its
|
|
167
|
+
* `frameworkTools` switches because it loaded core kits from a generated
|
|
168
|
+
* registry instead of `autoDiscoverActions`.
|
|
169
|
+
*/
|
|
170
|
+
export function resolveFrameworkGroup(name, entry) {
|
|
171
|
+
return entry?.frameworkGroup ?? CORE_ACTION_GROUPS[name];
|
|
172
|
+
}
|
|
91
173
|
/**
|
|
92
174
|
* Drop every action belonging to a disabled group. Returns the input untouched
|
|
93
175
|
* when nothing is disabled so the default path allocates nothing.
|
|
@@ -95,12 +177,14 @@ export function resolveFrameworkTools(input) {
|
|
|
95
177
|
export function filterFrameworkToolGroups(actions, disabledGroups) {
|
|
96
178
|
if (disabledGroups.size === 0)
|
|
97
179
|
return actions;
|
|
98
|
-
return Object.fromEntries(Object.entries(actions).filter(([, entry]) =>
|
|
99
|
-
|
|
180
|
+
return Object.fromEntries(Object.entries(actions).filter(([name, entry]) => {
|
|
181
|
+
const group = resolveFrameworkGroup(name, entry);
|
|
182
|
+
return group === undefined || !disabledGroups.has(group);
|
|
183
|
+
}));
|
|
100
184
|
}
|
|
101
185
|
/** True for actions the framework contributes rather than the app's own. */
|
|
102
|
-
export function isFrameworkGroupedAction(entry) {
|
|
103
|
-
return entry
|
|
186
|
+
export function isFrameworkGroupedAction(name, entry) {
|
|
187
|
+
return resolveFrameworkGroup(name, entry) !== undefined;
|
|
104
188
|
}
|
|
105
189
|
/**
|
|
106
190
|
* Whether a group is live, for prompt builders that only receive the disabled
|
|
@@ -71,6 +71,21 @@ export interface MCPConfig {
|
|
|
71
71
|
* a constrained / locked-down mount.
|
|
72
72
|
*/
|
|
73
73
|
builtinCrossAppTools?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* `"app"` serves exactly the app's own tool registry, flat: every action the
|
|
76
|
+
* in-app agent holds, and nothing the in-app agent does not — no cross-app
|
|
77
|
+
* builtins, no `ask-agent`, no `tool-search`, and no compact/connector
|
|
78
|
+
* trimming. `connectorCatalog`, the compact default, and the
|
|
79
|
+
* `--full-catalog` / `AGENT_NATIVE_MCP_FULL_CATALOG` opt-ins are all inert
|
|
80
|
+
* on this mode; `externalAgents.denyActions` and the OAuth scope filter
|
|
81
|
+
* still apply, because both are explicit removals rather than tiering.
|
|
82
|
+
*
|
|
83
|
+
* The dev-open surface split is deliberately NOT bypassed: an
|
|
84
|
+
* unauthenticated loopback probe still gets `actions`, not
|
|
85
|
+
* `productionActions`. Parity is with the app's agent for a real
|
|
86
|
+
* authenticated caller, not an escalation for anonymous ones.
|
|
87
|
+
*/
|
|
88
|
+
catalogMode?: "app";
|
|
74
89
|
/**
|
|
75
90
|
* Curated allow-list of action names served to **external connector** clients
|
|
76
91
|
* on a hosted multi-tenant deployment.
|