@kanon-pm/setup 0.2.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/.gitkeep +0 -0
- package/assets/skills/kanon-create-issue/SKILL.md +435 -0
- package/assets/skills/kanon-init/SKILL.md +363 -0
- package/assets/skills/kanon-mcp/SKILL.md +248 -0
- package/assets/skills/kanon-orchestrator-hooks/SKILL.md +43 -0
- package/assets/skills/kanon-roadmap/SKILL.md +466 -0
- package/assets/templates/claude-code-snippet.md +13 -0
- package/assets/templates/cursor-rules.mdc +29 -0
- package/assets/templates/gemini-instructions.md +19 -0
- package/assets/workflows/kanon-create-issue.md +9 -0
- package/assets/workflows/kanon-init.md +10 -0
- package/dist/auth.d.ts +14 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +33 -0
- package/dist/auth.js.map +1 -0
- package/dist/detect.d.ts +14 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +50 -0
- package/dist/detect.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +200 -0
- package/dist/index.js.map +1 -0
- package/dist/installers/index.d.ts +5 -0
- package/dist/installers/index.d.ts.map +1 -0
- package/dist/installers/index.js +7 -0
- package/dist/installers/index.js.map +1 -0
- package/dist/mcp-config.d.ts +35 -0
- package/dist/mcp-config.d.ts.map +1 -0
- package/dist/mcp-config.js +125 -0
- package/dist/mcp-config.js.map +1 -0
- package/dist/registry.d.ts +12 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +109 -0
- package/dist/registry.js.map +1 -0
- package/dist/skills.d.ts +11 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +56 -0
- package/dist/skills.js.map +1 -0
- package/dist/templates.d.ts +17 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +86 -0
- package/dist/templates.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/workflows.d.ts +12 -0
- package/dist/workflows.d.ts.map +1 -0
- package/dist/workflows.js +61 -0
- package/dist/workflows.js.map +1 -0
- package/package.json +29 -0
package/dist/skills.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// ─── Skill Installer ─────────────────────────────────────────────────────────
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
const PRODUCT_SKILLS = [
|
|
5
|
+
"kanon-mcp",
|
|
6
|
+
"kanon-init",
|
|
7
|
+
"kanon-create-issue",
|
|
8
|
+
"kanon-roadmap",
|
|
9
|
+
"kanon-orchestrator-hooks",
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* Install product skills from assets directory to the tool's skill directory.
|
|
13
|
+
* Creates parent directories if needed. Idempotent — overwrites on re-run.
|
|
14
|
+
*/
|
|
15
|
+
export function installSkills(skillDest, assetsDir) {
|
|
16
|
+
const skillsSource = path.join(assetsDir, "skills");
|
|
17
|
+
if (!fs.existsSync(skillsSource)) {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
const installed = [];
|
|
21
|
+
for (const skillName of PRODUCT_SKILLS) {
|
|
22
|
+
const srcDir = path.join(skillsSource, skillName);
|
|
23
|
+
if (!fs.existsSync(srcDir))
|
|
24
|
+
continue;
|
|
25
|
+
const destDir = path.join(skillDest, skillName);
|
|
26
|
+
fs.rmSync(destDir, { recursive: true, force: true });
|
|
27
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
28
|
+
// Copy all files in the skill directory
|
|
29
|
+
const files = fs.readdirSync(srcDir);
|
|
30
|
+
for (const file of files) {
|
|
31
|
+
const srcFile = path.join(srcDir, file);
|
|
32
|
+
const destFile = path.join(destDir, file);
|
|
33
|
+
if (fs.statSync(srcFile).isFile()) {
|
|
34
|
+
fs.copyFileSync(srcFile, destFile);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
installed.push(skillName);
|
|
38
|
+
}
|
|
39
|
+
return installed;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Remove Kanon product skill directories from the tool's skill directory.
|
|
43
|
+
* Returns the list of skills that were removed.
|
|
44
|
+
*/
|
|
45
|
+
export function removeSkills(skillDest) {
|
|
46
|
+
const removed = [];
|
|
47
|
+
for (const skillName of PRODUCT_SKILLS) {
|
|
48
|
+
const dir = path.join(skillDest, skillName);
|
|
49
|
+
if (fs.existsSync(dir)) {
|
|
50
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
51
|
+
removed.push(skillName);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return removed;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,cAAc,GAAG;IACrB,WAAW;IACX,YAAY;IACZ,oBAAoB;IACpB,eAAe;IACf,0BAA0B;CAC3B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB,EAAE,SAAiB;IAChE,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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C;QAC5C,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACjD,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install a template to the target location.
|
|
3
|
+
*
|
|
4
|
+
* Two strategies:
|
|
5
|
+
* - "marker-inject": Insert content between start/end markers in the target file.
|
|
6
|
+
* Creates the file if it doesn't exist. Replaces content between markers on re-run.
|
|
7
|
+
* - "file-copy": Copy the template file to the destination, overwriting on re-run.
|
|
8
|
+
*/
|
|
9
|
+
export declare function installTemplate(templateTarget: string, templateSource: string, assetsDir: string, mode: "marker-inject" | "file-copy"): void;
|
|
10
|
+
/**
|
|
11
|
+
* Remove template content from the target location.
|
|
12
|
+
*
|
|
13
|
+
* - "marker-inject": Remove everything between markers (inclusive).
|
|
14
|
+
* - "file-copy": Delete the target file.
|
|
15
|
+
*/
|
|
16
|
+
export declare function removeTemplate(templateTarget: string, mode: "marker-inject" | "file-copy"): boolean;
|
|
17
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,eAAe,GAAG,WAAW,GAClC,IAAI,CA4CN;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,eAAe,GAAG,WAAW,GAClC,OAAO,CAiCT"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// ─── Template Installer ──────────────────────────────────────────────────────
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
const MARKER_START = "<!-- kanon-mcp-start -->";
|
|
5
|
+
const MARKER_END = "<!-- kanon-mcp-end -->";
|
|
6
|
+
/**
|
|
7
|
+
* Install a template to the target location.
|
|
8
|
+
*
|
|
9
|
+
* Two strategies:
|
|
10
|
+
* - "marker-inject": Insert content between start/end markers in the target file.
|
|
11
|
+
* Creates the file if it doesn't exist. Replaces content between markers on re-run.
|
|
12
|
+
* - "file-copy": Copy the template file to the destination, overwriting on re-run.
|
|
13
|
+
*/
|
|
14
|
+
export function installTemplate(templateTarget, templateSource, assetsDir, mode) {
|
|
15
|
+
const srcPath = path.join(assetsDir, "templates", templateSource);
|
|
16
|
+
if (!fs.existsSync(srcPath)) {
|
|
17
|
+
throw new Error(`Template source not found: ${srcPath}`);
|
|
18
|
+
}
|
|
19
|
+
const snippet = fs.readFileSync(srcPath, "utf8");
|
|
20
|
+
const targetDir = path.dirname(templateTarget);
|
|
21
|
+
if (!fs.existsSync(targetDir)) {
|
|
22
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
23
|
+
}
|
|
24
|
+
if (mode === "file-copy") {
|
|
25
|
+
fs.writeFileSync(templateTarget, snippet);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// marker-inject mode
|
|
29
|
+
if (fs.existsSync(templateTarget)) {
|
|
30
|
+
const content = fs.readFileSync(templateTarget, "utf8");
|
|
31
|
+
if (content.includes(MARKER_START)) {
|
|
32
|
+
// Replace existing section between markers
|
|
33
|
+
const startIdx = content.indexOf(MARKER_START);
|
|
34
|
+
const endIdx = content.indexOf(MARKER_END);
|
|
35
|
+
if (startIdx !== -1 && endIdx !== -1) {
|
|
36
|
+
const before = content.substring(0, startIdx);
|
|
37
|
+
const after = content.substring(endIdx + MARKER_END.length);
|
|
38
|
+
fs.writeFileSync(templateTarget, before + snippet.trim() + after);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Append with a blank line separator
|
|
43
|
+
const sep = content.endsWith("\n") ? "\n" : "\n\n";
|
|
44
|
+
fs.writeFileSync(templateTarget, content + sep + snippet);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// Create new file with the snippet
|
|
48
|
+
fs.writeFileSync(templateTarget, snippet);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Remove template content from the target location.
|
|
53
|
+
*
|
|
54
|
+
* - "marker-inject": Remove everything between markers (inclusive).
|
|
55
|
+
* - "file-copy": Delete the target file.
|
|
56
|
+
*/
|
|
57
|
+
export function removeTemplate(templateTarget, mode) {
|
|
58
|
+
if (!fs.existsSync(templateTarget)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
if (mode === "file-copy") {
|
|
62
|
+
fs.rmSync(templateTarget);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
// marker-inject mode — remove section between markers
|
|
66
|
+
const content = fs.readFileSync(templateTarget, "utf8");
|
|
67
|
+
if (!content.includes(MARKER_START)) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
const startIdx = content.indexOf(MARKER_START);
|
|
71
|
+
const endIdx = content.indexOf(MARKER_END);
|
|
72
|
+
if (startIdx === -1 || endIdx === -1) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
// Remove section and clean up surrounding whitespace
|
|
76
|
+
const before = content.substring(0, startIdx).replace(/\n+$/, "\n");
|
|
77
|
+
const after = content
|
|
78
|
+
.substring(endIdx + MARKER_END.length)
|
|
79
|
+
.replace(/^\n+/, "\n");
|
|
80
|
+
let result = before + after;
|
|
81
|
+
// Clean up excessive blank lines
|
|
82
|
+
result = result.replace(/\n{3,}/g, "\n\n").trimEnd() + "\n";
|
|
83
|
+
fs.writeFileSync(templateTarget, result);
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAChD,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,cAAsB,EACtB,cAAsB,EACtB,SAAiB,EACjB,IAAmC;IAEnC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;IAClE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAE/C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;QACzB,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAC1C,OAAO;IACT,CAAC;IAED,qBAAqB;IACrB,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,EA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0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,4CAA4C;AAE5C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ToolDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
configPath: (winHome?: string) => string;
|
|
5
|
+
rootKey: string;
|
|
6
|
+
detect: () => Promise<boolean>;
|
|
7
|
+
wslDetect?: (winHome: string) => Promise<boolean>;
|
|
8
|
+
skillDest: (winHome?: string) => string;
|
|
9
|
+
workflowDest?: (winHome?: string) => string;
|
|
10
|
+
templateSource: string;
|
|
11
|
+
templateTarget: (winHome?: string) => string;
|
|
12
|
+
templateMode: "marker-inject" | "file-copy";
|
|
13
|
+
isWindowsNative: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface SetupOptions {
|
|
16
|
+
apiUrl: string;
|
|
17
|
+
apiKey: string;
|
|
18
|
+
tools: ToolDefinition[];
|
|
19
|
+
remove: boolean;
|
|
20
|
+
wslMode: boolean;
|
|
21
|
+
winHome?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface McpServerEntry {
|
|
24
|
+
command: string;
|
|
25
|
+
args: string[];
|
|
26
|
+
env?: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7C,YAAY,EAAE,eAAe,GAAG,WAAW,CAAC;IAC5C,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,gFAAgF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,mCAAmC;AAEnC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install workflow files from assets to the tool's workflow directory.
|
|
3
|
+
* Only for tools that support workflows (have a workflowDest).
|
|
4
|
+
* Creates parent directories if needed. Idempotent — overwrites on re-run.
|
|
5
|
+
*/
|
|
6
|
+
export declare function installWorkflows(workflowDest: string, assetsDir: string): string[];
|
|
7
|
+
/**
|
|
8
|
+
* Remove Kanon workflow files from the tool's workflow directory.
|
|
9
|
+
* Returns the list of workflow files that were removed.
|
|
10
|
+
*/
|
|
11
|
+
export declare function removeWorkflows(workflowDest: string): string[];
|
|
12
|
+
//# sourceMappingURL=workflows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../src/workflows.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GAChB,MAAM,EAAE,CAwCV;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAmB9D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// ─── Workflow Installer ──────────────────────────────────────────────────────
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Install workflow files from assets to the tool's workflow directory.
|
|
6
|
+
* Only for tools that support workflows (have a workflowDest).
|
|
7
|
+
* Creates parent directories if needed. Idempotent — overwrites on re-run.
|
|
8
|
+
*/
|
|
9
|
+
export function installWorkflows(workflowDest, assetsDir) {
|
|
10
|
+
const workflowsSource = path.join(assetsDir, "workflows");
|
|
11
|
+
if (!fs.existsSync(workflowsSource)) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
const installed = [];
|
|
15
|
+
fs.mkdirSync(workflowDest, { recursive: true });
|
|
16
|
+
// Clean stale kanon workflows not in the current source set
|
|
17
|
+
const sourceFiles = fs.readdirSync(workflowsSource).filter((f) => f.startsWith("kanon-") && f.endsWith(".md"));
|
|
18
|
+
const sourceSet = new Set(sourceFiles);
|
|
19
|
+
if (fs.existsSync(workflowDest)) {
|
|
20
|
+
const existing = fs.readdirSync(workflowDest).filter((f) => f.startsWith("kanon-") && f.endsWith(".md"));
|
|
21
|
+
for (const file of existing) {
|
|
22
|
+
if (!sourceSet.has(file)) {
|
|
23
|
+
fs.rmSync(path.join(workflowDest, file));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const files = fs.readdirSync(workflowsSource);
|
|
28
|
+
for (const file of files) {
|
|
29
|
+
if (!file.startsWith("kanon-") || !file.endsWith(".md"))
|
|
30
|
+
continue;
|
|
31
|
+
const srcFile = path.join(workflowsSource, file);
|
|
32
|
+
const destFile = path.join(workflowDest, 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 workflow files from the tool's workflow directory.
|
|
42
|
+
* Returns the list of workflow files that were removed.
|
|
43
|
+
*/
|
|
44
|
+
export function removeWorkflows(workflowDest) {
|
|
45
|
+
if (!fs.existsSync(workflowDest)) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
const removed = [];
|
|
49
|
+
const files = fs.readdirSync(workflowDest);
|
|
50
|
+
for (const file of files) {
|
|
51
|
+
if (!file.startsWith("kanon-") || !file.endsWith(".md"))
|
|
52
|
+
continue;
|
|
53
|
+
const filePath = path.join(workflowDest, file);
|
|
54
|
+
if (fs.statSync(filePath).isFile()) {
|
|
55
|
+
fs.rmSync(filePath);
|
|
56
|
+
removed.push(file);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return removed;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../src/workflows.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,YAAoB,EACpB,SAAiB;IAEjB,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC1D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACpC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,SAAS,GAAa,EAAE,CAAC;IAE/B,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhD,4DAA4D;IAC5D,MAAM,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,MAAM,CACxD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACnD,CAAC;IACF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACvC,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,MAAM,CAClD,CAAC,CAAC,EAAE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CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,SAAS;QAElE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAC/C,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/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kanon-pm/setup",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Setup and configure Kanon AI tool integrations (Claude Code, Cursor, Antigravity)",
|
|
6
|
+
"bin": {
|
|
7
|
+
"kanon-setup": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"prebuild": "bash scripts/copy-assets.sh",
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"test": "vitest run",
|
|
14
|
+
"test:watch": "vitest"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/",
|
|
18
|
+
"assets/"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"chalk": "^5.3.0",
|
|
22
|
+
"commander": "^12.0.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^20.0.0",
|
|
26
|
+
"typescript": "^5.6.0",
|
|
27
|
+
"vitest": "^3.0.0"
|
|
28
|
+
}
|
|
29
|
+
}
|