@kenkaiiii/ggcoder 4.3.235 → 4.3.236
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/cli/command-routing.d.ts +1 -1
- package/dist/cli/command-routing.d.ts.map +1 -1
- package/dist/cli/command-routing.js +2 -0
- package/dist/cli/command-routing.js.map +1 -1
- package/dist/cli/command-routing.test.js +1 -0
- package/dist/cli/command-routing.test.js.map +1 -1
- package/dist/cli/mcp.d.ts +2 -0
- package/dist/cli/mcp.d.ts.map +1 -0
- package/dist/cli/mcp.js +309 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/mcp/client.d.ts +20 -0
- package/dist/core/mcp/client.d.ts.map +1 -1
- package/dist/core/mcp/client.js +55 -11
- package/dist/core/mcp/client.js.map +1 -1
- package/dist/core/mcp/defaults.d.ts +7 -0
- package/dist/core/mcp/defaults.d.ts.map +1 -1
- package/dist/core/mcp/defaults.js +14 -0
- package/dist/core/mcp/defaults.js.map +1 -1
- package/dist/core/mcp/index.d.ts +6 -1
- package/dist/core/mcp/index.d.ts.map +1 -1
- package/dist/core/mcp/index.js +3 -1
- package/dist/core/mcp/index.js.map +1 -1
- package/dist/core/mcp/parse-add-command.d.ts +25 -0
- package/dist/core/mcp/parse-add-command.d.ts.map +1 -0
- package/dist/core/mcp/parse-add-command.js +220 -0
- package/dist/core/mcp/parse-add-command.js.map +1 -0
- package/dist/core/mcp/parse-add-command.test.d.ts +2 -0
- package/dist/core/mcp/parse-add-command.test.d.ts.map +1 -0
- package/dist/core/mcp/parse-add-command.test.js +75 -0
- package/dist/core/mcp/parse-add-command.test.js.map +1 -0
- package/dist/core/mcp/store.d.ts +80 -0
- package/dist/core/mcp/store.d.ts.map +1 -0
- package/dist/core/mcp/store.js +157 -0
- package/dist/core/mcp/store.js.map +1 -0
- package/dist/core/mcp/store.test.d.ts +2 -0
- package/dist/core/mcp/store.test.d.ts.map +1 -0
- package/dist/core/mcp/store.test.js +101 -0
- package/dist/core/mcp/store.test.js.map +1 -0
- package/dist/ui/mcp.d.ts +62 -0
- package/dist/ui/mcp.d.ts.map +1 -0
- package/dist/ui/mcp.js +302 -0
- package/dist/ui/mcp.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { describe, expect, it, beforeEach, afterEach, vi } from "vitest";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import fs from "node:fs/promises";
|
|
5
|
+
// Point the global mcp file at a temp home so tests don't touch the real ~/.gg.
|
|
6
|
+
let tmpHome;
|
|
7
|
+
let tmpProject;
|
|
8
|
+
vi.mock("../../config.js", async () => {
|
|
9
|
+
const actual = await vi.importActual("../../config.js");
|
|
10
|
+
return {
|
|
11
|
+
...actual,
|
|
12
|
+
getAppPaths: () => ({
|
|
13
|
+
...actual.getAppPaths(),
|
|
14
|
+
mcpFile: path.join(process.env.GG_TEST_HOME, ".gg", "mcp.json"),
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
import { addServer, loadServers, removeServer, getServer, fromStoredEntry, globalMcpPath, projectMcpPath, } from "./store.js";
|
|
19
|
+
beforeEach(async () => {
|
|
20
|
+
tmpHome = await fs.mkdtemp(path.join(os.tmpdir(), "gg-mcp-home-"));
|
|
21
|
+
tmpProject = await fs.mkdtemp(path.join(os.tmpdir(), "gg-mcp-proj-"));
|
|
22
|
+
process.env.GG_TEST_HOME = tmpHome;
|
|
23
|
+
});
|
|
24
|
+
afterEach(async () => {
|
|
25
|
+
await fs.rm(tmpHome, { recursive: true, force: true });
|
|
26
|
+
await fs.rm(tmpProject, { recursive: true, force: true });
|
|
27
|
+
delete process.env.GG_TEST_HOME;
|
|
28
|
+
});
|
|
29
|
+
describe("mcp store", () => {
|
|
30
|
+
it("round-trips an http server in global scope", async () => {
|
|
31
|
+
const res = await addServer({ name: "notion", url: "https://mcp.notion.com/mcp" }, "global", tmpProject);
|
|
32
|
+
expect(res.ok).toBe(true);
|
|
33
|
+
const servers = await loadServers(tmpProject);
|
|
34
|
+
expect(servers).toEqual([
|
|
35
|
+
{ config: { name: "notion", url: "https://mcp.notion.com/mcp" }, scope: "global" },
|
|
36
|
+
]);
|
|
37
|
+
// On-disk shape uses Claude's `type` field.
|
|
38
|
+
const raw = JSON.parse(await fs.readFile(globalMcpPath(), "utf-8"));
|
|
39
|
+
expect(raw.mcpServers.notion.type).toBe("http");
|
|
40
|
+
});
|
|
41
|
+
it("round-trips a stdio server with env in project scope", async () => {
|
|
42
|
+
await addServer({
|
|
43
|
+
name: "airtable",
|
|
44
|
+
command: "npx",
|
|
45
|
+
args: ["-y", "airtable-mcp-server"],
|
|
46
|
+
env: { AIRTABLE_API_KEY: "key" },
|
|
47
|
+
}, "project", tmpProject);
|
|
48
|
+
const servers = await loadServers(tmpProject);
|
|
49
|
+
expect(servers[0]).toEqual({
|
|
50
|
+
config: {
|
|
51
|
+
name: "airtable",
|
|
52
|
+
command: "npx",
|
|
53
|
+
args: ["-y", "airtable-mcp-server"],
|
|
54
|
+
env: { AIRTABLE_API_KEY: "key" },
|
|
55
|
+
},
|
|
56
|
+
scope: "project",
|
|
57
|
+
});
|
|
58
|
+
// Project file lives at ./.gg/mcp.json.
|
|
59
|
+
await fs.access(projectMcpPath(tmpProject));
|
|
60
|
+
});
|
|
61
|
+
it("project overrides global on name collision", async () => {
|
|
62
|
+
await addServer({ name: "dup", url: "https://global.example/mcp" }, "global", tmpProject);
|
|
63
|
+
await addServer({ name: "dup", url: "https://project.example/mcp" }, "project", tmpProject);
|
|
64
|
+
const servers = await loadServers(tmpProject);
|
|
65
|
+
expect(servers).toHaveLength(1);
|
|
66
|
+
expect(servers[0].scope).toBe("project");
|
|
67
|
+
expect(servers[0].config.url).toBe("https://project.example/mcp");
|
|
68
|
+
});
|
|
69
|
+
it("rejects duplicate name in the same scope unless overwrite", async () => {
|
|
70
|
+
await addServer({ name: "x", url: "https://a.example/mcp" }, "global", tmpProject);
|
|
71
|
+
const dup = await addServer({ name: "x", url: "https://b.example/mcp" }, "global", tmpProject);
|
|
72
|
+
expect(dup.ok).toBe(false);
|
|
73
|
+
const ow = await addServer({ name: "x", url: "https://b.example/mcp" }, "global", tmpProject, true);
|
|
74
|
+
expect(ow.ok).toBe(true);
|
|
75
|
+
const found = await getServer("x", tmpProject);
|
|
76
|
+
expect(found?.config.url).toBe("https://b.example/mcp");
|
|
77
|
+
});
|
|
78
|
+
it("removes a server", async () => {
|
|
79
|
+
await addServer({ name: "gone", url: "https://x.example/mcp" }, "global", tmpProject);
|
|
80
|
+
expect(await removeServer("gone", "global", tmpProject)).toBe(true);
|
|
81
|
+
expect(await removeServer("gone", "global", tmpProject)).toBe(false);
|
|
82
|
+
expect(await loadServers(tmpProject)).toEqual([]);
|
|
83
|
+
});
|
|
84
|
+
it("tolerates a malformed config file", async () => {
|
|
85
|
+
await fs.mkdir(path.dirname(globalMcpPath()), { recursive: true });
|
|
86
|
+
await fs.writeFile(globalMcpPath(), "{ not valid json", "utf-8");
|
|
87
|
+
expect(await loadServers(tmpProject)).toEqual([]);
|
|
88
|
+
});
|
|
89
|
+
it("parses Claude's .mcp.json type field for http and sse", () => {
|
|
90
|
+
expect(fromStoredEntry("n", { type: "http", url: "https://x/mcp" })).toEqual({
|
|
91
|
+
name: "n",
|
|
92
|
+
url: "https://x/mcp",
|
|
93
|
+
});
|
|
94
|
+
expect(fromStoredEntry("s", {
|
|
95
|
+
type: "sse",
|
|
96
|
+
url: "https://x/sse",
|
|
97
|
+
headers: { Authorization: "Bearer t" },
|
|
98
|
+
})).toEqual({ name: "s", url: "https://x/sse", headers: { Authorization: "Bearer t" } });
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=store.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.test.js","sourceRoot":"","sources":["../../../src/core/mcp/store.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGlC,gFAAgF;AAChF,IAAI,OAAe,CAAC;AACpB,IAAI,UAAkB,CAAC;AAEvB,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;IACpC,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,YAAY,CAAsB,iBAAiB,CAAC,CAAC;IAC7E,OAAO;QACL,GAAG,MAAM;QACT,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;YAClB,GAAG,MAAM,CAAC,WAAW,EAAE;YACvB,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAa,EAAE,KAAK,EAAE,UAAU,CAAC;SACjE,CAAC;KACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,OAAO,EACL,SAAS,EACT,WAAW,EACX,YAAY,EACZ,SAAS,EACT,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,UAAU,CAAC,KAAK,IAAI,EAAE;IACpB,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;IACnE,UAAU,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,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cp/index.js";
|
|
2
|
+
declare function gradientLine(text: string): string;
|
|
3
|
+
declare function bannerLines(version: string, subtitle: string): string[];
|
|
4
|
+
/** A server row joined with its live connection status. */
|
|
5
|
+
export interface McpServerRow {
|
|
6
|
+
config: MCPServerConfig;
|
|
7
|
+
scope: MCPScope;
|
|
8
|
+
ok: boolean;
|
|
9
|
+
toolCount: number;
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
export type McpDashboardAction = {
|
|
13
|
+
kind: "add";
|
|
14
|
+
} | {
|
|
15
|
+
kind: "remove";
|
|
16
|
+
name: string;
|
|
17
|
+
scope: MCPScope;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "retry";
|
|
20
|
+
} | {
|
|
21
|
+
kind: "details";
|
|
22
|
+
name: string;
|
|
23
|
+
scope: MCPScope;
|
|
24
|
+
} | {
|
|
25
|
+
kind: "close";
|
|
26
|
+
};
|
|
27
|
+
declare function transportSummary(config: MCPServerConfig): string;
|
|
28
|
+
/**
|
|
29
|
+
* Render the interactive dashboard. Resolves with the chosen action so the
|
|
30
|
+
* flow controller in cli/mcp.ts can re-run connect + redraw afterwards.
|
|
31
|
+
*/
|
|
32
|
+
export declare function renderMcpDashboard(options: {
|
|
33
|
+
version: string;
|
|
34
|
+
rows: McpServerRow[];
|
|
35
|
+
}): Promise<McpDashboardAction>;
|
|
36
|
+
export declare function renderScopeSelector(version: string, cwd: string): Promise<MCPScope | null>;
|
|
37
|
+
/** Read one line of input via readline (used for the paste prompt). */
|
|
38
|
+
export declare function promptLine(question: string): Promise<string>;
|
|
39
|
+
export interface BannerPromptOptions {
|
|
40
|
+
/** Subtitle shown under the logo. */
|
|
41
|
+
subtitle: string;
|
|
42
|
+
/** The input prompt label, e.g. "Command: ". */
|
|
43
|
+
question: string;
|
|
44
|
+
/** Hint text shown above the prompt (default: leave empty to go back). */
|
|
45
|
+
hint?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Paint the MCP banner from the home position (same anchor as every other
|
|
49
|
+
* screen, so nothing drifts), then read one line. Returns null when the user
|
|
50
|
+
* submits an empty line (treated as "go back").
|
|
51
|
+
*/
|
|
52
|
+
export declare function promptWithBanner(version: string, options: BannerPromptOptions): Promise<string | null>;
|
|
53
|
+
export declare const mcpColors: {
|
|
54
|
+
primary: string;
|
|
55
|
+
accent: string;
|
|
56
|
+
text: string;
|
|
57
|
+
dim: string;
|
|
58
|
+
good: string;
|
|
59
|
+
bad: string;
|
|
60
|
+
};
|
|
61
|
+
export { bannerLines, transportSummary, gradientLine };
|
|
62
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/ui/mcp.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAkCtE,iBAAS,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY1C;AAED,iBAAS,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAWhE;AAED,2DAA2D;AAC3D,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,QAAQ,CAAC;IAChB,EAAE,EAAE,OAAO,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GACf;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtB,iBAAS,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAIzD;AA4ED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAsE9B;AA6ED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAS1F;AAED,uEAAuE;AACvE,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQlE;AAED,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYxB;AAED,eAAO,MAAM,SAAS;;;;;;;CAOrB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/ui/mcp.js
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import readline from "node:readline/promises";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
const LOGO_LINES = [
|
|
4
|
+
" \u2584\u2580\u2580\u2580 \u2584\u2580\u2580\u2580",
|
|
5
|
+
" \u2588 \u2580\u2588 \u2588 \u2580\u2588",
|
|
6
|
+
" \u2580\u2584\u2584\u2580 \u2580\u2584\u2584\u2580",
|
|
7
|
+
];
|
|
8
|
+
const GRADIENT = [
|
|
9
|
+
"#60a5fa",
|
|
10
|
+
"#6da1f9",
|
|
11
|
+
"#7a9df7",
|
|
12
|
+
"#8799f5",
|
|
13
|
+
"#9495f3",
|
|
14
|
+
"#a18ff1",
|
|
15
|
+
"#a78bfa",
|
|
16
|
+
"#a18ff1",
|
|
17
|
+
"#9495f3",
|
|
18
|
+
"#8799f5",
|
|
19
|
+
"#7a9df7",
|
|
20
|
+
"#6da1f9",
|
|
21
|
+
];
|
|
22
|
+
const PRIMARY = "#60a5fa";
|
|
23
|
+
const ACCENT = "#a78bfa";
|
|
24
|
+
const TEXT = "#e2e8f0";
|
|
25
|
+
const TEXT_DIM = "#64748b";
|
|
26
|
+
const GOOD = "#4ade80";
|
|
27
|
+
const BAD = "#ef4444";
|
|
28
|
+
const GAP = " ";
|
|
29
|
+
// Every MCP screen paints from the home position after a full clear, so the
|
|
30
|
+
// banner sits at the same row no matter which screen you came from. Mixing
|
|
31
|
+
// save/restore-cursor with full-clear screens is what made the banner drift.
|
|
32
|
+
const CLEAR_HOME = "\x1b[2J\x1b[H";
|
|
33
|
+
function gradientLine(text) {
|
|
34
|
+
let result = "";
|
|
35
|
+
let colorIdx = 0;
|
|
36
|
+
for (const ch of text) {
|
|
37
|
+
if (ch === " ") {
|
|
38
|
+
result += ch;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
result += chalk.hex(GRADIENT[colorIdx % GRADIENT.length])(ch);
|
|
42
|
+
colorIdx++;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
function bannerLines(version, subtitle) {
|
|
48
|
+
return [
|
|
49
|
+
gradientLine(LOGO_LINES[0]) +
|
|
50
|
+
GAP +
|
|
51
|
+
chalk.hex(PRIMARY).bold("GG Coder") +
|
|
52
|
+
chalk.hex(TEXT_DIM)(` v${version}`) +
|
|
53
|
+
chalk.hex(TEXT_DIM)(" · By ") +
|
|
54
|
+
chalk.hex(TEXT).bold("Ken Kai"),
|
|
55
|
+
gradientLine(LOGO_LINES[1]) + GAP + chalk.hex(ACCENT)("MCP Servers"),
|
|
56
|
+
gradientLine(LOGO_LINES[2]) + GAP + chalk.hex(TEXT_DIM)(subtitle),
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
function transportSummary(config) {
|
|
60
|
+
if (config.url)
|
|
61
|
+
return config.url;
|
|
62
|
+
const parts = [config.command, ...(config.args ?? [])].filter(Boolean);
|
|
63
|
+
return parts.join(" ");
|
|
64
|
+
}
|
|
65
|
+
/** Render a `key label` hint with the key emphasized and the label dimmed. */
|
|
66
|
+
function keyHint(key, label) {
|
|
67
|
+
return chalk.hex(ACCENT).bold(key) + " " + chalk.hex(TEXT_DIM)(label);
|
|
68
|
+
}
|
|
69
|
+
function footerHints(hints) {
|
|
70
|
+
return " " + hints.map(([k, l]) => keyHint(k, l)).join(chalk.hex(TEXT_DIM)(" "));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Build the navigable list: every server row, then a trailing "add" row. The
|
|
74
|
+
* add row is index === rows.length so Enter on it triggers the add flow.
|
|
75
|
+
*/
|
|
76
|
+
function renderDashboard(rows, selectedIndex, version) {
|
|
77
|
+
const lines = [];
|
|
78
|
+
lines.push(...bannerLines(version, "Manage your servers"));
|
|
79
|
+
lines.push("");
|
|
80
|
+
if (rows.length === 0) {
|
|
81
|
+
lines.push(chalk.hex(TEXT_DIM)(" No MCP servers configured yet."));
|
|
82
|
+
lines.push("");
|
|
83
|
+
}
|
|
84
|
+
for (let i = 0; i < rows.length; i++) {
|
|
85
|
+
const row = rows[i];
|
|
86
|
+
const selected = i === selectedIndex;
|
|
87
|
+
const marker = selected ? chalk.hex(PRIMARY)("❯ ") : " ";
|
|
88
|
+
const dot = row.ok ? "🟢" : "🔴";
|
|
89
|
+
const nameColor = selected ? PRIMARY : TEXT;
|
|
90
|
+
const meta = row.ok
|
|
91
|
+
? chalk.hex(TEXT_DIM)(` · ${row.toolCount} tool${row.toolCount === 1 ? "" : "s"} · ${row.scope}`)
|
|
92
|
+
: chalk.hex(TEXT_DIM)(` · ${row.scope} · `) + chalk.hex(BAD)(shortError(row.error));
|
|
93
|
+
lines.push(`${marker}${dot} ` + chalk.hex(nameColor)(row.config.name) + meta);
|
|
94
|
+
}
|
|
95
|
+
// Trailing selectable "add" row.
|
|
96
|
+
const addIndex = rows.length;
|
|
97
|
+
const addSelected = selectedIndex === addIndex;
|
|
98
|
+
const addMarker = addSelected ? chalk.hex(PRIMARY)("❯ ") : " ";
|
|
99
|
+
const addColor = addSelected ? PRIMARY : GOOD;
|
|
100
|
+
lines.push(addMarker + chalk.hex(addColor)("➕ Add a new MCP server"));
|
|
101
|
+
lines.push("");
|
|
102
|
+
const hints = selectedIndex === addIndex
|
|
103
|
+
? [
|
|
104
|
+
["↑↓", "navigate"],
|
|
105
|
+
["⏎", "add a server"],
|
|
106
|
+
["esc", "close"],
|
|
107
|
+
]
|
|
108
|
+
: [
|
|
109
|
+
["↑↓", "navigate"],
|
|
110
|
+
["⏎", "view details"],
|
|
111
|
+
["d", "remove"],
|
|
112
|
+
["r", "retry"],
|
|
113
|
+
["esc", "close"],
|
|
114
|
+
];
|
|
115
|
+
lines.push(footerHints(hints));
|
|
116
|
+
return lines.join("\n");
|
|
117
|
+
}
|
|
118
|
+
/** Paint a fully-built screen string from the home position. */
|
|
119
|
+
function paint(content) {
|
|
120
|
+
process.stdout.write(CLEAR_HOME + content + "\n");
|
|
121
|
+
}
|
|
122
|
+
function shortError(error) {
|
|
123
|
+
if (!error)
|
|
124
|
+
return "failed";
|
|
125
|
+
const oneLine = error.replace(/\s+/g, " ").trim();
|
|
126
|
+
return oneLine.length > 48 ? oneLine.slice(0, 47) + "…" : oneLine;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Render the interactive dashboard. Resolves with the chosen action so the
|
|
130
|
+
* flow controller in cli/mcp.ts can re-run connect + redraw afterwards.
|
|
131
|
+
*/
|
|
132
|
+
export function renderMcpDashboard(options) {
|
|
133
|
+
const { version, rows } = options;
|
|
134
|
+
return new Promise((resolve) => {
|
|
135
|
+
let selectedIndex = 0;
|
|
136
|
+
const draw = () => paint(renderDashboard(rows, selectedIndex, version));
|
|
137
|
+
draw();
|
|
138
|
+
process.stdin.setRawMode(true);
|
|
139
|
+
process.stdin.resume();
|
|
140
|
+
const cleanup = () => {
|
|
141
|
+
process.stdin.removeListener("data", onData);
|
|
142
|
+
process.stdin.setRawMode(false);
|
|
143
|
+
process.stdin.pause();
|
|
144
|
+
process.stdout.write(CLEAR_HOME);
|
|
145
|
+
};
|
|
146
|
+
const finish = (action) => {
|
|
147
|
+
cleanup();
|
|
148
|
+
resolve(action);
|
|
149
|
+
};
|
|
150
|
+
// The trailing "add" row lives at index rows.length, so the last navigable
|
|
151
|
+
// index is rows.length (one past the server rows).
|
|
152
|
+
const addIndex = rows.length;
|
|
153
|
+
const onData = (chunk) => {
|
|
154
|
+
const key = chunk.toString();
|
|
155
|
+
const onAddRow = selectedIndex === addIndex;
|
|
156
|
+
if (key === "\x1b" || key === "\x03") {
|
|
157
|
+
finish({ kind: "close" });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (key === "a" || key === "A") {
|
|
161
|
+
finish({ kind: "add" });
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (key === "r" || key === "R") {
|
|
165
|
+
finish({ kind: "retry" });
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if ((key === "d" || key === "D") && !onAddRow) {
|
|
169
|
+
const row = rows[selectedIndex];
|
|
170
|
+
finish({ kind: "remove", name: row.config.name, scope: row.scope });
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (key === "\r" || key === "\n") {
|
|
174
|
+
if (onAddRow) {
|
|
175
|
+
finish({ kind: "add" });
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
const row = rows[selectedIndex];
|
|
179
|
+
finish({ kind: "details", name: row.config.name, scope: row.scope });
|
|
180
|
+
}
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (key === "\x1b[A" && selectedIndex > 0) {
|
|
184
|
+
selectedIndex--;
|
|
185
|
+
draw();
|
|
186
|
+
}
|
|
187
|
+
if (key === "\x1b[B" && selectedIndex < addIndex) {
|
|
188
|
+
selectedIndex++;
|
|
189
|
+
draw();
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
process.stdin.on("data", onData);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/** Generic single-select menu mirroring renderLoginSelector. */
|
|
196
|
+
function renderSelector(options) {
|
|
197
|
+
const { version, subtitle, items } = options;
|
|
198
|
+
return new Promise((resolve) => {
|
|
199
|
+
let selectedIndex = 0;
|
|
200
|
+
const screen = () => {
|
|
201
|
+
const lines = [];
|
|
202
|
+
lines.push(...bannerLines(version, subtitle));
|
|
203
|
+
lines.push("");
|
|
204
|
+
for (let i = 0; i < items.length; i++) {
|
|
205
|
+
const item = items[i];
|
|
206
|
+
const selected = i === selectedIndex;
|
|
207
|
+
const marker = selected ? chalk.hex(PRIMARY)("❯ ") : " ";
|
|
208
|
+
const labelColor = selected ? PRIMARY : TEXT;
|
|
209
|
+
lines.push(marker +
|
|
210
|
+
chalk.hex(labelColor)(item.label) +
|
|
211
|
+
(item.description ? chalk.hex(TEXT_DIM)(` — ${item.description}`) : ""));
|
|
212
|
+
}
|
|
213
|
+
lines.push("");
|
|
214
|
+
lines.push(footerHints([
|
|
215
|
+
["↑↓", "navigate"],
|
|
216
|
+
["⏎", "select"],
|
|
217
|
+
["esc", "cancel"],
|
|
218
|
+
]));
|
|
219
|
+
return lines.join("\n");
|
|
220
|
+
};
|
|
221
|
+
const draw = () => paint(screen());
|
|
222
|
+
draw();
|
|
223
|
+
process.stdin.setRawMode(true);
|
|
224
|
+
process.stdin.resume();
|
|
225
|
+
const cleanup = () => {
|
|
226
|
+
process.stdin.removeListener("data", onData);
|
|
227
|
+
process.stdin.setRawMode(false);
|
|
228
|
+
process.stdin.pause();
|
|
229
|
+
process.stdout.write(CLEAR_HOME);
|
|
230
|
+
};
|
|
231
|
+
const onData = (chunk) => {
|
|
232
|
+
const key = chunk.toString();
|
|
233
|
+
if (key === "\x1b" || key === "\x03") {
|
|
234
|
+
cleanup();
|
|
235
|
+
resolve(null);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (key === "\r" || key === "\n") {
|
|
239
|
+
cleanup();
|
|
240
|
+
resolve(items[selectedIndex].value);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (key === "\x1b[A" && selectedIndex > 0) {
|
|
244
|
+
selectedIndex--;
|
|
245
|
+
draw();
|
|
246
|
+
}
|
|
247
|
+
if (key === "\x1b[B" && selectedIndex < items.length - 1) {
|
|
248
|
+
selectedIndex++;
|
|
249
|
+
draw();
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
process.stdin.on("data", onData);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
export function renderScopeSelector(version, cwd) {
|
|
256
|
+
return renderSelector({
|
|
257
|
+
version,
|
|
258
|
+
subtitle: "Choose a scope",
|
|
259
|
+
items: [
|
|
260
|
+
{ label: "Global (all GG Coder sessions)", value: "global", description: "~/.gg/mcp.json" },
|
|
261
|
+
{ label: `This project (${cwd})`, value: "project", description: "./.gg/mcp.json" },
|
|
262
|
+
],
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
/** Read one line of input via readline (used for the paste prompt). */
|
|
266
|
+
export async function promptLine(question) {
|
|
267
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
268
|
+
try {
|
|
269
|
+
const answer = await rl.question(chalk.hex(PRIMARY)(question));
|
|
270
|
+
return answer.trim();
|
|
271
|
+
}
|
|
272
|
+
finally {
|
|
273
|
+
rl.close();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Paint the MCP banner from the home position (same anchor as every other
|
|
278
|
+
* screen, so nothing drifts), then read one line. Returns null when the user
|
|
279
|
+
* submits an empty line (treated as "go back").
|
|
280
|
+
*/
|
|
281
|
+
export async function promptWithBanner(version, options) {
|
|
282
|
+
const { subtitle, question, hint } = options;
|
|
283
|
+
const lines = [
|
|
284
|
+
...bannerLines(version, subtitle),
|
|
285
|
+
"",
|
|
286
|
+
chalk.hex(TEXT_DIM)(" " + (hint ?? "Leave empty and press Enter to go back.")),
|
|
287
|
+
"",
|
|
288
|
+
];
|
|
289
|
+
process.stdout.write(CLEAR_HOME + lines.join("\n") + "\n");
|
|
290
|
+
const answer = (await promptLine(" " + question)).trim();
|
|
291
|
+
return answer === "" ? null : answer;
|
|
292
|
+
}
|
|
293
|
+
export const mcpColors = {
|
|
294
|
+
primary: PRIMARY,
|
|
295
|
+
accent: ACCENT,
|
|
296
|
+
text: TEXT,
|
|
297
|
+
dim: TEXT_DIM,
|
|
298
|
+
good: GOOD,
|
|
299
|
+
bad: BAD,
|
|
300
|
+
};
|
|
301
|
+
export { bannerLines, transportSummary, gradientLine };
|
|
302
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/ui/mcp.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,UAAU,GAAG;IACjB,oDAAoD;IACpD,0CAA0C;IAC1C,oDAAoD;CACrD,CAAC;AACF,MAAM,QAAQ,GAAG;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;CACV,CAAC;AACF,MAAM,OAAO,GAAG,SAAS,CAAC;AAC1B,MAAM,MAAM,GAAG,SAAS,CAAC;AACzB,MAAM,IAAI,GAAG,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E,MAAM;IACd,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,QAAQ;IACb,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,GAAG;CACT,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenkaiiii/ggcoder",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.236",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI coding agent with OAuth authentication for Anthropic, OpenAI, and Gemini",
|
|
6
6
|
"license": "MIT",
|
|
@@ -110,9 +110,9 @@
|
|
|
110
110
|
"strip-ansi": "^7.2.0",
|
|
111
111
|
"wrap-ansi": "^10.0.0",
|
|
112
112
|
"zod": "^4.4.3",
|
|
113
|
-
"@kenkaiiii/gg-agent": "4.3.
|
|
114
|
-
"@kenkaiiii/gg-
|
|
115
|
-
"@kenkaiiii/gg-
|
|
113
|
+
"@kenkaiiii/gg-agent": "4.3.236",
|
|
114
|
+
"@kenkaiiii/gg-ai": "4.3.236",
|
|
115
|
+
"@kenkaiiii/gg-pixel": "4.3.101"
|
|
116
116
|
},
|
|
117
117
|
"optionalDependencies": {
|
|
118
118
|
"@huggingface/transformers": "^3.6.0",
|