@kanon-pm/setup 0.2.0 → 0.3.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/dist/detect.d.ts +15 -1
- package/dist/detect.d.ts.map +1 -1
- package/dist/detect.js +44 -2
- package/dist/detect.js.map +1 -1
- package/dist/index.js +27 -23
- package/dist/index.js.map +1 -1
- package/dist/mcp-config.d.ts +6 -4
- package/dist/mcp-config.d.ts.map +1 -1
- package/dist/mcp-config.js +11 -6
- package/dist/mcp-config.js.map +1 -1
- package/dist/registry.d.ts +3 -3
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +87 -61
- package/dist/registry.js.map +1 -1
- package/dist/types.d.ts +17 -15
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/detect.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Platform, PlatformContext } from "./types.js";
|
|
1
2
|
/**
|
|
2
3
|
* Check if running inside WSL by reading /proc/version.
|
|
3
4
|
*/
|
|
@@ -7,8 +8,21 @@ export declare function isWsl(): boolean;
|
|
|
7
8
|
* Uses cmd.exe to get %USERNAME% and constructs /mnt/c/Users/<user>.
|
|
8
9
|
*/
|
|
9
10
|
export declare function resolveWinHome(): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Detect the current platform as a tri-state: win32, wsl, or linux.
|
|
13
|
+
* Accepts an optional override for testing.
|
|
14
|
+
*/
|
|
15
|
+
export declare function detectPlatform(override?: Platform): Platform;
|
|
16
|
+
/**
|
|
17
|
+
* Build a PlatformContext once at startup. All downstream functions receive
|
|
18
|
+
* this context instead of threading winHome/wslMode booleans.
|
|
19
|
+
*
|
|
20
|
+
* Overrides allow test injection without mocking globals.
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildPlatformContext(overrides?: Partial<PlatformContext>): Promise<PlatformContext>;
|
|
10
23
|
/**
|
|
11
24
|
* Check if a command exists on the system.
|
|
25
|
+
* Uses `where` on win32 and `which` on linux/wsl.
|
|
12
26
|
*/
|
|
13
|
-
export declare function commandExists(cmd: string): boolean;
|
|
27
|
+
export declare function commandExists(cmd: string, platform?: Platform): boolean;
|
|
14
28
|
//# sourceMappingURL=detect.d.ts.map
|
package/dist/detect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAO/B;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,SAAS,CAiBnD;AAED
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAI5D;;GAEG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAO/B;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,SAAS,CAiBnD;AAID;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAM5D;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GACnC,OAAO,CAAC,eAAe,CAAC,CAmB1B;AAID;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAQvE"}
|
package/dist/detect.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// ─── Detection Utilities ─────────────────────────────────────────────────────
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
3
4
|
import { execSync } from "node:child_process";
|
|
5
|
+
// ─── Internal Helpers ────────────────────────────────────────────────────────
|
|
4
6
|
/**
|
|
5
7
|
* Check if running inside WSL by reading /proc/version.
|
|
6
8
|
*/
|
|
@@ -35,12 +37,52 @@ export function resolveWinHome() {
|
|
|
35
37
|
return undefined;
|
|
36
38
|
}
|
|
37
39
|
}
|
|
40
|
+
// ─── Platform Detection ──────────────────────────────────────────────────────
|
|
41
|
+
/**
|
|
42
|
+
* Detect the current platform as a tri-state: win32, wsl, or linux.
|
|
43
|
+
* Accepts an optional override for testing.
|
|
44
|
+
*/
|
|
45
|
+
export function detectPlatform(override) {
|
|
46
|
+
if (override)
|
|
47
|
+
return override;
|
|
48
|
+
if (process.platform === "win32")
|
|
49
|
+
return "win32";
|
|
50
|
+
if (isWsl())
|
|
51
|
+
return "wsl";
|
|
52
|
+
return "linux";
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Build a PlatformContext once at startup. All downstream functions receive
|
|
56
|
+
* this context instead of threading winHome/wslMode booleans.
|
|
57
|
+
*
|
|
58
|
+
* Overrides allow test injection without mocking globals.
|
|
59
|
+
*/
|
|
60
|
+
export async function buildPlatformContext(overrides) {
|
|
61
|
+
const platform = overrides?.platform ?? detectPlatform();
|
|
62
|
+
const homedir = overrides?.homedir ?? os.homedir();
|
|
63
|
+
const ctx = { platform, homedir };
|
|
64
|
+
switch (platform) {
|
|
65
|
+
case "win32":
|
|
66
|
+
ctx.appDataDir = overrides?.appDataDir ?? process.env["APPDATA"];
|
|
67
|
+
break;
|
|
68
|
+
case "wsl":
|
|
69
|
+
ctx.winHome = overrides?.winHome ?? resolveWinHome();
|
|
70
|
+
break;
|
|
71
|
+
case "linux":
|
|
72
|
+
// No extra fields needed
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
return ctx;
|
|
76
|
+
}
|
|
77
|
+
// ─── Command Existence ───────────────────────────────────────────────────────
|
|
38
78
|
/**
|
|
39
79
|
* Check if a command exists on the system.
|
|
80
|
+
* Uses `where` on win32 and `which` on linux/wsl.
|
|
40
81
|
*/
|
|
41
|
-
export function commandExists(cmd) {
|
|
82
|
+
export function commandExists(cmd, platform) {
|
|
83
|
+
const whichCmd = platform === "win32" ? "where" : "which";
|
|
42
84
|
try {
|
|
43
|
-
execSync(
|
|
85
|
+
execSync(`${whichCmd} ${cmd}`, { stdio: ["pipe", "pipe", "pipe"] });
|
|
44
86
|
return true;
|
|
45
87
|
}
|
|
46
88
|
catch {
|
package/dist/detect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.js","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"detect.js","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,KAAK;IACnB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QACzD,OAAO,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,8BAA8B,EAAE;YACxD,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;SAChC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAE3B,IAAI,CAAC,QAAQ;YAAE,OAAO,SAAS,CAAC;QAEhC,MAAM,OAAO,GAAG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AO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAC1D,IAAI,CAAC;QACH,QAAQ,CAAC,GAAG,QAAQ,IAAI,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// ─── Kanon Setup ───────────────────────────────────────────────────────────────
|
|
3
3
|
import { Command } from "commander";
|
|
4
4
|
import chalk from "chalk";
|
|
5
|
-
import {
|
|
5
|
+
import { buildPlatformContext } from "./detect.js";
|
|
6
6
|
import { resolveAuth } from "./auth.js";
|
|
7
7
|
import { detectTools, getToolByName } from "./registry.js";
|
|
8
8
|
import { buildMcpEntry, mergeConfig, removeConfig, resolveMcpServerPath, resolveNodeBin, } from "./mcp-config.js";
|
|
@@ -43,14 +43,12 @@ program.action(async (options) => {
|
|
|
43
43
|
async function run(options) {
|
|
44
44
|
const removeMode = options.remove === true;
|
|
45
45
|
const assetsDir = getAssetsDir();
|
|
46
|
-
// ──
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
winHome = resolveWinHome();
|
|
51
|
-
if (winHome) {
|
|
46
|
+
// ── Platform Detection ─────────────────────────────────────────────
|
|
47
|
+
const ctx = await buildPlatformContext();
|
|
48
|
+
if (ctx.platform === "wsl") {
|
|
49
|
+
if (ctx.winHome) {
|
|
52
50
|
console.log(chalk.cyan("[info]") +
|
|
53
|
-
` WSL detected — Windows home: ${chalk.bold(winHome)}`);
|
|
51
|
+
` WSL detected — Windows home: ${chalk.bold(ctx.winHome)}`);
|
|
54
52
|
}
|
|
55
53
|
else {
|
|
56
54
|
console.log(chalk.yellow("[warn]") +
|
|
@@ -64,17 +62,21 @@ async function run(options) {
|
|
|
64
62
|
if (!tool) {
|
|
65
63
|
throw new Error(`Unknown tool: '${options.tool}'. Supported: claude-code, cursor, antigravity`);
|
|
66
64
|
}
|
|
65
|
+
// Check if the tool supports the current platform
|
|
66
|
+
if (!tool.platforms[ctx.platform]) {
|
|
67
|
+
throw new Error(`${tool.displayName} is not supported on ${ctx.platform}`);
|
|
68
|
+
}
|
|
67
69
|
selectedTools = [tool];
|
|
68
70
|
}
|
|
69
71
|
else if (options.all) {
|
|
70
|
-
selectedTools = await detectTools(
|
|
72
|
+
selectedTools = await detectTools(ctx);
|
|
71
73
|
if (selectedTools.length === 0) {
|
|
72
74
|
throw new Error("No supported tools detected. Install at least one supported AI coding tool.");
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
else {
|
|
76
78
|
// Detect and show what's available
|
|
77
|
-
selectedTools = await detectTools(
|
|
79
|
+
selectedTools = await detectTools(ctx);
|
|
78
80
|
if (selectedTools.length === 0) {
|
|
79
81
|
throw new Error("No supported tools detected. Install at least one supported AI coding tool.");
|
|
80
82
|
}
|
|
@@ -110,11 +112,18 @@ async function run(options) {
|
|
|
110
112
|
console.log("");
|
|
111
113
|
let successCount = 0;
|
|
112
114
|
for (const tool of selectedTools) {
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
+
const platformPaths = tool.platforms[ctx.platform];
|
|
116
|
+
if (!platformPaths) {
|
|
117
|
+
console.log(chalk.yellow(" ⚠") +
|
|
118
|
+
` ${tool.displayName} is not supported on ${ctx.platform} — skipping`);
|
|
119
|
+
console.log("");
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const configPath = platformPaths.config(ctx);
|
|
123
|
+
const skillDir = platformPaths.skills(ctx);
|
|
124
|
+
const templatePath = platformPaths.template(ctx);
|
|
115
125
|
if (removeMode) {
|
|
116
126
|
// ── Remove Mode ──────────────────────────────────────────────
|
|
117
|
-
const configPath = tool.configPath(pathArg);
|
|
118
127
|
const removed = removeConfig(configPath, tool.rootKey);
|
|
119
128
|
if (removed) {
|
|
120
129
|
console.log(chalk.green(" ✓") +
|
|
@@ -125,22 +134,20 @@ async function run(options) {
|
|
|
125
134
|
` MCP config not found for ${tool.displayName} — nothing to remove`);
|
|
126
135
|
}
|
|
127
136
|
// Remove skills
|
|
128
|
-
const skillDir = tool.skillDest(pathArg);
|
|
129
137
|
const removedSkills = removeSkills(skillDir);
|
|
130
138
|
if (removedSkills.length > 0) {
|
|
131
139
|
console.log(chalk.green(" ✓") +
|
|
132
140
|
` Removed ${removedSkills.length} skills from ${chalk.bold(tool.displayName)}`);
|
|
133
141
|
}
|
|
134
142
|
// Remove template
|
|
135
|
-
const templatePath = tool.templateTarget(pathArg);
|
|
136
143
|
const removedTemplate = removeTemplate(templatePath, tool.templateMode);
|
|
137
144
|
if (removedTemplate) {
|
|
138
145
|
console.log(chalk.green(" ✓") +
|
|
139
146
|
` Removed template from ${chalk.bold(tool.displayName)}`);
|
|
140
147
|
}
|
|
141
148
|
// Remove workflows
|
|
142
|
-
if (
|
|
143
|
-
const wfDir =
|
|
149
|
+
if (platformPaths.workflows) {
|
|
150
|
+
const wfDir = platformPaths.workflows(ctx);
|
|
144
151
|
const removedWfs = removeWorkflows(wfDir);
|
|
145
152
|
if (removedWfs.length > 0) {
|
|
146
153
|
console.log(chalk.green(" ✓") +
|
|
@@ -151,27 +158,24 @@ async function run(options) {
|
|
|
151
158
|
}
|
|
152
159
|
else {
|
|
153
160
|
// ── Install Mode ─────────────────────────────────────────────
|
|
154
|
-
const
|
|
155
|
-
const entry = buildMcpEntry(mcpResolution, apiUrl, apiKey, wslMode, tool.isWindowsNative, nodeBin);
|
|
161
|
+
const entry = buildMcpEntry(mcpResolution, apiUrl, apiKey, ctx, platformPaths.mcpMode, nodeBin);
|
|
156
162
|
// 1. MCP config
|
|
157
163
|
mergeConfig(configPath, tool.rootKey, entry);
|
|
158
164
|
console.log(chalk.green(" ✓") +
|
|
159
165
|
` Configured MCP for ${chalk.bold(tool.displayName)} (${configPath})`);
|
|
160
166
|
// 2. Skills
|
|
161
|
-
const skillDir = tool.skillDest(pathArg);
|
|
162
167
|
const installedSkills = installSkills(skillDir, assetsDir);
|
|
163
168
|
if (installedSkills.length > 0) {
|
|
164
169
|
console.log(chalk.green(" ✓") +
|
|
165
170
|
` Installed ${installedSkills.length} skills to ${chalk.cyan(skillDir)}`);
|
|
166
171
|
}
|
|
167
172
|
// 3. Template
|
|
168
|
-
const templatePath = tool.templateTarget(pathArg);
|
|
169
173
|
installTemplate(templatePath, tool.templateSource, assetsDir, tool.templateMode);
|
|
170
174
|
console.log(chalk.green(" ✓") +
|
|
171
175
|
` Installed template for ${chalk.bold(tool.displayName)} (${templatePath})`);
|
|
172
176
|
// 4. Workflows
|
|
173
|
-
if (
|
|
174
|
-
const wfDir =
|
|
177
|
+
if (platformPaths.workflows) {
|
|
178
|
+
const wfDir = platformPaths.workflows(ctx);
|
|
175
179
|
const installedWfs = installWorkflows(wfDir, assetsDir);
|
|
176
180
|
if (installedWfs.length > 0) {
|
|
177
181
|
console.log(chalk.green(" ✓") +
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,kFAAkF;AAElF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,kFAAkF;AAElF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC3D,O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CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/mcp-config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { McpServerEntry } from "./types.js";
|
|
1
|
+
import type { McpServerEntry, McpMode, PlatformContext } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Merge a Kanon MCP server entry into a tool's JSON config file.
|
|
4
4
|
* Creates the file and parent directories if they don't exist.
|
|
@@ -18,10 +18,12 @@ export type McpResolution = {
|
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* Build the MCP server entry for Kanon.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
*
|
|
22
|
+
* Uses PlatformContext + McpMode to determine the entry format:
|
|
23
|
+
* - 'direct': linux, wsl-native tools, or win32 — uses node/npx directly
|
|
24
|
+
* - 'wsl-bridge': Windows-side tools invoked from WSL — uses `wsl` wrapper
|
|
23
25
|
*/
|
|
24
|
-
export declare function buildMcpEntry(resolution: McpResolution, apiUrl: string, apiKey: string,
|
|
26
|
+
export declare function buildMcpEntry(resolution: McpResolution, apiUrl: string, apiKey: string, ctx: PlatformContext, mcpMode: McpMode, nodeBin: string): McpServerEntry;
|
|
25
27
|
/**
|
|
26
28
|
* Resolve how to invoke the Kanon MCP server.
|
|
27
29
|
* When running from the monorepo or with @kanon/mcp installed locally,
|
package/dist/mcp-config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../src/mcp-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../src/mcp-config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,cAAc,GACpB,IAAI,CAqBN;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAsBzE;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAEpB;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,aAAa,EACzB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,cAAc,CAwChB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,CAwBpD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
|
package/dist/mcp-config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// ─── MCP Config Merger ───────────────────────────────────────────────────────
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
4
5
|
/**
|
|
5
6
|
* Merge a Kanon MCP server entry into a tool's JSON config file.
|
|
6
7
|
* Creates the file and parent directories if they don't exist.
|
|
@@ -52,13 +53,15 @@ export function removeConfig(configPath, rootKey) {
|
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
54
55
|
* Build the MCP server entry for Kanon.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
56
|
+
*
|
|
57
|
+
* Uses PlatformContext + McpMode to determine the entry format:
|
|
58
|
+
* - 'direct': linux, wsl-native tools, or win32 — uses node/npx directly
|
|
59
|
+
* - 'wsl-bridge': Windows-side tools invoked from WSL — uses `wsl` wrapper
|
|
57
60
|
*/
|
|
58
|
-
export function buildMcpEntry(resolution, apiUrl, apiKey,
|
|
61
|
+
export function buildMcpEntry(resolution, apiUrl, apiKey, ctx, mcpMode, nodeBin) {
|
|
59
62
|
const isNpx = resolution.mode === "npx";
|
|
60
|
-
if (
|
|
61
|
-
// Windows-
|
|
63
|
+
if (mcpMode === "wsl-bridge") {
|
|
64
|
+
// Windows-side tools invoked via WSL wrapper
|
|
62
65
|
const envArgs = [`KANON_API_URL=${apiUrl}`];
|
|
63
66
|
if (apiKey) {
|
|
64
67
|
envArgs.push(`KANON_API_KEY=${apiKey}`);
|
|
@@ -74,6 +77,7 @@ export function buildMcpEntry(resolution, apiUrl, apiKey, wslMode, isWindowsNati
|
|
|
74
77
|
args: ["env", ...envArgs, nodeBin, resolution.path],
|
|
75
78
|
};
|
|
76
79
|
}
|
|
80
|
+
// Direct mode (linux, wsl-native tools, or win32)
|
|
77
81
|
const env = { KANON_API_URL: apiUrl };
|
|
78
82
|
if (apiKey) {
|
|
79
83
|
env["KANON_API_KEY"] = apiKey;
|
|
@@ -98,7 +102,8 @@ export function buildMcpEntry(resolution, apiUrl, apiKey, wslMode, isWindowsNati
|
|
|
98
102
|
*/
|
|
99
103
|
export function resolveMcpServerPath() {
|
|
100
104
|
// Try to find the local monorepo MCP dist
|
|
101
|
-
|
|
105
|
+
// Use fileURLToPath() instead of .pathname to handle Windows drive letters correctly
|
|
106
|
+
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
102
107
|
const localMcp = path.resolve(scriptDir, "../../mcp/dist/index.js");
|
|
103
108
|
if (fs.existsSync(localMcp)) {
|
|
104
109
|
return { mode: "local", path: localMcp };
|
package/dist/mcp-config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-config.js","sourceRoot":"","sources":["../src/mcp-config.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file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AAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC3C,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IAED,0DAA0D;IAC1D,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC1B,CAAC"}
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ToolDefinition } from "./types.js";
|
|
1
|
+
import type { ToolDefinition, PlatformContext } from "./types.js";
|
|
2
2
|
export declare const toolRegistry: ToolDefinition[];
|
|
3
3
|
/**
|
|
4
4
|
* Detect which tools are available on the system.
|
|
5
|
-
*
|
|
5
|
+
* Uses the per-platform paths map to check support and run detection.
|
|
6
6
|
*/
|
|
7
|
-
export declare function detectTools(
|
|
7
|
+
export declare function detectTools(ctx: PlatformContext): Promise<ToolDefinition[]>;
|
|
8
8
|
/**
|
|
9
9
|
* Find a tool by name from the registry.
|
|
10
10
|
*/
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlE,eAAO,MAAM,YAAY,EAAE,cAAc,EA2HxC,CAAC;AAEF;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,cAAc,EAAE,CAAC,CAiB3B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEtE"}
|
package/dist/registry.js
CHANGED
|
@@ -1,99 +1,125 @@
|
|
|
1
1
|
// ─── Tool Registry ───────────────────────────────────────────────────────────
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
-
import os from "node:os";
|
|
4
3
|
import { commandExists } from "./detect.js";
|
|
5
|
-
const home = os.homedir();
|
|
6
4
|
export const toolRegistry = [
|
|
7
5
|
// ── Claude Code ──────────────────────────────────────────────────────
|
|
8
6
|
{
|
|
9
7
|
name: "claude-code",
|
|
10
8
|
displayName: "Claude Code",
|
|
11
|
-
configPath: () => `${home}/.claude.json`,
|
|
12
9
|
rootKey: "mcpServers",
|
|
13
|
-
detect: async () => {
|
|
14
|
-
return fs.existsSync(`${home}/.claude`) || commandExists("claude");
|
|
15
|
-
},
|
|
16
|
-
skillDest: () => `${home}/.claude/skills`,
|
|
17
|
-
workflowDest: () => `${home}/.claude/workflows`,
|
|
18
10
|
templateSource: "claude-code-snippet.md",
|
|
19
|
-
templateTarget: () => `${home}/.claude/CLAUDE.md`,
|
|
20
11
|
templateMode: "marker-inject",
|
|
21
|
-
|
|
12
|
+
platforms: {
|
|
13
|
+
// Claude Code is NOT supported on win32 — no entry
|
|
14
|
+
wsl: {
|
|
15
|
+
detect: async (ctx) => fs.existsSync(`${ctx.homedir}/.claude`) ||
|
|
16
|
+
commandExists("claude", ctx.platform),
|
|
17
|
+
config: (ctx) => `${ctx.homedir}/.claude.json`,
|
|
18
|
+
skills: (ctx) => `${ctx.homedir}/.claude/skills`,
|
|
19
|
+
workflows: (ctx) => `${ctx.homedir}/.claude/workflows`,
|
|
20
|
+
template: (ctx) => `${ctx.homedir}/.claude/CLAUDE.md`,
|
|
21
|
+
mcpMode: "direct",
|
|
22
|
+
},
|
|
23
|
+
linux: {
|
|
24
|
+
detect: async (ctx) => fs.existsSync(`${ctx.homedir}/.claude`) ||
|
|
25
|
+
commandExists("claude", ctx.platform),
|
|
26
|
+
config: (ctx) => `${ctx.homedir}/.claude.json`,
|
|
27
|
+
skills: (ctx) => `${ctx.homedir}/.claude/skills`,
|
|
28
|
+
workflows: (ctx) => `${ctx.homedir}/.claude/workflows`,
|
|
29
|
+
template: (ctx) => `${ctx.homedir}/.claude/CLAUDE.md`,
|
|
30
|
+
mcpMode: "direct",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
22
33
|
},
|
|
23
34
|
// ── Cursor ───────────────────────────────────────────────────────────
|
|
24
35
|
{
|
|
25
36
|
name: "cursor",
|
|
26
37
|
displayName: "Cursor",
|
|
27
|
-
configPath: (winHome) => {
|
|
28
|
-
const base = winHome || home;
|
|
29
|
-
return `${base}/.cursor/mcp.json`;
|
|
30
|
-
},
|
|
31
38
|
rootKey: "mcpServers",
|
|
32
|
-
detect: async () => {
|
|
33
|
-
return fs.existsSync(`${home}/.cursor`);
|
|
34
|
-
},
|
|
35
|
-
wslDetect: async (winHome) => {
|
|
36
|
-
return fs.existsSync(`${winHome}/.cursor`);
|
|
37
|
-
},
|
|
38
|
-
skillDest: (winHome) => {
|
|
39
|
-
const base = winHome || home;
|
|
40
|
-
return `${base}/.cursor/skills`;
|
|
41
|
-
},
|
|
42
|
-
// Cursor has no global workflows
|
|
43
39
|
templateSource: "cursor-rules.mdc",
|
|
44
|
-
templateTarget: (winHome) => {
|
|
45
|
-
const base = winHome || home;
|
|
46
|
-
return `${base}/.cursor/rules/kanon.mdc`;
|
|
47
|
-
},
|
|
48
40
|
templateMode: "file-copy",
|
|
49
|
-
|
|
41
|
+
platforms: {
|
|
42
|
+
win32: {
|
|
43
|
+
detect: async (ctx) => {
|
|
44
|
+
const appData = ctx.appDataDir;
|
|
45
|
+
return !!appData && fs.existsSync(`${appData}\\Cursor\\User`);
|
|
46
|
+
},
|
|
47
|
+
config: (ctx) => {
|
|
48
|
+
const appData = ctx.appDataDir;
|
|
49
|
+
return `${appData}\\Cursor\\User\\mcp.json`;
|
|
50
|
+
},
|
|
51
|
+
skills: (ctx) => `${ctx.homedir}\\.cursor\\skills`,
|
|
52
|
+
template: (ctx) => `${ctx.homedir}\\.cursor\\rules\\kanon.mdc`,
|
|
53
|
+
mcpMode: "direct",
|
|
54
|
+
},
|
|
55
|
+
wsl: {
|
|
56
|
+
detect: async (ctx) => {
|
|
57
|
+
return !!ctx.winHome && fs.existsSync(`${ctx.winHome}/.cursor`);
|
|
58
|
+
},
|
|
59
|
+
config: (ctx) => `${ctx.winHome}/.cursor/mcp.json`,
|
|
60
|
+
skills: (ctx) => `${ctx.winHome}/.cursor/skills`,
|
|
61
|
+
template: (ctx) => `${ctx.winHome}/.cursor/rules/kanon.mdc`,
|
|
62
|
+
mcpMode: "wsl-bridge",
|
|
63
|
+
},
|
|
64
|
+
linux: {
|
|
65
|
+
detect: async (ctx) => fs.existsSync(`${ctx.homedir}/.cursor`),
|
|
66
|
+
config: (ctx) => `${ctx.homedir}/.cursor/mcp.json`,
|
|
67
|
+
skills: (ctx) => `${ctx.homedir}/.cursor/skills`,
|
|
68
|
+
template: (ctx) => `${ctx.homedir}/.cursor/rules/kanon.mdc`,
|
|
69
|
+
mcpMode: "direct",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
50
72
|
},
|
|
51
73
|
// ── Antigravity (Gemini) ─────────────────────────────────────────────
|
|
52
74
|
{
|
|
53
75
|
name: "antigravity",
|
|
54
76
|
displayName: "Antigravity",
|
|
55
|
-
configPath: (winHome) => {
|
|
56
|
-
const base = winHome || home;
|
|
57
|
-
return `${base}/.gemini/antigravity/mcp_config.json`;
|
|
58
|
-
},
|
|
59
77
|
rootKey: "mcpServers",
|
|
60
|
-
detect: async () => {
|
|
61
|
-
return fs.existsSync(`${home}/.gemini`);
|
|
62
|
-
},
|
|
63
|
-
wslDetect: async (winHome) => {
|
|
64
|
-
return fs.existsSync(`${winHome}/.gemini`);
|
|
65
|
-
},
|
|
66
|
-
skillDest: (winHome) => {
|
|
67
|
-
const base = winHome || home;
|
|
68
|
-
return `${base}/.gemini/antigravity/skills`;
|
|
69
|
-
},
|
|
70
|
-
workflowDest: (winHome) => {
|
|
71
|
-
const base = winHome || home;
|
|
72
|
-
return `${base}/.gemini/antigravity/global_workflows`;
|
|
73
|
-
},
|
|
74
78
|
templateSource: "gemini-instructions.md",
|
|
75
|
-
templateTarget: (winHome) => {
|
|
76
|
-
const base = winHome || home;
|
|
77
|
-
return `${base}/.gemini/GEMINI.md`;
|
|
78
|
-
},
|
|
79
79
|
templateMode: "marker-inject",
|
|
80
|
-
|
|
80
|
+
platforms: {
|
|
81
|
+
win32: {
|
|
82
|
+
detect: async (ctx) => fs.existsSync(`${ctx.homedir}\\.gemini`),
|
|
83
|
+
config: (ctx) => `${ctx.homedir}\\.gemini\\antigravity\\mcp_config.json`,
|
|
84
|
+
skills: (ctx) => `${ctx.homedir}\\.gemini\\antigravity\\skills`,
|
|
85
|
+
workflows: (ctx) => `${ctx.homedir}\\.gemini\\antigravity\\global_workflows`,
|
|
86
|
+
template: (ctx) => `${ctx.homedir}\\.gemini\\GEMINI.md`,
|
|
87
|
+
mcpMode: "direct",
|
|
88
|
+
},
|
|
89
|
+
wsl: {
|
|
90
|
+
detect: async (ctx) => {
|
|
91
|
+
return !!ctx.winHome && fs.existsSync(`${ctx.winHome}/.gemini`);
|
|
92
|
+
},
|
|
93
|
+
config: (ctx) => `${ctx.winHome}/.gemini/antigravity/mcp_config.json`,
|
|
94
|
+
skills: (ctx) => `${ctx.winHome}/.gemini/antigravity/skills`,
|
|
95
|
+
workflows: (ctx) => `${ctx.winHome}/.gemini/antigravity/global_workflows`,
|
|
96
|
+
template: (ctx) => `${ctx.winHome}/.gemini/GEMINI.md`,
|
|
97
|
+
mcpMode: "wsl-bridge",
|
|
98
|
+
},
|
|
99
|
+
linux: {
|
|
100
|
+
detect: async (ctx) => fs.existsSync(`${ctx.homedir}/.gemini`),
|
|
101
|
+
config: (ctx) => `${ctx.homedir}/.gemini/antigravity/mcp_config.json`,
|
|
102
|
+
skills: (ctx) => `${ctx.homedir}/.gemini/antigravity/skills`,
|
|
103
|
+
workflows: (ctx) => `${ctx.homedir}/.gemini/antigravity/global_workflows`,
|
|
104
|
+
template: (ctx) => `${ctx.homedir}/.gemini/GEMINI.md`,
|
|
105
|
+
mcpMode: "direct",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
81
108
|
},
|
|
82
109
|
];
|
|
83
110
|
/**
|
|
84
111
|
* Detect which tools are available on the system.
|
|
85
|
-
*
|
|
112
|
+
* Uses the per-platform paths map to check support and run detection.
|
|
86
113
|
*/
|
|
87
|
-
export async function detectTools(
|
|
114
|
+
export async function detectTools(ctx) {
|
|
88
115
|
const detected = [];
|
|
89
116
|
for (const tool of toolRegistry) {
|
|
90
|
-
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
else if (!tool.isWindowsNative || !wslMode) {
|
|
95
|
-
found = await tool.detect();
|
|
117
|
+
const platformPaths = tool.platforms[ctx.platform];
|
|
118
|
+
if (!platformPaths) {
|
|
119
|
+
// Tool doesn't support this platform — skip silently
|
|
120
|
+
continue;
|
|
96
121
|
}
|
|
122
|
+
const found = await platformPaths.detect(ctx);
|
|
97
123
|
if (found) {
|
|
98
124
|
detected.push(tool);
|
|
99
125
|
}
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C,wEAAwE;IACxE;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE,YAAY;QACrB,cAAc,EAAE,wBAAwB;QACxC,YAAY,EAAE,eAAe;QAE7B,SAAS,EAAE;YACT,mDAAmD;YACnD,GAAG,E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QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
+
export type Platform = "win32" | "wsl" | "linux";
|
|
2
|
+
export interface PlatformContext {
|
|
3
|
+
platform: Platform;
|
|
4
|
+
homedir: string;
|
|
5
|
+
winHome?: string;
|
|
6
|
+
appDataDir?: string;
|
|
7
|
+
}
|
|
8
|
+
export type McpMode = "direct" | "wsl-bridge";
|
|
9
|
+
export interface PlatformPaths {
|
|
10
|
+
detect: (ctx: PlatformContext) => Promise<boolean>;
|
|
11
|
+
config: (ctx: PlatformContext) => string;
|
|
12
|
+
skills: (ctx: PlatformContext) => string;
|
|
13
|
+
workflows?: (ctx: PlatformContext) => string;
|
|
14
|
+
template: (ctx: PlatformContext) => string;
|
|
15
|
+
mcpMode: McpMode;
|
|
16
|
+
}
|
|
1
17
|
export interface ToolDefinition {
|
|
2
18
|
name: string;
|
|
3
19
|
displayName: string;
|
|
4
|
-
configPath: (winHome?: string) => string;
|
|
5
20
|
rootKey: string;
|
|
6
|
-
detect: () => Promise<boolean>;
|
|
7
|
-
wslDetect?: (winHome: string) => Promise<boolean>;
|
|
8
|
-
skillDest: (winHome?: string) => string;
|
|
9
|
-
workflowDest?: (winHome?: string) => string;
|
|
10
21
|
templateSource: string;
|
|
11
|
-
templateTarget: (winHome?: string) => string;
|
|
12
22
|
templateMode: "marker-inject" | "file-copy";
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
export interface SetupOptions {
|
|
16
|
-
apiUrl: string;
|
|
17
|
-
apiKey: string;
|
|
18
|
-
tools: ToolDefinition[];
|
|
19
|
-
remove: boolean;
|
|
20
|
-
wslMode: boolean;
|
|
21
|
-
winHome?: string;
|
|
23
|
+
platforms: Partial<Record<Platform, PlatformPaths>>;
|
|
22
24
|
}
|
|
23
25
|
export interface McpServerEntry {
|
|
24
26
|
command: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACnD,MAAM,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,MAAM,CAAC;IACzC,MAAM,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,MAAM,CAAC;IACzC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,MAAM,CAAC;IAC7C,QAAQ,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,MAAM,CAAC;IAC3C,OAAO,EAAE,OAAO,CAAC;CAClB;AAID,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,eAAe,GAAG,WAAW,CAAC;IAG5C,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC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