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.
- package/LICENSE +21 -0
- package/README.md +239 -20
- package/dist/assets/logo.png +0 -0
- package/dist/bin/commands/docs.js +357 -0
- package/dist/bin/commands/docs.js.map +7 -0
- package/dist/bin/commands/help.js +3 -0
- package/dist/bin/commands/help.js.map +2 -2
- package/dist/bin/commands/uninit.js +10 -13
- package/dist/bin/commands/uninit.js.map +2 -2
- package/dist/bin/installer/config-prompt.js +53 -23
- package/dist/bin/installer/config-prompt.js.map +2 -2
- package/dist/bin/installer/hooks.js +20 -1
- package/dist/bin/installer/hooks.js.map +2 -2
- package/dist/bin/installer/index.js +14 -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 +40 -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 +5 -1
- package/dist/bin/kirograph.js.map +3 -3
- package/dist/compression/naive-cost.js +33 -0
- package/dist/compression/naive-cost.js.map +2 -2
- package/dist/compression/tracker.js +27 -4
- package/dist/compression/tracker.js.map +2 -2
- package/dist/compression/types.js.map +1 -1
- package/dist/config.js +66 -1
- package/dist/config.js.map +2 -2
- package/dist/core/pipeline.js +23 -0
- package/dist/core/pipeline.js.map +2 -2
- package/dist/db/database.js +28 -0
- package/dist/db/database.js.map +2 -2
- package/dist/db/docs-schema.sql +50 -0
- package/dist/docs/formats/asciidoc.js +108 -0
- package/dist/docs/formats/asciidoc.js.map +7 -0
- package/dist/docs/formats/html.js +100 -0
- package/dist/docs/formats/html.js.map +7 -0
- package/dist/docs/formats/index.js +81 -0
- package/dist/docs/formats/index.js.map +7 -0
- package/dist/docs/formats/markdown.js +146 -0
- package/dist/docs/formats/markdown.js.map +7 -0
- package/dist/docs/formats/openapi.js +228 -0
- package/dist/docs/formats/openapi.js.map +7 -0
- package/dist/docs/formats/org.js +117 -0
- package/dist/docs/formats/org.js.map +7 -0
- package/dist/docs/formats/plaintext.js +119 -0
- package/dist/docs/formats/plaintext.js.map +7 -0
- package/dist/docs/formats/rdoc.js +105 -0
- package/dist/docs/formats/rdoc.js.map +7 -0
- package/dist/docs/formats/rst.js +121 -0
- package/dist/docs/formats/rst.js.map +7 -0
- package/dist/docs/indexer.js +340 -0
- package/dist/docs/indexer.js.map +7 -0
- package/dist/docs/linker.js +151 -0
- package/dist/docs/linker.js.map +7 -0
- package/dist/docs/lint.js +92 -0
- package/dist/docs/lint.js.map +7 -0
- package/dist/docs/queries.js +295 -0
- package/dist/docs/queries.js.map +7 -0
- package/dist/docs/section-id.js +57 -0
- package/dist/docs/section-id.js.map +7 -0
- package/dist/docs/summarizer.js +55 -0
- package/dist/docs/summarizer.js.map +7 -0
- package/dist/docs/types.js +17 -0
- package/dist/docs/types.js.map +7 -0
- package/dist/docs/vectors.js +217 -0
- package/dist/docs/vectors.js.map +7 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +2 -2
- package/dist/mcp/tool-names.js +10 -1
- package/dist/mcp/tool-names.js.map +2 -2
- package/dist/mcp/tools.js +476 -3
- package/dist/mcp/tools.js.map +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/installer/prompts.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * KiroGraph Installer \u2014 interactive prompt helpers\n */\n\nimport * as readline from 'readline';\n\n// \u2500\u2500 ANSI \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const violet = '\\x1b[38;5;99m';\nexport const reset = '\\x1b[0m';\nexport const dim = '\\x1b[2m';\nconst bold = '\\x1b[1m';\nconst green = '\\x1b[32m';\n\n// \u2500\u2500 Primitives \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function ask(rl: readline.Interface, question: string): Promise<string> {\n return new Promise(resolve => rl.question(question, resolve));\n}\n\n/**\n * Prompt a yes/no question, re-prompting on invalid input.\n * Accepts: \"\" (use default), \"y\", \"Y\", \"n\", \"N\".\n */\nexport async function askBool(\n rl: readline.Interface,\n question: string,\n description: string,\n defaultYes = true,\n): Promise<boolean> {\n const hint = defaultYes ? 'Y/n' : 'y/N';\n console.log(`\\n ${dim}${description}${reset}`);\n while (true) {\n const raw = await ask(rl, ` ${violet}${question}${reset} ${dim}(${hint})${reset} `);\n if (raw === '') return defaultYes;\n if (raw === 'y' || raw === 'Y') return true;\n if (raw === 'n' || raw === 'N') return false;\n console.log(` Please enter y or n.`);\n }\n}\n\n/**\n * Prompt for a string value, returning the default on empty input.\n */\nexport async function askString(\n rl: readline.Interface,\n question: string,\n description: string,\n defaultValue: string,\n): Promise<string> {\n console.log(`\\n ${dim}${description}${reset}`);\n const raw = await ask(rl, ` ${violet}${question}${reset} ${dim}(${defaultValue})${reset} `);\n return raw === '' ? defaultValue : raw;\n}\n\n/**\n * Interactive arrow-key selection menu.\n * Temporarily pauses the readline interface to take over raw stdin,\n * then resumes it when done so subsequent prompts work normally.\n */\nexport async function arrowSelect<T>(\n rl: readline.Interface,\n label: string,\n options: Array<{ value: T; label: string; description: string }>,\n defaultIndex = 0,\n): Promise<T> {\n const CURSOR_UP = '\\x1b[A';\n const CURSOR_DOWN = '\\x1b[B';\n const CLEAR_LINE = '\\x1b[2K\\x1b[G';\n\n function descLineCount(desc: string): number {\n const termWidth = process.stdout.columns || 80;\n return Math.max(1, Math.ceil((desc.length + 4) / termWidth));\n }\n\n let selected = defaultIndex;\n let prevDescLines = descLineCount(options[defaultIndex]!.description);\n\n function render(first: boolean) {\n if (!first) {\n process.stdout.write(`\\x1b[${options.length + prevDescLines}A`);\n }\n for (let i = 0; i < options.length; i++) {\n const active = i === selected;\n const cursor = active ? `${green}${bold}\u276F${reset}` : ' ';\n const text = active ? `${bold}${options[i]!.label}${reset}` : `${dim}${options[i]!.label}${reset}`;\n process.stdout.write(`${CLEAR_LINE} ${cursor} ${text}\\n`);\n }\n const desc = options[selected]!.description;\n process.stdout.write(`${CLEAR_LINE} ${dim}${desc}${reset}\\n`);\n prevDescLines = descLineCount(desc);\n }\n\n return new Promise(resolve => {\n console.log(`\\n ${violet}${label}${reset}`);\n render(true);\n\n rl.pause();\n const stdin = process.stdin;\n const wasTTY = stdin.isTTY;\n if (wasTTY) stdin.setRawMode(true);\n stdin.resume();\n stdin.setEncoding('utf8');\n\n function onData(key: string) {\n if (key === CURSOR_UP || key === '\\x1b[A') {\n selected = (selected - 1 + options.length) % options.length;\n render(false);\n } else if (key === CURSOR_DOWN || key === '\\x1b[B') {\n selected = (selected + 1) % options.length;\n render(false);\n } else if (key === '\\r' || key === '\\n' || key === ' ') {\n stdin.removeListener('data', onData);\n if (wasTTY) stdin.setRawMode(false);\n stdin.pause();\n rl.resume();\n process.stdout.write(`\\x1b[${options.length + prevDescLines}A`)
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,MAAM,SAAS;AACf,MAAM,QAAS;AACf,MAAM,MAAS;AACtB,MAAM,OAAgB;AACtB,MAAM,QAAgB;AAIf,SAAS,IAAI,IAAwB,UAAmC;AAC7E,SAAO,IAAI,QAAQ,aAAW,GAAG,SAAS,UAAU,OAAO,CAAC;AAC9D;AAMA,eAAsB,QACpB,IACA,UACA,aACA,aAAa,MACK;AAClB,QAAM,OAAO,aAAa,QAAQ;AAClC,UAAQ,IAAI;AAAA,IAAO,GAAG,GAAG,WAAW,GAAG,KAAK,EAAE;AAC9C,SAAO,MAAM;AACX,UAAM,MAAM,MAAM,IAAI,IAAI,KAAK,MAAM,GAAG,QAAQ,GAAG,KAAK,IAAI,GAAG,IAAI,IAAI,IAAI,KAAK,GAAG;AACnF,QAAI,QAAQ,GAAI,QAAO;AACvB,QAAI,QAAQ,OAAO,QAAQ,IAAK,QAAO;AACvC,QAAI,QAAQ,OAAO,QAAQ,IAAK,QAAO;AACvC,YAAQ,IAAI,wBAAwB;AAAA,EACtC;AACF;AAKA,eAAsB,UACpB,IACA,UACA,aACA,cACiB;AACjB,UAAQ,IAAI;AAAA,IAAO,GAAG,GAAG,WAAW,GAAG,KAAK,EAAE;AAC9C,QAAM,MAAM,MAAM,IAAI,IAAI,KAAK,MAAM,GAA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;AACtB,UAAM,SAAS,MAAM;AACrB,QAAI,OAAQ,OAAM,WAAW,IAAI;AACjC,UAAM,OAAO;AACb,UAAM,YAAY,MAAM;AAExB,aAAS,OAAO,KAAa;AAC3B,UAAI,QAAQ,aAAa,QAAQ,UAAU;AACzC,oBAAY,WAAW,IAAI,QAAQ,UAAU,QAAQ;AACrD,eAAO,KAAK;AAAA,MACd,WAAW,QAAQ,eAAe,QAAQ,UAAU;AAClD,oBAAY,WAAW,KAAK,QAAQ;AACpC,eAAO,KAAK;AAAA,MACd,WAAW,QAAQ,QAAQ,QAAQ,QAAQ,QAAQ,KAAK;AACtD,cAAM,eAAe,QAAQ,MAAM;AACnC,YAAI,OAAQ,OAAM,WAAW,KAAK;AAClC,cAAM,MAAM;AACZ,WAAG,OAAO;
|
|
4
|
+
"sourcesContent": ["/**\n * KiroGraph Installer \u2014 interactive prompt helpers\n */\n\nimport * as readline from 'readline';\n\n// \u2500\u2500 ANSI \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const violet = '\\x1b[38;5;99m';\nexport const reset = '\\x1b[0m';\nexport const dim = '\\x1b[2m';\nconst bold = '\\x1b[1m';\nconst green = '\\x1b[32m';\nconst yellow = '\\x1b[33m';\nconst cyan = '\\x1b[36m';\n\n// \u2500\u2500 Primitives \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function ask(rl: readline.Interface, question: string): Promise<string> {\n return new Promise(resolve => rl.question(question, resolve));\n}\n\n/**\n * Prompt a yes/no question, re-prompting on invalid input.\n * Accepts: \"\" (use default), \"y\", \"Y\", \"n\", \"N\".\n */\nexport async function askBool(\n rl: readline.Interface,\n question: string,\n description: string,\n defaultYes = true,\n): Promise<boolean> {\n const hint = defaultYes ? 'Y/n' : 'y/N';\n console.log(`\\n ${dim}${description}${reset}`);\n while (true) {\n const raw = await ask(rl, ` ${violet}${question}${reset} ${dim}(${hint})${reset} `);\n if (raw === '') return defaultYes;\n if (raw === 'y' || raw === 'Y') return true;\n if (raw === 'n' || raw === 'N') return false;\n console.log(` Please enter y or n.`);\n }\n}\n\n/**\n * Interactive enable/disable toggle using arrow keys.\n * More visual alternative to askBool.\n */\nexport async function askToggle(\n rl: readline.Interface,\n label: string,\n description: string,\n defaultEnabled = true,\n): Promise<boolean> {\n return arrowSelect<boolean>(rl, label, [\n { value: true, label: 'yes', description },\n { value: false, label: 'no', description: 'Skip' },\n ], defaultEnabled ? 0 : 1);\n}\n\n/**\n * Prompt for a string value, returning the default on empty input.\n */\nexport async function askString(\n rl: readline.Interface,\n question: string,\n description: string,\n defaultValue: string,\n): Promise<string> {\n console.log(`\\n ${dim}${description}${reset}`);\n const raw = await ask(rl, ` ${violet}${question}${reset} ${dim}(${defaultValue})${reset} `);\n return raw === '' ? defaultValue : raw;\n}\n\n/**\n * Print a styled section header with an icon.\n */\nexport function printSection(icon: string, title: string): void {\n console.log(`\\n ${violet}${bold}${icon} ${title}${reset}`);\n console.log(` ${violet}${'\u2500'.repeat(title.length + 4)}${reset}`);\n}\n\n/**\n * Print a separator line.\n */\nexport function printSeparator(): void {\n console.log(`\\n ${dim}${'\u00B7'.repeat(50)}${reset}`);\n}\n\n/**\n * Print a feature summary line.\n */\nexport function printFeature(enabled: boolean, label: string): void {\n const icon = enabled ? `${green}\u2713${reset}` : `${dim}\u2717${reset}`;\n const text = enabled ? label : `${dim}${label}${reset}`;\n console.log(` ${icon} ${text}`);\n}\n\n/**\n * Interactive arrow-key selection menu.\n * Temporarily pauses the readline interface to take over raw stdin,\n * then resumes it when done so subsequent prompts work normally.\n */\nexport async function arrowSelect<T>(\n rl: readline.Interface,\n label: string,\n options: Array<{ value: T; label: string; description: string }>,\n defaultIndex = 0,\n): Promise<T> {\n const CURSOR_UP = '\\x1b[A';\n const CURSOR_DOWN = '\\x1b[B';\n const CLEAR_LINE = '\\x1b[2K\\x1b[G';\n\n function descLineCount(desc: string): number {\n const termWidth = process.stdout.columns || 80;\n return Math.max(1, Math.ceil((desc.length + 4) / termWidth));\n }\n\n let selected = defaultIndex;\n let prevDescLines = descLineCount(options[defaultIndex]!.description);\n\n function render(first: boolean) {\n if (!first) {\n process.stdout.write(`\\x1b[${options.length + prevDescLines}A`);\n }\n for (let i = 0; i < options.length; i++) {\n const active = i === selected;\n const cursor = active ? `${green}${bold}\u276F${reset}` : ' ';\n const text = active ? `${bold}${options[i]!.label}${reset}` : `${dim}${options[i]!.label}${reset}`;\n process.stdout.write(`${CLEAR_LINE} ${cursor} ${text}\\n`);\n }\n const desc = options[selected]!.description;\n process.stdout.write(`${CLEAR_LINE} ${dim}${desc}${reset}\\n`);\n prevDescLines = descLineCount(desc);\n }\n\n return new Promise(resolve => {\n console.log(`\\n ${violet}${label}${reset}`);\n render(true);\n\n rl.pause();\n const stdin = process.stdin;\n const wasTTY = stdin.isTTY;\n if (wasTTY) stdin.setRawMode(true);\n stdin.resume();\n stdin.setEncoding('utf8');\n\n function onData(key: string) {\n if (key === CURSOR_UP || key === '\\x1b[A') {\n selected = (selected - 1 + options.length) % options.length;\n render(false);\n } else if (key === CURSOR_DOWN || key === '\\x1b[B') {\n selected = (selected + 1) % options.length;\n render(false);\n } else if (key === '\\r' || key === '\\n' || key === ' ') {\n stdin.removeListener('data', onData);\n if (wasTTY) stdin.setRawMode(false);\n stdin.pause();\n rl.resume();\n // Clear all rendered lines (options + desc + label + blank line before label)\n const totalLines = options.length + prevDescLines + 2;\n process.stdout.write(`\\x1b[${options.length + prevDescLines}A`); // go up to first option\n process.stdout.write(`\\x1b[1A`); // go up past label\n process.stdout.write(`\\x1b[1A`); // go up past blank line\n for (let i = 0; i < totalLines; i++) {\n process.stdout.write(`${CLEAR_LINE}\\n`);\n }\n process.stdout.write(`\\x1b[${totalLines}A`);\n process.stdout.write(`${CLEAR_LINE} ${green}${bold}\u2713${reset} ${label} ${green}${bold}${options[selected]!.label}${reset}\\n`);\n resolve(options[selected]!.value);\n } else if (key === '\\x03') {\n stdin.removeListener('data', onData);\n if (wasTTY) stdin.setRawMode(false);\n process.exit(1);\n }\n }\n\n stdin.on('data', onData);\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,MAAM,SAAS;AACf,MAAM,QAAS;AACf,MAAM,MAAS;AACtB,MAAM,OAAgB;AACtB,MAAM,QAAgB;AACtB,MAAM,SAAgB;AACtB,MAAM,OAAgB;AAIf,SAAS,IAAI,IAAwB,UAAmC;AAC7E,SAAO,IAAI,QAAQ,aAAW,GAAG,SAAS,UAAU,OAAO,CAAC;AAC9D;AAMA,eAAsB,QACpB,IACA,UACA,aACA,aAAa,MACK;AAClB,QAAM,OAAO,aAAa,QAAQ;AAClC,UAAQ,IAAI;AAAA,IAAO,GAAG,GAAG,WAAW,GAAG,KAAK,EAAE;AAC9C,SAAO,MAAM;AACX,UAAM,MAAM,MAAM,IAAI,IAAI,KAAK,MAAM,GAAG,QAAQ,GAAG,KAAK,IAAI,GAAG,IAA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caveman) {
|
|
343
343
|
content = content.trimEnd() + "\n\n" + caveman + "\n";
|
|
344
344
|
}
|
|
345
|
+
if (opts?.enableMemory) {
|
|
346
|
+
const memorySection = `
|
|
347
|
+
## Memory
|
|
348
|
+
|
|
349
|
+
KiroGraph has persistent memory. Use \`kirograph_mem_search\` to recall past decisions,
|
|
350
|
+
errors, and patterns before making changes. Use \`kirograph_mem_store\` to save important
|
|
351
|
+
observations (architecture decisions, bug root causes, patterns discovered).
|
|
352
|
+
|
|
353
|
+
Memory is searchable via hybrid FTS + vector search. Observations are automatically
|
|
354
|
+
linked to code symbols in the graph and surface in \`kirograph_context\` and
|
|
355
|
+
\`kirograph_impact\` results when relevant.
|
|
356
|
+
|
|
357
|
+
**When to store:** After fixing a bug, making an architecture decision, discovering a pattern,
|
|
358
|
+
encountering a non-obvious error, or learning something about the codebase that future sessions
|
|
359
|
+
should know. Keep observations concise \u2014 one fact per store call. A hook will also remind you
|
|
360
|
+
at session end.
|
|
361
|
+
`;
|
|
362
|
+
content = content.trimEnd() + "\n\n" + memorySection.trim() + "\n";
|
|
363
|
+
}
|
|
364
|
+
if (opts?.enableDocs) {
|
|
365
|
+
const docsSection = `
|
|
366
|
+
## Documentation
|
|
367
|
+
|
|
368
|
+
KiroGraph indexes project documentation by heading structure. Use \`kirograph_docs_search\`
|
|
369
|
+
to find relevant doc sections instead of reading entire files. Use \`kirograph_docs_section\`
|
|
370
|
+
to retrieve the exact section you need by ID.
|
|
371
|
+
|
|
372
|
+
**Available tools:**
|
|
373
|
+
- \`kirograph_docs_toc\` \u2014 table of contents for a file or the whole project
|
|
374
|
+
- \`kirograph_docs_search\` \u2014 search sections by query (independent from code search)
|
|
375
|
+
- \`kirograph_docs_section\` \u2014 retrieve full content of a section by ID
|
|
376
|
+
- \`kirograph_docs_outline\` \u2014 heading hierarchy for a single document
|
|
377
|
+
- \`kirograph_docs_refs\` \u2014 find code symbols referenced by a doc section (or vice versa)
|
|
378
|
+
|
|
379
|
+
**When to use:** Before reading a documentation file directly, check if \`kirograph_docs_search\`
|
|
380
|
+
or \`kirograph_docs_outline\` can give you the specific section you need. This saves tokens
|
|
381
|
+
and gives you structured navigation instead of raw file content.
|
|
382
|
+
`;
|
|
383
|
+
content = content.trimEnd() + "\n\n" + docsSection.trim() + "\n";
|
|
384
|
+
}
|
|
345
385
|
return content;
|
|
346
386
|
}
|
|
347
387
|
function writeSteering(kiroDir, opts) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/installer/steering.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * KiroGraph Installer: Kiro steering file\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { CAVEMAN_RULES, CavemanMode } from './caveman';\n\nconst STEERING_CONTENT = `---\ninclusion: always\n---\n\n# KiroGraph\n\nKiroGraph builds a semantic knowledge graph of your codebase. Use its MCP tools instead of grep/glob/file reads whenever \\`.kirograph/\\` exists in the project.\n\n## Quick decision guide\n\n| Question | Tool |\n|----------|------|\n| Where do I start on this task? | \\`kirograph_context\\` |\n| What is this symbol / show me its code | \\`kirograph_node\\` with \\`includeCode: true\\` |\n| Find a symbol by name | \\`kirograph_search\\` |\n| Who calls function X? | \\`kirograph_callers\\` |\n| What does function X call? | \\`kirograph_callees\\` |\n| What breaks if I change X? | \\`kirograph_impact\\` |\n| How are X and Y connected? | \\`kirograph_path\\` |\n| What extends / implements this type? | \\`kirograph_type_hierarchy\\` |\n| Which code is never called? | \\`kirograph_dead_code\\` |\n| Are there import cycles? | \\`kirograph_circular_deps\\` |\n| What files are indexed? | \\`kirograph_files\\` |\n| Is the index healthy? | \\`kirograph_status\\` |\n| What are the most critical symbols? | \\`kirograph_hotspots\\` |\n| Any unexpected cross-module coupling? | \\`kirograph_surprising\\` |\n| What changed since the last snapshot? | \\`kirograph_diff\\` |\n| What packages/layers exist? | \\`kirograph_architecture\\` |\n| How coupled is package X? | \\`kirograph_coupling\\` |\n| What does package X depend on? | \\`kirograph_package\\` |\n| Run a command with token savings | \\`kirograph_exec\\` |\n| Check token savings stats | \\`kirograph_gain\\` |\n\n---\n\n## Tool reference\n\n### \\`kirograph_context\\`: **start here for any code task**\n\nReturns entry points, related symbols, and code snippets for a natural-language task description. Usually enough to orient without any additional tool calls.\n\n\\`\\`\\`\nkirograph_context(task: \"fix the auth token expiry bug\")\nkirograph_context(task: \"add dark mode\", maxNodes: 30)\nkirograph_context(task: \"refactor payment service\", includeCode: false)\n\\`\\`\\`\n\n### \\`kirograph_search\\`: find symbols by name\n\nExact match \u2192 FTS \u2192 LIKE fallback \u2192 vector (last resort). Use instead of grep.\n\n\\`\\`\\`\nkirograph_search(query: \"signIn\")\nkirograph_search(query: \"UserService\", kind: \"class\")\nkirograph_search(query: \"auth\", limit: 20)\n\\`\\`\\`\n\nSupported kinds: \\`function\\`, \\`method\\`, \\`class\\`, \\`interface\\`, \\`type_alias\\`, \\`variable\\`, \\`route\\`, \\`component\\`\n\n### \\`kirograph_node\\`: inspect a symbol\n\nReturns kind, file, signature, docstring. Add \\`includeCode: true\\` to get the full source.\n\n\\`\\`\\`\nkirograph_node(symbol: \"validateToken\")\nkirograph_node(symbol: \"AuthService\", includeCode: true)\n\\`\\`\\`\n\n### \\`kirograph_callers\\`: who calls this?\n\nBFS over incoming \\`calls\\` edges (depth 1).\n\n\\`\\`\\`\nkirograph_callers(symbol: \"processPayment\", limit: 30)\n\\`\\`\\`\n\n### \\`kirograph_callees\\`: what does this call?\n\nBFS over outgoing \\`calls\\` edges (depth 1).\n\n\\`\\`\\`\nkirograph_callees(symbol: \"handleRequest\")\n\\`\\`\\`\n\n### \\`kirograph_impact\\`: blast radius before a change\n\nTraverses all incoming edges up to \\`depth\\` hops. Call this before editing a symbol.\n\n\\`\\`\\`\nkirograph_impact(symbol: \"UserRepository\", depth: 3)\n\\`\\`\\`\n\n### \\`kirograph_path\\`: how are two symbols connected?\n\nBFS shortest path across all edge types.\n\n\\`\\`\\`\nkirograph_path(from: \"LoginController\", to: \"DatabasePool\")\n\\`\\`\\`\n\n### \\`kirograph_type_hierarchy\\`: class/interface inheritance\n\n\\`\\`\\`\nkirograph_type_hierarchy(symbol: \"BaseRepository\", direction: \"down\") // derived types\nkirograph_type_hierarchy(symbol: \"PaymentService\", direction: \"up\") // base types\nkirograph_type_hierarchy(symbol: \"IUserStore\", direction: \"both\") // all\n\\`\\`\\`\n\n### \\`kirograph_dead_code\\`: unreferenced symbols\n\nReturns unexported symbols with zero incoming edges. Good first step when cleaning up.\n\n\\`\\`\\`\nkirograph_dead_code(limit: 50)\n\\`\\`\\`\n\n### \\`kirograph_circular_deps\\`: import cycles\n\nRuns Tarjan's SCC over import edges. No parameters needed.\n\n\\`\\`\\`\nkirograph_circular_deps()\n\\`\\`\\`\n\n### \\`kirograph_files\\`: indexed file structure\n\n\\`\\`\\`\nkirograph_files(format: \"tree\") // default\nkirograph_files(format: \"flat\") // one path per line\nkirograph_files(format: \"grouped\") // by directory\nkirograph_files(filterPath: \"src/auth\", maxDepth: 2)\nkirograph_files(pattern: \"**/*.test.ts\")\n\\`\\`\\`\n\n### \\`kirograph_status\\`: index health\n\nReturns file count, symbol count, edge count, embedding coverage, DB size. Call when something feels off.\n\n### \\`kirograph_hotspots\\`: most-connected symbols\n\nReturns the top-N symbols by total edge degree (in + out, excluding structural \\`contains\\` edges). Use to find core abstractions, identify high blast-radius symbols before a refactor, or understand what the codebase revolves around.\n\n\\`\\`\\`\nkirograph_hotspots(limit: 20)\n\\`\\`\\`\n\n### \\`kirograph_surprising\\`: unexpected cross-module coupling\n\nFinds direct edges between symbols in structurally distant files, scored by path distance \u00D7 edge-kind weight. Use before a refactor to discover hidden dependencies that will break. High score = more unexpected.\n\n\\`\\`\\`\nkirograph_surprising(limit: 20)\n\\`\\`\\`\n\n### \\`kirograph_diff\\`: what changed since a snapshot?\n\nCompares the current graph against a saved snapshot. Shows added/removed symbols and edges. A snapshot must exist: the user saves one with \\`kirograph snapshot save <label>\\` before making changes.\n\n\\`\\`\\`\nkirograph_diff() // vs latest snapshot\nkirograph_diff(snapshot: \"pre-refactor\") // vs named snapshot\n\\`\\`\\`\n\n---\n\n## Architecture tools *(require \\`enableArchitecture: true\\` in config)*\n\n### \\`kirograph_architecture\\`: **start here for architectural questions**\n\nReturns the full package graph, detected layers (api/service/data/ui/shared), and their dependency edges.\n\n\\`\\`\\`\nkirograph_architecture() // packages + layers\nkirograph_architecture(level: \"packages\")\nkirograph_architecture(level: \"layers\")\nkirograph_architecture(includeFiles: true) // add file\u2192package assignments\n\\`\\`\\`\n\n### \\`kirograph_coupling\\`: stability metrics per package\n\nReturns Ca (afferent: depended on by), Ce (efferent: depends on), and instability (Ce/(Ca+Ce)).\n- High Ca + low instability = load-bearing, safe to depend on, risky to change interface.\n- High Ce + high instability = depends on many things, safe to refactor internals.\n\n\\`\\`\\`\nkirograph_coupling() // all packages, sorted by instability\nkirograph_coupling(sortBy: \"afferent\") // most depended-on first\nkirograph_coupling(sortBy: \"efferent\") // most outgoing deps first\n\\`\\`\\`\n\n### \\`kirograph_package\\`: drill into one package\n\nReturns metadata, coupling metrics, outgoing deps, incoming dependents, and file list.\n\n\\`\\`\\`\nkirograph_package(package: \"auth\")\nkirograph_package(package: \"src/services\", includeFiles: false)\n\\`\\`\\`\n\n---\n\n## Workflows\n\n**Bug fix or feature:**\n1. \\`kirograph_context\\`: orient, find entry points.\n2. \\`kirograph_node\\` with \\`includeCode: true\\`: read the relevant symbol.\n3. \\`kirograph_callers\\` / \\`kirograph_callees\\`: trace the call flow.\n4. \\`kirograph_impact\\`: check blast radius before editing.\n\n**Refactor planning:**\n1. \\`kirograph_hotspots\\`: identify the most-connected symbols; changing these is risky.\n2. \\`kirograph_surprising\\`: surface hidden coupling that will break.\n3. \\`kirograph_impact\\` on specific targets: confirm blast radius.\n4. \\`kirograph_diff\\` after the refactor: verify the structural change matches intent.\n\n**Architectural review:**\n1. \\`kirograph_architecture\\`: get the package and layer map.\n2. \\`kirograph_coupling\\`: find the most stable (high Ca) and most volatile (high instability) packages.\n3. \\`kirograph_package\\`: drill into any package of interest.\n4. \\`kirograph_circular_deps\\`: check for import cycles.\n\n**Code cleanup:**\n1. \\`kirograph_dead_code\\`: find unreferenced unexported symbols.\n2. \\`kirograph_circular_deps\\`: find import cycles to untangle.\n3. \\`kirograph_surprising\\`: find unexpected coupling to decouple.\n\n---\n\n## If \\`.kirograph/\\` does NOT exist\n\nAsk the user: \"This project doesn't have KiroGraph initialized. Run \\`kirograph init -i\\` to build a code knowledge graph for faster exploration?\"\n`;\n\n// \u2500\u2500 Compression section builder (level-aware) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst LEVEL_DESCRIPTIONS: Record<string, string> = {\n normal: 'Balanced: removes noise, keeps structure.',\n aggressive: 'Compact: groups by category, limits output.',\n ultra: 'Maximum compression: counts and summaries only.',\n};\n\nconst LEVEL_EXAMPLES: Record<string, string> = {\n normal: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\")\nkirograph_exec(command: \"npm test\")\nkirograph_exec(command: \"cargo build\")\nkirograph_exec(command: \"ls -la src/\")\n\\\\\\`\\\\\\`\\\\\\``,\n aggressive: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\", level: \"aggressive\")\nkirograph_exec(command: \"npm test\", level: \"aggressive\")\nkirograph_exec(command: \"eslint .\", level: \"aggressive\")\nkirograph_exec(command: \"find . -name '*.ts'\", level: \"aggressive\")\n\\\\\\`\\\\\\`\\\\\\``,\n ultra: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\", level: \"ultra\")\nkirograph_exec(command: \"npm test\", level: \"ultra\")\nkirograph_exec(command: \"docker ps\", level: \"ultra\")\nkirograph_exec(command: \"ls -la src/\", level: \"ultra\")\n\\\\\\`\\\\\\`\\\\\\``,\n};\n\nfunction buildCompressionSection(level: 'normal' | 'aggressive' | 'ultra'): string {\n return `\n---\n\n## Shell Compression (\\\\\\`kirograph_exec\\\\\\`)\n\nWhen running shell commands, prefer \\\\\\`kirograph_exec\\\\\\` over raw shell execution for:\n- **git** operations (status, log, diff, push, pull, commit, add, fetch, branch)\n- **GitHub CLI** (gh pr list/view, gh issue list, gh run list)\n- **test runners** (jest, vitest, pytest, cargo test, go test, rspec, minitest, playwright)\n- **linters/build** (eslint, tsc, ruff, clippy, cargo build, prettier, biome, golangci-lint, rubocop, next build)\n- **file listings** (ls, find, tree)\n- **search** (grep, rg/ripgrep: grouped by file)\n- **diff** (diff file1 file2: condensed context)\n- **docker/k8s** (docker ps, images, logs, compose ps, kubectl pods, logs, services)\n- **package managers** (npm/pnpm install/list, pip list/install, bundle install, prisma generate)\n- **AWS CLI** (sts, ec2, lambda, logs, cloudformation, dynamodb, iam, s3, ecs, sqs, sns)\n- **network** (curl, wget: strip progress bars and headers)\n\nThis saves 60-90% of tokens compared to raw output.\n\nCompression level: **${level}**: ${LEVEL_DESCRIPTIONS[level]}\n\n${LEVEL_EXAMPLES[level]}\n\n**Important:** Error details are always preserved. Failed commands show full diagnostic output regardless of level.\n\n**Do NOT re-run commands:** When \\\\\\`kirograph_exec\\\\\\` returns a result, treat it as the final answer. Never re-run the same command with raw shell execution to \"get more details.\" The compressed output preserves all essential information. If you genuinely need something missing from the output, explain what's missing before making a second call.\n\nUse \\\\\\`kirograph_gain\\\\\\` to check token savings statistics.`;\n}\n\nexport interface SteeringOptions {\n cavemanMode?: CavemanMode | 'off';\n enableCompression?: boolean;\n shellCompressionLevel?: 'off' | 'normal' | 'aggressive' | 'ultra';\n}\n\nfunction buildSteeringContent(opts?: SteeringOptions): string {\n const cavemanMode = opts?.cavemanMode;\n const enableCompression = opts?.enableCompression !== false && opts?.shellCompressionLevel !== 'off';\n const shellCompressionLevel = opts?.shellCompressionLevel ?? 'normal';\n\n let content = STEERING_CONTENT;\n\n // Insert compression section before the \"If .kirograph/ does NOT exist\" section\n if (enableCompression && shellCompressionLevel !== 'off') {\n const section = buildCompressionSection(shellCompressionLevel as 'normal' | 'aggressive' | 'ultra');\n content = content.replace(\n '---\\n\\n## If `.kirograph/` does NOT exist',\n section.trim() + '\\n\\n---\\n\\n## If `.kirograph/` does NOT exist',\n );\n }\n\n // Remove compression tools from decision guide if disabled\n if (!enableCompression) {\n content = content.replace('| Run a command with token savings | `kirograph_exec` |\\n', '');\n content = content.replace('| Check token savings stats | `kirograph_gain` |\\n', '');\n }\n\n const caveman = cavemanMode && cavemanMode !== 'off' ? CAVEMAN_RULES[cavemanMode] : null;\n if (caveman) {\n content = content.trimEnd() + '\\n\\n' + caveman + '\\n';\n }\n\n return content;\n}\n\nexport function writeSteering(kiroDir: string, opts?: SteeringOptions | CavemanMode | 'off'): void {\n const steeringDir = path.join(kiroDir, 'steering');\n fs.mkdirSync(steeringDir, { recursive: true });\n const steeringPath = path.join(steeringDir, 'kirograph.md');\n\n // Support both old signature (cavemanMode string) and new signature (options object)\n const resolvedOpts: SteeringOptions = typeof opts === 'string'\n ? { cavemanMode: opts }\n : opts ?? {};\n\n fs.writeFileSync(steeringPath, buildSteeringContent(resolvedOpts));\n console.log(` \u2713 Steering file written to ${steeringPath}`);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAoB;AACpB,WAAsB;AACtB,qBAA2C;AAE3C,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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T;AAEA,MAAM,iBAAyC;AAAA,EAC7C,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMR,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMZ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAMT;AAEA,SAAS,wBAAwB,OAAkD;AACjF,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAoBc,KAAK,OAAO,mBAAmB,KAAK,CAAC;AAAA;AAAA,EAE1D,eAAe,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvB;
|
|
4
|
+
"sourcesContent": ["/**\n * KiroGraph Installer: Kiro steering file\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { CAVEMAN_RULES, CavemanMode } from './caveman';\n\nconst STEERING_CONTENT = `---\ninclusion: always\n---\n\n# KiroGraph\n\nKiroGraph builds a semantic knowledge graph of your codebase. Use its MCP tools instead of grep/glob/file reads whenever \\`.kirograph/\\` exists in the project.\n\n## Quick decision guide\n\n| Question | Tool |\n|----------|------|\n| Where do I start on this task? | \\`kirograph_context\\` |\n| What is this symbol / show me its code | \\`kirograph_node\\` with \\`includeCode: true\\` |\n| Find a symbol by name | \\`kirograph_search\\` |\n| Who calls function X? | \\`kirograph_callers\\` |\n| What does function X call? | \\`kirograph_callees\\` |\n| What breaks if I change X? | \\`kirograph_impact\\` |\n| How are X and Y connected? | \\`kirograph_path\\` |\n| What extends / implements this type? | \\`kirograph_type_hierarchy\\` |\n| Which code is never called? | \\`kirograph_dead_code\\` |\n| Are there import cycles? | \\`kirograph_circular_deps\\` |\n| What files are indexed? | \\`kirograph_files\\` |\n| Is the index healthy? | \\`kirograph_status\\` |\n| What are the most critical symbols? | \\`kirograph_hotspots\\` |\n| Any unexpected cross-module coupling? | \\`kirograph_surprising\\` |\n| What changed since the last snapshot? | \\`kirograph_diff\\` |\n| What packages/layers exist? | \\`kirograph_architecture\\` |\n| How coupled is package X? | \\`kirograph_coupling\\` |\n| What does package X depend on? | \\`kirograph_package\\` |\n| Run a command with token savings | \\`kirograph_exec\\` |\n| Check token savings stats | \\`kirograph_gain\\` |\n\n---\n\n## Tool reference\n\n### \\`kirograph_context\\`: **start here for any code task**\n\nReturns entry points, related symbols, and code snippets for a natural-language task description. Usually enough to orient without any additional tool calls.\n\n\\`\\`\\`\nkirograph_context(task: \"fix the auth token expiry bug\")\nkirograph_context(task: \"add dark mode\", maxNodes: 30)\nkirograph_context(task: \"refactor payment service\", includeCode: false)\n\\`\\`\\`\n\n### \\`kirograph_search\\`: find symbols by name\n\nExact match \u2192 FTS \u2192 LIKE fallback \u2192 vector (last resort). Use instead of grep.\n\n\\`\\`\\`\nkirograph_search(query: \"signIn\")\nkirograph_search(query: \"UserService\", kind: \"class\")\nkirograph_search(query: \"auth\", limit: 20)\n\\`\\`\\`\n\nSupported kinds: \\`function\\`, \\`method\\`, \\`class\\`, \\`interface\\`, \\`type_alias\\`, \\`variable\\`, \\`route\\`, \\`component\\`\n\n### \\`kirograph_node\\`: inspect a symbol\n\nReturns kind, file, signature, docstring. Add \\`includeCode: true\\` to get the full source.\n\n\\`\\`\\`\nkirograph_node(symbol: \"validateToken\")\nkirograph_node(symbol: \"AuthService\", includeCode: true)\n\\`\\`\\`\n\n### \\`kirograph_callers\\`: who calls this?\n\nBFS over incoming \\`calls\\` edges (depth 1).\n\n\\`\\`\\`\nkirograph_callers(symbol: \"processPayment\", limit: 30)\n\\`\\`\\`\n\n### \\`kirograph_callees\\`: what does this call?\n\nBFS over outgoing \\`calls\\` edges (depth 1).\n\n\\`\\`\\`\nkirograph_callees(symbol: \"handleRequest\")\n\\`\\`\\`\n\n### \\`kirograph_impact\\`: blast radius before a change\n\nTraverses all incoming edges up to \\`depth\\` hops. Call this before editing a symbol.\n\n\\`\\`\\`\nkirograph_impact(symbol: \"UserRepository\", depth: 3)\n\\`\\`\\`\n\n### \\`kirograph_path\\`: how are two symbols connected?\n\nBFS shortest path across all edge types.\n\n\\`\\`\\`\nkirograph_path(from: \"LoginController\", to: \"DatabasePool\")\n\\`\\`\\`\n\n### \\`kirograph_type_hierarchy\\`: class/interface inheritance\n\n\\`\\`\\`\nkirograph_type_hierarchy(symbol: \"BaseRepository\", direction: \"down\") // derived types\nkirograph_type_hierarchy(symbol: \"PaymentService\", direction: \"up\") // base types\nkirograph_type_hierarchy(symbol: \"IUserStore\", direction: \"both\") // all\n\\`\\`\\`\n\n### \\`kirograph_dead_code\\`: unreferenced symbols\n\nReturns unexported symbols with zero incoming edges. Good first step when cleaning up.\n\n\\`\\`\\`\nkirograph_dead_code(limit: 50)\n\\`\\`\\`\n\n### \\`kirograph_circular_deps\\`: import cycles\n\nRuns Tarjan's SCC over import edges. No parameters needed.\n\n\\`\\`\\`\nkirograph_circular_deps()\n\\`\\`\\`\n\n### \\`kirograph_files\\`: indexed file structure\n\n\\`\\`\\`\nkirograph_files(format: \"tree\") // default\nkirograph_files(format: \"flat\") // one path per line\nkirograph_files(format: \"grouped\") // by directory\nkirograph_files(filterPath: \"src/auth\", maxDepth: 2)\nkirograph_files(pattern: \"**/*.test.ts\")\n\\`\\`\\`\n\n### \\`kirograph_status\\`: index health\n\nReturns file count, symbol count, edge count, embedding coverage, DB size. Call when something feels off.\n\n### \\`kirograph_hotspots\\`: most-connected symbols\n\nReturns the top-N symbols by total edge degree (in + out, excluding structural \\`contains\\` edges). Use to find core abstractions, identify high blast-radius symbols before a refactor, or understand what the codebase revolves around.\n\n\\`\\`\\`\nkirograph_hotspots(limit: 20)\n\\`\\`\\`\n\n### \\`kirograph_surprising\\`: unexpected cross-module coupling\n\nFinds direct edges between symbols in structurally distant files, scored by path distance \u00D7 edge-kind weight. Use before a refactor to discover hidden dependencies that will break. High score = more unexpected.\n\n\\`\\`\\`\nkirograph_surprising(limit: 20)\n\\`\\`\\`\n\n### \\`kirograph_diff\\`: what changed since a snapshot?\n\nCompares the current graph against a saved snapshot. Shows added/removed symbols and edges. A snapshot must exist: the user saves one with \\`kirograph snapshot save <label>\\` before making changes.\n\n\\`\\`\\`\nkirograph_diff() // vs latest snapshot\nkirograph_diff(snapshot: \"pre-refactor\") // vs named snapshot\n\\`\\`\\`\n\n---\n\n## Architecture tools *(require \\`enableArchitecture: true\\` in config)*\n\n### \\`kirograph_architecture\\`: **start here for architectural questions**\n\nReturns the full package graph, detected layers (api/service/data/ui/shared), and their dependency edges.\n\n\\`\\`\\`\nkirograph_architecture() // packages + layers\nkirograph_architecture(level: \"packages\")\nkirograph_architecture(level: \"layers\")\nkirograph_architecture(includeFiles: true) // add file\u2192package assignments\n\\`\\`\\`\n\n### \\`kirograph_coupling\\`: stability metrics per package\n\nReturns Ca (afferent: depended on by), Ce (efferent: depends on), and instability (Ce/(Ca+Ce)).\n- High Ca + low instability = load-bearing, safe to depend on, risky to change interface.\n- High Ce + high instability = depends on many things, safe to refactor internals.\n\n\\`\\`\\`\nkirograph_coupling() // all packages, sorted by instability\nkirograph_coupling(sortBy: \"afferent\") // most depended-on first\nkirograph_coupling(sortBy: \"efferent\") // most outgoing deps first\n\\`\\`\\`\n\n### \\`kirograph_package\\`: drill into one package\n\nReturns metadata, coupling metrics, outgoing deps, incoming dependents, and file list.\n\n\\`\\`\\`\nkirograph_package(package: \"auth\")\nkirograph_package(package: \"src/services\", includeFiles: false)\n\\`\\`\\`\n\n---\n\n## Workflows\n\n**Bug fix or feature:**\n1. \\`kirograph_context\\`: orient, find entry points.\n2. \\`kirograph_node\\` with \\`includeCode: true\\`: read the relevant symbol.\n3. \\`kirograph_callers\\` / \\`kirograph_callees\\`: trace the call flow.\n4. \\`kirograph_impact\\`: check blast radius before editing.\n\n**Refactor planning:**\n1. \\`kirograph_hotspots\\`: identify the most-connected symbols; changing these is risky.\n2. \\`kirograph_surprising\\`: surface hidden coupling that will break.\n3. \\`kirograph_impact\\` on specific targets: confirm blast radius.\n4. \\`kirograph_diff\\` after the refactor: verify the structural change matches intent.\n\n**Architectural review:**\n1. \\`kirograph_architecture\\`: get the package and layer map.\n2. \\`kirograph_coupling\\`: find the most stable (high Ca) and most volatile (high instability) packages.\n3. \\`kirograph_package\\`: drill into any package of interest.\n4. \\`kirograph_circular_deps\\`: check for import cycles.\n\n**Code cleanup:**\n1. \\`kirograph_dead_code\\`: find unreferenced unexported symbols.\n2. \\`kirograph_circular_deps\\`: find import cycles to untangle.\n3. \\`kirograph_surprising\\`: find unexpected coupling to decouple.\n\n---\n\n## If \\`.kirograph/\\` does NOT exist\n\nAsk the user: \"This project doesn't have KiroGraph initialized. Run \\`kirograph init -i\\` to build a code knowledge graph for faster exploration?\"\n`;\n\n// \u2500\u2500 Compression section builder (level-aware) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst LEVEL_DESCRIPTIONS: Record<string, string> = {\n normal: 'Balanced: removes noise, keeps structure.',\n aggressive: 'Compact: groups by category, limits output.',\n ultra: 'Maximum compression: counts and summaries only.',\n};\n\nconst LEVEL_EXAMPLES: Record<string, string> = {\n normal: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\")\nkirograph_exec(command: \"npm test\")\nkirograph_exec(command: \"cargo build\")\nkirograph_exec(command: \"ls -la src/\")\n\\\\\\`\\\\\\`\\\\\\``,\n aggressive: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\", level: \"aggressive\")\nkirograph_exec(command: \"npm test\", level: \"aggressive\")\nkirograph_exec(command: \"eslint .\", level: \"aggressive\")\nkirograph_exec(command: \"find . -name '*.ts'\", level: \"aggressive\")\n\\\\\\`\\\\\\`\\\\\\``,\n ultra: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\", level: \"ultra\")\nkirograph_exec(command: \"npm test\", level: \"ultra\")\nkirograph_exec(command: \"docker ps\", level: \"ultra\")\nkirograph_exec(command: \"ls -la src/\", level: \"ultra\")\n\\\\\\`\\\\\\`\\\\\\``,\n};\n\nfunction buildCompressionSection(level: 'normal' | 'aggressive' | 'ultra'): string {\n return `\n---\n\n## Shell Compression (\\\\\\`kirograph_exec\\\\\\`)\n\nWhen running shell commands, prefer \\\\\\`kirograph_exec\\\\\\` over raw shell execution for:\n- **git** operations (status, log, diff, push, pull, commit, add, fetch, branch)\n- **GitHub CLI** (gh pr list/view, gh issue list, gh run list)\n- **test runners** (jest, vitest, pytest, cargo test, go test, rspec, minitest, playwright)\n- **linters/build** (eslint, tsc, ruff, clippy, cargo build, prettier, biome, golangci-lint, rubocop, next build)\n- **file listings** (ls, find, tree)\n- **search** (grep, rg/ripgrep: grouped by file)\n- **diff** (diff file1 file2: condensed context)\n- **docker/k8s** (docker ps, images, logs, compose ps, kubectl pods, logs, services)\n- **package managers** (npm/pnpm install/list, pip list/install, bundle install, prisma generate)\n- **AWS CLI** (sts, ec2, lambda, logs, cloudformation, dynamodb, iam, s3, ecs, sqs, sns)\n- **network** (curl, wget: strip progress bars and headers)\n\nThis saves 60-90% of tokens compared to raw output.\n\nCompression level: **${level}**: ${LEVEL_DESCRIPTIONS[level]}\n\n${LEVEL_EXAMPLES[level]}\n\n**Important:** Error details are always preserved. Failed commands show full diagnostic output regardless of level.\n\n**Do NOT re-run commands:** When \\\\\\`kirograph_exec\\\\\\` returns a result, treat it as the final answer. Never re-run the same command with raw shell execution to \"get more details.\" The compressed output preserves all essential information. If you genuinely need something missing from the output, explain what's missing before making a second call.\n\nUse \\\\\\`kirograph_gain\\\\\\` to check token savings statistics.`;\n}\n\nexport interface SteeringOptions {\n cavemanMode?: CavemanMode | 'off';\n enableCompression?: boolean;\n shellCompressionLevel?: 'off' | 'normal' | 'aggressive' | 'ultra';\n enableMemory?: boolean;\n enableDocs?: boolean;\n}\n\nfunction buildSteeringContent(opts?: SteeringOptions): string {\n const cavemanMode = opts?.cavemanMode;\n const enableCompression = opts?.enableCompression !== false && opts?.shellCompressionLevel !== 'off';\n const shellCompressionLevel = opts?.shellCompressionLevel ?? 'normal';\n\n let content = STEERING_CONTENT;\n\n // Insert compression section before the \"If .kirograph/ does NOT exist\" section\n if (enableCompression && shellCompressionLevel !== 'off') {\n const section = buildCompressionSection(shellCompressionLevel as 'normal' | 'aggressive' | 'ultra');\n content = content.replace(\n '---\\n\\n## If `.kirograph/` does NOT exist',\n section.trim() + '\\n\\n---\\n\\n## If `.kirograph/` does NOT exist',\n );\n }\n\n // Remove compression tools from decision guide if disabled\n if (!enableCompression) {\n content = content.replace('| Run a command with token savings | `kirograph_exec` |\\n', '');\n content = content.replace('| Check token savings stats | `kirograph_gain` |\\n', '');\n }\n\n const caveman = cavemanMode && cavemanMode !== 'off' ? CAVEMAN_RULES[cavemanMode] : null;\n if (caveman) {\n content = content.trimEnd() + '\\n\\n' + caveman + '\\n';\n }\n\n // Memory section\n if (opts?.enableMemory) {\n const memorySection = `\n## Memory\n\nKiroGraph has persistent memory. Use \\`kirograph_mem_search\\` to recall past decisions,\nerrors, and patterns before making changes. Use \\`kirograph_mem_store\\` to save important\nobservations (architecture decisions, bug root causes, patterns discovered).\n\nMemory is searchable via hybrid FTS + vector search. Observations are automatically\nlinked to code symbols in the graph and surface in \\`kirograph_context\\` and\n\\`kirograph_impact\\` results when relevant.\n\n**When to store:** After fixing a bug, making an architecture decision, discovering a pattern,\nencountering a non-obvious error, or learning something about the codebase that future sessions\nshould know. Keep observations concise \u2014 one fact per store call. A hook will also remind you\nat session end.\n`;\n content = content.trimEnd() + '\\n\\n' + memorySection.trim() + '\\n';\n }\n\n // Documentation section\n if (opts?.enableDocs) {\n const docsSection = `\n## Documentation\n\nKiroGraph indexes project documentation by heading structure. Use \\`kirograph_docs_search\\`\nto find relevant doc sections instead of reading entire files. Use \\`kirograph_docs_section\\`\nto retrieve the exact section you need by ID.\n\n**Available tools:**\n- \\`kirograph_docs_toc\\` \u2014 table of contents for a file or the whole project\n- \\`kirograph_docs_search\\` \u2014 search sections by query (independent from code search)\n- \\`kirograph_docs_section\\` \u2014 retrieve full content of a section by ID\n- \\`kirograph_docs_outline\\` \u2014 heading hierarchy for a single document\n- \\`kirograph_docs_refs\\` \u2014 find code symbols referenced by a doc section (or vice versa)\n\n**When to use:** Before reading a documentation file directly, check if \\`kirograph_docs_search\\`\nor \\`kirograph_docs_outline\\` can give you the specific section you need. This saves tokens\nand gives you structured navigation instead of raw file content.\n`;\n content = content.trimEnd() + '\\n\\n' + docsSection.trim() + '\\n';\n }\n\n return content;\n}\n\nexport function writeSteering(kiroDir: string, opts?: SteeringOptions | CavemanMode | 'off'): void {\n const steeringDir = path.join(kiroDir, 'steering');\n fs.mkdirSync(steeringDir, { recursive: true });\n const steeringPath = path.join(steeringDir, 'kirograph.md');\n\n // Support both old signature (cavemanMode string) and new signature (options object)\n const resolvedOpts: SteeringOptions = typeof opts === 'string'\n ? { cavemanMode: opts }\n : opts ?? {};\n\n fs.writeFileSync(steeringPath, buildSteeringContent(resolvedOpts));\n console.log(` \u2713 Steering file written to ${steeringPath}`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAoB;AACpB,WAAsB;AACtB,qBAA2C;AAE3C,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBpB,cAAU,QAAQ,QAAQ,IAAI,SAAS,YAAY,KAAK,IAAI;AAAA,EAC9D;AAEA,SAAO;AACT;AAEO,SAAS,cAAc,SAAiB,MAAoD;AACjG,QAAM,cAAc,KAAK,KAAK,SAAS,UAAU;AACjD,KAAG,UAAU,aAAa,EAAE,WAAW,KAAK,CAAC;AAC7C,QAAM,eAAe,KAAK,KAAK,aAAa,cAAc;AAG1D,QAAM,eAAgC,OAAO,SAAS,WAClD,EAAE,aAAa,KAAK,IACpB,QAAQ,CAAC;AAEb,KAAG,cAAc,cAAc,qBAAqB,YAAY,CAAC;AACjE,UAAQ,IAAI,qCAAgC,YAAY,EAAE;AAC5D;",
|
|
6
6
|
"names": []
|
|
7
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 aider_exports = {};
|
|
30
|
+
__export(aider_exports, {
|
|
31
|
+
installAiderEarly: () => installAiderEarly,
|
|
32
|
+
installAiderLate: () => installAiderLate,
|
|
33
|
+
printAiderNextSteps: () => printAiderNextSteps,
|
|
34
|
+
uninitAider: () => uninitAider
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(aider_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 AIDER_BLOCK_ID = "aider";
|
|
43
|
+
function installAiderEarly(_projectRoot) {
|
|
44
|
+
}
|
|
45
|
+
function installAiderLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
|
|
46
|
+
const instructionsPath = path.join(projectRoot, ".kirograph", "aider.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 Aider instructions written to ${instructionsPath}`);
|
|
50
|
+
const conventionsPath = path.join(projectRoot, "CONVENTIONS.md");
|
|
51
|
+
const changed = (0, import_common.upsertGeneratedBlock)(conventionsPath, AIDER_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
|
|
52
|
+
console.log(changed ? ` \u2713 CONVENTIONS.md updated with KiroGraph instructions` : ` \u2713 CONVENTIONS.md already up to date`);
|
|
53
|
+
}
|
|
54
|
+
function uninitAider(projectRoot) {
|
|
55
|
+
const conventionsPath = path.join(projectRoot, "CONVENTIONS.md");
|
|
56
|
+
if ((0, import_common.removeGeneratedBlock)(conventionsPath, AIDER_BLOCK_ID)) {
|
|
57
|
+
console.log(` \u2713 Removed KiroGraph block from CONVENTIONS.md`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function printAiderNextSteps(projectRoot) {
|
|
61
|
+
const escapedPath = projectRoot.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
62
|
+
console.log("\n Done! KiroGraph instructions are in CONVENTIONS.md.");
|
|
63
|
+
(0, import_common.printMcpCommand)(`aider --mcp "kirograph serve --mcp --path ${escapedPath}"`);
|
|
64
|
+
}
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
installAiderEarly,
|
|
68
|
+
installAiderLate,
|
|
69
|
+
printAiderNextSteps,
|
|
70
|
+
uninitAider
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=aider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/bin/installer/targets/aider.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 AIDER_BLOCK_ID = 'aider';\n\nexport function installAiderEarly(_projectRoot: string): void {\n // Aider MCP is configured via CLI flags (--mcp) or .aider.conf.yml.\n // We print the setup command in next steps instead of writing outside the project.\n}\n\nexport function installAiderLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'aider.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(` \u2713 Aider instructions written to ${instructionsPath}`);\n\n const conventionsPath = path.join(projectRoot, 'CONVENTIONS.md');\n const changed = upsertGeneratedBlock(conventionsPath, AIDER_BLOCK_ID, '## KiroGraph', buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(changed\n ? ` \u2713 CONVENTIONS.md updated with KiroGraph instructions`\n : ` \u2713 CONVENTIONS.md already up to date`);\n}\n\nexport function uninitAider(projectRoot: string): void {\n const conventionsPath = path.join(projectRoot, 'CONVENTIONS.md');\n if (removeGeneratedBlock(conventionsPath, AIDER_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from CONVENTIONS.md`);\n }\n}\n\nexport function printAiderNextSteps(projectRoot: string): void {\n const escapedPath = projectRoot.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"');\n console.log('\\n Done! KiroGraph instructions are in CONVENTIONS.md.');\n printMcpCommand(`aider --mcp \"kirograph serve --mcp --path ${escapedPath}\"`);\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,iBAAiB;AAEhB,SAAS,kBAAkB,cAA4B;AAG9D;AAEO,SAAS,iBAAiB,aAAqB,aAAmC,uBAAgC,cAA8B;AACrJ,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,UAAU;AACxE,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,gDAAuB,qCAAqB,aAAa,uBAAuB,YAAY,CAAC,CAAC;AACjI,UAAQ,IAAI,0CAAqC,gBAAgB,EAAE;AAEnE,QAAM,kBAAkB,KAAK,KAAK,aAAa,gBAAgB;AAC/D,QAAM,cAAU,oCAAqB,iBAAiB,gBAAgB,oBAAgB,gDAAuB,qCAAqB,aAAa,uBAAuB,YAAY,CAAC,CAAC;AACpL,UAAQ,IAAI,UACR,gEACA,4CAAuC;AAC7C;AAEO,SAAS,YAAY,aAA2B;AACrD,QAAM,kBAAkB,KAAK,KAAK,aAAa,gBAAgB;AAC/D,UAAI,oCAAqB,iBAAiB,cAAc,GAAG;AACzD,YAAQ,IAAI,sDAAiD;AAAA,EAC/D;AACF;AAEO,SAAS,oBAAoB,aAA2B;AAC7D,QAAM,cAAc,YAAY,QAAQ,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAK;AAC1E,UAAQ,IAAI,yDAAyD;AACrE,qCAAgB,6CAA6C,WAAW,GAAG;AAC7E;",
|
|
6
|
+
"names": ["import_common"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 amp_exports = {};
|
|
30
|
+
__export(amp_exports, {
|
|
31
|
+
installAmpEarly: () => installAmpEarly,
|
|
32
|
+
installAmpLate: () => installAmpLate,
|
|
33
|
+
printAmpNextSteps: () => printAmpNextSteps,
|
|
34
|
+
uninitAmp: () => uninitAmp
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(amp_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 installAmpEarly(projectRoot) {
|
|
43
|
+
const configPath = path.join(projectRoot, ".amp", "config.json");
|
|
44
|
+
(0, import_common.ensureDir)(path.dirname(configPath));
|
|
45
|
+
const config = (0, import_common.readJson)(configPath);
|
|
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)(configPath, config);
|
|
52
|
+
console.log(` \u2713 Sourcegraph Amp MCP server registered in ${configPath}`);
|
|
53
|
+
}
|
|
54
|
+
function installAmpLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
|
|
55
|
+
const instructionsPath = path.join(projectRoot, ".kirograph", "amp.md");
|
|
56
|
+
(0, import_common.ensureDir)(path.dirname(instructionsPath));
|
|
57
|
+
fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
|
|
58
|
+
console.log(` \u2713 Amp instructions written to ${instructionsPath}`);
|
|
59
|
+
const ampInstructionsPath = path.join(projectRoot, ".amp", "instructions.md");
|
|
60
|
+
(0, import_common.ensureDir)(path.dirname(ampInstructionsPath));
|
|
61
|
+
fs.writeFileSync(ampInstructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
|
|
62
|
+
console.log(` \u2713 Amp instructions written to ${ampInstructionsPath}`);
|
|
63
|
+
}
|
|
64
|
+
function uninitAmp(projectRoot) {
|
|
65
|
+
const configPath = path.join(projectRoot, ".amp", "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 .amp/config.json`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const ampInstructionsPath = path.join(projectRoot, ".amp", "instructions.md");
|
|
75
|
+
if (fs.existsSync(ampInstructionsPath)) {
|
|
76
|
+
fs.unlinkSync(ampInstructionsPath);
|
|
77
|
+
console.log(` \u2713 Removed .amp/instructions.md`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function printAmpNextSteps() {
|
|
81
|
+
console.log("\n Done! Restart Sourcegraph Amp for the MCP server to load.");
|
|
82
|
+
console.log(" KiroGraph instructions are in .amp/instructions.md\n");
|
|
83
|
+
}
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
installAmpEarly,
|
|
87
|
+
installAmpLate,
|
|
88
|
+
printAmpNextSteps,
|
|
89
|
+
uninitAmp
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=amp.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/bin/installer/targets/amp.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} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts } from '../common';\n\nexport function installAmpEarly(projectRoot: string): void {\n const configPath = path.join(projectRoot, '.amp', '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 Sourcegraph Amp MCP server registered in ${configPath}`);\n}\n\nexport function installAmpLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'amp.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(` \u2713 Amp instructions written to ${instructionsPath}`);\n\n const ampInstructionsPath = path.join(projectRoot, '.amp', 'instructions.md');\n ensureDir(path.dirname(ampInstructionsPath));\n fs.writeFileSync(ampInstructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(` \u2713 Amp instructions written to ${ampInstructionsPath}`);\n}\n\nexport function uninitAmp(projectRoot: string): void {\n const configPath = path.join(projectRoot, '.amp', '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 .amp/config.json`);\n }\n }\n\n const ampInstructionsPath = path.join(projectRoot, '.amp', 'instructions.md');\n if (fs.existsSync(ampInstructionsPath)) {\n fs.unlinkSync(ampInstructionsPath);\n console.log(` \u2713 Removed .amp/instructions.md`);\n }\n}\n\nexport function printAmpNextSteps(): void {\n console.log('\\n Done! Restart Sourcegraph Amp for the MCP server to load.');\n console.log(' KiroGraph instructions are in .amp/instructions.md\\n');\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AAEtB,oBAOO;AACP,0BAAuC;AACvC,IAAAA,iBAAqC;AAE9B,SAAS,gBAAgB,aAA2B;AACzD,QAAM,aAAa,KAAK,KAAK,aAAa,QAAQ,aAAa;AAC/D,+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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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 antigravity_exports = {};
|
|
30
|
+
__export(antigravity_exports, {
|
|
31
|
+
installAntigravityEarly: () => installAntigravityEarly,
|
|
32
|
+
installAntigravityLate: () => installAntigravityLate,
|
|
33
|
+
printAntigravityNextSteps: () => printAntigravityNextSteps,
|
|
34
|
+
uninitAntigravity: () => uninitAntigravity
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(antigravity_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 ANTIGRAVITY_BLOCK_ID = "antigravity";
|
|
42
|
+
function buildAntigravityHooks() {
|
|
43
|
+
return {
|
|
44
|
+
"kirograph-sync": {
|
|
45
|
+
Stop: [
|
|
46
|
+
{
|
|
47
|
+
hooks: [
|
|
48
|
+
{
|
|
49
|
+
type: "command",
|
|
50
|
+
command: "kirograph sync --quiet 2>/dev/null || true",
|
|
51
|
+
timeout: 30
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function installAntigravityEarly(_projectRoot) {
|
|
60
|
+
}
|
|
61
|
+
function installAntigravityLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
|
|
62
|
+
const opts = (0, import_common.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory, true);
|
|
63
|
+
const instructionsPath = path.join(projectRoot, ".kirograph", "antigravity.md");
|
|
64
|
+
(0, import_common.ensureDir)(path.dirname(instructionsPath));
|
|
65
|
+
fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)(opts));
|
|
66
|
+
console.log(` \u2713 Antigravity instructions written to ${instructionsPath}`);
|
|
67
|
+
const geminiPath = path.join(projectRoot, "GEMINI.md");
|
|
68
|
+
const changed = (0, import_common.upsertGeneratedBlock)(geminiPath, ANTIGRAVITY_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)(opts));
|
|
69
|
+
console.log(changed ? ` \u2713 GEMINI.md updated with KiroGraph instructions` : ` \u2713 GEMINI.md already up to date`);
|
|
70
|
+
const hooksPath = path.join(projectRoot, ".agents", "hooks.json");
|
|
71
|
+
(0, import_common.ensureDir)(path.dirname(hooksPath));
|
|
72
|
+
const existing = (0, import_common.readJson)(hooksPath);
|
|
73
|
+
const kgHooks = buildAntigravityHooks();
|
|
74
|
+
for (const [name, config] of Object.entries(kgHooks)) {
|
|
75
|
+
if (!existing[name]) {
|
|
76
|
+
existing[name] = config;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
(0, import_common.writeJson)(hooksPath, existing);
|
|
80
|
+
console.log(` \u2713 Antigravity hooks written to ${hooksPath}`);
|
|
81
|
+
}
|
|
82
|
+
function uninitAntigravity(projectRoot) {
|
|
83
|
+
const geminiPath = path.join(projectRoot, "GEMINI.md");
|
|
84
|
+
if ((0, import_common.removeGeneratedBlock)(geminiPath, ANTIGRAVITY_BLOCK_ID)) {
|
|
85
|
+
console.log(` \u2713 Removed KiroGraph block from GEMINI.md`);
|
|
86
|
+
}
|
|
87
|
+
const hooksPath = path.join(projectRoot, ".agents", "hooks.json");
|
|
88
|
+
if (fs.existsSync(hooksPath)) {
|
|
89
|
+
const config = (0, import_common.readJson)(hooksPath);
|
|
90
|
+
if (config["kirograph-sync"]) {
|
|
91
|
+
delete config["kirograph-sync"];
|
|
92
|
+
(0, import_common.writeJson)(hooksPath, config);
|
|
93
|
+
console.log(` \u2713 Removed kirograph-sync from .agents/hooks.json`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function printAntigravityNextSteps(projectRoot) {
|
|
98
|
+
console.log("\n Done! KiroGraph instructions are in GEMINI.md.");
|
|
99
|
+
console.log(" Auto-sync hook installed in .agents/hooks.json");
|
|
100
|
+
(0, import_common.printMcpSetup)("~/.gemini/antigravity/mcp_config.json", projectRoot);
|
|
101
|
+
}
|
|
102
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
+
0 && (module.exports = {
|
|
104
|
+
installAntigravityEarly,
|
|
105
|
+
installAntigravityLate,
|
|
106
|
+
printAntigravityNextSteps,
|
|
107
|
+
uninitAntigravity
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=antigravity.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/bin/installer/targets/antigravity.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Antigravity IDE target.\n *\n * MCP: user-scoped at ~/.gemini/antigravity/mcp_config.json (print instructions)\n * Hooks: .agents/hooks.json (workspace-level)\n * Instructions: GEMINI.md (upsert block)\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 printMcpSetup,\n upsertGeneratedBlock,\n removeGeneratedBlock,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\n\nconst ANTIGRAVITY_BLOCK_ID = 'antigravity';\n\nfunction buildAntigravityHooks(): object {\n return {\n 'kirograph-sync': {\n Stop: [\n {\n hooks: [\n {\n type: 'command',\n command: 'kirograph sync --quiet 2>/dev/null || true',\n timeout: 30,\n },\n ],\n },\n ],\n },\n };\n}\n\nexport function installAntigravityEarly(_projectRoot: string): void {\n // Antigravity IDE MCP is user-scoped at ~/.gemini/antigravity/mcp_config.json.\n // We print the setup instructions in printNextSteps instead of writing outside the project.\n}\n\nexport function installAntigravityLate(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', 'antigravity.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(opts));\n console.log(` \u2713 Antigravity instructions written to ${instructionsPath}`);\n\n const geminiPath = path.join(projectRoot, 'GEMINI.md');\n const changed = upsertGeneratedBlock(geminiPath, ANTIGRAVITY_BLOCK_ID, '## KiroGraph', buildAgentInstructions(opts));\n console.log(changed\n ? ` \u2713 GEMINI.md updated with KiroGraph instructions`\n : ` \u2713 GEMINI.md already up to date`);\n\n // Write hooks to .agents/hooks.json\n const hooksPath = path.join(projectRoot, '.agents', 'hooks.json');\n ensureDir(path.dirname(hooksPath));\n const existing = readJson(hooksPath);\n const kgHooks = buildAntigravityHooks() as any;\n // Merge without overwriting existing hooks\n for (const [name, config] of Object.entries(kgHooks)) {\n if (!existing[name]) {\n existing[name] = config;\n }\n }\n writeJson(hooksPath, existing);\n console.log(` \u2713 Antigravity hooks written to ${hooksPath}`);\n}\n\nexport function uninitAntigravity(projectRoot: string): void {\n const geminiPath = path.join(projectRoot, 'GEMINI.md');\n if (removeGeneratedBlock(geminiPath, ANTIGRAVITY_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from GEMINI.md`);\n }\n\n // Remove hooks\n const hooksPath = path.join(projectRoot, '.agents', 'hooks.json');\n if (fs.existsSync(hooksPath)) {\n const config = readJson(hooksPath);\n if (config['kirograph-sync']) {\n delete config['kirograph-sync'];\n writeJson(hooksPath, config);\n console.log(` \u2713 Removed kirograph-sync from .agents/hooks.json`);\n }\n }\n}\n\nexport function printAntigravityNextSteps(projectRoot: string): void {\n console.log('\\n Done! KiroGraph instructions are in GEMINI.md.');\n console.log(' Auto-sync hook installed in .agents/hooks.json');\n printMcpSetup('~/.gemini/antigravity/mcp_config.json', projectRoot);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,SAAoB;AACpB,WAAsB;AAEtB,oBAQO;AACP,0BAAuC;AAEvC,MAAM,uBAAuB;AAE7B,SAAS,wBAAgC;AACvC,SAAO;AAAA,IACL,kBAAkB;AAAA,MAChB,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,YACL;AAAA,cACE,MAAM;AAAA,cACN,SAAS;AAAA,cACT,SAAS;AAAA,YACX;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,SAAS,wBAAwB,cAA4B;AAGpE;AAEO,SAAS,uBAAuB,aAAqB,aAAmC,uBAAgC,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AAChE,UAAQ,IAAI,kDAAkD;AAC9D,mCAAc,yCAAyC,WAAW;AACpE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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 augment_exports = {};
|
|
30
|
+
__export(augment_exports, {
|
|
31
|
+
installAugmentEarly: () => installAugmentEarly,
|
|
32
|
+
installAugmentLate: () => installAugmentLate,
|
|
33
|
+
printAugmentNextSteps: () => printAugmentNextSteps,
|
|
34
|
+
uninitAugment: () => uninitAugment
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(augment_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 AUGMENT_BLOCK_ID = "augment";
|
|
43
|
+
function installAugmentEarly(projectRoot) {
|
|
44
|
+
const mcpPath = path.join(projectRoot, ".augment", "mcp.json");
|
|
45
|
+
(0, import_common.writeMcpServersConfig)(mcpPath, {
|
|
46
|
+
command: import_common.KIROGRAPH_COMMAND,
|
|
47
|
+
args: import_common.KIROGRAPH_MCP_ARGS
|
|
48
|
+
});
|
|
49
|
+
console.log(` \u2713 Augment Code MCP server registered in ${mcpPath}`);
|
|
50
|
+
}
|
|
51
|
+
function installAugmentLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory) {
|
|
52
|
+
const instructionsPath = path.join(projectRoot, ".kirograph", "augment.md");
|
|
53
|
+
(0, import_common.ensureDir)(path.dirname(instructionsPath));
|
|
54
|
+
fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
|
|
55
|
+
console.log(` \u2713 Augment instructions written to ${instructionsPath}`);
|
|
56
|
+
const guidelinesPath = path.join(projectRoot, "augment-guidelines.md");
|
|
57
|
+
const changed = (0, import_common.upsertGeneratedBlock)(guidelinesPath, AUGMENT_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory)));
|
|
58
|
+
console.log(changed ? ` \u2713 augment-guidelines.md updated with KiroGraph instructions` : ` \u2713 augment-guidelines.md already up to date`);
|
|
59
|
+
}
|
|
60
|
+
function uninitAugment(projectRoot) {
|
|
61
|
+
const mcpPath = path.join(projectRoot, ".augment", "mcp.json");
|
|
62
|
+
if ((0, import_common.removeMcpServersConfig)(mcpPath)) {
|
|
63
|
+
console.log(` \u2713 Removed kirograph from .augment/mcp.json`);
|
|
64
|
+
}
|
|
65
|
+
const guidelinesPath = path.join(projectRoot, "augment-guidelines.md");
|
|
66
|
+
if ((0, import_common.removeGeneratedBlock)(guidelinesPath, AUGMENT_BLOCK_ID)) {
|
|
67
|
+
console.log(` \u2713 Removed KiroGraph block from augment-guidelines.md`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function printAugmentNextSteps() {
|
|
71
|
+
console.log("\n Done! Restart Augment Code for the MCP server to load.");
|
|
72
|
+
console.log(" KiroGraph instructions are in augment-guidelines.md\n");
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
installAugmentEarly,
|
|
77
|
+
installAugmentLate,
|
|
78
|
+
printAugmentNextSteps,
|
|
79
|
+
uninitAugment
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=augment.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/bin/installer/targets/augment.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 upsertGeneratedBlock,\n removeGeneratedBlock,\n writeMcpServersConfig,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts } from '../common';\n\nconst AUGMENT_BLOCK_ID = 'augment';\n\nexport function installAugmentEarly(projectRoot: string): void {\n const mcpPath = path.join(projectRoot, '.augment', 'mcp.json');\n writeMcpServersConfig(mcpPath, {\n command: KIROGRAPH_COMMAND,\n args: KIROGRAPH_MCP_ARGS,\n });\n console.log(` \u2713 Augment Code MCP server registered in ${mcpPath}`);\n}\n\nexport function installAugmentLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'augment.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(` \u2713 Augment instructions written to ${instructionsPath}`);\n\n const guidelinesPath = path.join(projectRoot, 'augment-guidelines.md');\n const changed = upsertGeneratedBlock(guidelinesPath, AUGMENT_BLOCK_ID, '## KiroGraph', buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory)));\n console.log(changed\n ? ` \u2713 augment-guidelines.md updated with KiroGraph instructions`\n : ` \u2713 augment-guidelines.md already up to date`);\n}\n\nexport function uninitAugment(projectRoot: string): void {\n const mcpPath = path.join(projectRoot, '.augment', 'mcp.json');\n if (removeMcpServersConfig(mcpPath)) {\n console.log(` \u2713 Removed kirograph from .augment/mcp.json`);\n }\n\n const guidelinesPath = path.join(projectRoot, 'augment-guidelines.md');\n if (removeGeneratedBlock(guidelinesPath, AUGMENT_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from augment-guidelines.md`);\n }\n}\n\nexport function printAugmentNextSteps(): void {\n console.log('\\n Done! Restart Augment Code for the MCP server to load.');\n console.log(' KiroGraph instructions are in augment-guidelines.md\\n');\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AAEtB,oBAQO;AACP,0BAAuC;AACvC,IAAAA,iBAAqC;AAErC,MAAM,mBAAmB;AAElB,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,kDAA6C,OAAO,EAAE;AACpE;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,iBAAiB,KAAK,KAAK,aAAa,uBAAuB;AACrE,QAAM,cAAU,oCAAqB,gBAAgB,kBAAkB,oBAAgB,gDAAuB,qCAAqB,aAAa,uBAAuB,YAAY,CAAC,CAAC;AACrL,UAAQ,IAAI,UACR,uEACA,mDAA8C;AACpD;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,iBAAiB,KAAK,KAAK,aAAa,uBAAuB;AACrE,UAAI,oCAAqB,gBAAgB,gBAAgB,GAAG;AAC1D,YAAQ,IAAI,6DAAwD;AAAA,EACtE;AACF;AAEO,SAAS,wBAA8B;AAC5C,UAAQ,IAAI,4DAA4D;AACxE,UAAQ,IAAI,yDAAyD;AACvE;",
|
|
6
|
+
"names": ["import_common"]
|
|
7
|
+
}
|
|
@@ -47,7 +47,7 @@ function installClaudeEarly(projectRoot) {
|
|
|
47
47
|
});
|
|
48
48
|
console.log(` \u2713 Claude MCP server registered in ${mcpPath}`);
|
|
49
49
|
}
|
|
50
|
-
function installClaudeLate(projectRoot, cavemanMode) {
|
|
50
|
+
function installClaudeLate(projectRoot, cavemanMode, _shellCompressionLevel, _enableMemory) {
|
|
51
51
|
const instructionsPath = path.join(projectRoot, ".kirograph", "claude.md");
|
|
52
52
|
(0, import_common.ensureDir)(path.dirname(instructionsPath));
|
|
53
53
|
fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)(cavemanMode));
|