@kanon-pm/setup 0.3.0 → 0.5.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/assets/agents/kanon.md +39 -0
- package/assets/skills/kanon-create-issue/SKILL.md +63 -267
- package/assets/skills/kanon-init/SKILL.md +57 -175
- package/assets/skills/kanon-mcp/SKILL.md +34 -114
- package/assets/skills/kanon-orchestrator-hooks/SKILL.md +26 -11
- package/assets/skills/kanon-roadmap/SKILL.md +84 -332
- package/dist/agents.d.ts +12 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/agents.js +61 -0
- package/dist/agents.js.map +1 -0
- package/dist/auth.d.ts +22 -8
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +162 -18
- package/dist/auth.js.map +1 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +96 -42
- package/dist/index.js.map +1 -1
- package/dist/mcp-config.d.ts +15 -0
- package/dist/mcp-config.d.ts.map +1 -1
- package/dist/mcp-config.js +66 -0
- package/dist/mcp-config.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +8 -0
- package/dist/registry.js.map +1 -1
- package/dist/types.d.ts +24 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/agents.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// ─── Agent Installer ─────────────────────────────────────────────────────────
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Install agent files from assets to the tool's agent directory.
|
|
6
|
+
* Only for tools that support agents (have an agentDest).
|
|
7
|
+
* Creates parent directories if needed. Idempotent — overwrites on re-run.
|
|
8
|
+
*/
|
|
9
|
+
export function installAgents(agentDest, assetsDir) {
|
|
10
|
+
const agentsSource = path.join(assetsDir, "agents");
|
|
11
|
+
if (!fs.existsSync(agentsSource)) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
const installed = [];
|
|
15
|
+
fs.mkdirSync(agentDest, { recursive: true });
|
|
16
|
+
// Clean stale kanon agents not in the current source set
|
|
17
|
+
const sourceFiles = fs.readdirSync(agentsSource).filter((f) => f.startsWith("kanon") && f.endsWith(".md"));
|
|
18
|
+
const sourceSet = new Set(sourceFiles);
|
|
19
|
+
if (fs.existsSync(agentDest)) {
|
|
20
|
+
const existing = fs.readdirSync(agentDest).filter((f) => f.startsWith("kanon") && f.endsWith(".md"));
|
|
21
|
+
for (const file of existing) {
|
|
22
|
+
if (!sourceSet.has(file)) {
|
|
23
|
+
fs.rmSync(path.join(agentDest, file));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const files = fs.readdirSync(agentsSource);
|
|
28
|
+
for (const file of files) {
|
|
29
|
+
if (!file.startsWith("kanon") || !file.endsWith(".md"))
|
|
30
|
+
continue;
|
|
31
|
+
const srcFile = path.join(agentsSource, file);
|
|
32
|
+
const destFile = path.join(agentDest, file);
|
|
33
|
+
if (fs.statSync(srcFile).isFile()) {
|
|
34
|
+
fs.copyFileSync(srcFile, destFile);
|
|
35
|
+
installed.push(file);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return installed;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Remove Kanon agent files from the tool's agent directory.
|
|
42
|
+
* Returns the list of agent files that were removed.
|
|
43
|
+
*/
|
|
44
|
+
export function removeAgents(agentDest) {
|
|
45
|
+
if (!fs.existsSync(agentDest)) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const removed = [];
|
|
49
|
+
const files = fs.readdirSync(agentDest);
|
|
50
|
+
for (const file of files) {
|
|
51
|
+
if (!file.startsWith("kanon") || !file.endsWith(".md"))
|
|
52
|
+
continue;
|
|
53
|
+
const filePath = path.join(agentDest, file);
|
|
54
|
+
if (fs.statSync(filePath).isFile()) {
|
|
55
|
+
fs.rmSync(filePath);
|
|
56
|
+
removed.push(file);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return removed;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,SAAiB,EACjB,SAAiB;IAEjB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACpD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,SAAS,GAAa,EAAE,CAAC;IAE/B,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7C,yDAAyD;IACzD,MAAM,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,MAAM,CACrD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAClD,CAAC;IACF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACvC,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,MAAM,CAC/C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAClD,CAAC;QACF,KAAK,MAAM,IAAI,IAAI,QAA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Q,CAAC,KAAK,CAAC;YAAE,SAAS;QAEjE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5C,IAAI,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;YACnC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
apiUrl: string;
|
|
3
|
-
apiKey: string;
|
|
4
|
-
}
|
|
1
|
+
import type { AuthResult, AuthDeps, PlatformContext } from "./types.js";
|
|
5
2
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
* Check if a URL points to a localhost address.
|
|
4
|
+
* Matches: localhost, 127.0.0.1, ::1, 0.0.0.0
|
|
5
|
+
*/
|
|
6
|
+
export declare function isLocalhost(url: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Auto-generate an API key by logging in with dev credentials.
|
|
9
|
+
* Only works against localhost URLs — returns null for remote or on any error.
|
|
10
|
+
*/
|
|
11
|
+
export declare function autoGenerateApiKey(apiUrl: string, fetchFn?: typeof globalThis.fetch): Promise<string | null>;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve API URL and key with a 5-step cascade:
|
|
14
|
+
* 1. CLI flags
|
|
15
|
+
* 2. Environment variables
|
|
16
|
+
* 3. Existing MCP config extraction
|
|
17
|
+
* 4. Auto-generation (localhost only)
|
|
18
|
+
* 5. Interactive prompt
|
|
19
|
+
*
|
|
20
|
+
* URL is resolved first (steps 1-5), then key (steps 1-5),
|
|
21
|
+
* because auto-generating a key requires a resolved URL.
|
|
8
22
|
*/
|
|
9
23
|
export declare function resolveAuth(options: {
|
|
10
24
|
apiUrl?: string;
|
|
11
25
|
apiKey?: string;
|
|
12
|
-
|
|
13
|
-
|
|
26
|
+
yes?: boolean;
|
|
27
|
+
}, ctx: PlatformContext, deps?: AuthDeps): Promise<AuthResult>;
|
|
14
28
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGxE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAchD;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,OAAO,UAAU,CAAC,KAAwB,GAClD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsCxB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,EAC5D,GAAG,EAAE,eAAe,EACpB,IAAI,CAAC,EAAE,QAAQ,GACd,OAAO,CAAC,UAAU,CAAC,CAgHrB"}
|
package/dist/auth.js
CHANGED
|
@@ -1,33 +1,177 @@
|
|
|
1
1
|
// ─── Auth Resolution ─────────────────────────────────────────────────────────
|
|
2
|
-
import
|
|
2
|
+
import { input, password } from "@inquirer/prompts";
|
|
3
|
+
import { extractExistingAuth } from "./mcp-config.js";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
5
|
+
* Check if a URL points to a localhost address.
|
|
6
|
+
* Matches: localhost, 127.0.0.1, ::1, 0.0.0.0
|
|
6
7
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
export function isLocalhost(url) {
|
|
9
|
+
try {
|
|
10
|
+
const parsed = new URL(url);
|
|
11
|
+
const host = parsed.hostname;
|
|
12
|
+
return (host === "localhost" ||
|
|
13
|
+
host === "127.0.0.1" ||
|
|
14
|
+
host === "::1" ||
|
|
15
|
+
host === "[::1]" ||
|
|
16
|
+
host === "0.0.0.0");
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Auto-generate an API key by logging in with dev credentials.
|
|
24
|
+
* Only works against localhost URLs — returns null for remote or on any error.
|
|
25
|
+
*/
|
|
26
|
+
export async function autoGenerateApiKey(apiUrl, fetchFn = globalThis.fetch) {
|
|
27
|
+
if (!isLocalhost(apiUrl)) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
// Step 1: Login with dev credentials
|
|
32
|
+
const loginResp = await fetchFn(`${apiUrl}/api/auth/login`, {
|
|
33
|
+
method: "POST",
|
|
34
|
+
headers: { "Content-Type": "application/json" },
|
|
35
|
+
body: JSON.stringify({
|
|
36
|
+
email: "dev@kanon.io",
|
|
37
|
+
password: "Password1!",
|
|
38
|
+
workspaceId: "kanon-dev",
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
if (!loginResp.ok)
|
|
42
|
+
return null;
|
|
43
|
+
const loginData = (await loginResp.json());
|
|
44
|
+
const accessToken = loginData.accessToken;
|
|
45
|
+
if (!accessToken)
|
|
46
|
+
return null;
|
|
47
|
+
// Step 2: Generate API key
|
|
48
|
+
const keyResp = await fetchFn(`${apiUrl}/api/auth/api-key`, {
|
|
49
|
+
method: "POST",
|
|
50
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
51
|
+
});
|
|
52
|
+
if (!keyResp.ok)
|
|
53
|
+
return null;
|
|
54
|
+
const keyData = (await keyResp.json());
|
|
55
|
+
return keyData.apiKey ?? null;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Resolve API URL and key with a 5-step cascade:
|
|
63
|
+
* 1. CLI flags
|
|
64
|
+
* 2. Environment variables
|
|
65
|
+
* 3. Existing MCP config extraction
|
|
66
|
+
* 4. Auto-generation (localhost only)
|
|
67
|
+
* 5. Interactive prompt
|
|
68
|
+
*
|
|
69
|
+
* URL is resolved first (steps 1-5), then key (steps 1-5),
|
|
70
|
+
* because auto-generating a key requires a resolved URL.
|
|
71
|
+
*/
|
|
72
|
+
export async function resolveAuth(options, ctx, deps) {
|
|
73
|
+
const _extractExisting = deps?.extractExisting ?? extractExistingAuth;
|
|
74
|
+
const _autoGenerateKey = deps?.autoGenerateKey ?? autoGenerateApiKey;
|
|
75
|
+
const _promptUrl = deps?.promptUrl ?? defaultPromptUrl;
|
|
76
|
+
const _promptKey = deps?.promptKey ?? defaultPromptKey;
|
|
77
|
+
const _fetchFn = deps?.fetchFn ?? globalThis.fetch;
|
|
78
|
+
let apiUrl;
|
|
79
|
+
let urlSource = "flag";
|
|
80
|
+
// ── Resolve URL ────────────────────────────────────────────────────
|
|
81
|
+
// Step 1: Flag
|
|
82
|
+
if (options.apiUrl) {
|
|
83
|
+
apiUrl = options.apiUrl;
|
|
84
|
+
urlSource = "flag";
|
|
85
|
+
}
|
|
86
|
+
// Step 2: Env
|
|
87
|
+
if (!apiUrl && process.env["KANON_API_URL"]) {
|
|
88
|
+
apiUrl = process.env["KANON_API_URL"];
|
|
89
|
+
urlSource = "env";
|
|
90
|
+
}
|
|
91
|
+
// Step 3: Existing config
|
|
92
|
+
if (!apiUrl) {
|
|
93
|
+
const existing = _extractExisting(ctx);
|
|
94
|
+
if (existing.apiUrl) {
|
|
95
|
+
apiUrl = existing.apiUrl;
|
|
96
|
+
urlSource = "existing-config";
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Step 4: Auto-detect localhost
|
|
10
100
|
if (!apiUrl) {
|
|
11
|
-
|
|
101
|
+
try {
|
|
102
|
+
const healthResp = await _fetchFn("http://localhost:3000/health");
|
|
103
|
+
if (healthResp.ok) {
|
|
104
|
+
apiUrl = "http://localhost:3000";
|
|
105
|
+
urlSource = "auto-generated";
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// localhost not running — fall through
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Step 5: Interactive prompt
|
|
113
|
+
if (!apiUrl) {
|
|
114
|
+
if (options.yes || !process.stdin.isTTY) {
|
|
115
|
+
throw new Error("API URL could not be resolved automatically. " +
|
|
116
|
+
"Provide via --api-url flag or KANON_API_URL env var.");
|
|
117
|
+
}
|
|
118
|
+
apiUrl = await _promptUrl();
|
|
119
|
+
urlSource = "prompt";
|
|
12
120
|
}
|
|
13
121
|
if (!apiUrl) {
|
|
14
122
|
throw new Error("API URL is required. Provide via --api-url, KANON_API_URL env var, or enter it when prompted.");
|
|
15
123
|
}
|
|
124
|
+
// ── Resolve Key ────────────────────────────────────────────────────
|
|
125
|
+
let apiKey;
|
|
126
|
+
let keySource = "flag";
|
|
127
|
+
// Step 1: Flag
|
|
128
|
+
if (options.apiKey) {
|
|
129
|
+
apiKey = options.apiKey;
|
|
130
|
+
keySource = "flag";
|
|
131
|
+
}
|
|
132
|
+
// Step 2: Env
|
|
133
|
+
if (!apiKey && process.env["KANON_API_KEY"]) {
|
|
134
|
+
apiKey = process.env["KANON_API_KEY"];
|
|
135
|
+
keySource = "env";
|
|
136
|
+
}
|
|
137
|
+
// Step 3: Existing config
|
|
16
138
|
if (!apiKey) {
|
|
17
|
-
|
|
139
|
+
const existing = _extractExisting(ctx);
|
|
140
|
+
if (existing.apiKey) {
|
|
141
|
+
apiKey = existing.apiKey;
|
|
142
|
+
keySource = "existing-config";
|
|
143
|
+
}
|
|
18
144
|
}
|
|
19
|
-
|
|
145
|
+
// Step 4: Auto-generate (localhost only)
|
|
146
|
+
if (!apiKey) {
|
|
147
|
+
const generated = await _autoGenerateKey(apiUrl);
|
|
148
|
+
if (generated) {
|
|
149
|
+
apiKey = generated;
|
|
150
|
+
keySource = "auto-generated";
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// Step 5: Interactive prompt
|
|
154
|
+
if (!apiKey) {
|
|
155
|
+
if (options.yes || !process.stdin.isTTY) {
|
|
156
|
+
throw new Error("API key could not be resolved automatically. " +
|
|
157
|
+
"Provide via --api-key flag or KANON_API_KEY env var.");
|
|
158
|
+
}
|
|
159
|
+
apiKey = await _promptKey();
|
|
160
|
+
keySource = "prompt";
|
|
161
|
+
}
|
|
162
|
+
return { apiUrl, apiKey: apiKey ?? "", urlSource, keySource };
|
|
20
163
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
164
|
+
// ── Default prompt implementations ──────────────────────────────────────────
|
|
165
|
+
async function defaultPromptUrl() {
|
|
166
|
+
return input({
|
|
167
|
+
message: "Kanon API URL:",
|
|
168
|
+
default: "http://localhost:3000",
|
|
25
169
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
170
|
+
}
|
|
171
|
+
async function defaultPromptKey() {
|
|
172
|
+
return password({
|
|
173
|
+
message: "Kanon API Key:",
|
|
174
|
+
mask: "*",
|
|
31
175
|
});
|
|
32
176
|
}
|
|
33
177
|
//# sourceMappingURL=auth.js.map
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF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AED,KAAK,UAAU,gBAAgB;IAC7B,OAAO,QAAQ,CAAC;QACd,OAAO,EAAE,gBAAgB;QACzB,IAAI,EAAE,GAAG;KACV,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import type { ToolDefinition, PlatformContext } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Select which tools to configure based on flags or interactive checkbox.
|
|
5
|
+
*
|
|
6
|
+
* - --tool <name> → single tool (validated against registry)
|
|
7
|
+
* - --all or --yes → all detected tools
|
|
8
|
+
* - interactive (TTY, no flags) → checkbox with all pre-selected
|
|
9
|
+
* - non-interactive (no TTY, no flags) → all detected tools
|
|
10
|
+
*/
|
|
11
|
+
export declare function selectTools(detected: ToolDefinition[], flags: {
|
|
12
|
+
tool?: string;
|
|
13
|
+
all?: boolean;
|
|
14
|
+
yes?: boolean;
|
|
15
|
+
}, isInteractive: boolean, ctx: PlatformContext, deps?: {
|
|
16
|
+
promptTools?: (choices: Array<{
|
|
17
|
+
name: string;
|
|
18
|
+
value: string;
|
|
19
|
+
checked: boolean;
|
|
20
|
+
}>) => Promise<string[]>;
|
|
21
|
+
}): Promise<ToolDefinition[]>;
|
|
3
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAoBA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAc,MAAM,YAAY,CAAC;AAoT9E;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,cAAc,EAAE,EAC1B,KAAK,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,EACtD,aAAa,EAAE,OAAO,EACtB,GAAG,EAAE,eAAe,EACpB,IAAI,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;CAAE,GAChH,OAAO,CAAC,cAAc,EAAE,CAAC,CAoD3B"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// ─── Kanon Setup ───────────────────────────────────────────────────────────────
|
|
3
3
|
import { Command } from "commander";
|
|
4
4
|
import chalk from "chalk";
|
|
5
|
+
import { checkbox } from "@inquirer/prompts";
|
|
5
6
|
import { buildPlatformContext } from "./detect.js";
|
|
6
7
|
import { resolveAuth } from "./auth.js";
|
|
7
8
|
import { detectTools, getToolByName } from "./registry.js";
|
|
@@ -9,6 +10,7 @@ import { buildMcpEntry, mergeConfig, removeConfig, resolveMcpServerPath, resolve
|
|
|
9
10
|
import { installSkills, removeSkills } from "./skills.js";
|
|
10
11
|
import { installTemplate, removeTemplate } from "./templates.js";
|
|
11
12
|
import { installWorkflows, removeWorkflows } from "./workflows.js";
|
|
13
|
+
import { installAgents, removeAgents } from "./agents.js";
|
|
12
14
|
import path from "node:path";
|
|
13
15
|
import { fileURLToPath } from "node:url";
|
|
14
16
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -29,7 +31,8 @@ program
|
|
|
29
31
|
.option("--api-key <key>", "Kanon API key")
|
|
30
32
|
.option("--tool <name>", "Target a specific tool (claude-code, cursor, antigravity)")
|
|
31
33
|
.option("--all", "Configure all detected tools")
|
|
32
|
-
.option("--remove", "Remove Kanon configuration from tools")
|
|
34
|
+
.option("--remove", "Remove Kanon configuration from tools")
|
|
35
|
+
.option("-y, --yes", "Accept all defaults without interactive prompts");
|
|
33
36
|
program.action(async (options) => {
|
|
34
37
|
try {
|
|
35
38
|
await run(options);
|
|
@@ -43,58 +46,35 @@ program.action(async (options) => {
|
|
|
43
46
|
async function run(options) {
|
|
44
47
|
const removeMode = options.remove === true;
|
|
45
48
|
const assetsDir = getAssetsDir();
|
|
46
|
-
|
|
49
|
+
const isInteractive = !options.yes && !options.tool && !options.all && !!process.stdin.isTTY;
|
|
50
|
+
// ── 1. Platform Detection ──────────────────────────────────────────
|
|
47
51
|
const ctx = await buildPlatformContext();
|
|
52
|
+
const platformLabel = ctx.platform === "wsl" ? "WSL2" : ctx.platform.charAt(0).toUpperCase() + ctx.platform.slice(1);
|
|
53
|
+
console.log(chalk.cyan("[info]") + ` Detected platform: ${chalk.bold(platformLabel)}`);
|
|
48
54
|
if (ctx.platform === "wsl") {
|
|
49
55
|
if (ctx.winHome) {
|
|
50
56
|
console.log(chalk.cyan("[info]") +
|
|
51
|
-
`
|
|
57
|
+
` Windows home: ${chalk.bold(ctx.winHome)}`);
|
|
52
58
|
}
|
|
53
59
|
else {
|
|
54
60
|
console.log(chalk.yellow("[warn]") +
|
|
55
61
|
" WSL detected but could not resolve Windows home directory");
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
|
-
// ──
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
throw new Error(`Unknown tool: '${options.tool}'. Supported: claude-code, cursor, antigravity`);
|
|
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
|
-
}
|
|
69
|
-
selectedTools = [tool];
|
|
70
|
-
}
|
|
71
|
-
else if (options.all) {
|
|
72
|
-
selectedTools = await detectTools(ctx);
|
|
73
|
-
if (selectedTools.length === 0) {
|
|
74
|
-
throw new Error("No supported tools detected. Install at least one supported AI coding tool.");
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
// Detect and show what's available
|
|
79
|
-
selectedTools = await detectTools(ctx);
|
|
80
|
-
if (selectedTools.length === 0) {
|
|
81
|
-
throw new Error("No supported tools detected. Install at least one supported AI coding tool.");
|
|
82
|
-
}
|
|
83
|
-
console.log("");
|
|
84
|
-
console.log(chalk.bold("Detected AI coding tools:"));
|
|
85
|
-
for (const tool of selectedTools) {
|
|
86
|
-
console.log(` ${chalk.cyan("-")} ${tool.displayName}`);
|
|
87
|
-
}
|
|
88
|
-
console.log("");
|
|
89
|
-
}
|
|
90
|
-
// ── Auth Resolution (skip for --remove) ────────────────────────────
|
|
64
|
+
// ── 2. Detect all tools ────────────────────────────────────────────
|
|
65
|
+
const detectedTools = await detectTools(ctx);
|
|
66
|
+
// ── 3. Select tools (interactive or flag-based) ────────────────────
|
|
67
|
+
const selectedTools = await selectTools(detectedTools, { tool: options.tool, all: options.all, yes: options.yes }, isInteractive, ctx);
|
|
68
|
+
// ── 4. Auth Resolution (skip for --remove) ─────────────────────────
|
|
91
69
|
let apiUrl = "";
|
|
92
70
|
let apiKey = "";
|
|
71
|
+
let auth;
|
|
93
72
|
if (!removeMode) {
|
|
94
|
-
|
|
73
|
+
auth = await resolveAuth({
|
|
95
74
|
apiUrl: options.apiUrl,
|
|
96
75
|
apiKey: options.apiKey,
|
|
97
|
-
|
|
76
|
+
yes: options.yes,
|
|
77
|
+
}, ctx);
|
|
98
78
|
apiUrl = auth.apiUrl;
|
|
99
79
|
apiKey = auth.apiKey;
|
|
100
80
|
}
|
|
@@ -154,6 +134,15 @@ async function run(options) {
|
|
|
154
134
|
` Removed ${removedWfs.length} workflows from ${chalk.bold(tool.displayName)}`);
|
|
155
135
|
}
|
|
156
136
|
}
|
|
137
|
+
// Remove agents
|
|
138
|
+
if (platformPaths.agents) {
|
|
139
|
+
const agentDir = platformPaths.agents(ctx);
|
|
140
|
+
const removedAgents = removeAgents(agentDir);
|
|
141
|
+
if (removedAgents.length > 0) {
|
|
142
|
+
console.log(chalk.green(" ✓") +
|
|
143
|
+
` Removed ${removedAgents.length} agents from ${chalk.bold(tool.displayName)}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
157
146
|
successCount++;
|
|
158
147
|
}
|
|
159
148
|
else {
|
|
@@ -182,23 +171,88 @@ async function run(options) {
|
|
|
182
171
|
` Installed ${installedWfs.length} workflows to ${chalk.cyan(wfDir)}`);
|
|
183
172
|
}
|
|
184
173
|
}
|
|
174
|
+
// 5. Agents
|
|
175
|
+
if (platformPaths.agents) {
|
|
176
|
+
const agentDir = platformPaths.agents(ctx);
|
|
177
|
+
const installedAgents = installAgents(agentDir, assetsDir);
|
|
178
|
+
if (installedAgents.length > 0) {
|
|
179
|
+
console.log(chalk.green(" ✓") +
|
|
180
|
+
` Installed ${installedAgents.length} agents to ${chalk.cyan(agentDir)}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
185
183
|
successCount++;
|
|
186
184
|
}
|
|
187
185
|
console.log("");
|
|
188
186
|
}
|
|
189
|
-
// ── Summary
|
|
187
|
+
// ── 6. Summary ─────────────────────────────────────────────────────
|
|
190
188
|
if (removeMode) {
|
|
191
189
|
console.log(chalk.green(`✓ Removed Kanon configuration from ${successCount} tool(s).`));
|
|
192
190
|
}
|
|
193
191
|
else {
|
|
194
|
-
console.log(chalk.green(`✓
|
|
192
|
+
console.log(chalk.green(`✓ Configured ${successCount} tool(s)!`));
|
|
195
193
|
console.log("");
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
if (auth) {
|
|
195
|
+
const maskKey = (key) => key.length > 4 ? "****" + key.slice(-4) : "****";
|
|
196
|
+
console.log(` API URL: ${chalk.cyan(apiUrl)} ${chalk.dim(`(from ${auth.urlSource})`)}`);
|
|
197
|
+
console.log(` API Key: ${chalk.cyan(maskKey(apiKey))} ${chalk.dim(`(${auth.keySource})`)}`);
|
|
198
|
+
}
|
|
198
199
|
console.log("");
|
|
199
200
|
console.log(chalk.yellow(" Restart your AI coding tool(s) to pick up the new configuration."));
|
|
200
201
|
}
|
|
201
202
|
console.log("");
|
|
202
203
|
}
|
|
204
|
+
// ─── Tool Selection ──────────────────────────────────────────────────────────
|
|
205
|
+
/**
|
|
206
|
+
* Select which tools to configure based on flags or interactive checkbox.
|
|
207
|
+
*
|
|
208
|
+
* - --tool <name> → single tool (validated against registry)
|
|
209
|
+
* - --all or --yes → all detected tools
|
|
210
|
+
* - interactive (TTY, no flags) → checkbox with all pre-selected
|
|
211
|
+
* - non-interactive (no TTY, no flags) → all detected tools
|
|
212
|
+
*/
|
|
213
|
+
export async function selectTools(detected, flags, isInteractive, ctx, deps) {
|
|
214
|
+
// --tool flag: single tool by name
|
|
215
|
+
if (flags.tool) {
|
|
216
|
+
const tool = getToolByName(flags.tool);
|
|
217
|
+
if (!tool) {
|
|
218
|
+
throw new Error(`Unknown tool: '${flags.tool}'. Supported: claude-code, cursor, antigravity`);
|
|
219
|
+
}
|
|
220
|
+
if (!tool.platforms[ctx.platform]) {
|
|
221
|
+
throw new Error(`${tool.displayName} is not supported on ${ctx.platform}`);
|
|
222
|
+
}
|
|
223
|
+
return [tool];
|
|
224
|
+
}
|
|
225
|
+
// No tools detected → error
|
|
226
|
+
if (detected.length === 0) {
|
|
227
|
+
throw new Error("No supported tools detected. Install at least one supported AI coding tool.");
|
|
228
|
+
}
|
|
229
|
+
// --all or --yes → all detected
|
|
230
|
+
if (flags.all || flags.yes) {
|
|
231
|
+
return detected;
|
|
232
|
+
}
|
|
233
|
+
// Non-interactive (no TTY) → all detected
|
|
234
|
+
if (!isInteractive) {
|
|
235
|
+
return detected;
|
|
236
|
+
}
|
|
237
|
+
// Interactive → checkbox with all pre-selected
|
|
238
|
+
const _promptTools = deps?.promptTools ?? defaultPromptTools;
|
|
239
|
+
console.log("");
|
|
240
|
+
const selectedNames = await _promptTools(detected.map((t) => ({
|
|
241
|
+
name: t.displayName,
|
|
242
|
+
value: t.name,
|
|
243
|
+
checked: true,
|
|
244
|
+
})));
|
|
245
|
+
if (selectedNames.length === 0) {
|
|
246
|
+
console.log(chalk.yellow("No tools selected — nothing to do."));
|
|
247
|
+
process.exit(0);
|
|
248
|
+
}
|
|
249
|
+
return detected.filter((t) => selectedNames.includes(t.name));
|
|
250
|
+
}
|
|
251
|
+
async function defaultPromptTools(choices) {
|
|
252
|
+
return checkbox({
|
|
253
|
+
message: "Select tools to configure:",
|
|
254
|
+
choices,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
203
257
|
program.parse();
|
|
204
258
|
//# sourceMappingURL=index.js.map
|
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,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EACL,aAAa,EACb,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
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,EAA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,CAAC,KAAK,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,KAAK,UAAU,kBAAkB,CAC/B,OAAiE;IAEjE,OAAO,QAAQ,CAAC;QACd,OAAO,EAAE,4BAA4B;QACrC,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AAED,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/mcp-config.d.ts
CHANGED
|
@@ -34,4 +34,19 @@ export declare function resolveMcpServerPath(): McpResolution;
|
|
|
34
34
|
* Resolve the path to the node binary.
|
|
35
35
|
*/
|
|
36
36
|
export declare function resolveNodeBin(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Extract auth credentials from existing kanon-mcp entries across all tool configs.
|
|
39
|
+
*
|
|
40
|
+
* Scans each tool in the registry that supports the current platform, reads its
|
|
41
|
+
* MCP config file, and looks for a "kanon-mcp" entry. Extracts KANON_API_URL and
|
|
42
|
+
* KANON_API_KEY from:
|
|
43
|
+
* - Direct mode: `entry.env.KANON_API_URL` / `entry.env.KANON_API_KEY`
|
|
44
|
+
* - WSL bridge mode: parses `entry.args` array for `KANON_API_URL=xxx` patterns
|
|
45
|
+
*
|
|
46
|
+
* Returns the first values found. Missing files/entries are handled gracefully.
|
|
47
|
+
*/
|
|
48
|
+
export declare function extractExistingAuth(ctx: PlatformContext): {
|
|
49
|
+
apiUrl?: string;
|
|
50
|
+
apiKey?: string;
|
|
51
|
+
};
|
|
37
52
|
//# sourceMappingURL=mcp-config.d.ts.map
|
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":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../src/mcp-config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,eAAe,EAChB,MAAM,YAAY,CAAC;AAGpB;;;;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;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,eAAe,GACnB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CA2DtC"}
|