@fitchmultz/pi-mcp-adapter 5.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 +750 -0
- package/LICENSE +21 -0
- package/OAUTH.md +462 -0
- package/README.md +820 -0
- package/abort.ts +34 -0
- package/agent-dir.ts +24 -0
- package/app-bridge.bundle.js +67 -0
- package/banner.png +0 -0
- package/checkpoint.ts +55 -0
- package/cli.js +222 -0
- package/commands.ts +619 -0
- package/config.ts +1204 -0
- package/consent-manager.ts +25 -0
- package/direct-tools.ts +408 -0
- package/dist/abort.d.ts +2 -0
- package/dist/abort.js +35 -0
- package/dist/agent-dir.d.ts +3 -0
- package/dist/agent-dir.js +21 -0
- package/dist/app-bridge.bundle.js +67 -0
- package/dist/checkpoint.d.ts +18 -0
- package/dist/checkpoint.js +53 -0
- package/dist/commands.d.ts +20 -0
- package/dist/commands.js +521 -0
- package/dist/config.d.ts +109 -0
- package/dist/config.js +1013 -0
- package/dist/consent-manager.d.ts +8 -0
- package/dist/consent-manager.js +21 -0
- package/dist/direct-tools.d.ts +10 -0
- package/dist/direct-tools.js +350 -0
- package/dist/docs/client-metadata.json +14 -0
- package/dist/elicitation-handler.d.ts +17 -0
- package/dist/elicitation-handler.js +308 -0
- package/dist/error-signal.d.ts +15 -0
- package/dist/error-signal.js +21 -0
- package/dist/glimpse-ui.d.ts +9 -0
- package/dist/glimpse-ui.js +75 -0
- package/dist/host-html-template.d.ts +15 -0
- package/dist/host-html-template.js +429 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +840 -0
- package/dist/init.d.ts +25 -0
- package/dist/init.js +562 -0
- package/dist/legacy-migration.d.ts +18 -0
- package/dist/legacy-migration.js +45 -0
- package/dist/lifecycle.d.ts +40 -0
- package/dist/lifecycle.js +167 -0
- package/dist/logger.d.ts +38 -0
- package/dist/logger.js +102 -0
- package/dist/mcp-auth-flow.d.ts +113 -0
- package/dist/mcp-auth-flow.js +834 -0
- package/dist/mcp-auth.d.ts +127 -0
- package/dist/mcp-auth.js +658 -0
- package/dist/mcp-callback-server.d.ts +56 -0
- package/dist/mcp-callback-server.js +371 -0
- package/dist/mcp-code.d.ts +51 -0
- package/dist/mcp-code.js +366 -0
- package/dist/mcp-keyring-helper.cjs +89 -0
- package/dist/mcp-oauth-provider.d.ts +154 -0
- package/dist/mcp-oauth-provider.js +672 -0
- package/dist/mcp-output-guard.d.ts +59 -0
- package/dist/mcp-output-guard.js +332 -0
- package/dist/mcp-panel.d.ts +66 -0
- package/dist/mcp-panel.js +889 -0
- package/dist/mcp-script-worker.mjs +128 -0
- package/dist/mcp-setup-panel.d.ts +84 -0
- package/dist/mcp-setup-panel.js +561 -0
- package/dist/mcp-status.d.ts +11 -0
- package/dist/mcp-status.js +96 -0
- package/dist/mcp-trace.d.ts +95 -0
- package/dist/mcp-trace.js +233 -0
- package/dist/metadata-cache.d.ts +18 -0
- package/dist/metadata-cache.js +277 -0
- package/dist/npx-resolver.d.ts +6 -0
- package/dist/npx-resolver.js +448 -0
- package/dist/onboarding-state.d.ts +11 -0
- package/dist/onboarding-state.js +47 -0
- package/dist/panel-keys.d.ts +16 -0
- package/dist/panel-keys.js +15 -0
- package/dist/prompts.d.ts +56 -0
- package/dist/prompts.js +284 -0
- package/dist/proxy-modes.d.ts +38 -0
- package/dist/proxy-modes.js +1235 -0
- package/dist/resource-tools.d.ts +1 -0
- package/dist/resource-tools.js +14 -0
- package/dist/runtime-owner.d.ts +18 -0
- package/dist/runtime-owner.js +117 -0
- package/dist/sampling-handler.d.ts +15 -0
- package/dist/sampling-handler.js +211 -0
- package/dist/search-ranking.d.ts +20 -0
- package/dist/search-ranking.js +180 -0
- package/dist/server-manager.d.ts +114 -0
- package/dist/server-manager.js +1175 -0
- package/dist/session-recovery.d.ts +31 -0
- package/dist/session-recovery.js +310 -0
- package/dist/state.d.ts +63 -0
- package/dist/state.js +1 -0
- package/dist/tool-approval.d.ts +10 -0
- package/dist/tool-approval.js +42 -0
- package/dist/tool-metadata.d.ts +9 -0
- package/dist/tool-metadata.js +193 -0
- package/dist/tool-registrar.d.ts +10 -0
- package/dist/tool-registrar.js +64 -0
- package/dist/tool-result-renderer.d.ts +45 -0
- package/dist/tool-result-renderer.js +224 -0
- package/dist/ts-shape.d.ts +2 -0
- package/dist/ts-shape.js +147 -0
- package/dist/types.d.ts +516 -0
- package/dist/types.js +168 -0
- package/dist/ui-resource-handler.d.ts +17 -0
- package/dist/ui-resource-handler.js +209 -0
- package/dist/ui-server.d.ts +51 -0
- package/dist/ui-server.js +669 -0
- package/dist/ui-session.d.ts +39 -0
- package/dist/ui-session.js +463 -0
- package/dist/ui-stream-types.d.ts +104 -0
- package/dist/ui-stream-types.js +58 -0
- package/dist/ui-tool-visibility.d.ts +4 -0
- package/dist/ui-tool-visibility.js +26 -0
- package/dist/unix-socket-transport.d.ts +15 -0
- package/dist/unix-socket-transport.js +84 -0
- package/dist/utils.d.ts +30 -0
- package/dist/utils.js +276 -0
- package/docs/client-metadata.json +14 -0
- package/elicitation-handler.ts +349 -0
- package/error-signal.ts +21 -0
- package/glimpse-ui.ts +80 -0
- package/host-html-template.ts +456 -0
- package/index.ts +900 -0
- package/init.ts +627 -0
- package/legacy-migration.ts +47 -0
- package/lifecycle.ts +165 -0
- package/logger.ts +127 -0
- package/mcp-auth-flow.ts +975 -0
- package/mcp-auth.ts +793 -0
- package/mcp-callback-server.ts +450 -0
- package/mcp-code.ts +386 -0
- package/mcp-keyring-helper.cjs +89 -0
- package/mcp-oauth-provider.ts +774 -0
- package/mcp-output-guard.ts +412 -0
- package/mcp-panel.ts +978 -0
- package/mcp-script-worker.mjs +128 -0
- package/mcp-setup-panel.ts +666 -0
- package/mcp-status.ts +109 -0
- package/mcp-trace.ts +295 -0
- package/metadata-cache.ts +333 -0
- package/npx-resolver.ts +488 -0
- package/onboarding-state.ts +58 -0
- package/package.json +182 -0
- package/panel-keys.ts +37 -0
- package/prompts.ts +337 -0
- package/proxy-modes.ts +1361 -0
- package/resource-tools.ts +17 -0
- package/runtime-owner.ts +123 -0
- package/sampling-handler.ts +273 -0
- package/scripts/build.mjs +131 -0
- package/scripts/prepare.mjs +102 -0
- package/search-ranking.ts +196 -0
- package/server-manager.ts +1320 -0
- package/session-recovery.ts +316 -0
- package/skills/mcp-scripting/SKILL.md +38 -0
- package/state.ts +64 -0
- package/tool-approval.ts +78 -0
- package/tool-metadata.ts +235 -0
- package/tool-registrar.ts +69 -0
- package/tool-result-renderer.ts +286 -0
- package/ts-shape.ts +145 -0
- package/tsconfig.build.json +13 -0
- package/tsconfig.json +16 -0
- package/types.ts +810 -0
- package/ui-resource-handler.ts +249 -0
- package/ui-server.ts +808 -0
- package/ui-session.ts +568 -0
- package/ui-stream-types.ts +89 -0
- package/ui-tool-visibility.ts +25 -0
- package/unix-socket-transport.ts +85 -0
- package/utils.ts +309 -0
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { type HostConfigDiscovery, type McpConfig, type ServerEntry, type ImportKind, type ServerProvenance } from "./types.ts";
|
|
2
|
+
export interface KnownServerPreset {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
summary: string;
|
|
6
|
+
entry: ServerEntry;
|
|
7
|
+
}
|
|
8
|
+
export declare const KNOWN_SERVER_PRESETS: readonly KnownServerPreset[];
|
|
9
|
+
interface ConfigSourceSpec {
|
|
10
|
+
id: "shared-global" | "agents-global" | "agents-nested-global" | "pi-global" | "shared-project" | "pi-project";
|
|
11
|
+
label: string;
|
|
12
|
+
readPath: string;
|
|
13
|
+
writePath: string;
|
|
14
|
+
kind: "user" | "project" | "import";
|
|
15
|
+
importKind?: string;
|
|
16
|
+
shared: boolean;
|
|
17
|
+
scope: "global" | "project";
|
|
18
|
+
}
|
|
19
|
+
export interface ConfigDiscoverySource {
|
|
20
|
+
id: ConfigSourceSpec["id"];
|
|
21
|
+
label: string;
|
|
22
|
+
path: string;
|
|
23
|
+
exists: boolean;
|
|
24
|
+
scope: ConfigSourceSpec["scope"];
|
|
25
|
+
kind: "shared" | "pi";
|
|
26
|
+
serverCount: number;
|
|
27
|
+
}
|
|
28
|
+
export interface ImportConfigSummary {
|
|
29
|
+
kind: ImportKind;
|
|
30
|
+
path: string;
|
|
31
|
+
serverCount: number;
|
|
32
|
+
}
|
|
33
|
+
export interface HostConfigSummary extends ImportConfigSummary {
|
|
34
|
+
active: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface McpConfigConflict {
|
|
37
|
+
serverName: string;
|
|
38
|
+
sources: Array<{
|
|
39
|
+
kind: "shared" | "pi" | "host";
|
|
40
|
+
path: string;
|
|
41
|
+
}>;
|
|
42
|
+
winner: {
|
|
43
|
+
kind: "shared" | "pi" | "host";
|
|
44
|
+
path: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface RepoPromptDiscovery {
|
|
48
|
+
configured: boolean;
|
|
49
|
+
configuredPath?: string;
|
|
50
|
+
executablePath?: string;
|
|
51
|
+
targetPath?: string;
|
|
52
|
+
serverName?: string;
|
|
53
|
+
entry?: ServerEntry;
|
|
54
|
+
}
|
|
55
|
+
export interface McpDiscoverySummary {
|
|
56
|
+
sources: ConfigDiscoverySource[];
|
|
57
|
+
imports: ImportConfigSummary[];
|
|
58
|
+
hostConfigs: HostConfigSummary[];
|
|
59
|
+
hostConfigDiscovery: HostConfigDiscovery;
|
|
60
|
+
conflicts: McpConfigConflict[];
|
|
61
|
+
hasAnyConfig: boolean;
|
|
62
|
+
hasAnyDetectedPaths: boolean;
|
|
63
|
+
hasSharedServers: boolean;
|
|
64
|
+
hasPiOwnedServers: boolean;
|
|
65
|
+
totalServerCount: number;
|
|
66
|
+
repoPrompt: RepoPromptDiscovery;
|
|
67
|
+
}
|
|
68
|
+
export interface ConfigWritePreview {
|
|
69
|
+
path: string;
|
|
70
|
+
existed: boolean;
|
|
71
|
+
changed: boolean;
|
|
72
|
+
beforeText: string;
|
|
73
|
+
afterText: string;
|
|
74
|
+
diffText: string;
|
|
75
|
+
}
|
|
76
|
+
export declare function getPiGlobalConfigPath(overridePath?: string): string;
|
|
77
|
+
export declare function getProjectConfigPath(cwd?: string): string;
|
|
78
|
+
export declare function getProjectPiConfigPath(cwd?: string): string;
|
|
79
|
+
export declare function getMcpDiscoverySummary(overridePath?: string, cwd?: string): McpDiscoverySummary;
|
|
80
|
+
export declare function cloneMcpConfig(config: McpConfig): McpConfig;
|
|
81
|
+
export interface LoadMcpConfigOptions {
|
|
82
|
+
includeProject?: boolean;
|
|
83
|
+
}
|
|
84
|
+
export declare function loadMcpConfig(overridePath?: string, cwd?: string, options?: LoadMcpConfigOptions): McpConfig;
|
|
85
|
+
export declare function isPathInsideProject(path: string, cwd: string): boolean;
|
|
86
|
+
export interface ServerDisabledOverrideResult {
|
|
87
|
+
path: string;
|
|
88
|
+
changed: boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Persist only the disabled field in the project Pi layer. Enabling writes an
|
|
92
|
+
* explicit false only when a lower-precedence source is itself disabled; this
|
|
93
|
+
* writer never copies a server definition or its credentials into the file.
|
|
94
|
+
*/
|
|
95
|
+
export declare function writeProjectServerDisabledOverride(overridePath: string | undefined, cwd: string, serverName: string, disabled: boolean): ServerDisabledOverrideResult;
|
|
96
|
+
export declare function previewCompatibilityImports(importKinds: ImportKind[], overridePath?: string): ConfigWritePreview;
|
|
97
|
+
export declare function ensureCompatibilityImports(importKinds: ImportKind[], overridePath?: string): {
|
|
98
|
+
path: string;
|
|
99
|
+
added: ImportKind[];
|
|
100
|
+
};
|
|
101
|
+
export declare function buildStarterProjectConfig(): McpConfig;
|
|
102
|
+
export declare function previewStarterProjectConfig(cwd?: string): ConfigWritePreview;
|
|
103
|
+
export declare function writeStarterProjectConfig(cwd?: string): string;
|
|
104
|
+
export declare function previewSharedServerEntry(filePath: string, serverName: string, entry: ServerEntry): ConfigWritePreview;
|
|
105
|
+
export declare function writeSharedServerEntry(filePath: string, serverName: string, entry: ServerEntry): string;
|
|
106
|
+
export declare function getServerProvenance(overridePath?: string, cwd?: string): Map<string, ServerProvenance>;
|
|
107
|
+
export declare function writeDirectToolsConfig(changes: Map<string, true | string[] | false>, provenance: Map<string, ServerProvenance>): void;
|
|
108
|
+
export declare function resolveConfiguredOAuthDir(raw: unknown, cwd?: string): string | undefined;
|
|
109
|
+
export {};
|