kirograph 0.14.0 → 0.15.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/README.md +128 -20
- package/dist/assets/logo.png +0 -0
- package/dist/bin/commands/help.js +3 -0
- package/dist/bin/commands/help.js.map +2 -2
- package/dist/bin/commands/memory.js +483 -0
- package/dist/bin/commands/memory.js.map +7 -0
- package/dist/bin/commands/uninit.js +22 -13
- package/dist/bin/commands/uninit.js.map +2 -2
- package/dist/bin/installer/config-prompt.js +37 -23
- package/dist/bin/installer/config-prompt.js.map +2 -2
- package/dist/bin/installer/hooks.js +53 -75
- package/dist/bin/installer/hooks.js.map +2 -2
- package/dist/bin/installer/index.js +9 -4
- package/dist/bin/installer/index.js.map +2 -2
- package/dist/bin/installer/prompts.js +37 -6
- package/dist/bin/installer/prompts.js.map +2 -2
- package/dist/bin/installer/steering.js +19 -0
- package/dist/bin/installer/steering.js.map +2 -2
- package/dist/bin/installer/targets/aider.js +72 -0
- package/dist/bin/installer/targets/aider.js.map +7 -0
- package/dist/bin/installer/targets/amp.js +91 -0
- package/dist/bin/installer/targets/amp.js.map +7 -0
- package/dist/bin/installer/targets/antigravity.js +109 -0
- package/dist/bin/installer/targets/antigravity.js.map +7 -0
- package/dist/bin/installer/targets/augment.js +81 -0
- package/dist/bin/installer/targets/augment.js.map +7 -0
- package/dist/bin/installer/targets/claude.js +1 -1
- package/dist/bin/installer/targets/claude.js.map +2 -2
- package/dist/bin/installer/targets/cline.js +91 -0
- package/dist/bin/installer/targets/cline.js.map +7 -0
- package/dist/bin/installer/targets/codex.js +1 -1
- package/dist/bin/installer/targets/codex.js.map +2 -2
- package/dist/bin/installer/targets/continue.js +107 -0
- package/dist/bin/installer/targets/continue.js.map +7 -0
- package/dist/bin/installer/targets/copilot.js +123 -0
- package/dist/bin/installer/targets/copilot.js.map +7 -0
- package/dist/bin/installer/targets/cursor.js +143 -0
- package/dist/bin/installer/targets/cursor.js.map +7 -0
- package/dist/bin/installer/targets/devin.js +148 -0
- package/dist/bin/installer/targets/devin.js.map +7 -0
- package/dist/bin/installer/targets/gemini-cli.js +126 -0
- package/dist/bin/installer/targets/gemini-cli.js.map +7 -0
- package/dist/bin/installer/targets/generic.js +120 -0
- package/dist/bin/installer/targets/generic.js.map +7 -0
- package/dist/bin/installer/targets/goose.js +72 -0
- package/dist/bin/installer/targets/goose.js.map +7 -0
- package/dist/bin/installer/targets/index.js.map +1 -1
- package/dist/bin/installer/targets/junie.js +105 -0
- package/dist/bin/installer/targets/junie.js.map +7 -0
- package/dist/bin/installer/targets/kilo.js +122 -0
- package/dist/bin/installer/targets/kilo.js.map +7 -0
- package/dist/bin/installer/targets/kiro.js +3 -3
- package/dist/bin/installer/targets/kiro.js.map +2 -2
- package/dist/bin/installer/targets/opencode.js +135 -0
- package/dist/bin/installer/targets/opencode.js.map +7 -0
- package/dist/bin/installer/targets/openhands.js +90 -0
- package/dist/bin/installer/targets/openhands.js.map +7 -0
- package/dist/bin/installer/targets/replit.js +72 -0
- package/dist/bin/installer/targets/replit.js.map +7 -0
- package/dist/bin/installer/targets/roo.js +96 -0
- package/dist/bin/installer/targets/roo.js.map +7 -0
- package/dist/bin/installer/targets/tabnine.js +82 -0
- package/dist/bin/installer/targets/tabnine.js.map +7 -0
- package/dist/bin/installer/targets/trae.js +84 -0
- package/dist/bin/installer/targets/trae.js.map +7 -0
- package/dist/bin/installer/targets/warp.js +97 -0
- package/dist/bin/installer/targets/warp.js.map +7 -0
- package/dist/bin/installer/targets/windsurf.js +141 -0
- package/dist/bin/installer/targets/windsurf.js.map +7 -0
- package/dist/bin/kirograph.js +3 -1
- package/dist/bin/kirograph.js.map +3 -3
- package/dist/compression/naive-cost.js +14 -0
- package/dist/compression/naive-cost.js.map +2 -2
- package/dist/compression/tracker.js +18 -4
- package/dist/compression/tracker.js.map +2 -2
- package/dist/compression/types.js.map +1 -1
- package/dist/config.js +33 -1
- package/dist/config.js.map +2 -2
- package/dist/db/database.js +17 -0
- package/dist/db/database.js.map +2 -2
- package/dist/db/memory-schema.sql +51 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +2 -2
- package/dist/mcp/tool-names.js +5 -1
- package/dist/mcp/tool-names.js.map +2 -2
- package/dist/mcp/tools.js +232 -3
- package/dist/mcp/tools.js.map +2 -2
- package/dist/memory/compress.js +142 -0
- package/dist/memory/compress.js.map +7 -0
- package/dist/memory/database.js +375 -0
- package/dist/memory/database.js.map +7 -0
- package/dist/memory/index.js +239 -0
- package/dist/memory/index.js.map +7 -0
- package/dist/memory/symbols.js +54 -0
- package/dist/memory/symbols.js.map +7 -0
- package/dist/memory/types.js +17 -0
- package/dist/memory/types.js.map +7 -0
- package/dist/memory/vectors.js +199 -0
- package/dist/memory/vectors.js.map +7 -0
- package/package.json +1 -1
|
@@ -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,wBAAS,UAAU;AAElC,QAAM,eAAyB,OAAO,gBAAgB,CAAC;AACvD,MAAI,CAAC,aAAa,SAAS,0BAA0B,GAAG;AACtD,iBAAa,KAAK,0BAA0B;AAAA,EAC9C;AACA,SAAO,eAAe;AACtB,+BAAU,YAAY,MAAM;AAC5B,UAAQ,IAAI,gDAA2C,UAAU,EAAE;AAGnE,QAAM,aAAa,KAAK,KAAK,aAAa,aAAa,SAAS;AAChE,+BAAU,UAAU;AACpB,QAAM,aAAa,KAAK,KAAK,YAAY,oBAAoB;AAC7D,KAAG,cAAc,YAAY,uBAAuB;AACpD,UAAQ,IAAI,4CAAuC,UAAU,EAAE;AACjE;AAEO,SAAS,eAAe,aAA2B;AACxD,QAAM,aAAa,KAAK,KAAK,aAAa,eAAe;AACzD,MAAI,GAAG,WAAW,UAAU,GAAG;AAC7B,UAAM,aAAS,wBAAS,UAAU;AAClC,QAAI,UAAU;AAGd,QAAI,OAAO,MAAM,iBAAiB,GAAG;AACnC,aAAO,OAAO,IAAI,iBAAiB;AACnC,UAAI,OAAO,KAAK,OAAO,GAAG,EAAE,WAAW,EAAG,QAAO,OAAO;AACxD,gBAAU;AACV,cAAQ,IAAI,oDAA+C;AAAA,IAC7D;AAGA,QAAI,MAAM,QAAQ,OAAO,YAAY,GAAG;AACtC,YAAM,MAAM,OAAO,aAAa,QAAQ,0BAA0B;AAClE,UAAI,QAAQ,IAAI;AACd,eAAO,aAAa,OAAO,KAAK,CAAC;AACjC,YAAI,OAAO,aAAa,WAAW,EAAG,QAAO,OAAO;AACpD,kBAAU;AACV,gBAAQ,IAAI,6DAAwD;AAAA,MACtE;AAAA,IACF;AAEA,QAAI,QAAS,8BAAU,YAAY,MAAM;AAAA,EAC3C;AAGA,QAAM,aAAa,KAAK,KAAK,aAAa,aAAa,WAAW,oBAAoB;AACtF,MAAI,GAAG,WAAW,UAAU,GAAG;AAC7B,OAAG,WAAW,UAAU;AACxB,YAAQ,IAAI,uCAAkC;AAAA,EAChD;AACF;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;AAClC,QAAM,aAAS,wBAAS,UAAU;AAClC,SAAO,aAAa,OAAO,cAAc,CAAC;AAC1C,SAAO,WAAW,mCAAqB,IAAI;AAAA,IACzC,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACA,+BAAU,YAAY,MAAM;AAC5B,UAAQ,IAAI,+CAA0C,UAAU,EAAE;AACpE;AAEO,SAAS,qBAAqB,aAAqB,aAAmC,uBAAgC,cAA8B;AACzJ,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,cAAc;AAC5E,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,gDAAuB,qCAAqB,aAAa,uBAAuB,YAAY,CAAC,CAAC;AACjI,UAAQ,IAAI,8CAAyC,gBAAgB,EAAE;AAEvE,QAAM,aAAa,KAAK,KAAK,aAAa,WAAW;AACrD,QAAM,cAAU,oCAAqB,YAAY,oBAAoB,oBAAgB,gDAAuB,qCAAqB,aAAa,uBAAuB,YAAY,CAAC,CAAC;AACnL,UAAQ,IAAI,UACR,uEACA,uCAAkC;AACxC;AAEO,SAAS,gBAAgB,aAA2B;AACzD,QAAM,aAAa,KAAK,KAAK,aAAa,cAAc,aAAa;AACrE,MAAI,GAAG,WAAW,UAAU,GAAG;AAC7B,UAAM,aAAS,wBAAS,UAAU;AAClC,QAAI,OAAO,aAAa,mCAAqB,GAAG;AAC9C,aAAO,OAAO,WAAW,mCAAqB;AAC9C,mCAAU,YAAY,MAAM;AAC5B,cAAQ,IAAI,wDAAmD;AAAA,IACjE;AAAA,EACF;AAEA,QAAM,aAAa,KAAK,KAAK,aAAa,WAAW;AACrD,UAAI,oCAAqB,YAAY,kBAAkB,GAAG;AACxD,YAAQ,IAAI,6DAAwD;AAAA,EACtE;AACF;AAEO,SAAS,0BAAgC;AAC9C,UAAQ,IAAI,yDAAyD;AACrE,UAAQ,IAAI,6CAA6C;AAC3D;",
|
|
6
|
+
"names": ["import_common"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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 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
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/bin/installer/targets/replit.ts"],
|
|
4
|
+
"sourcesContent": ["import * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n printMcpCommand,\n upsertGeneratedBlock,\n removeGeneratedBlock,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts } from '../common';\n\nconst REPLIT_BLOCK_ID = 'replit';\n\nexport function installReplitEarly(_projectRoot: string): void {\n // Replit MCP is configured through the Replit UI or .replit file.\n // We print instructions in next steps.\n}\n\nexport function installReplitLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'replit.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(` \u2713 Replit instructions written to ${instructionsPath}`);\n\n const agentsPath = path.join(projectRoot, 'AGENTS.md');\n const changed = upsertGeneratedBlock(agentsPath, REPLIT_BLOCK_ID, '## KiroGraph', buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(changed\n ? ` \u2713 AGENTS.md updated with KiroGraph instructions (Replit)`\n : ` \u2713 AGENTS.md already up to date`);\n}\n\nexport function uninitReplit(projectRoot: string): void {\n const agentsPath = path.join(projectRoot, 'AGENTS.md');\n if (removeGeneratedBlock(agentsPath, REPLIT_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from AGENTS.md (Replit)`);\n }\n}\n\nexport function printReplitNextSteps(projectRoot: string): void {\n console.log('\\n Done! KiroGraph instructions are in AGENTS.md.');\n printMcpCommand(`kirograph serve --mcp --path \"${projectRoot}\"`);\n console.log(' Configure this command in your Replit workspace MCP settings.');\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AAEtB,oBAKO;AACP,0BAAuC;AACvC,IAAAA,iBAAqC;AAErC,MAAM,kBAAkB;AAEjB,SAAS,mBAAmB,cAA4B;AAG/D;AAEO,SAAS,kBAAkB,aAAqB,aAAmC,uBAAgC,cAA8B;AACtJ,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,WAAW;AACzE,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,gDAAuB,qCAAqB,aAAa,uBAAuB,YAAY,CAAC,CAAC;AACjI,UAAQ,IAAI,2CAAsC,gBAAgB,EAAE;AAEpE,QAAM,aAAa,KAAK,KAAK,aAAa,WAAW;AACrD,QAAM,cAAU,oCAAqB,YAAY,iBAAiB,oBAAgB,gDAAuB,qCAAqB,aAAa,uBAAuB,YAAY,CAAC,CAAC;AAChL,UAAQ,IAAI,UACR,oEACA,uCAAkC;AACxC;AAEO,SAAS,aAAa,aAA2B;AACtD,QAAM,aAAa,KAAK,KAAK,aAAa,WAAW;AACrD,UAAI,oCAAqB,YAAY,eAAe,GAAG;AACrD,YAAQ,IAAI,0DAAqD;AAAA,EACnE;AACF;AAEO,SAAS,qBAAqB,aAA2B;AAC9D,UAAQ,IAAI,oDAAoD;AAChE,qCAAgB,iCAAiC,WAAW,GAAG;AAC/D,UAAQ,IAAI,iEAAiE;AAC/E;",
|
|
6
|
+
"names": ["import_common"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
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 roo_exports = {};
|
|
30
|
+
__export(roo_exports, {
|
|
31
|
+
installRooEarly: () => installRooEarly,
|
|
32
|
+
installRooLate: () => installRooLate,
|
|
33
|
+
printRooNextSteps: () => printRooNextSteps,
|
|
34
|
+
uninitRoo: () => uninitRoo
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(roo_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 ROO_RULES_FILE = "kirograph.md";
|
|
42
|
+
function installRooEarly(projectRoot) {
|
|
43
|
+
const mcpPath = path.join(projectRoot, ".roo", "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
|
+
disabled: false
|
|
51
|
+
};
|
|
52
|
+
(0, import_common.writeJson)(mcpPath, config);
|
|
53
|
+
console.log(` \u2713 Roo Code MCP server registered in ${mcpPath}`);
|
|
54
|
+
}
|
|
55
|
+
function installRooLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
|
|
56
|
+
const opts = (0, import_common.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory);
|
|
57
|
+
const instructionsPath = path.join(projectRoot, ".kirograph", "roo.md");
|
|
58
|
+
(0, import_common.ensureDir)(path.dirname(instructionsPath));
|
|
59
|
+
fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)(opts));
|
|
60
|
+
console.log(` \u2713 Roo Code instructions written to ${instructionsPath}`);
|
|
61
|
+
const rulesDir = path.join(projectRoot, ".roo", "rules");
|
|
62
|
+
(0, import_common.ensureDir)(rulesDir);
|
|
63
|
+
const rulePath = path.join(rulesDir, ROO_RULES_FILE);
|
|
64
|
+
fs.writeFileSync(rulePath, (0, import_instructions.buildAgentInstructions)(opts));
|
|
65
|
+
console.log(` \u2713 Roo Code rule written to ${rulePath}`);
|
|
66
|
+
}
|
|
67
|
+
function uninitRoo(projectRoot) {
|
|
68
|
+
const mcpPath = path.join(projectRoot, ".roo", "mcp.json");
|
|
69
|
+
if (fs.existsSync(mcpPath)) {
|
|
70
|
+
const config = (0, import_common.readJson)(mcpPath);
|
|
71
|
+
if (config.mcpServers?.[import_common.KIROGRAPH_SERVER_NAME]) {
|
|
72
|
+
delete config.mcpServers[import_common.KIROGRAPH_SERVER_NAME];
|
|
73
|
+
if (Object.keys(config.mcpServers).length === 0) delete config.mcpServers;
|
|
74
|
+
(0, import_common.writeJson)(mcpPath, config);
|
|
75
|
+
console.log(` \u2713 Removed kirograph from .roo/mcp.json`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const rulePath = path.join(projectRoot, ".roo", "rules", ROO_RULES_FILE);
|
|
79
|
+
if (fs.existsSync(rulePath)) {
|
|
80
|
+
fs.unlinkSync(rulePath);
|
|
81
|
+
console.log(` \u2713 Removed .roo/rules/${ROO_RULES_FILE}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function printRooNextSteps() {
|
|
85
|
+
console.log("\n Done! Restart Roo Code for the MCP server to load.");
|
|
86
|
+
console.log(" MCP is in .roo/mcp.json");
|
|
87
|
+
console.log(" KiroGraph rule is in .roo/rules/kirograph.md\n");
|
|
88
|
+
}
|
|
89
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
90
|
+
0 && (module.exports = {
|
|
91
|
+
installRooEarly,
|
|
92
|
+
installRooLate,
|
|
93
|
+
printRooNextSteps,
|
|
94
|
+
uninitRoo
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=roo.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/bin/installer/targets/roo.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Roo Code target.\n *\n * MCP: user-scoped at ~/.roo/mcp_settings.json (print instructions)\n * Rules: .roo/rules/kirograph.md (directory-based, preferred method)\n * Also reads: AGENTS.md, .roorules (fallback)\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n buildInstructionOpts,\n KIROGRAPH_COMMAND,\n KIROGRAPH_MCP_ARGS,\n KIROGRAPH_SERVER_NAME,\n readJson,\n writeJson,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\n\nconst ROO_RULES_FILE = 'kirograph.md';\n\nexport function installRooEarly(projectRoot: string): void {\n // Write MCP to .roo/mcp.json (project-level, per Roo Code docs)\n const mcpPath = path.join(projectRoot, '.roo', '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 disabled: false,\n };\n writeJson(mcpPath, config);\n console.log(` \u2713 Roo Code MCP server registered in ${mcpPath}`);\n}\n\nexport function installRooLate(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', 'roo.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(opts));\n console.log(` \u2713 Roo Code instructions written to ${instructionsPath}`);\n\n // Write rules file inside .roo/rules/ directory (preferred method)\n const rulesDir = path.join(projectRoot, '.roo', 'rules');\n ensureDir(rulesDir);\n const rulePath = path.join(rulesDir, ROO_RULES_FILE);\n fs.writeFileSync(rulePath, buildAgentInstructions(opts));\n console.log(` \u2713 Roo Code rule written to ${rulePath}`);\n}\n\nexport function uninitRoo(projectRoot: string): void {\n // Remove MCP entry\n const mcpPath = path.join(projectRoot, '.roo', '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 .roo/mcp.json`);\n }\n }\n\n // Remove rule file\n const rulePath = path.join(projectRoot, '.roo', 'rules', ROO_RULES_FILE);\n if (fs.existsSync(rulePath)) {\n fs.unlinkSync(rulePath);\n console.log(` \u2713 Removed .roo/rules/${ROO_RULES_FILE}`);\n }\n}\n\nexport function printRooNextSteps(): void {\n console.log('\\n Done! Restart Roo Code for the MCP server to load.');\n console.log(' MCP is in .roo/mcp.json');\n console.log(' KiroGraph rule is in .roo/rules/kirograph.md\\n');\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,SAAoB;AACpB,WAAsB;AAEtB,oBAQO;AACP,0BAAuC;AAEvC,MAAM,iBAAiB;AAEhB,SAAS,gBAAgB,aAA2B;AAEzD,QAAM,UAAU,KAAK,KAAK,aAAa,QAAQ,UAAU;AACzD,+BAAU,KAAK,QAAQ,OAAO,CAAC;AAC/B,QAAM,aAAS,wBAAS,OAAO;AAC/B,SAAO,aAAa,OAAO,cAAc,CAAC;AAC1C,SAAO,WAAW,mCAAqB,IAAI;AAAA,IACzC,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AACA,+BAAU,SAAS,MAAM;AACzB,UAAQ,IAAI,8CAAyC,OAAO,EAAE;AAChE;AAEO,SAAS,eAAe,aAAqB,aAAmC,uBAAgC,cAA8B;AACnJ,QAAM,WAAO,oCAAqB,aAAa,uBAAuB,YAAY;AAElF,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,QAAQ;AACtE,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,4CAAuB,IAAI,CAAC;AAC/D,UAAQ,IAAI,6CAAwC,gBAAgB,EAAE;AAGtE,QAAM,WAAW,KAAK,KAAK,aAAa,QAAQ,OAAO;AACvD,+BAAU,QAAQ;AAClB,QAAM,WAAW,KAAK,KAAK,UAAU,cAAc;AACnD,KAAG,cAAc,cAAU,4CAAuB,IAAI,CAAC;AACvD,UAAQ,IAAI,qCAAgC,QAAQ,EAAE;AACxD;AAEO,SAAS,UAAU,aAA2B;AAEnD,QAAM,UAAU,KAAK,KAAK,aAAa,QAAQ,UAAU;AACzD,MAAI,GAAG,WAAW,OAAO,GAAG;AAC1B,UAAM,aAAS,wBAAS,OAAO;AAC/B,QAAI,OAAO,aAAa,mCAAqB,GAAG;AAC9C,aAAO,OAAO,WAAW,mCAAqB;AAC9C,UAAI,OAAO,KAAK,OAAO,UAAU,EAAE,WAAW,EAAG,QAAO,OAAO;AAC/D,mCAAU,SAAS,MAAM;AACzB,cAAQ,IAAI,+CAA0C;AAAA,IACxD;AAAA,EACF;AAGA,QAAM,WAAW,KAAK,KAAK,aAAa,QAAQ,SAAS,cAAc;AACvE,MAAI,GAAG,WAAW,QAAQ,GAAG;AAC3B,OAAG,WAAW,QAAQ;AACtB,YAAQ,IAAI,+BAA0B,cAAc,EAAE;AAAA,EACxD;AACF;AAEO,SAAS,oBAA0B;AACxC,UAAQ,IAAI,wDAAwD;AACpE,UAAQ,IAAI,2BAA2B;AACvC,UAAQ,IAAI,kDAAkD;AAChE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
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 tabnine_exports = {};
|
|
30
|
+
__export(tabnine_exports, {
|
|
31
|
+
installTabnineEarly: () => installTabnineEarly,
|
|
32
|
+
installTabnineLate: () => installTabnineLate,
|
|
33
|
+
printTabnineNextSteps: () => printTabnineNextSteps,
|
|
34
|
+
uninitTabnine: () => uninitTabnine
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(tabnine_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
|
+
function installTabnineEarly(projectRoot) {
|
|
43
|
+
const mcpPath = path.join(projectRoot, ".tabnine", "mcp.json");
|
|
44
|
+
(0, import_common.writeMcpServersConfig)(mcpPath, {
|
|
45
|
+
command: import_common.KIROGRAPH_COMMAND,
|
|
46
|
+
args: import_common.KIROGRAPH_MCP_ARGS
|
|
47
|
+
});
|
|
48
|
+
console.log(` \u2713 Tabnine MCP server registered in ${mcpPath}`);
|
|
49
|
+
}
|
|
50
|
+
function installTabnineLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
|
|
51
|
+
const instructionsPath = path.join(projectRoot, ".kirograph", "tabnine.md");
|
|
52
|
+
(0, import_common.ensureDir)(path.dirname(instructionsPath));
|
|
53
|
+
fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
|
|
54
|
+
console.log(` \u2713 Tabnine instructions written to ${instructionsPath}`);
|
|
55
|
+
const rulesPath = path.join(projectRoot, ".tabnine", "instructions.md");
|
|
56
|
+
(0, import_common.ensureDir)(path.dirname(rulesPath));
|
|
57
|
+
fs.writeFileSync(rulesPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
|
|
58
|
+
console.log(` \u2713 Tabnine instructions written to ${rulesPath}`);
|
|
59
|
+
}
|
|
60
|
+
function uninitTabnine(projectRoot) {
|
|
61
|
+
const mcpPath = path.join(projectRoot, ".tabnine", "mcp.json");
|
|
62
|
+
if ((0, import_common.removeMcpServersConfig)(mcpPath)) {
|
|
63
|
+
console.log(` \u2713 Removed kirograph from .tabnine/mcp.json`);
|
|
64
|
+
}
|
|
65
|
+
const rulesPath = path.join(projectRoot, ".tabnine", "instructions.md");
|
|
66
|
+
if (fs.existsSync(rulesPath)) {
|
|
67
|
+
fs.unlinkSync(rulesPath);
|
|
68
|
+
console.log(` \u2713 Removed .tabnine/instructions.md`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function printTabnineNextSteps() {
|
|
72
|
+
console.log("\n Done! Restart Tabnine for the MCP server to load.");
|
|
73
|
+
console.log(" KiroGraph instructions are in .tabnine/instructions.md\n");
|
|
74
|
+
}
|
|
75
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
+
0 && (module.exports = {
|
|
77
|
+
installTabnineEarly,
|
|
78
|
+
installTabnineLate,
|
|
79
|
+
printTabnineNextSteps,
|
|
80
|
+
uninitTabnine
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=tabnine.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/bin/installer/targets/tabnine.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 removeMcpServersConfig,\n writeMcpServersConfig,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts } from '../common';\n\nexport function installTabnineEarly(projectRoot: string): void {\n const mcpPath = path.join(projectRoot, '.tabnine', 'mcp.json');\n writeMcpServersConfig(mcpPath, {\n command: KIROGRAPH_COMMAND,\n args: KIROGRAPH_MCP_ARGS,\n });\n console.log(` \u2713 Tabnine MCP server registered in ${mcpPath}`);\n}\n\nexport function installTabnineLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'tabnine.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(` \u2713 Tabnine instructions written to ${instructionsPath}`);\n\n const rulesPath = path.join(projectRoot, '.tabnine', 'instructions.md');\n ensureDir(path.dirname(rulesPath));\n fs.writeFileSync(rulesPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(` \u2713 Tabnine instructions written to ${rulesPath}`);\n}\n\nexport function uninitTabnine(projectRoot: string): void {\n const mcpPath = path.join(projectRoot, '.tabnine', 'mcp.json');\n if (removeMcpServersConfig(mcpPath)) {\n console.log(` \u2713 Removed kirograph from .tabnine/mcp.json`);\n }\n\n const rulesPath = path.join(projectRoot, '.tabnine', 'instructions.md');\n if (fs.existsSync(rulesPath)) {\n fs.unlinkSync(rulesPath);\n console.log(` \u2713 Removed .tabnine/instructions.md`);\n }\n}\n\nexport function printTabnineNextSteps(): void {\n console.log('\\n Done! Restart Tabnine for the MCP server to load.');\n console.log(' KiroGraph instructions are in .tabnine/instructions.md\\n');\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AAEtB,oBAMO;AACP,0BAAuC;AACvC,IAAAA,iBAAqC;AAE9B,SAAS,oBAAoB,aAA2B;AAC7D,QAAM,UAAU,KAAK,KAAK,aAAa,YAAY,UAAU;AAC7D,2CAAsB,SAAS;AAAA,IAC7B,SAAS;AAAA,IACT,MAAM;AAAA,EACR,CAAC;AACD,UAAQ,IAAI,6CAAwC,OAAO,EAAE;AAC/D;AAEO,SAAS,mBAAmB,aAAqB,aAAmC,uBAAgC,cAA8B;AACvJ,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,YAAY;AAC1E,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,gDAAuB,qCAAqB,aAAa,uBAAuB,YAAY,CAAC,CAAC;AACjI,UAAQ,IAAI,4CAAuC,gBAAgB,EAAE;AAErE,QAAM,YAAY,KAAK,KAAK,aAAa,YAAY,iBAAiB;AACtE,+BAAU,KAAK,QAAQ,SAAS,CAAC;AACjC,KAAG,cAAc,eAAW,gDAAuB,qCAAqB,aAAa,uBAAuB,YAAY,CAAC,CAAC;AAC1H,UAAQ,IAAI,4CAAuC,SAAS,EAAE;AAChE;AAEO,SAAS,cAAc,aAA2B;AACvD,QAAM,UAAU,KAAK,KAAK,aAAa,YAAY,UAAU;AAC7D,UAAI,sCAAuB,OAAO,GAAG;AACnC,YAAQ,IAAI,mDAA8C;AAAA,EAC5D;AAEA,QAAM,YAAY,KAAK,KAAK,aAAa,YAAY,iBAAiB;AACtE,MAAI,GAAG,WAAW,SAAS,GAAG;AAC5B,OAAG,WAAW,SAAS;AACvB,YAAQ,IAAI,2CAAsC;AAAA,EACpD;AACF;AAEO,SAAS,wBAA8B;AAC5C,UAAQ,IAAI,uDAAuD;AACnE,UAAQ,IAAI,4DAA4D;AAC1E;",
|
|
6
|
+
"names": ["import_common"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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 trae_exports = {};
|
|
30
|
+
__export(trae_exports, {
|
|
31
|
+
installTraeEarly: () => installTraeEarly,
|
|
32
|
+
installTraeLate: () => installTraeLate,
|
|
33
|
+
printTraeNextSteps: () => printTraeNextSteps,
|
|
34
|
+
uninitTrae: () => uninitTrae
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(trae_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
|
+
function installTraeEarly(projectRoot) {
|
|
43
|
+
const mcpPath = path.join(projectRoot, ".trae", "mcp.json");
|
|
44
|
+
(0, import_common.writeMcpServersConfig)(mcpPath, {
|
|
45
|
+
command: import_common.KIROGRAPH_COMMAND,
|
|
46
|
+
args: import_common.KIROGRAPH_MCP_ARGS
|
|
47
|
+
});
|
|
48
|
+
console.log(` \u2713 Trae MCP server registered in ${mcpPath}`);
|
|
49
|
+
}
|
|
50
|
+
function installTraeLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
|
|
51
|
+
const instructionsPath = path.join(projectRoot, ".kirograph", "trae.md");
|
|
52
|
+
(0, import_common.ensureDir)(path.dirname(instructionsPath));
|
|
53
|
+
fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
|
|
54
|
+
console.log(` \u2713 Trae instructions written to ${instructionsPath}`);
|
|
55
|
+
const rulesDir = path.join(projectRoot, ".trae", "rules");
|
|
56
|
+
(0, import_common.ensureDir)(rulesDir);
|
|
57
|
+
const rulePath = path.join(rulesDir, "kirograph.md");
|
|
58
|
+
const frontmatter = "---\nalwaysApply: true\n---\n\n";
|
|
59
|
+
fs.writeFileSync(rulePath, frontmatter + (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
|
|
60
|
+
console.log(` \u2713 Trae rule written to ${rulePath}`);
|
|
61
|
+
}
|
|
62
|
+
function uninitTrae(projectRoot) {
|
|
63
|
+
const mcpPath = path.join(projectRoot, ".trae", "mcp.json");
|
|
64
|
+
if ((0, import_common.removeMcpServersConfig)(mcpPath)) {
|
|
65
|
+
console.log(` \u2713 Removed kirograph from .trae/mcp.json`);
|
|
66
|
+
}
|
|
67
|
+
const rulePath = path.join(projectRoot, ".trae", "rules", "kirograph.md");
|
|
68
|
+
if (fs.existsSync(rulePath)) {
|
|
69
|
+
fs.unlinkSync(rulePath);
|
|
70
|
+
console.log(` \u2713 Removed .trae/rules/kirograph.md`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function printTraeNextSteps() {
|
|
74
|
+
console.log("\n Done! Restart Trae for the MCP server to load.");
|
|
75
|
+
console.log(" KiroGraph rule is in .trae/rules/kirograph.md\n");
|
|
76
|
+
}
|
|
77
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
78
|
+
0 && (module.exports = {
|
|
79
|
+
installTraeEarly,
|
|
80
|
+
installTraeLate,
|
|
81
|
+
printTraeNextSteps,
|
|
82
|
+
uninitTrae
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=trae.js.map
|