kirograph 0.14.1 → 0.16.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.
Files changed (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +239 -20
  3. package/dist/assets/logo.png +0 -0
  4. package/dist/bin/commands/docs.js +357 -0
  5. package/dist/bin/commands/docs.js.map +7 -0
  6. package/dist/bin/commands/help.js +3 -0
  7. package/dist/bin/commands/help.js.map +2 -2
  8. package/dist/bin/commands/uninit.js +10 -13
  9. package/dist/bin/commands/uninit.js.map +2 -2
  10. package/dist/bin/installer/config-prompt.js +53 -23
  11. package/dist/bin/installer/config-prompt.js.map +2 -2
  12. package/dist/bin/installer/hooks.js +20 -1
  13. package/dist/bin/installer/hooks.js.map +2 -2
  14. package/dist/bin/installer/index.js +14 -4
  15. package/dist/bin/installer/index.js.map +2 -2
  16. package/dist/bin/installer/prompts.js +37 -6
  17. package/dist/bin/installer/prompts.js.map +2 -2
  18. package/dist/bin/installer/steering.js +40 -0
  19. package/dist/bin/installer/steering.js.map +2 -2
  20. package/dist/bin/installer/targets/aider.js +72 -0
  21. package/dist/bin/installer/targets/aider.js.map +7 -0
  22. package/dist/bin/installer/targets/amp.js +91 -0
  23. package/dist/bin/installer/targets/amp.js.map +7 -0
  24. package/dist/bin/installer/targets/antigravity.js +109 -0
  25. package/dist/bin/installer/targets/antigravity.js.map +7 -0
  26. package/dist/bin/installer/targets/augment.js +81 -0
  27. package/dist/bin/installer/targets/augment.js.map +7 -0
  28. package/dist/bin/installer/targets/claude.js +1 -1
  29. package/dist/bin/installer/targets/claude.js.map +2 -2
  30. package/dist/bin/installer/targets/cline.js +91 -0
  31. package/dist/bin/installer/targets/cline.js.map +7 -0
  32. package/dist/bin/installer/targets/codex.js +1 -1
  33. package/dist/bin/installer/targets/codex.js.map +2 -2
  34. package/dist/bin/installer/targets/continue.js +107 -0
  35. package/dist/bin/installer/targets/continue.js.map +7 -0
  36. package/dist/bin/installer/targets/copilot.js +123 -0
  37. package/dist/bin/installer/targets/copilot.js.map +7 -0
  38. package/dist/bin/installer/targets/cursor.js +143 -0
  39. package/dist/bin/installer/targets/cursor.js.map +7 -0
  40. package/dist/bin/installer/targets/devin.js +148 -0
  41. package/dist/bin/installer/targets/devin.js.map +7 -0
  42. package/dist/bin/installer/targets/gemini-cli.js +126 -0
  43. package/dist/bin/installer/targets/gemini-cli.js.map +7 -0
  44. package/dist/bin/installer/targets/generic.js +120 -0
  45. package/dist/bin/installer/targets/generic.js.map +7 -0
  46. package/dist/bin/installer/targets/goose.js +72 -0
  47. package/dist/bin/installer/targets/goose.js.map +7 -0
  48. package/dist/bin/installer/targets/index.js.map +1 -1
  49. package/dist/bin/installer/targets/junie.js +105 -0
  50. package/dist/bin/installer/targets/junie.js.map +7 -0
  51. package/dist/bin/installer/targets/kilo.js +122 -0
  52. package/dist/bin/installer/targets/kilo.js.map +7 -0
  53. package/dist/bin/installer/targets/kiro.js +3 -3
  54. package/dist/bin/installer/targets/kiro.js.map +2 -2
  55. package/dist/bin/installer/targets/opencode.js +135 -0
  56. package/dist/bin/installer/targets/opencode.js.map +7 -0
  57. package/dist/bin/installer/targets/openhands.js +90 -0
  58. package/dist/bin/installer/targets/openhands.js.map +7 -0
  59. package/dist/bin/installer/targets/replit.js +72 -0
  60. package/dist/bin/installer/targets/replit.js.map +7 -0
  61. package/dist/bin/installer/targets/roo.js +96 -0
  62. package/dist/bin/installer/targets/roo.js.map +7 -0
  63. package/dist/bin/installer/targets/tabnine.js +82 -0
  64. package/dist/bin/installer/targets/tabnine.js.map +7 -0
  65. package/dist/bin/installer/targets/trae.js +84 -0
  66. package/dist/bin/installer/targets/trae.js.map +7 -0
  67. package/dist/bin/installer/targets/warp.js +97 -0
  68. package/dist/bin/installer/targets/warp.js.map +7 -0
  69. package/dist/bin/installer/targets/windsurf.js +141 -0
  70. package/dist/bin/installer/targets/windsurf.js.map +7 -0
  71. package/dist/bin/kirograph.js +5 -1
  72. package/dist/bin/kirograph.js.map +3 -3
  73. package/dist/compression/naive-cost.js +33 -0
  74. package/dist/compression/naive-cost.js.map +2 -2
  75. package/dist/compression/tracker.js +27 -4
  76. package/dist/compression/tracker.js.map +2 -2
  77. package/dist/compression/types.js.map +1 -1
  78. package/dist/config.js +66 -1
  79. package/dist/config.js.map +2 -2
  80. package/dist/core/pipeline.js +23 -0
  81. package/dist/core/pipeline.js.map +2 -2
  82. package/dist/db/database.js +28 -0
  83. package/dist/db/database.js.map +2 -2
  84. package/dist/db/docs-schema.sql +50 -0
  85. package/dist/docs/formats/asciidoc.js +108 -0
  86. package/dist/docs/formats/asciidoc.js.map +7 -0
  87. package/dist/docs/formats/html.js +100 -0
  88. package/dist/docs/formats/html.js.map +7 -0
  89. package/dist/docs/formats/index.js +81 -0
  90. package/dist/docs/formats/index.js.map +7 -0
  91. package/dist/docs/formats/markdown.js +146 -0
  92. package/dist/docs/formats/markdown.js.map +7 -0
  93. package/dist/docs/formats/openapi.js +228 -0
  94. package/dist/docs/formats/openapi.js.map +7 -0
  95. package/dist/docs/formats/org.js +117 -0
  96. package/dist/docs/formats/org.js.map +7 -0
  97. package/dist/docs/formats/plaintext.js +119 -0
  98. package/dist/docs/formats/plaintext.js.map +7 -0
  99. package/dist/docs/formats/rdoc.js +105 -0
  100. package/dist/docs/formats/rdoc.js.map +7 -0
  101. package/dist/docs/formats/rst.js +121 -0
  102. package/dist/docs/formats/rst.js.map +7 -0
  103. package/dist/docs/indexer.js +340 -0
  104. package/dist/docs/indexer.js.map +7 -0
  105. package/dist/docs/linker.js +151 -0
  106. package/dist/docs/linker.js.map +7 -0
  107. package/dist/docs/lint.js +92 -0
  108. package/dist/docs/lint.js.map +7 -0
  109. package/dist/docs/queries.js +295 -0
  110. package/dist/docs/queries.js.map +7 -0
  111. package/dist/docs/section-id.js +57 -0
  112. package/dist/docs/section-id.js.map +7 -0
  113. package/dist/docs/summarizer.js +55 -0
  114. package/dist/docs/summarizer.js.map +7 -0
  115. package/dist/docs/types.js +17 -0
  116. package/dist/docs/types.js.map +7 -0
  117. package/dist/docs/vectors.js +217 -0
  118. package/dist/docs/vectors.js.map +7 -0
  119. package/dist/index.js +3 -0
  120. package/dist/index.js.map +2 -2
  121. package/dist/mcp/tool-names.js +10 -1
  122. package/dist/mcp/tool-names.js.map +2 -2
  123. package/dist/mcp/tools.js +476 -3
  124. package/dist/mcp/tools.js.map +2 -2
  125. package/package.json +1 -1
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var junie_exports = {};
30
+ __export(junie_exports, {
31
+ installJunieEarly: () => installJunieEarly,
32
+ installJunieLate: () => installJunieLate,
33
+ printJunieNextSteps: () => printJunieNextSteps,
34
+ uninitJunie: () => uninitJunie
35
+ });
36
+ module.exports = __toCommonJS(junie_exports);
37
+ var fs = __toESM(require("fs"));
38
+ var path = __toESM(require("path"));
39
+ var import_common = require("../common");
40
+ var import_instructions = require("../instructions");
41
+ const JUNIE_BLOCK_ID = "junie";
42
+ function installJunieEarly(projectRoot) {
43
+ const mcpPath = path.join(projectRoot, ".junie", "mcp", "mcp.json");
44
+ (0, import_common.ensureDir)(path.dirname(mcpPath));
45
+ const config = (0, import_common.readJson)(mcpPath);
46
+ config.mcpServers = config.mcpServers ?? {};
47
+ config.mcpServers[import_common.KIROGRAPH_SERVER_NAME] = {
48
+ command: import_common.KIROGRAPH_COMMAND,
49
+ args: import_common.KIROGRAPH_MCP_ARGS
50
+ };
51
+ (0, import_common.writeJson)(mcpPath, config);
52
+ console.log(` \u2713 Junie MCP server registered in ${mcpPath}`);
53
+ }
54
+ function installJunieLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
55
+ const opts = (0, import_common.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory);
56
+ const instructionsPath = path.join(projectRoot, ".kirograph", "junie.md");
57
+ (0, import_common.ensureDir)(path.dirname(instructionsPath));
58
+ fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)(opts));
59
+ console.log(` \u2713 Junie instructions written to ${instructionsPath}`);
60
+ const agentsPath = path.join(projectRoot, ".junie", "AGENTS.md");
61
+ (0, import_common.ensureDir)(path.dirname(agentsPath));
62
+ const changed = (0, import_common.upsertGeneratedBlock)(agentsPath, JUNIE_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)(opts));
63
+ console.log(changed ? ` \u2713 .junie/AGENTS.md updated with KiroGraph instructions` : ` \u2713 .junie/AGENTS.md already up to date`);
64
+ const legacyPath = path.join(projectRoot, ".junie", "guidelines.md");
65
+ if (fs.existsSync(legacyPath)) {
66
+ const content = fs.readFileSync(legacyPath, "utf8");
67
+ if (content.includes("kirograph") || content.includes("KiroGraph")) {
68
+ fs.unlinkSync(legacyPath);
69
+ console.log(` \u2713 Removed legacy .junie/guidelines.md (migrated to .junie/AGENTS.md)`);
70
+ }
71
+ }
72
+ }
73
+ function uninitJunie(projectRoot) {
74
+ const mcpPath = path.join(projectRoot, ".junie", "mcp", "mcp.json");
75
+ if (fs.existsSync(mcpPath)) {
76
+ const config = (0, import_common.readJson)(mcpPath);
77
+ if (config.mcpServers?.[import_common.KIROGRAPH_SERVER_NAME]) {
78
+ delete config.mcpServers[import_common.KIROGRAPH_SERVER_NAME];
79
+ if (Object.keys(config.mcpServers).length === 0) delete config.mcpServers;
80
+ (0, import_common.writeJson)(mcpPath, config);
81
+ console.log(` \u2713 Removed kirograph from .junie/mcp/mcp.json`);
82
+ }
83
+ }
84
+ const agentsPath = path.join(projectRoot, ".junie", "AGENTS.md");
85
+ if ((0, import_common.removeGeneratedBlock)(agentsPath, JUNIE_BLOCK_ID)) {
86
+ console.log(` \u2713 Removed KiroGraph block from .junie/AGENTS.md`);
87
+ }
88
+ const legacyPath = path.join(projectRoot, ".junie", "guidelines.md");
89
+ if ((0, import_common.removeGeneratedBlock)(legacyPath, JUNIE_BLOCK_ID)) {
90
+ console.log(` \u2713 Removed KiroGraph block from .junie/guidelines.md`);
91
+ }
92
+ }
93
+ function printJunieNextSteps() {
94
+ console.log("\n Done! Restart Junie for the MCP server to load.");
95
+ console.log(" MCP is in .junie/mcp/mcp.json");
96
+ console.log(" KiroGraph guidelines are in .junie/AGENTS.md\n");
97
+ }
98
+ // Annotate the CommonJS export names for ESM import in node:
99
+ 0 && (module.exports = {
100
+ installJunieEarly,
101
+ installJunieLate,
102
+ printJunieNextSteps,
103
+ uninitJunie
104
+ });
105
+ //# sourceMappingURL=junie.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/bin/installer/targets/junie.ts"],
4
+ "sourcesContent": ["/**\n * JetBrains Junie target.\n *\n * MCP: .junie/mcp/mcp.json (project-level, standard mcpServers format)\n * Rules: .junie/AGENTS.md (preferred guidelines location)\n * Hooks: Only SessionStart (EAP, user-level only) \u2014 not useful for auto-sync\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n buildInstructionOpts,\n readJson,\n writeJson,\n KIROGRAPH_COMMAND,\n KIROGRAPH_MCP_ARGS,\n KIROGRAPH_SERVER_NAME,\n upsertGeneratedBlock,\n removeGeneratedBlock,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\n\nconst JUNIE_BLOCK_ID = 'junie';\n\nexport function installJunieEarly(projectRoot: string): void {\n // Write MCP to .junie/mcp/mcp.json (project-level)\n const mcpPath = path.join(projectRoot, '.junie', 'mcp', 'mcp.json');\n ensureDir(path.dirname(mcpPath));\n const config = readJson(mcpPath);\n config.mcpServers = config.mcpServers ?? {};\n config.mcpServers[KIROGRAPH_SERVER_NAME] = {\n command: KIROGRAPH_COMMAND,\n args: KIROGRAPH_MCP_ARGS,\n };\n writeJson(mcpPath, config);\n console.log(` \u2713 Junie MCP server registered in ${mcpPath}`);\n}\n\nexport function installJunieLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean): void {\n const opts = buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory);\n\n const instructionsPath = path.join(projectRoot, '.kirograph', 'junie.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(opts));\n console.log(` \u2713 Junie instructions written to ${instructionsPath}`);\n\n // Write to .junie/AGENTS.md (preferred guidelines location)\n const agentsPath = path.join(projectRoot, '.junie', 'AGENTS.md');\n ensureDir(path.dirname(agentsPath));\n const changed = upsertGeneratedBlock(agentsPath, JUNIE_BLOCK_ID, '## KiroGraph', buildAgentInstructions(opts));\n console.log(changed\n ? ` \u2713 .junie/AGENTS.md updated with KiroGraph instructions`\n : ` \u2713 .junie/AGENTS.md already up to date`);\n\n // Remove legacy .junie/guidelines.md if it was created by us\n const legacyPath = path.join(projectRoot, '.junie', 'guidelines.md');\n if (fs.existsSync(legacyPath)) {\n const content = fs.readFileSync(legacyPath, 'utf8');\n if (content.includes('kirograph') || content.includes('KiroGraph')) {\n fs.unlinkSync(legacyPath);\n console.log(` \u2713 Removed legacy .junie/guidelines.md (migrated to .junie/AGENTS.md)`);\n }\n }\n}\n\nexport function uninitJunie(projectRoot: string): void {\n // Remove MCP entry\n const mcpPath = path.join(projectRoot, '.junie', 'mcp', 'mcp.json');\n if (fs.existsSync(mcpPath)) {\n const config = readJson(mcpPath);\n if (config.mcpServers?.[KIROGRAPH_SERVER_NAME]) {\n delete config.mcpServers[KIROGRAPH_SERVER_NAME];\n if (Object.keys(config.mcpServers).length === 0) delete config.mcpServers;\n writeJson(mcpPath, config);\n console.log(` \u2713 Removed kirograph from .junie/mcp/mcp.json`);\n }\n }\n\n // Remove guidelines block\n const agentsPath = path.join(projectRoot, '.junie', 'AGENTS.md');\n if (removeGeneratedBlock(agentsPath, JUNIE_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from .junie/AGENTS.md`);\n }\n\n // Also check legacy path\n const legacyPath = path.join(projectRoot, '.junie', 'guidelines.md');\n if (removeGeneratedBlock(legacyPath, JUNIE_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from .junie/guidelines.md`);\n }\n}\n\nexport function printJunieNextSteps(): void {\n console.log('\\n Done! Restart Junie for the MCP server to load.');\n console.log(' MCP is in .junie/mcp/mcp.json');\n console.log(' KiroGraph guidelines are in .junie/AGENTS.md\\n');\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,SAAoB;AACpB,WAAsB;AAEtB,oBAUO;AACP,0BAAuC;AAEvC,MAAM,iBAAiB;AAEhB,SAAS,kBAAkB,aAA2B;AAE3D,QAAM,UAAU,KAAK,KAAK,aAAa,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,WAAW,mCAAqB;AAC9C,UAAI,OAAO,KAAK,OAAO,UAAU,EAAE,WAAW,EAAG,QAAO,OAAO;AAC/D,mCAAU,SAAS,MAAM;AACzB,cAAQ,IAAI,qDAAgD;AAAA,IAC9D;AAAA,EACF;AAGA,QAAM,aAAa,KAAK,KAAK,aAAa,UAAU,WAAW;AAC/D,UAAI,oCAAqB,YAAY,cAAc,GAAG;AACpD,YAAQ,IAAI,wDAAmD;AAAA,EACjE;AAGA,QAAM,aAAa,KAAK,KAAK,aAAa,UAAU,eAAe;AACnE,UAAI,oCAAqB,YAAY,cAAc,GAAG;AACpD,YAAQ,IAAI,4DAAuD;AAAA,EACrE;AACF;AAEO,SAAS,sBAA4B;AAC1C,UAAQ,IAAI,qDAAqD;AACjE,UAAQ,IAAI,iCAAiC;AAC7C,UAAQ,IAAI,kDAAkD;AAChE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var kilo_exports = {};
30
+ __export(kilo_exports, {
31
+ installKiloEarly: () => installKiloEarly,
32
+ installKiloLate: () => installKiloLate,
33
+ printKiloNextSteps: () => printKiloNextSteps,
34
+ uninitKilo: () => uninitKilo
35
+ });
36
+ module.exports = __toCommonJS(kilo_exports);
37
+ var fs = __toESM(require("fs"));
38
+ var path = __toESM(require("path"));
39
+ var import_common = require("../common");
40
+ var import_instructions = require("../instructions");
41
+ const KILO_MCP_NAME = "kirograph";
42
+ const KILO_RULES_FILE = ".kilo/rules/kirograph.md";
43
+ function installKiloEarly(projectRoot) {
44
+ const configPath = path.join(projectRoot, "kilo.json");
45
+ const config = (0, import_common.readJson)(configPath);
46
+ config.mcp = config.mcp ?? {};
47
+ config.mcp[KILO_MCP_NAME] = {
48
+ type: "local",
49
+ command: [import_common.KIROGRAPH_COMMAND, ...import_common.KIROGRAPH_MCP_ARGS],
50
+ enabled: true
51
+ };
52
+ (0, import_common.writeJson)(configPath, config);
53
+ console.log(` \u2713 Kilo Code MCP server registered in ${configPath}`);
54
+ }
55
+ function installKiloLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
56
+ const opts = (0, import_common.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory);
57
+ const instructionsPath = path.join(projectRoot, ".kirograph", "kilo.md");
58
+ (0, import_common.ensureDir)(path.dirname(instructionsPath));
59
+ fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)(opts));
60
+ console.log(` \u2713 Kilo Code instructions written to ${instructionsPath}`);
61
+ const rulesDir = path.join(projectRoot, ".kilo", "rules");
62
+ (0, import_common.ensureDir)(rulesDir);
63
+ const rulePath = path.join(rulesDir, "kirograph.md");
64
+ fs.writeFileSync(rulePath, (0, import_instructions.buildAgentInstructions)(opts));
65
+ console.log(` \u2713 Kilo Code rule written to ${rulePath}`);
66
+ const jsoncPath = path.join(projectRoot, "kilo.jsonc");
67
+ const jsonPath = path.join(projectRoot, "kilo.json");
68
+ const cfgPath = fs.existsSync(jsoncPath) ? jsoncPath : jsonPath;
69
+ const cfg = (0, import_common.readJson)(cfgPath);
70
+ const instructions = cfg.instructions ?? [];
71
+ if (!instructions.includes(KILO_RULES_FILE)) {
72
+ instructions.push(KILO_RULES_FILE);
73
+ }
74
+ cfg.instructions = instructions;
75
+ (0, import_common.writeJson)(cfgPath, cfg);
76
+ console.log(` \u2713 Kilo Code instructions referenced in ${cfgPath}`);
77
+ }
78
+ function uninitKilo(projectRoot) {
79
+ const configPath = path.join(projectRoot, "kilo.json");
80
+ if (fs.existsSync(configPath)) {
81
+ const config = (0, import_common.readJson)(configPath);
82
+ if (config.mcp?.[KILO_MCP_NAME]) {
83
+ delete config.mcp[KILO_MCP_NAME];
84
+ if (Object.keys(config.mcp).length === 0) delete config.mcp;
85
+ (0, import_common.writeJson)(configPath, config);
86
+ console.log(` \u2713 Removed kirograph from kilo.json mcp`);
87
+ }
88
+ }
89
+ const jsoncPath = path.join(projectRoot, "kilo.jsonc");
90
+ const jsonPath = path.join(projectRoot, "kilo.json");
91
+ const cfgPath = fs.existsSync(jsoncPath) ? jsoncPath : jsonPath;
92
+ if (fs.existsSync(cfgPath)) {
93
+ const cfg = (0, import_common.readJson)(cfgPath);
94
+ if (Array.isArray(cfg.instructions)) {
95
+ const idx = cfg.instructions.indexOf(KILO_RULES_FILE);
96
+ if (idx !== -1) {
97
+ cfg.instructions.splice(idx, 1);
98
+ if (cfg.instructions.length === 0) delete cfg.instructions;
99
+ (0, import_common.writeJson)(cfgPath, cfg);
100
+ console.log(` \u2713 Removed kirograph instructions from ${cfgPath}`);
101
+ }
102
+ }
103
+ }
104
+ const rulePath = path.join(projectRoot, ".kilo", "rules", "kirograph.md");
105
+ if (fs.existsSync(rulePath)) {
106
+ fs.unlinkSync(rulePath);
107
+ console.log(` \u2713 Removed .kilo/rules/kirograph.md`);
108
+ }
109
+ }
110
+ function printKiloNextSteps() {
111
+ console.log("\n Done! Restart Kilo Code for the MCP server to load.");
112
+ console.log(" MCP is in kilo.json");
113
+ console.log(" KiroGraph rule is in .kilo/rules/kirograph.md\n");
114
+ }
115
+ // Annotate the CommonJS export names for ESM import in node:
116
+ 0 && (module.exports = {
117
+ installKiloEarly,
118
+ installKiloLate,
119
+ printKiloNextSteps,
120
+ uninitKilo
121
+ });
122
+ //# sourceMappingURL=kilo.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/bin/installer/targets/kilo.ts"],
4
+ "sourcesContent": ["/**\n * Kilo Code target.\n *\n * MCP: kilo.json or .kilo/kilo.json (project-level, \"mcp\" key with type: \"local\")\n * Rules: .kilo/rules/kirograph.md + referenced in kilo.jsonc \"instructions\" array\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n buildInstructionOpts,\n readJson,\n writeJson,\n KIROGRAPH_COMMAND,\n KIROGRAPH_MCP_ARGS,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\n\nconst KILO_MCP_NAME = 'kirograph';\nconst KILO_RULES_FILE = '.kilo/rules/kirograph.md';\n\nexport function installKiloEarly(projectRoot: string): void {\n // Write MCP to kilo.json (project-level)\n const configPath = path.join(projectRoot, 'kilo.json');\n const config = readJson(configPath);\n config.mcp = config.mcp ?? {};\n config.mcp[KILO_MCP_NAME] = {\n type: 'local',\n command: [KIROGRAPH_COMMAND, ...KIROGRAPH_MCP_ARGS],\n enabled: true,\n };\n writeJson(configPath, config);\n console.log(` \u2713 Kilo Code MCP server registered in ${configPath}`);\n}\n\nexport function installKiloLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean): void {\n const opts = buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory);\n\n const instructionsPath = path.join(projectRoot, '.kirograph', 'kilo.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(opts));\n console.log(` \u2713 Kilo Code instructions written to ${instructionsPath}`);\n\n // Write rules file inside .kilo/rules/\n const rulesDir = path.join(projectRoot, '.kilo', 'rules');\n ensureDir(rulesDir);\n const rulePath = path.join(rulesDir, 'kirograph.md');\n fs.writeFileSync(rulePath, buildAgentInstructions(opts));\n console.log(` \u2713 Kilo Code rule written to ${rulePath}`);\n\n // Add to instructions array in kilo.jsonc (or kilo.json)\n const jsoncPath = path.join(projectRoot, 'kilo.jsonc');\n const jsonPath = path.join(projectRoot, 'kilo.json');\n const cfgPath = fs.existsSync(jsoncPath) ? jsoncPath : jsonPath;\n const cfg = readJson(cfgPath);\n const instructions: string[] = cfg.instructions ?? [];\n if (!instructions.includes(KILO_RULES_FILE)) {\n instructions.push(KILO_RULES_FILE);\n }\n cfg.instructions = instructions;\n writeJson(cfgPath, cfg);\n console.log(` \u2713 Kilo Code instructions referenced in ${cfgPath}`);\n}\n\nexport function uninitKilo(projectRoot: string): void {\n // Remove MCP entry\n const configPath = path.join(projectRoot, 'kilo.json');\n if (fs.existsSync(configPath)) {\n const config = readJson(configPath);\n if (config.mcp?.[KILO_MCP_NAME]) {\n delete config.mcp[KILO_MCP_NAME];\n if (Object.keys(config.mcp).length === 0) delete config.mcp;\n writeJson(configPath, config);\n console.log(` \u2713 Removed kirograph from kilo.json mcp`);\n }\n }\n\n // Remove instructions reference\n const jsoncPath = path.join(projectRoot, 'kilo.jsonc');\n const jsonPath = path.join(projectRoot, 'kilo.json');\n const cfgPath = fs.existsSync(jsoncPath) ? jsoncPath : jsonPath;\n if (fs.existsSync(cfgPath)) {\n const cfg = readJson(cfgPath);\n if (Array.isArray(cfg.instructions)) {\n const idx = cfg.instructions.indexOf(KILO_RULES_FILE);\n if (idx !== -1) {\n cfg.instructions.splice(idx, 1);\n if (cfg.instructions.length === 0) delete cfg.instructions;\n writeJson(cfgPath, cfg);\n console.log(` \u2713 Removed kirograph instructions from ${cfgPath}`);\n }\n }\n }\n\n // Remove rule file\n const rulePath = path.join(projectRoot, '.kilo', 'rules', 'kirograph.md');\n if (fs.existsSync(rulePath)) {\n fs.unlinkSync(rulePath);\n console.log(` \u2713 Removed .kilo/rules/kirograph.md`);\n }\n}\n\nexport function printKiloNextSteps(): void {\n console.log('\\n Done! Restart Kilo Code for the MCP server to load.');\n console.log(' MCP is in kilo.json');\n console.log(' KiroGraph rule is in .kilo/rules/kirograph.md\\n');\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,SAAoB;AACpB,WAAsB;AAEtB,oBAOO;AACP,0BAAuC;AAEvC,MAAM,gBAAgB;AACtB,MAAM,kBAAkB;AAEjB,SAAS,iBAAiB,aAA2B;AAE1D,QAAM,aAAa,KAAK,KAAK,aAAa,WAAW;AACrD,QAAM,aAAS,wBAAS,UAAU;AAClC,SAAO,MAAM,OAAO,OAAO,CAAC;AAC5B,SAAO,IAAI,aAAa,IAAI;AAAA,IAC1B,MAAM;AAAA,IACN,SAAS,CAAC,iCAAmB,GAAG,gCAAkB;AAAA,IAClD,SAAS;AAAA,EACX;AACA,+BAAU,YAAY,MAAM;AAC5B,UAAQ,IAAI,+CAA0C,UAAU,EAAE;AACpE;AAEO,SAAS,gBAAgB,aAAqB,aAAmC,uBAAgC,cAA8B;AACpJ,QAAM,WAAO,oCAAqB,aAAa,uBAAuB,YAAY;AAElF,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,SAAS;AACvE,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,4CAAuB,IAAI,CAAC;AAC/D,UAAQ,IAAI,8CAAyC,gBAAgB,EAAE;AAGvE,QAAM,WAAW,KAAK,KAAK,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CAAC;AAC9B,YAAI,IAAI,aAAa,WAAW,EAAG,QAAO,IAAI;AAC9C,qCAAU,SAAS,GAAG;AACtB,gBAAQ,IAAI,gDAA2C,OAAO,EAAE;AAAA,MAClE;AAAA,IACF;AAAA,EACF;AAGA,QAAM,WAAW,KAAK,KAAK,aAAa,SAAS,SAAS,cAAc;AACxE,MAAI,GAAG,WAAW,QAAQ,GAAG;AAC3B,OAAG,WAAW,QAAQ;AACtB,YAAQ,IAAI,2CAAsC;AAAA,EACpD;AACF;AAEO,SAAS,qBAA2B;AACzC,UAAQ,IAAI,yDAAyD;AACrE,UAAQ,IAAI,uBAAuB;AACnC,UAAQ,IAAI,mDAAmD;AACjE;",
6
+ "names": []
7
+ }
@@ -43,11 +43,11 @@ function installKiroEarly(projectRoot) {
43
43
  (0, import_mcp.writeMcpConfig)(kiroDir);
44
44
  (0, import_hooks.writeHooks)(kiroDir);
45
45
  }
