@fitchmultz/pi-mcp-adapter 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +12 -8
- package/dist/app-bridge.bundle.js +14 -14
- package/dist/config.js +41 -16
- package/dist/gateway-arguments.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lifecycle.d.ts +2 -2
- package/dist/lifecycle.js +2 -2
- package/dist/mcp-auth-flow.js +2 -2
- package/dist/mcp-auth.d.ts +1 -1
- package/dist/mcp-auth.js +3 -3
- package/dist/mcp-code.d.ts +6 -6
- package/dist/mcp-code.js +11 -10
- package/dist/mcp-oauth-provider.d.ts +5 -5
- package/dist/mcp-oauth-provider.js +5 -5
- package/dist/mcp-output-guard.d.ts +1 -1
- package/dist/mcp-panel.d.ts +2 -2
- package/dist/mcp-panel.js +2 -2
- package/dist/mcp-setup-panel.d.ts +5 -4
- package/dist/mcp-setup-panel.js +15 -7
- package/dist/mcp-trace.d.ts +1 -1
- package/dist/mcp-trace.js +1 -1
- package/dist/npx-resolver.js +8 -4
- package/dist/proxy-modes.d.ts +2 -2
- package/dist/proxy-modes.js +9 -9
- package/dist/sampling-handler.js +1 -0
- package/dist/search-ranking.js +6 -2
- package/dist/server-manager.d.ts +2 -2
- package/dist/server-manager.js +44 -27
- package/dist/session-recovery.d.ts +7 -4
- package/dist/session-recovery.js +76 -10
- package/dist/tool-metadata.d.ts +43 -43
- package/dist/tool-result-renderer.d.ts +3 -3
- package/dist/tool-result-renderer.js +3 -3
- package/dist/ui-resource-handler.d.ts +2 -2
- package/dist/ui-resource-handler.js +2 -2
- package/dist/ui-server.js +4 -3
- package/dist/ui-stream-types.d.ts +8 -8
- package/dist/unix-socket-transport.d.ts +1 -1
- package/dist/unix-socket-transport.js +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +14 -0
- package/package.json +34 -98
- package/abort.ts +0 -34
- package/agent-dir.ts +0 -24
- package/app-bridge.bundle.js +0 -109
- package/banner.png +0 -0
- package/checkpoint.ts +0 -55
- package/commands.ts +0 -622
- package/config.ts +0 -1204
- package/consent-manager.ts +0 -25
- package/direct-tools.ts +0 -75
- package/elicitation-handler.ts +0 -349
- package/error-signal.ts +0 -21
- package/gateway-arguments.ts +0 -73
- package/glimpse-ui.ts +0 -80
- package/host-html-template.ts +0 -456
- package/index.ts +0 -767
- package/init.ts +0 -613
- package/legacy-migration.ts +0 -47
- package/lifecycle.ts +0 -165
- package/logger.ts +0 -127
- package/mcp-auth-flow.ts +0 -975
- package/mcp-auth.ts +0 -793
- package/mcp-callback-server.ts +0 -450
- package/mcp-code.ts +0 -412
- package/mcp-keyring-helper.cjs +0 -89
- package/mcp-oauth-provider.ts +0 -774
- package/mcp-output-guard.ts +0 -530
- package/mcp-panel.ts +0 -907
- package/mcp-script-worker.mjs +0 -131
- package/mcp-setup-panel.ts +0 -666
- package/mcp-status.ts +0 -110
- package/mcp-trace.ts +0 -295
- package/metadata-cache.ts +0 -271
- package/npx-resolver.ts +0 -488
- package/onboarding-state.ts +0 -58
- package/panel-keys.ts +0 -37
- package/prompts.ts +0 -337
- package/proxy-modes.ts +0 -1109
- package/resource-tools.ts +0 -52
- package/runtime-owner.ts +0 -123
- package/sampling-handler.ts +0 -276
- package/scripts/build-app-bridge.mjs +0 -15
- package/scripts/build.mjs +0 -132
- package/scripts/prepare.mjs +0 -103
- package/search-ranking.ts +0 -132
- package/server-manager.ts +0 -1320
- package/session-recovery.ts +0 -316
- package/state.ts +0 -64
- package/tool-approval.ts +0 -78
- package/tool-loader.ts +0 -153
- package/tool-metadata.ts +0 -240
- package/tool-registrar.ts +0 -74
- package/tool-result-renderer.ts +0 -294
- package/tsconfig.build.json +0 -13
- package/tsconfig.json +0 -16
- package/types.ts +0 -785
- package/ui-resource-handler.ts +0 -249
- package/ui-server.ts +0 -808
- package/ui-session.ts +0 -568
- package/ui-stream-types.ts +0 -89
- package/ui-tool-visibility.ts +0 -25
- package/unix-socket-transport.ts +0 -85
- package/utils.ts +0 -307
package/types.ts
DELETED
|
@@ -1,785 +0,0 @@
|
|
|
1
|
-
// types.ts - Core type definitions
|
|
2
|
-
import type { Transport as McpTransport } from "@modelcontextprotocol/client";
|
|
3
|
-
import type {
|
|
4
|
-
ContentBlock as McpContentBlock,
|
|
5
|
-
ListPromptsResult,
|
|
6
|
-
ListResourcesResult,
|
|
7
|
-
ListToolsResult,
|
|
8
|
-
} from "@modelcontextprotocol/client";
|
|
9
|
-
import type { TextContent, ImageContent } from "@earendil-works/pi-ai";
|
|
10
|
-
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
11
|
-
import type { UiStreamMode } from "./ui-stream-types.ts";
|
|
12
|
-
import type { UiToolVisibility } from "./ui-tool-visibility.ts";
|
|
13
|
-
|
|
14
|
-
export type Transport = McpTransport;
|
|
15
|
-
|
|
16
|
-
/** Versioned shared-event-bus channel for read-only MCP runtime snapshots. */
|
|
17
|
-
export const MCP_STATUS_EVENT = "fitch-mcp-adapter/status/v1";
|
|
18
|
-
|
|
19
|
-
export const MCP_STATUS_SNAPSHOT_VERSION = 1 as const;
|
|
20
|
-
|
|
21
|
-
export type McpServerRuntimeStatus =
|
|
22
|
-
| "connected"
|
|
23
|
-
| "cached"
|
|
24
|
-
| "failed"
|
|
25
|
-
| "needs-auth"
|
|
26
|
-
| "not-connected"
|
|
27
|
-
| "disabled";
|
|
28
|
-
|
|
29
|
-
export interface McpServerStatusSnapshot {
|
|
30
|
-
readonly name: string;
|
|
31
|
-
readonly status: McpServerRuntimeStatus;
|
|
32
|
-
readonly toolCount: number;
|
|
33
|
-
/** False means the server has not been discovered, rather than an empty inventory. */
|
|
34
|
-
readonly catalogKnown?: boolean;
|
|
35
|
-
readonly resourceCount?: number;
|
|
36
|
-
readonly failedAgoSeconds?: number;
|
|
37
|
-
readonly disabled: boolean;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface McpStatusSnapshot {
|
|
41
|
-
readonly version: typeof MCP_STATUS_SNAPSHOT_VERSION;
|
|
42
|
-
readonly servers: ReadonlyArray<McpServerStatusSnapshot>;
|
|
43
|
-
readonly totalTools: number;
|
|
44
|
-
readonly totalResources: number;
|
|
45
|
-
readonly connectedCount: number;
|
|
46
|
-
readonly disabledCount: number;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Import sources for config
|
|
50
|
-
export type ImportKind =
|
|
51
|
-
| "cursor"
|
|
52
|
-
| "claude-code"
|
|
53
|
-
| "claude-desktop"
|
|
54
|
-
| "codex"
|
|
55
|
-
| "opencode"
|
|
56
|
-
| "windsurf"
|
|
57
|
-
| "vscode";
|
|
58
|
-
|
|
59
|
-
type SdkTool = ListToolsResult["tools"][number];
|
|
60
|
-
type SdkResource = ListResourcesResult["resources"][number];
|
|
61
|
-
type SdkPrompt = ListPromptsResult["prompts"][number];
|
|
62
|
-
type SdkPromptArgument = NonNullable<SdkPrompt["arguments"]>[number];
|
|
63
|
-
|
|
64
|
-
// Legacy cache records may omit inputSchema; otherwise retain the native descriptor.
|
|
65
|
-
export interface McpTool extends Omit<SdkTool, "inputSchema"> {
|
|
66
|
-
inputSchema?: SdkTool["inputSchema"];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export type McpResource = SdkResource;
|
|
70
|
-
|
|
71
|
-
export interface McpPromptArgument {
|
|
72
|
-
name: SdkPromptArgument["name"];
|
|
73
|
-
description?: SdkPromptArgument["description"];
|
|
74
|
-
required?: SdkPromptArgument["required"];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface McpPrompt {
|
|
78
|
-
name: SdkPrompt["name"];
|
|
79
|
-
title?: SdkPrompt["title"];
|
|
80
|
-
description?: SdkPrompt["description"];
|
|
81
|
-
arguments?: SdkPrompt["arguments"];
|
|
82
|
-
_meta?: SdkPrompt["_meta"];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface UiResourceMeta {
|
|
86
|
-
csp?: UiResourceCsp;
|
|
87
|
-
permissions?: UiResourcePermissions;
|
|
88
|
-
domain?: string;
|
|
89
|
-
prefersBorder?: boolean;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface UiResourceContent {
|
|
93
|
-
uri: string;
|
|
94
|
-
html: string;
|
|
95
|
-
mimeType?: string;
|
|
96
|
-
meta: UiResourceMeta;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface UiProxyRequestBody<TParams> {
|
|
100
|
-
token: string;
|
|
101
|
-
params: TParams;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface UiProxyResult<T = Record<string, unknown>> {
|
|
105
|
-
ok: boolean;
|
|
106
|
-
result?: T;
|
|
107
|
-
error?: string;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface UiResourceCsp {
|
|
111
|
-
resourceDomains?: string[];
|
|
112
|
-
connectDomains?: string[];
|
|
113
|
-
frameDomains?: string[];
|
|
114
|
-
baseUriDomains?: string[];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface UiResourcePermissions {
|
|
118
|
-
camera?: {};
|
|
119
|
-
microphone?: {};
|
|
120
|
-
geolocation?: {};
|
|
121
|
-
clipboardWrite?: {};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export interface UiToolInfo {
|
|
125
|
-
id?: string | number;
|
|
126
|
-
tool: {
|
|
127
|
-
name: string;
|
|
128
|
-
description?: string;
|
|
129
|
-
inputSchema?: unknown;
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface UiHostContext {
|
|
134
|
-
toolInfo?: UiToolInfo;
|
|
135
|
-
theme?: "light" | "dark";
|
|
136
|
-
styles?: Record<string, unknown>;
|
|
137
|
-
displayMode?: UiDisplayMode;
|
|
138
|
-
availableDisplayModes?: UiDisplayMode[];
|
|
139
|
-
containerDimensions?: {
|
|
140
|
-
width?: number;
|
|
141
|
-
maxWidth?: number;
|
|
142
|
-
height?: number;
|
|
143
|
-
maxHeight?: number;
|
|
144
|
-
};
|
|
145
|
-
[key: string]: unknown;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export type UiDisplayMode = "inline" | "fullscreen" | "pip";
|
|
149
|
-
|
|
150
|
-
// Re-export stream types from the shared lightweight module.
|
|
151
|
-
// This allows the example package to import stream schemas without pulling the full types.ts dependency graph.
|
|
152
|
-
export {
|
|
153
|
-
UI_STREAM_HOST_CONTEXT_KEY,
|
|
154
|
-
UI_STREAM_REQUEST_META_KEY,
|
|
155
|
-
UI_STREAM_RESULT_PATCH_METHOD,
|
|
156
|
-
SERVER_STREAM_RESULT_PATCH_METHOD,
|
|
157
|
-
UI_STREAM_STRUCTURED_CONTENT_KEY,
|
|
158
|
-
uiStreamModeSchema,
|
|
159
|
-
visualizationStreamPhaseSchema,
|
|
160
|
-
visualizationStreamFrameTypeSchema,
|
|
161
|
-
visualizationStreamStatusSchema,
|
|
162
|
-
uiStreamHostContextSchema,
|
|
163
|
-
visualizationStreamEnvelopeSchema,
|
|
164
|
-
uiStreamCallToolResultSchema,
|
|
165
|
-
uiStreamResultPatchNotificationSchema,
|
|
166
|
-
serverStreamResultPatchNotificationSchema,
|
|
167
|
-
getUiStreamHostContext,
|
|
168
|
-
getVisualizationStreamEnvelope,
|
|
169
|
-
type UiStreamMode,
|
|
170
|
-
type VisualizationStreamPhase,
|
|
171
|
-
type VisualizationStreamFrameType,
|
|
172
|
-
type VisualizationStreamStatus,
|
|
173
|
-
type UiStreamHostContext,
|
|
174
|
-
type VisualizationStreamEnvelope,
|
|
175
|
-
type UiStreamCallToolResult,
|
|
176
|
-
type UiStreamResultPatchNotification,
|
|
177
|
-
type ServerStreamResultPatchNotification,
|
|
178
|
-
type UiStreamSummary,
|
|
179
|
-
} from "./ui-stream-types.ts";
|
|
180
|
-
|
|
181
|
-
export interface UiMessageParams {
|
|
182
|
-
role?: string;
|
|
183
|
-
content?: unknown[];
|
|
184
|
-
type?: "prompt" | "notify" | "intent" | "message";
|
|
185
|
-
message?: string;
|
|
186
|
-
prompt?: string;
|
|
187
|
-
intent?: string;
|
|
188
|
-
params?: Record<string, unknown>;
|
|
189
|
-
[key: string]: unknown;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Extract prompt text from either legacy MCP UI message shapes or native AppBridge user messages.
|
|
194
|
-
*/
|
|
195
|
-
export function extractUiPromptText(params: UiMessageParams): string | undefined {
|
|
196
|
-
if (params.type === "prompt" || params.prompt) {
|
|
197
|
-
const prompt = params.prompt ?? String(params.message ?? "");
|
|
198
|
-
return prompt || undefined;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (params.role === "user" && Array.isArray(params.content)) {
|
|
202
|
-
const text = params.content
|
|
203
|
-
.map((block) => (block && typeof block === "object" && "text" in block ? String((block as { text?: unknown }).text ?? "") : ""))
|
|
204
|
-
.filter(Boolean)
|
|
205
|
-
.join("\n\n");
|
|
206
|
-
return text || undefined;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return undefined;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Structured UI handoff recovered from a canonical prompt envelope.
|
|
214
|
-
*/
|
|
215
|
-
export interface UiPromptHandoff {
|
|
216
|
-
intent: string;
|
|
217
|
-
params: Record<string, unknown>;
|
|
218
|
-
raw: string;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Parse a canonical named UI handoff encoded as `intent\n{json}`.
|
|
223
|
-
*/
|
|
224
|
-
export function parseUiPromptHandoff(prompt: string): UiPromptHandoff | undefined {
|
|
225
|
-
const newlineIndex = prompt.indexOf("\n");
|
|
226
|
-
if (newlineIndex <= 0) {
|
|
227
|
-
return undefined;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const intent = prompt.slice(0, newlineIndex).trim();
|
|
231
|
-
const payloadText = prompt.slice(newlineIndex + 1).trim();
|
|
232
|
-
if (!intent || !payloadText) {
|
|
233
|
-
return undefined;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
if (!/^[A-Za-z][A-Za-z0-9_-]*$/.test(intent)) {
|
|
237
|
-
return undefined;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
try {
|
|
241
|
-
const parsed = JSON.parse(payloadText);
|
|
242
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
243
|
-
return undefined;
|
|
244
|
-
}
|
|
245
|
-
return {
|
|
246
|
-
intent,
|
|
247
|
-
params: parsed as Record<string, unknown>,
|
|
248
|
-
raw: prompt,
|
|
249
|
-
};
|
|
250
|
-
} catch {
|
|
251
|
-
return undefined;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Accumulated messages from a UI session.
|
|
257
|
-
* Collected during the session and available when it ends.
|
|
258
|
-
*/
|
|
259
|
-
export interface UiSessionMessages {
|
|
260
|
-
prompts: string[];
|
|
261
|
-
notifications: string[];
|
|
262
|
-
intents: Array<{ intent: string; params?: Record<string, unknown> }>;
|
|
263
|
-
contexts: UiModelContextUpdate[];
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
export interface UiModelContextUpdate {
|
|
267
|
-
summary: string;
|
|
268
|
-
truncated: boolean;
|
|
269
|
-
payload?: Record<string, unknown>;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export interface UiModelContextParams {
|
|
273
|
-
content?: McpContentBlock[];
|
|
274
|
-
structuredContent?: Record<string, unknown>;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export function createUiModelContextUpdate(params: UiModelContextParams, maxChars = 12_000): UiModelContextUpdate | undefined {
|
|
278
|
-
const payload = Object.fromEntries(
|
|
279
|
-
Object.entries(params).filter(([, value]) => value !== undefined),
|
|
280
|
-
);
|
|
281
|
-
if (Object.keys(payload).length === 0) return undefined;
|
|
282
|
-
|
|
283
|
-
const serialized = JSON.stringify(payload);
|
|
284
|
-
if (serialized.length <= maxChars) {
|
|
285
|
-
return { payload, summary: serialized, truncated: false };
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
return {
|
|
289
|
-
summary: `${serialized.slice(0, Math.max(0, maxChars - 1))}…`,
|
|
290
|
-
truncated: true,
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
export interface UiOpenLinkResult {
|
|
295
|
-
isError?: boolean;
|
|
296
|
-
[key: string]: unknown;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export interface UiDisplayModeRequest {
|
|
300
|
-
mode?: UiDisplayMode;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
export interface UiDisplayModeResult {
|
|
304
|
-
mode: UiDisplayMode;
|
|
305
|
-
[key: string]: unknown;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
// Content types from MCP
|
|
309
|
-
export interface McpContent {
|
|
310
|
-
type: "text" | "image" | "audio" | "resource" | "resource_link";
|
|
311
|
-
text?: string;
|
|
312
|
-
data?: string;
|
|
313
|
-
mimeType?: string;
|
|
314
|
-
resource?: {
|
|
315
|
-
uri: string;
|
|
316
|
-
text?: string;
|
|
317
|
-
blob?: string;
|
|
318
|
-
};
|
|
319
|
-
uri?: string;
|
|
320
|
-
name?: string;
|
|
321
|
-
description?: string;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// Pi content block type
|
|
325
|
-
export type ContentBlock = TextContent | ImageContent;
|
|
326
|
-
|
|
327
|
-
/** Native private_key_jwt authentication; public verification keys are provisioned separately. */
|
|
328
|
-
export interface OAuthPrivateKeyJwtConfig {
|
|
329
|
-
/** PKCS#8 PEM, JWK object/JSON, or an existing environment/!command source. Resolved only when signing. */
|
|
330
|
-
privateKey: string | Record<string, unknown>;
|
|
331
|
-
/** Asymmetric JOSE algorithm, such as ES256, RS256, PS256 or EdDSA (JWK only). */
|
|
332
|
-
algorithm: string;
|
|
333
|
-
/** JWT audience override only; defaults to the discovered issuer, then token URL. */
|
|
334
|
-
audience?: string;
|
|
335
|
-
/** Positive integer assertion lifetime in seconds; native default is 300. */
|
|
336
|
-
lifetimeSeconds?: number;
|
|
337
|
-
/** Additional claims. Native iss/sub/aud/iat/exp/jti always take precedence. */
|
|
338
|
-
claims?: Record<string, unknown>;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/** Enterprise OIDC token exchange. IdP credentials are separate from the MCP client identity. */
|
|
342
|
-
export interface OAuthCrossAppAccessConfig {
|
|
343
|
-
/** IdP issuer used by native discovery. */
|
|
344
|
-
idpUrl: string;
|
|
345
|
-
/** IdP client ID, not the outer MCP clientId. */
|
|
346
|
-
clientId: string;
|
|
347
|
-
/** Existing OIDC ID token; environment/!command sources are resolved for each exchange. */
|
|
348
|
-
idToken: string;
|
|
349
|
-
/** Optional IdP client_secret_post credential, also resolved lazily. */
|
|
350
|
-
clientSecret?: string;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
export function isNonInteractiveOAuth(config: OAuthConfig | false | undefined): boolean {
|
|
354
|
-
return !!config && (config.grantType === "client_credentials" || config.crossAppAccess !== undefined);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
// OAuth configuration (SDK handles discovery and client registration)
|
|
358
|
-
export interface OAuthConfig {
|
|
359
|
-
/** Skip only authorization-server metadata issuer validation. Defaults to false. */
|
|
360
|
-
skipIssuerMetadataValidation?: boolean;
|
|
361
|
-
/** OAuth grant type (defaults to authorization_code) */
|
|
362
|
-
grantType?: "authorization_code" | "client_credentials";
|
|
363
|
-
/** Pre-registered client ID; takes priority over stored clients, CIMD and dynamic registration. */
|
|
364
|
-
clientId?: string;
|
|
365
|
-
/** Client secret for confidential clients */
|
|
366
|
-
clientSecret?: string;
|
|
367
|
-
/** Private-key authentication instead of clientSecret; requires clientId or a custom clientMetadataUrl. */
|
|
368
|
-
privateKeyJwt?: OAuthPrivateKeyJwtConfig;
|
|
369
|
-
/** Noninteractive ID-token -> ID-JAG -> MCP access token flow; omit grantType. */
|
|
370
|
-
crossAppAccess?: OAuthCrossAppAccessConfig;
|
|
371
|
-
/** Requested OAuth scopes */
|
|
372
|
-
scope?: string;
|
|
373
|
-
/** Extra authorization URL parameters for provider-specific extensions. Flow-owned parameters cannot be overridden. */
|
|
374
|
-
authorizationParams?: Record<string, string>;
|
|
375
|
-
/** Exact authorization-code redirect URI for pre-registered clients */
|
|
376
|
-
redirectUri?: string;
|
|
377
|
-
/** Client display name for dynamic registration */
|
|
378
|
-
clientName?: string;
|
|
379
|
-
/** Client homepage URI for dynamic registration */
|
|
380
|
-
clientUri?: string;
|
|
381
|
-
/** Client metadata document URL. Eligible browser clients default to Pi MCP Adapter's shared identity; false opts out for new registrations. Stored clients keep priority. */
|
|
382
|
-
clientMetadataUrl?: string | false;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
// Server configuration
|
|
386
|
-
export interface ServerEntry {
|
|
387
|
-
command?: string;
|
|
388
|
-
args?: string[];
|
|
389
|
-
/** Explicit rmcp-mux Unix-domain socket path. Mutually exclusive with command and url. */
|
|
390
|
-
socket?: string;
|
|
391
|
-
env?: Record<string, string>;
|
|
392
|
-
cwd?: string;
|
|
393
|
-
/** HTTP defaults to auto negotiation; stdio/socket default to legacy. */
|
|
394
|
-
protocolVersion?: "auto" | "legacy";
|
|
395
|
-
/** Trust explicit readOnlyHint/idempotentHint annotations for one modern transport retry. Defaults to false. */
|
|
396
|
-
retryOnTransportFailure?: boolean;
|
|
397
|
-
// HTTP fields
|
|
398
|
-
url?: string;
|
|
399
|
-
headers?: Record<string, string>;
|
|
400
|
-
/**
|
|
401
|
-
* Authentication type:
|
|
402
|
-
* - 'oauth' - Use OAuth 2.1 (auto-discovers endpoints, supports dynamic client registration)
|
|
403
|
-
* - 'bearer' - Use static Bearer token
|
|
404
|
-
* - false - Disable authentication
|
|
405
|
-
* If not specified and url is present, OAuth will be auto-detected unless custom headers are configured
|
|
406
|
-
*/
|
|
407
|
-
auth?: "oauth" | "bearer" | false;
|
|
408
|
-
bearerToken?: string;
|
|
409
|
-
bearerTokenEnv?: string;
|
|
410
|
-
/**
|
|
411
|
-
* OAuth configuration (optional).
|
|
412
|
-
* Eligible browser clients use the shared client metadata document when supported, otherwise dynamic registration.
|
|
413
|
-
* Set to false to explicitly disable OAuth for this server.
|
|
414
|
-
*/
|
|
415
|
-
oauth?: OAuthConfig | false;
|
|
416
|
-
lifecycle?: "keep-alive" | "lazy" | "lazy-keep-alive" | "eager";
|
|
417
|
-
idleTimeout?: number; // minutes, overrides global setting
|
|
418
|
-
requestTimeoutMs?: number; // milliseconds, overrides global request timeout when > 0
|
|
419
|
-
// Resource handling
|
|
420
|
-
exposeResources?: boolean;
|
|
421
|
-
// Direct tool registration
|
|
422
|
-
directTools?: boolean | string[];
|
|
423
|
-
// Override settings.toolPrefix for this server.
|
|
424
|
-
toolPrefix?: ToolPrefix;
|
|
425
|
-
// Include/exclude specific MCP tools/resources by original or prefixed name
|
|
426
|
-
includeTools?: string[];
|
|
427
|
-
excludeTools?: string[];
|
|
428
|
-
// Require interactive approval before calling matching MCP tools/resources.
|
|
429
|
-
approveTools?: boolean | string[];
|
|
430
|
-
// Debug
|
|
431
|
-
debug?: boolean; // Show server stderr (default: false)
|
|
432
|
-
/** Enable metadata-only JSONL protocol tracing for this server. */
|
|
433
|
-
trace?: boolean;
|
|
434
|
-
// Keep configuration visible without allowing connections or execution.
|
|
435
|
-
disabled?: boolean;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
/** Validate protocol options for both file and in-memory configurations. */
|
|
439
|
-
export function validateServerProtocolConfig(definition: ServerEntry): void {
|
|
440
|
-
if (definition.protocolVersion !== undefined && definition.protocolVersion !== "auto" && definition.protocolVersion !== "legacy") {
|
|
441
|
-
throw new Error("protocolVersion must be auto or legacy");
|
|
442
|
-
}
|
|
443
|
-
if (definition.retryOnTransportFailure !== undefined && typeof definition.retryOnTransportFailure !== "boolean") {
|
|
444
|
-
throw new Error("retryOnTransportFailure must be a boolean");
|
|
445
|
-
}
|
|
446
|
-
if (definition.oauth && definition.oauth.skipIssuerMetadataValidation !== undefined
|
|
447
|
-
&& typeof definition.oauth.skipIssuerMetadataValidation !== "boolean") {
|
|
448
|
-
throw new Error("oauth.skipIssuerMetadataValidation must be a boolean");
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
/** Only the literal boolean `true` disables a server. */
|
|
453
|
-
export function isServerDisabled(definition: ServerEntry | undefined): boolean {
|
|
454
|
-
return definition?.disabled === true;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// Output guard tuning (settings.outputGuard object form)
|
|
458
|
-
export interface McpOutputGuardSettings {
|
|
459
|
-
/** Maximum inline MCP text output bytes before truncation/spill-to-disk. Defaults to 51200 (50 KiB). */
|
|
460
|
-
maxBytes?: number;
|
|
461
|
-
/** Maximum inline MCP text output lines before truncation/spill-to-disk. Defaults to 2000. */
|
|
462
|
-
maxLines?: number;
|
|
463
|
-
/** Maximum details.mcpResult JSON bytes kept raw; larger results are summarized and spilled to disk. Defaults to 16384 (16 KiB). */
|
|
464
|
-
detailsMaxBytes?: number;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
// Settings
|
|
468
|
-
export type ToolPrefix = "server" | "none" | "short" | "mcp";
|
|
469
|
-
export type HostConfigDiscovery = "off" | "on";
|
|
470
|
-
export type McpFooterStatus = "full" | "compact" | "off";
|
|
471
|
-
|
|
472
|
-
export interface McpTraceSettings {
|
|
473
|
-
/** Enable tracing for all servers unless a server sets trace to false. */
|
|
474
|
-
enabled?: boolean;
|
|
475
|
-
/** JSONL destination; relative paths are resolved from the session cwd. */
|
|
476
|
-
file?: string;
|
|
477
|
-
/** Maximum per-session trace file size in bytes. */
|
|
478
|
-
maxBytes?: number;
|
|
479
|
-
/** Maximum events retained in the per-session trace file. */
|
|
480
|
-
maxEvents?: number;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
export interface McpSettings {
|
|
484
|
-
toolPrefix?: ToolPrefix;
|
|
485
|
-
/** Show the plug prefix in MCP status and connection text (default: true). Set to false to disable it. */
|
|
486
|
-
showStatusIcon?: boolean;
|
|
487
|
-
/** Footer status verbosity: full details, compact connected/enabled count, or no footer status. Defaults to compact. */
|
|
488
|
-
mcpFooterStatus?: McpFooterStatus;
|
|
489
|
-
/** Discover detected host-specific MCP configs only when explicitly enabled. */
|
|
490
|
-
hostConfigDiscovery?: HostConfigDiscovery;
|
|
491
|
-
idleTimeout?: number; // minutes, default 10, 0 to disable
|
|
492
|
-
requestTimeoutMs?: number; // milliseconds, overrides the SDK request timeout when > 0
|
|
493
|
-
directTools?: boolean;
|
|
494
|
-
/** Register the trusted MCP-only JavaScript scripting tool. Defaults to true; set false to hide it. */
|
|
495
|
-
scriptMode?: boolean;
|
|
496
|
-
/** Default approval gate for matching tools/resources; per-server settings override it. */
|
|
497
|
-
approveTools?: boolean | string[];
|
|
498
|
-
disableProxyTool?: boolean;
|
|
499
|
-
/** Freeze direct-tool registration after the initial sync. Automatic metadata updates
|
|
500
|
-
* (reconnects, lazy-connect, tool-list-changed) won't rebuild the system prompt,
|
|
501
|
-
* preserving the prompt-cache prefix. The agent rediscovers explicitly via
|
|
502
|
-
* mcp({ action: "connect", server: "server" }). Default: false. */
|
|
503
|
-
freezeDirectTools?: boolean;
|
|
504
|
-
autoAuth?: boolean;
|
|
505
|
-
sampling?: boolean;
|
|
506
|
-
samplingAutoApprove?: boolean;
|
|
507
|
-
elicitation?: boolean;
|
|
508
|
-
/**
|
|
509
|
-
* Guard oversized MCP tool/resource output before it is returned to the model.
|
|
510
|
-
* Defaults to true (50 KiB / 2,000 lines inline text, 16 KiB details.mcpResult).
|
|
511
|
-
* Set to false to restore raw MCP output behavior, or pass an object to tune
|
|
512
|
-
* the limits. Env kill switch: MCP_OUTPUT_GUARD=0.
|
|
513
|
-
*/
|
|
514
|
-
outputGuard?: boolean | McpOutputGuardSettings;
|
|
515
|
-
/**
|
|
516
|
-
* Opt-in metadata-only MCP protocol tracing. Payloads, prompts, tool
|
|
517
|
-
* arguments/results, authorization data, and URLs are never persisted.
|
|
518
|
-
*/
|
|
519
|
-
trace?: McpTraceSettings;
|
|
520
|
-
/**
|
|
521
|
-
* Message returned in tool results when a server needs (re-)authentication.
|
|
522
|
-
* "${server}" is substituted with the server name. Defaults to a TUI
|
|
523
|
-
* instruction when unset.
|
|
524
|
-
*/
|
|
525
|
-
authRequiredMessage?: string;
|
|
526
|
-
/**
|
|
527
|
-
* Parent of the fitch-mcp-adapter/ legacy OAuth import directory.
|
|
528
|
-
* Relative paths resolve from the project root (cwd). Explicit v4 migration
|
|
529
|
-
* reads the original directory; runtime never consumes those source files.
|
|
530
|
-
* FITCH_MCP_OAUTH_DIR overrides the final runtime import path.
|
|
531
|
-
* Persistent credentials live in the OS credential store. Plaintext files
|
|
532
|
-
* in the runtime import directory are imported once and removed.
|
|
533
|
-
*/
|
|
534
|
-
oauthDir?: string;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
// Root config
|
|
538
|
-
export interface McpConfig {
|
|
539
|
-
mcpServers: Record<string, ServerEntry>;
|
|
540
|
-
imports?: ImportKind[];
|
|
541
|
-
settings?: McpSettings;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
export interface McpToolCallIdentity {
|
|
545
|
-
/** Native Pi call ID; correlation only, never a provider idempotency key. */
|
|
546
|
-
toolCallId?: string;
|
|
547
|
-
/** Existing mcp_script IPC sequence ID, scoped to toolCallId. */
|
|
548
|
-
innerCallId?: number;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
export type McpToolCallEvent = McpToolCallIdentity & {
|
|
552
|
-
server: string;
|
|
553
|
-
tool: string;
|
|
554
|
-
args: Record<string, unknown>;
|
|
555
|
-
annotations?: McpTool["annotations"];
|
|
556
|
-
resourceUri?: string;
|
|
557
|
-
signal: AbortSignal;
|
|
558
|
-
} & (
|
|
559
|
-
| { phase: "before" }
|
|
560
|
-
| { phase: "after"; result: unknown }
|
|
561
|
-
| { phase: "after"; error: unknown }
|
|
562
|
-
);
|
|
563
|
-
|
|
564
|
-
/** Resolved operation facts before the service deadline; no connection/configuration objects. */
|
|
565
|
-
export type McpOperationContext = Omit<Extract<McpToolCallEvent, { phase: "before" }>, "phase" | "signal"> & {
|
|
566
|
-
/** The configured server opted into trusting annotations via retryOnTransportFailure. */
|
|
567
|
-
annotationsTrusted: boolean;
|
|
568
|
-
};
|
|
569
|
-
|
|
570
|
-
export interface McpAdapterOptions {
|
|
571
|
-
/** Awaited before the service deadline for each resolved call; operation is absent for other proxy modes. Honor ctx.signal. Selects native sequential sibling scheduling. */
|
|
572
|
-
beforeExecute?: (toolCallId: string, ctx: ExtensionContext, operation?: McpOperationContext) => Promise<void>;
|
|
573
|
-
config?: McpConfig;
|
|
574
|
-
configPath?: string;
|
|
575
|
-
/** Synchronously transform a clone of the resolved config once per session_start, before registration/initialization.
|
|
576
|
-
* The result is cloned for session ownership. Ambient config/trust and panels remain enabled unless config is supplied. */
|
|
577
|
-
transformConfig?: (config: McpConfig, ctx: ExtensionContext) => McpConfig;
|
|
578
|
-
/** Default overall mcp_script timeout: integer 1–2,147,483,647ms, or null to disable. Omit for 30,000ms. */
|
|
579
|
-
defaultScriptTimeoutMs?: number | null;
|
|
580
|
-
/** Parent directory for oversized text/raw results, including script output. Defaults to the system temp directory. */
|
|
581
|
-
outputDirectory?: string;
|
|
582
|
-
/** Awaited before dispatch and after its raw outcome, before any dependent script call. */
|
|
583
|
-
onToolCall?: (event: McpToolCallEvent) => Promise<void>;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
// Alias for clarity
|
|
587
|
-
export type ServerDefinition = ServerEntry;
|
|
588
|
-
|
|
589
|
-
export interface ToolMetadata extends Omit<McpTool, "name" | "description"> {
|
|
590
|
-
name: string; // Prefixed tool name (e.g., "xcodebuild_list_sims")
|
|
591
|
-
originalName: string; // Original MCP tool name (e.g., "list_sims")
|
|
592
|
-
description: string;
|
|
593
|
-
resourceUri?: string; // Legacy resource alias; new calls address server + URI.
|
|
594
|
-
resourceDescriptor?: McpResource;
|
|
595
|
-
uiResourceUri?: string; // For app-enabled tools: the UI resource URI
|
|
596
|
-
uiVisibility?: UiToolVisibility[];
|
|
597
|
-
uiStreamMode?: UiStreamMode;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
export interface PromptMetadata {
|
|
601
|
-
serverName: string;
|
|
602
|
-
originalName: string;
|
|
603
|
-
commandName: string;
|
|
604
|
-
title?: string;
|
|
605
|
-
description: string;
|
|
606
|
-
arguments: McpPromptArgument[];
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
export interface DirectToolSpec extends Omit<ToolMetadata, "name"> {
|
|
610
|
-
serverName: string;
|
|
611
|
-
prefixedName: string;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
export interface ServerProvenance {
|
|
615
|
-
path: string;
|
|
616
|
-
kind: "user" | "project" | "import";
|
|
617
|
-
importKind?: string;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
export interface McpAuthResult {
|
|
621
|
-
ok: boolean;
|
|
622
|
-
message?: string;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
export interface CachedTool extends McpTool {
|
|
626
|
-
// Version-1 caches stored flattened UI fields instead of the raw _meta.
|
|
627
|
-
uiResourceUri?: string;
|
|
628
|
-
uiVisibility?: UiToolVisibility[];
|
|
629
|
-
uiStreamMode?: UiStreamMode;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
export type CachedResource = McpResource;
|
|
633
|
-
|
|
634
|
-
export interface CachedPrompt {
|
|
635
|
-
name: string;
|
|
636
|
-
title?: string;
|
|
637
|
-
description?: string;
|
|
638
|
-
arguments?: { name: string; description?: string; required?: boolean }[];
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
export interface ServerCacheEntry {
|
|
642
|
-
configHash: string;
|
|
643
|
-
tools: CachedTool[];
|
|
644
|
-
resources: CachedResource[];
|
|
645
|
-
prompts?: CachedPrompt[];
|
|
646
|
-
instructions?: string;
|
|
647
|
-
cachedAt: number;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
export interface MetadataCache {
|
|
651
|
-
version: number;
|
|
652
|
-
servers: Record<string, ServerCacheEntry>;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
export interface McpPanelCallbacks {
|
|
656
|
-
reconnect: (serverName: string, afterAuth?: boolean) => Promise<boolean>;
|
|
657
|
-
canAuthenticate: (serverName: string) => boolean;
|
|
658
|
-
authenticate: (serverName: string) => Promise<McpAuthResult>;
|
|
659
|
-
getConnectionStatus: (serverName: string) => "connected" | "idle" | "failed" | "needs-auth" | "disabled";
|
|
660
|
-
getFailureMessage?: (serverName: string) => string | null;
|
|
661
|
-
refreshCacheAfterReconnect: (serverName: string) => ServerCacheEntry | null;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
export interface McpPanelResult {
|
|
665
|
-
changes: Map<string, true | string[] | false>;
|
|
666
|
-
cancelled: boolean;
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* Get server prefix based on tool prefix mode.
|
|
671
|
-
*/
|
|
672
|
-
export function getServerPrefix(
|
|
673
|
-
serverName: string,
|
|
674
|
-
mode: ToolPrefix
|
|
675
|
-
): string {
|
|
676
|
-
if (mode === "none") return "";
|
|
677
|
-
if (mode === "short") {
|
|
678
|
-
let short = serverName.replace(/-?mcp$/i, "").replace(/-/g, "_");
|
|
679
|
-
if (!short) short = "mcp";
|
|
680
|
-
return short;
|
|
681
|
-
}
|
|
682
|
-
if (mode === "mcp") return `mcp__${serverName.replace(/-/g, "_")}`;
|
|
683
|
-
return serverName.replace(/-/g, "_");
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
/**
|
|
687
|
-
* Format a tool name with server prefix.
|
|
688
|
-
*/
|
|
689
|
-
export function formatToolName(
|
|
690
|
-
toolName: string,
|
|
691
|
-
serverName: string,
|
|
692
|
-
prefix: ToolPrefix
|
|
693
|
-
): string {
|
|
694
|
-
const p = getServerPrefix(serverName, prefix);
|
|
695
|
-
const sanitized = toolName.replace(/\./g, "_");
|
|
696
|
-
return p ? `${p}_${sanitized}` : sanitized;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
export function resolveToolPrefix(
|
|
700
|
-
definition?: Pick<ServerEntry, "toolPrefix">,
|
|
701
|
-
globalPrefix?: ToolPrefix,
|
|
702
|
-
): ToolPrefix {
|
|
703
|
-
return definition?.toolPrefix ?? globalPrefix ?? "server";
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
export function sanitizePromptName(name: string): string {
|
|
707
|
-
const cleaned = name.replace(/[^A-Za-z0-9_-]+/g, "_").replace(/^[_-]+|[_-]+$/g, "");
|
|
708
|
-
if (!cleaned) return "prompt";
|
|
709
|
-
return /^[0-9]/.test(cleaned) ? `_${cleaned}` : cleaned;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
export function formatPromptCommandName(
|
|
713
|
-
promptName: string,
|
|
714
|
-
serverName: string,
|
|
715
|
-
prefix: ToolPrefix,
|
|
716
|
-
): string {
|
|
717
|
-
const serverPart = getServerPrefix(serverName, prefix) || serverName.replace(/-/g, "_") || "server";
|
|
718
|
-
return `mcp__${serverPart}__${sanitizePromptName(promptName)}`;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
function normalizeToolName(value: string): string {
|
|
722
|
-
return value.replace(/-/g, "_");
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
export function getToolNameCandidates(toolName: string, serverName: string, prefix: ToolPrefix): Set<string> {
|
|
726
|
-
return new Set<string>([
|
|
727
|
-
normalizeToolName(toolName),
|
|
728
|
-
normalizeToolName(formatToolName(toolName, serverName, prefix)),
|
|
729
|
-
normalizeToolName(formatToolName(toolName, serverName, "server")),
|
|
730
|
-
normalizeToolName(formatToolName(toolName, serverName, "short")),
|
|
731
|
-
normalizeToolName(formatToolName(toolName, serverName, "mcp")),
|
|
732
|
-
]);
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
function globToRegExp(pattern: string): RegExp {
|
|
736
|
-
const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
737
|
-
return new RegExp(`^${escaped}$`);
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
export function matchesToolPattern(candidates: Set<string>, patterns?: unknown): boolean {
|
|
741
|
-
if (!Array.isArray(patterns) || patterns.length === 0) return false;
|
|
742
|
-
|
|
743
|
-
for (const pattern of patterns) {
|
|
744
|
-
if (typeof pattern !== "string") continue;
|
|
745
|
-
const normalized = normalizeToolName(pattern);
|
|
746
|
-
if (!normalized.includes("*") && !normalized.includes("?") && candidates.has(normalized)) {
|
|
747
|
-
return true;
|
|
748
|
-
}
|
|
749
|
-
if ((normalized.includes("*") || normalized.includes("?")) && [...candidates].some(candidate => globToRegExp(normalized).test(candidate))) {
|
|
750
|
-
return true;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
return false;
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
export function isToolIncluded(
|
|
758
|
-
toolName: string,
|
|
759
|
-
serverName: string,
|
|
760
|
-
prefix: ToolPrefix,
|
|
761
|
-
includeTools?: unknown
|
|
762
|
-
): boolean {
|
|
763
|
-
if (!Array.isArray(includeTools) || includeTools.length === 0) return true;
|
|
764
|
-
return matchesToolPattern(getToolNameCandidates(toolName, serverName, prefix), includeTools);
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
export function isToolExcluded(
|
|
768
|
-
toolName: string,
|
|
769
|
-
serverName: string,
|
|
770
|
-
prefix: ToolPrefix,
|
|
771
|
-
excludeTools?: unknown
|
|
772
|
-
): boolean {
|
|
773
|
-
return matchesToolPattern(getToolNameCandidates(toolName, serverName, prefix), excludeTools);
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
export function isToolAllowed(
|
|
777
|
-
toolName: string,
|
|
778
|
-
serverName: string,
|
|
779
|
-
prefix: ToolPrefix,
|
|
780
|
-
includeTools?: unknown,
|
|
781
|
-
excludeTools?: unknown,
|
|
782
|
-
): boolean {
|
|
783
|
-
return isToolIncluded(toolName, serverName, prefix, includeTools)
|
|
784
|
-
&& !isToolExcluded(toolName, serverName, prefix, excludeTools);
|
|
785
|
-
}
|