46
- function installKiroLate(projectRoot, cavemanMode, shellCompressionLevel) {
46
+ function installKiroLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory, enableDocs) {
47
47
  const kiroDir = path.join(projectRoot, ".kiro");
48
48
  const enableCompression = shellCompressionLevel !== "off";
49
- (0, import_hooks.writeHooks)(kiroDir, { enableCompression });
50
- (0, import_steering.writeSteering)(kiroDir, { cavemanMode, enableCompression, shellCompressionLevel });
49
+ (0, import_hooks.writeHooks)(kiroDir, { enableCompression, enableMemory });
50
+ (0, import_steering.writeSteering)(kiroDir, { cavemanMode, enableCompression, shellCompressionLevel, enableMemory, enableDocs });
51
51
  (0, import_cli_agent.writeCliAgent)(kiroDir);
52
52
  }
53
53
  function printKiroNextSteps() {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/bin/installer/targets/kiro.ts"],
4
- "sourcesContent": ["import * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport { writeCliAgent } from '../cli-agent';\nimport { writeHooks } from '../hooks';\nimport { writeMcpConfig } from '../mcp';\nimport { writeSteering } from '../steering';\n\nexport function installKiroEarly(projectRoot: string): void {\n const kiroDir = path.join(projectRoot, '.kiro');\n writeMcpConfig(kiroDir);\n writeHooks(kiroDir);\n}\n\nexport function installKiroLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string): void {\n const kiroDir = path.join(projectRoot, '.kiro');\n const enableCompression = shellCompressionLevel !== 'off';\n // Re-write hooks with compression awareness\n writeHooks(kiroDir, { enableCompression });\n writeSteering(kiroDir, { cavemanMode, enableCompression, shellCompressionLevel: shellCompressionLevel as any });\n writeCliAgent(kiroDir);\n}\n\nexport function printKiroNextSteps(): void {\n console.log('\\n Done! Restart Kiro IDE for the MCP server to load.');\n console.log(' For Kiro CLI, use the \"kirograph\" agent: kiro-cli --agent kirograph\\n');\n}\n\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AAEtB,uBAA8B;AAC9B,mBAA2B;AAC3B,iBAA+B;AAC/B,sBAA8B;AAEvB,SAAS,iBAAiB,aAA2B;AAC1D,QAAM,UAAU,KAAK,KAAK,aAAa,OAAO;AAC9C,iCAAe,OAAO;AACtB,+BAAW,OAAO;AACpB;AAEO,SAAS,gBAAgB,aAAqB,aAAmC,uBAAsC;AAC5H,QAAM,UAAU,KAAK,KAAK,aAAa,OAAO;AAC9C,QAAM,oBAAoB,0BAA0B;AAEpD,+BAAW,SAAS,EAAE,kBAAkB,CAAC;AACzC,qCAAc,SAAS,EAAE,aAAa,mBAAmB,sBAAoD,CAAC;AAC9G,sCAAc,OAAO;AACvB;AAEO,SAAS,qBAA2B;AACzC,UAAQ,IAAI,wDAAwD;AACpE,UAAQ,IAAI,yEAAyE;AACvF;",
4
+ "sourcesContent": ["import * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport { writeCliAgent } from '../cli-agent';\nimport { writeHooks } from '../hooks';\nimport { writeMcpConfig } from '../mcp';\nimport { writeSteering } from '../steering';\n\nexport function installKiroEarly(projectRoot: string): void {\n const kiroDir = path.join(projectRoot, '.kiro');\n writeMcpConfig(kiroDir);\n writeHooks(kiroDir);\n}\n\nexport function installKiroLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean, enableDocs?: boolean): void {\n const kiroDir = path.join(projectRoot, '.kiro');\n const enableCompression = shellCompressionLevel !== 'off';\n // Re-write hooks with compression and memory awareness\n writeHooks(kiroDir, { enableCompression, enableMemory });\n writeSteering(kiroDir, { cavemanMode, enableCompression, shellCompressionLevel: shellCompressionLevel as any, enableMemory, enableDocs });\n writeCliAgent(kiroDir);\n}\n\nexport function printKiroNextSteps(): void {\n console.log('\\n Done! Restart Kiro IDE for the MCP server to load.');\n console.log(' For Kiro CLI, use the \"kirograph\" agent: kiro-cli --agent kirograph\\n');\n}\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AAEtB,uBAA8B;AAC9B,mBAA2B;AAC3B,iBAA+B;AAC/B,sBAA8B;AAEvB,SAAS,iBAAiB,aAA2B;AAC1D,QAAM,UAAU,KAAK,KAAK,aAAa,OAAO;AAC9C,iCAAe,OAAO;AACtB,+BAAW,OAAO;AACpB;AAEO,SAAS,gBAAgB,aAAqB,aAAmC,uBAAgC,cAAwB,YAA4B;AAC1K,QAAM,UAAU,KAAK,KAAK,aAAa,OAAO;AAC9C,QAAM,oBAAoB,0BAA0B;AAEpD,+BAAW,SAAS,EAAE,mBAAmB,aAAa,CAAC;AACvD,qCAAc,SAAS,EAAE,aAAa,mBAAmB,uBAAqD,cAAc,WAAW,CAAC;AACxI,sCAAc,OAAO;AACvB;AAEO,SAAS,qBAA2B;AACzC,UAAQ,IAAI,wDAAwD;AACpE,UAAQ,IAAI,yEAAyE;AACvF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var opencode_exports = {};
30
+ __export(opencode_exports, {
31
+ installOpenCodeEarly: () => installOpenCodeEarly,
32
+ installOpenCodeLate: () => installOpenCodeLate,
33
+ printOpenCodeNextSteps: () => printOpenCodeNextSteps,
34
+ uninitOpenCode: () => uninitOpenCode
35
+ });
36
+ module.exports = __toCommonJS(opencode_exports);
37
+ var fs = __toESM(require("fs"));
38
+ var path = __toESM(require("path"));
39
+ var import_common = require("../common");
40
+ var import_instructions = require("../instructions");
41
+ const OPENCODE_CONFIG = ".opencode.json";
42
+ const OPENCODE_MCP_NAME = "kirograph";
43
+ const OPENCODE_INSTRUCTIONS_PATH = ".kirograph/opencode.md";
44
+ const OPENCODE_PLUGIN_FILE = "kirograph-sync.js";
45
+ const OPENCODE_PLUGIN_CONTENT = `/**
46
+ * KiroGraph auto-sync plugin for OpenCode.
47
+ * Syncs the KiroGraph index when the agent session goes idle.
48
+ */
49
+ export const KirographSync = async ({ $ }) => {
50
+ return {
51
+ event: async ({ event }) => {
52
+ if (event.type === "session.idle") {
53
+ await $\`kirograph sync --quiet 2>/dev/null || true\`
54
+ }
55
+ },
56
+ }
57
+ }
58
+ `;
59
+ function installOpenCodeEarly(projectRoot) {
60
+ const configPath = path.join(projectRoot, OPENCODE_CONFIG);
61
+ const config = (0, import_common.readJson)(configPath);
62
+ config.mcp = config.mcp ?? {};
63
+ config.mcp[OPENCODE_MCP_NAME] = {
64
+ type: "local",
65
+ command: ["kirograph", "serve", "--mcp"],
66
+ enabled: true
67
+ };
68
+ if (!config.$schema) {
69
+ config.$schema = "https://opencode.ai/config.json";
70
+ }
71
+ (0, import_common.writeJson)(configPath, config);
72
+ console.log(` \u2713 OpenCode MCP server registered in ${configPath}`);
73
+ }
74
+ function installOpenCodeLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
75
+ const opts = (0, import_common.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory, true);
76
+ const instructionsPath = path.join(projectRoot, ".kirograph", "opencode.md");
77
+ (0, import_common.ensureDir)(path.dirname(instructionsPath));
78
+ fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)(opts));
79
+ console.log(` \u2713 OpenCode instructions written to ${instructionsPath}`);
80
+ const configPath = path.join(projectRoot, OPENCODE_CONFIG);
81
+ const config = (0, import_common.readJson)(configPath);
82
+ const instructions = config.instructions ?? [];
83
+ if (!instructions.includes(OPENCODE_INSTRUCTIONS_PATH)) {
84
+ instructions.push(OPENCODE_INSTRUCTIONS_PATH);
85
+ }
86
+ config.instructions = instructions;
87
+ (0, import_common.writeJson)(configPath, config);
88
+ console.log(` \u2713 OpenCode instructions referenced in ${configPath}`);
89
+ const pluginsDir = path.join(projectRoot, ".opencode", "plugins");
90
+ (0, import_common.ensureDir)(pluginsDir);
91
+ const pluginPath = path.join(pluginsDir, OPENCODE_PLUGIN_FILE);
92
+ fs.writeFileSync(pluginPath, OPENCODE_PLUGIN_CONTENT);
93
+ console.log(` \u2713 OpenCode sync plugin written to ${pluginPath}`);
94
+ }
95
+ function uninitOpenCode(projectRoot) {
96
+ const configPath = path.join(projectRoot, OPENCODE_CONFIG);
97
+ if (fs.existsSync(configPath)) {
98
+ const config = (0, import_common.readJson)(configPath);
99
+ let changed = false;
100
+ if (config.mcp?.[OPENCODE_MCP_NAME]) {
101
+ delete config.mcp[OPENCODE_MCP_NAME];
102
+ if (Object.keys(config.mcp).length === 0) delete config.mcp;
103
+ changed = true;
104
+ console.log(` \u2713 Removed kirograph from .opencode.json mcp`);
105
+ }
106
+ if (Array.isArray(config.instructions)) {
107
+ const idx = config.instructions.indexOf(OPENCODE_INSTRUCTIONS_PATH);
108
+ if (idx !== -1) {
109
+ config.instructions.splice(idx, 1);
110
+ if (config.instructions.length === 0) delete config.instructions;
111
+ changed = true;
112
+ console.log(` \u2713 Removed kirograph instructions from .opencode.json`);
113
+ }
114
+ }
115
+ if (changed) (0, import_common.writeJson)(configPath, config);
116
+ }
117
+ const pluginPath = path.join(projectRoot, ".opencode", "plugins", OPENCODE_PLUGIN_FILE);
118
+ if (fs.existsSync(pluginPath)) {
119
+ fs.unlinkSync(pluginPath);
120
+ console.log(` \u2713 Removed OpenCode sync plugin`);
121
+ }
122
+ }
123
+ function printOpenCodeNextSteps() {
124
+ console.log("\n Done! Restart OpenCode for the MCP server and sync plugin to load.");
125
+ console.log(" MCP and instructions are in .opencode.json");
126
+ console.log(" Auto-sync plugin is in .opencode/plugins/kirograph-sync.js\n");
127
+ }
128
+ // Annotate the CommonJS export names for ESM import in node:
129
+ 0 && (module.exports = {
130
+ installOpenCodeEarly,
131
+ installOpenCodeLate,
132
+ printOpenCodeNextSteps,
133
+ uninitOpenCode
134
+ });
135
+ //# sourceMappingURL=opencode.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/bin/installer/targets/opencode.ts"],
4
+ "sourcesContent": ["/**\n * OpenCode target.\n *\n * MCP: .opencode.json (mcp field with type: \"local\")\n * Hooks: .opencode/plugins/kirograph-sync.js (JS plugin)\n * Instructions: .opencode.json (instructions field)\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport { ensureDir, buildInstructionOpts, readJson, writeJson } from '../common';\nimport { buildAgentInstructions } from '../instructions';\n\nconst OPENCODE_CONFIG = '.opencode.json';\nconst OPENCODE_MCP_NAME = 'kirograph';\nconst OPENCODE_INSTRUCTIONS_PATH = '.kirograph/opencode.md';\nconst OPENCODE_PLUGIN_FILE = 'kirograph-sync.js';\n\nconst OPENCODE_PLUGIN_CONTENT = `/**\n * KiroGraph auto-sync plugin for OpenCode.\n * Syncs the KiroGraph index when the agent session goes idle.\n */\nexport const KirographSync = async ({ $ }) => {\n return {\n event: async ({ event }) => {\n if (event.type === \"session.idle\") {\n await $\\`kirograph sync --quiet 2>/dev/null || true\\`\n }\n },\n }\n}\n`;\n\nexport function installOpenCodeEarly(projectRoot: string): void {\n const configPath = path.join(projectRoot, OPENCODE_CONFIG);\n const config = readJson(configPath);\n\n config.mcp = config.mcp ?? {};\n config.mcp[OPENCODE_MCP_NAME] = {\n type: 'local',\n command: ['kirograph', 'serve', '--mcp'],\n enabled: true,\n };\n\n if (!config.$schema) {\n config.$schema = 'https://opencode.ai/config.json';\n }\n\n writeJson(configPath, config);\n console.log(` \u2713 OpenCode MCP server registered in ${configPath}`);\n}\n\nexport function installOpenCodeLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean): void {\n const opts = buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory, true);\n\n const instructionsPath = path.join(projectRoot, '.kirograph', 'opencode.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(opts));\n console.log(` \u2713 OpenCode instructions written to ${instructionsPath}`);\n\n // Add instructions reference to .opencode.json\n const configPath = path.join(projectRoot, OPENCODE_CONFIG);\n const config = readJson(configPath);\n\n const instructions: string[] = config.instructions ?? [];\n if (!instructions.includes(OPENCODE_INSTRUCTIONS_PATH)) {\n instructions.push(OPENCODE_INSTRUCTIONS_PATH);\n }\n config.instructions = instructions;\n writeJson(configPath, config);\n console.log(` \u2713 OpenCode instructions referenced in ${configPath}`);\n\n // Write sync plugin\n const pluginsDir = path.join(projectRoot, '.opencode', 'plugins');\n ensureDir(pluginsDir);\n const pluginPath = path.join(pluginsDir, OPENCODE_PLUGIN_FILE);\n fs.writeFileSync(pluginPath, OPENCODE_PLUGIN_CONTENT);\n console.log(` \u2713 OpenCode sync plugin written to ${pluginPath}`);\n}\n\nexport function uninitOpenCode(projectRoot: string): void {\n const configPath = path.join(projectRoot, OPENCODE_CONFIG);\n if (fs.existsSync(configPath)) {\n const config = readJson(configPath);\n let changed = false;\n\n // Remove MCP entry\n if (config.mcp?.[OPENCODE_MCP_NAME]) {\n delete config.mcp[OPENCODE_MCP_NAME];\n if (Object.keys(config.mcp).length === 0) delete config.mcp;\n changed = true;\n console.log(` \u2713 Removed kirograph from .opencode.json mcp`);\n }\n\n // Remove instructions reference\n if (Array.isArray(config.instructions)) {\n const idx = config.instructions.indexOf(OPENCODE_INSTRUCTIONS_PATH);\n if (idx !== -1) {\n config.instructions.splice(idx, 1);\n if (config.instructions.length === 0) delete config.instructions;\n changed = true;\n console.log(` \u2713 Removed kirograph instructions from .opencode.json`);\n }\n }\n\n if (changed) writeJson(configPath, config);\n }\n\n // Remove plugin\n const pluginPath = path.join(projectRoot, '.opencode', 'plugins', OPENCODE_PLUGIN_FILE);\n if (fs.existsSync(pluginPath)) {\n fs.unlinkSync(pluginPath);\n console.log(` \u2713 Removed OpenCode sync plugin`);\n }\n}\n\nexport function printOpenCodeNextSteps(): void {\n console.log('\\n Done! Restart OpenCode for the MCP server and sync plugin to load.');\n console.log(' MCP and instructions are in .opencode.json');\n console.log(' Auto-sync plugin is in .opencode/plugins/kirograph-sync.js\\n');\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,SAAoB;AACpB,WAAsB;AAEtB,oBAAqE;AACrE,0BAAuC;AAEvC,MAAM,kBAAkB;AACxB,MAAM,oBAAoB;AAC1B,MAAM,6BAA6B;AACnC,MAAM,uBAAuB;AAE7B,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAezB,SAAS,qBAAqB,aAA2B;AAC9D,QAAM,aAAa,KAAK,KAAK,aAAa,eAAe;AACzD,QAAM,aAAS,wBAAS,UAAU;AAElC,SAAO,MAAM,OAAO,OAAO,CAAC;AAC5B,SAAO,IAAI,iBAAiB,IAAI;AAAA,IAC9B,MAAM;AAAA,IACN,SAAS,CAAC,aAAa,SAAS,OAAO;AAAA,IACvC,SAAS;AAAA,EACX;AAEA,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO,UAAU;AAAA,EACnB;AAEA,+BAAU,YAAY,MAAM;AAC5B,UAAQ,IAAI,8CAAyC,UAAU,EAAE;AACnE;AAEO,SAAS,oBAAoB,aAAqB,aAAmC,uBAAgC,cAA8B;AACxJ,QAAM,WAAO,oCAAqB,aAAa,uBAAuB,cAAc,IAAI;AAExF,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,aAAa;AAC3E,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,4CAAuB,IAAI,CAAC;AAC/D,UAAQ,IAAI,6CAAwC,gBAAgB,EAAE;AAGtE,QAAM,aAAa,KAAK,KAAK,aAAa,eAAe;AACzD,QAAM,aAAS,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AAEO,SAAS,yBAA+B;AAC7C,UAAQ,IAAI,wEAAwE;AACpF,UAAQ,IAAI,8CAA8C;AAC1D,UAAQ,IAAI,gEAAgE;AAC9E;",
6
+ "names": []
7
+ }
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var openhands_exports = {};
30
+ __export(openhands_exports, {
31
+ installOpenHandsEarly: () => installOpenHandsEarly,
32
+ installOpenHandsLate: () => installOpenHandsLate,
33
+ printOpenHandsNextSteps: () => printOpenHandsNextSteps,
34
+ uninitOpenHands: () => uninitOpenHands
35
+ });
36
+ module.exports = __toCommonJS(openhands_exports);
37
+ var fs = __toESM(require("fs"));
38
+ var path = __toESM(require("path"));
39
+ var import_common = require("../common");
40
+ var import_instructions = require("../instructions");
41
+ var import_common2 = require("../common");
42
+ const OPENHANDS_BLOCK_ID = "openhands";
43
+ function installOpenHandsEarly(projectRoot) {
44
+ const configPath = path.join(projectRoot, ".openhands", "config.json");
45
+ (0, import_common.ensureDir)(path.dirname(configPath));
46
+ const config = (0, import_common.readJson)(configPath);
47
+ config.mcpServers = config.mcpServers ?? {};
48
+ config.mcpServers[import_common.KIROGRAPH_SERVER_NAME] = {
49
+ command: import_common.KIROGRAPH_COMMAND,
50
+ args: import_common.KIROGRAPH_MCP_ARGS
51
+ };
52
+ (0, import_common.writeJson)(configPath, config);
53
+ console.log(` \u2713 OpenHands MCP server registered in ${configPath}`);
54
+ }
55
+ function installOpenHandsLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
56
+ const instructionsPath = path.join(projectRoot, ".kirograph", "openhands.md");
57
+ (0, import_common.ensureDir)(path.dirname(instructionsPath));
58
+ fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
59
+ console.log(` \u2713 OpenHands instructions written to ${instructionsPath}`);
60
+ const agentsPath = path.join(projectRoot, "AGENTS.md");
61
+ const changed = (0, import_common.upsertGeneratedBlock)(agentsPath, OPENHANDS_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
62
+ console.log(changed ? ` \u2713 AGENTS.md updated with KiroGraph instructions (OpenHands)` : ` \u2713 AGENTS.md already up to date`);
63
+ }
64
+ function uninitOpenHands(projectRoot) {
65
+ const configPath = path.join(projectRoot, ".openhands", "config.json");
66
+ if (fs.existsSync(configPath)) {
67
+ const config = (0, import_common.readJson)(configPath);
68
+ if (config.mcpServers?.[import_common.KIROGRAPH_SERVER_NAME]) {
69
+ delete config.mcpServers[import_common.KIROGRAPH_SERVER_NAME];
70
+ (0, import_common.writeJson)(configPath, config);
71
+ console.log(` \u2713 Removed kirograph from .openhands/config.json`);
72
+ }
73
+ }
74
+ const agentsPath = path.join(projectRoot, "AGENTS.md");
75
+ if ((0, import_common.removeGeneratedBlock)(agentsPath, OPENHANDS_BLOCK_ID)) {
76
+ console.log(` \u2713 Removed KiroGraph block from AGENTS.md (OpenHands)`);
77
+ }
78
+ }
79
+ function printOpenHandsNextSteps() {
80
+ console.log("\n Done! Restart OpenHands for the MCP server to load.");
81
+ console.log(" KiroGraph instructions are in AGENTS.md\n");
82
+ }
83
+ // Annotate the CommonJS export names for ESM import in node:
84
+ 0 && (module.exports = {
85
+ installOpenHandsEarly,
86
+ installOpenHandsLate,
87
+ printOpenHandsNextSteps,
88
+ uninitOpenHands
89
+ });
90
+ //# sourceMappingURL=openhands.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/bin/installer/targets/openhands.ts"],
4
+ "sourcesContent": ["import * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n KIROGRAPH_COMMAND,\n KIROGRAPH_MCP_ARGS,\n KIROGRAPH_SERVER_NAME,\n readJson,\n writeJson,\n upsertGeneratedBlock,\n removeGeneratedBlock,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts } from '../common';\n\nconst OPENHANDS_BLOCK_ID = 'openhands';\n\nexport function installOpenHandsEarly(projectRoot: string): void {\n const configPath = path.join(projectRoot, '.openhands', 'config.json');\n ensureDir(path.dirname(configPath));\n const config = readJson(configPath);\n config.mcpServers = config.mcpServers ?? {};\n config.mcpServers[KIROGRAPH_SERVER_NAME] = {\n command: KIROGRAPH_COMMAND,\n args: KIROGRAPH_MCP_ARGS,\n };\n writeJson(configPath, config);\n console.log(` \u2713 OpenHands MCP server registered in ${configPath}`);\n}\n\nexport function installOpenHandsLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'openhands.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(` \u2713 OpenHands instructions written to ${instructionsPath}`);\n\n const agentsPath = path.join(projectRoot, 'AGENTS.md');\n const changed = upsertGeneratedBlock(agentsPath, OPENHANDS_BLOCK_ID, '## KiroGraph', buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(changed\n ? ` \u2713 AGENTS.md updated with KiroGraph instructions (OpenHands)`\n : ` \u2713 AGENTS.md already up to date`);\n}\n\nexport function uninitOpenHands(projectRoot: string): void {\n const configPath = path.join(projectRoot, '.openhands', 'config.json');\n if (fs.existsSync(configPath)) {\n const config = readJson(configPath);\n if (config.mcpServers?.[KIROGRAPH_SERVER_NAME]) {\n delete config.mcpServers[KIROGRAPH_SERVER_NAME];\n writeJson(configPath, config);\n console.log(` \u2713 Removed kirograph from .openhands/config.json`);\n }\n }\n\n const agentsPath = path.join(projectRoot, 'AGENTS.md');\n if (removeGeneratedBlock(agentsPath, OPENHANDS_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from AGENTS.md (OpenHands)`);\n }\n}\n\nexport function printOpenHandsNextSteps(): void {\n console.log('\\n Done! Restart OpenHands for the MCP server to load.');\n console.log(' KiroGraph instructions are in AGENTS.md\\n');\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AAEtB,oBASO;AACP,0BAAuC;AACvC,IAAAA,iBAAqC;AAErC,MAAM,qBAAqB;AAEpB,SAAS,sBAAsB,aAA2B;AAC/D,QAAM,aAAa,KAAK,KAAK,aAAa,cAAc,aAAa;AACrE,+BAAU,KAAK,QAAQ,UAAU,CAAC;AACl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 var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var replit_exports = {};
30
+ __export(replit_exports, {
31
+ installReplitEarly: () => installReplitEarly,
32
+ installReplitLate: () => installReplitLate,
33
+ printReplitNextSteps: () => printReplitNextSteps,
34
+ uninitReplit: () => uninitReplit
35
+ });
36
+ module.exports = __toCommonJS(replit_exports);
37
+ var fs = __toESM(require("fs"));
38
+ var path = __toESM(require("path"));
39
+ var import_common = require("../common");
40
+ var import_instructions = require("../instructions");
41
+ var import_common2 = require("../common");
42
+ const REPLIT_BLOCK_ID = "replit";
43
+ function installReplitEarly(_projectRoot) {
44
+ }
45
+ function installReplitLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
46
+ const instructionsPath = path.join(projectRoot, ".kirograph", "replit.md");
47
+ (0, import_common.ensureDir)(path.dirname(instructionsPath));
48
+ fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
49
+ console.log(` \u2713 Replit instructions written to ${instructionsPath}`);
50
+ const agentsPath = path.join(projectRoot, "AGENTS.md");
51
+ const changed = (0, import_common.upsertGeneratedBlock)(agentsPath, REPLIT_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
52
+ console.log(changed ? ` \u2713 AGENTS.md updated with KiroGraph instructions (Replit)` : ` \u2713 AGENTS.md already up to date`);
53
+ }
54
+ function uninitReplit(projectRoot) {
55
+ const agentsPath = path.join(projectRoot, "AGENTS.md");
56
+ if ((0, import_common.removeGeneratedBlock)(agentsPath, REPLIT_BLOCK_ID)) {
57
+ console.log(` \u2713 Removed KiroGraph block from AGENTS.md (Replit)`);
58
+ }
59
+ }
60
+ function printReplitNextSteps(projectRoot) {
61
+ console.log("\n Done! KiroGraph instructions are in AGENTS.md.");
62
+ (0, import_common.printMcpCommand)(`kirograph serve --mcp --path "${projectRoot}"`);
63
+ console.log(" Configure this command in your Replit workspace MCP settings.");
64
+ }
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ installReplitEarly,
68
+ installReplitLate,
69
+ printReplitNextSteps,
70
+ uninitReplit
71
+ });
72
+ //# sourceMappingURL=replit.js.map