kirograph 0.14.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +239 -20
  3. package/dist/assets/logo.png +0 -0
  4. package/dist/bin/commands/docs.js +357 -0
  5. package/dist/bin/commands/docs.js.map +7 -0
  6. package/dist/bin/commands/help.js +3 -0
  7. package/dist/bin/commands/help.js.map +2 -2
  8. package/dist/bin/commands/uninit.js +10 -13
  9. package/dist/bin/commands/uninit.js.map +2 -2
  10. package/dist/bin/installer/config-prompt.js +53 -23
  11. package/dist/bin/installer/config-prompt.js.map +2 -2
  12. package/dist/bin/installer/hooks.js +20 -1
  13. package/dist/bin/installer/hooks.js.map +2 -2
  14. package/dist/bin/installer/index.js +14 -4
  15. package/dist/bin/installer/index.js.map +2 -2
  16. package/dist/bin/installer/prompts.js +37 -6
  17. package/dist/bin/installer/prompts.js.map +2 -2
  18. package/dist/bin/installer/steering.js +40 -0
  19. package/dist/bin/installer/steering.js.map +2 -2
  20. package/dist/bin/installer/targets/aider.js +72 -0
  21. package/dist/bin/installer/targets/aider.js.map +7 -0
  22. package/dist/bin/installer/targets/amp.js +91 -0
  23. package/dist/bin/installer/targets/amp.js.map +7 -0
  24. package/dist/bin/installer/targets/antigravity.js +109 -0
  25. package/dist/bin/installer/targets/antigravity.js.map +7 -0
  26. package/dist/bin/installer/targets/augment.js +81 -0
  27. package/dist/bin/installer/targets/augment.js.map +7 -0
  28. package/dist/bin/installer/targets/claude.js +1 -1
  29. package/dist/bin/installer/targets/claude.js.map +2 -2
  30. package/dist/bin/installer/targets/cline.js +91 -0
  31. package/dist/bin/installer/targets/cline.js.map +7 -0
  32. package/dist/bin/installer/targets/codex.js +1 -1
  33. package/dist/bin/installer/targets/codex.js.map +2 -2
  34. package/dist/bin/installer/targets/continue.js +107 -0
  35. package/dist/bin/installer/targets/continue.js.map +7 -0
  36. package/dist/bin/installer/targets/copilot.js +123 -0
  37. package/dist/bin/installer/targets/copilot.js.map +7 -0
  38. package/dist/bin/installer/targets/cursor.js +143 -0
  39. package/dist/bin/installer/targets/cursor.js.map +7 -0
  40. package/dist/bin/installer/targets/devin.js +148 -0
  41. package/dist/bin/installer/targets/devin.js.map +7 -0
  42. package/dist/bin/installer/targets/gemini-cli.js +126 -0
  43. package/dist/bin/installer/targets/gemini-cli.js.map +7 -0
  44. package/dist/bin/installer/targets/generic.js +120 -0
  45. package/dist/bin/installer/targets/generic.js.map +7 -0
  46. package/dist/bin/installer/targets/goose.js +72 -0
  47. package/dist/bin/installer/targets/goose.js.map +7 -0
  48. package/dist/bin/installer/targets/index.js.map +1 -1
  49. package/dist/bin/installer/targets/junie.js +105 -0
  50. package/dist/bin/installer/targets/junie.js.map +7 -0
  51. package/dist/bin/installer/targets/kilo.js +122 -0
  52. package/dist/bin/installer/targets/kilo.js.map +7 -0
  53. package/dist/bin/installer/targets/kiro.js +3 -3
  54. package/dist/bin/installer/targets/kiro.js.map +2 -2
  55. package/dist/bin/installer/targets/opencode.js +135 -0
  56. package/dist/bin/installer/targets/opencode.js.map +7 -0
  57. package/dist/bin/installer/targets/openhands.js +90 -0
  58. package/dist/bin/installer/targets/openhands.js.map +7 -0
  59. package/dist/bin/installer/targets/replit.js +72 -0
  60. package/dist/bin/installer/targets/replit.js.map +7 -0
  61. package/dist/bin/installer/targets/roo.js +96 -0
  62. package/dist/bin/installer/targets/roo.js.map +7 -0
  63. package/dist/bin/installer/targets/tabnine.js +82 -0
  64. package/dist/bin/installer/targets/tabnine.js.map +7 -0
  65. package/dist/bin/installer/targets/trae.js +84 -0
  66. package/dist/bin/installer/targets/trae.js.map +7 -0
  67. package/dist/bin/installer/targets/warp.js +97 -0
  68. package/dist/bin/installer/targets/warp.js.map +7 -0
  69. package/dist/bin/installer/targets/windsurf.js +141 -0
  70. package/dist/bin/installer/targets/windsurf.js.map +7 -0
  71. package/dist/bin/kirograph.js +5 -1
  72. package/dist/bin/kirograph.js.map +3 -3
  73. package/dist/compression/naive-cost.js +33 -0
  74. package/dist/compression/naive-cost.js.map +2 -2
  75. package/dist/compression/tracker.js +27 -4
  76. package/dist/compression/tracker.js.map +2 -2
  77. package/dist/compression/types.js.map +1 -1
  78. package/dist/config.js +66 -1
  79. package/dist/config.js.map +2 -2
  80. package/dist/core/pipeline.js +23 -0
  81. package/dist/core/pipeline.js.map +2 -2
  82. package/dist/db/database.js +28 -0
  83. package/dist/db/database.js.map +2 -2
  84. package/dist/db/docs-schema.sql +50 -0
  85. package/dist/docs/formats/asciidoc.js +108 -0
  86. package/dist/docs/formats/asciidoc.js.map +7 -0
  87. package/dist/docs/formats/html.js +100 -0
  88. package/dist/docs/formats/html.js.map +7 -0
  89. package/dist/docs/formats/index.js +81 -0
  90. package/dist/docs/formats/index.js.map +7 -0
  91. package/dist/docs/formats/markdown.js +146 -0
  92. package/dist/docs/formats/markdown.js.map +7 -0
  93. package/dist/docs/formats/openapi.js +228 -0
  94. package/dist/docs/formats/openapi.js.map +7 -0
  95. package/dist/docs/formats/org.js +117 -0
  96. package/dist/docs/formats/org.js.map +7 -0
  97. package/dist/docs/formats/plaintext.js +119 -0
  98. package/dist/docs/formats/plaintext.js.map +7 -0
  99. package/dist/docs/formats/rdoc.js +105 -0
  100. package/dist/docs/formats/rdoc.js.map +7 -0
  101. package/dist/docs/formats/rst.js +121 -0
  102. package/dist/docs/formats/rst.js.map +7 -0
  103. package/dist/docs/indexer.js +340 -0
  104. package/dist/docs/indexer.js.map +7 -0
  105. package/dist/docs/linker.js +151 -0
  106. package/dist/docs/linker.js.map +7 -0
  107. package/dist/docs/lint.js +92 -0
  108. package/dist/docs/lint.js.map +7 -0
  109. package/dist/docs/queries.js +295 -0
  110. package/dist/docs/queries.js.map +7 -0
  111. package/dist/docs/section-id.js +57 -0
  112. package/dist/docs/section-id.js.map +7 -0
  113. package/dist/docs/summarizer.js +55 -0
  114. package/dist/docs/summarizer.js.map +7 -0
  115. package/dist/docs/types.js +17 -0
  116. package/dist/docs/types.js.map +7 -0
  117. package/dist/docs/vectors.js +217 -0
  118. package/dist/docs/vectors.js.map +7 -0
  119. package/dist/index.js +3 -0
  120. package/dist/index.js.map +2 -2
  121. package/dist/mcp/tool-names.js +10 -1
  122. package/dist/mcp/tool-names.js.map +2 -2
  123. package/dist/mcp/tools.js +476 -3
  124. package/dist/mcp/tools.js.map +2 -2
  125. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/bin/commands/uninit.ts"],
4
- "sourcesContent": ["import { Command } from 'commander';\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport { printBanner } from '../banner';\nimport { dim, reset, violet, bold, green } from '../ui';\n\nexport const UNINIT_FAREWELLS = [\n \"Oh. So it's come to this.\",\n \"We're sorry to see you go. (Are we? Yes. We are.)\",\n \"Deleting months of carefully indexed knowledge. Bold move.\",\n \"Fine. We'll just sit here in the dark.\",\n \"You can always come back. We won't mention this.\",\n \"The graph remembers everything. Except, soon, anything.\",\n \"Somewhere a tree-sitter is crying.\",\n \"Uninstalling... and pretending it doesn't hurt.\",\n \"574 embeddings. Gone. Just like that.\",\n \"See you on the other side of `kirograph install`.\",\n];\n\ntype UninitTarget = 'kiro' | 'claude' | 'codex' | 'all';\n\nconst UNINIT_TARGETS: UninitTarget[] = ['kiro', 'claude', 'codex', 'all'];\n\nasync function confirm(question: string): Promise<boolean> {\n const readline = await import('readline');\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n return new Promise<boolean>(resolve => rl.question(question, ans => {\n rl.close();\n resolve(ans.toLowerCase() === 'y');\n }));\n}\n\nasync function runUninit(projectPath: string | undefined, opts: { force?: boolean; target?: string }): Promise<void> {\n const target = path.resolve(projectPath ?? process.cwd());\n const integration = (opts.target ?? 'kiro').toLowerCase() as UninitTarget;\n if (!UNINIT_TARGETS.includes(integration)) {\n console.error(`Unknown uninit target: ${opts.target}. Choose from: kiro, claude, codex, all`);\n process.exit(1);\n }\n const dir = path.join(target, '.kirograph');\n if (!fs.existsSync(dir)) { console.log('Not initialized.'); return; }\n\n let removeIntegration = true;\n let removeGraph = opts.force === true;\n\n if (!opts.force) {\n printBanner();\n const farewell = UNINIT_FAREWELLS[Math.floor(Math.random() * UNINIT_FAREWELLS.length)]!;\n console.log(` ${violet}${bold}${farewell}${reset}`);\n console.log(`\\n ${dim}This can remove ${integration} integration files and, separately, the shared .kirograph/ data.${reset}`);\n console.log(` ${dim}Your source code is untouched.${reset}\\n`);\n\n removeIntegration = await confirm(` ${violet}Remove ${integration} integration files?${reset} ${dim}(y/N)${reset} `);\n removeGraph = await confirm(` ${violet}Remove shared .kirograph/ data too?${reset} ${dim}(y/N)${reset} `);\n\n if (!removeIntegration && !removeGraph) {\n console.log(`\\n ${dim}Cancelled. Nothing removed.${reset}\\n`);\n return;\n }\n console.log();\n }\n\n if (removeGraph) {\n fs.rmSync(dir, { recursive: true, force: true });\n console.log(` ${green}\u2713${reset} Removed .kirograph/`);\n }\n\n if (removeIntegration && (integration === 'kiro' || integration === 'all')) {\n // Remove .kiro hooks created by kirograph\n const kiroHooks = [\n 'kirograph-mark-dirty-on-save.kiro.hook',\n 'kirograph-mark-dirty-on-create.kiro.hook',\n 'kirograph-sync-on-delete.kiro.hook',\n 'kirograph-sync-if-dirty.kiro.hook',\n 'kirograph-compress-hint.kiro.hook',\n // Legacy .json filenames\n 'kirograph-mark-dirty-on-save.json',\n 'kirograph-mark-dirty-on-create.json',\n 'kirograph-sync-on-delete.json',\n 'kirograph-sync-if-dirty.json',\n 'kirograph-sync-on-save.json',\n 'kirograph-sync-on-create.json',\n 'kirograph-compress-hint.json',\n ];\n const hooksDir = path.join(target, '.kiro', 'hooks');\n let removedHooks = 0;\n for (const hook of kiroHooks) {\n const p = path.join(hooksDir, hook);\n if (fs.existsSync(p)) { fs.unlinkSync(p); removedHooks++; }\n }\n if (removedHooks > 0) console.log(` ${green}\u2713${reset} Removed ${removedHooks} hook(s) from .kiro/hooks/`);\n\n // Remove .kiro/steering/kirograph.md\n const steeringPath = path.join(target, '.kiro', 'steering', 'kirograph.md');\n if (fs.existsSync(steeringPath)) {\n fs.unlinkSync(steeringPath);\n console.log(` ${green}\u2713${reset} Removed .kiro/steering/kirograph.md`);\n }\n\n // Remove .kiro/agents/kirograph.json\n const agentPath = path.join(target, '.kiro', 'agents', 'kirograph.json');\n if (fs.existsSync(agentPath)) {\n fs.unlinkSync(agentPath);\n console.log(` ${green}\u2713${reset} Removed .kiro/agents/kirograph.json`);\n }\n\n // Remove kirograph server from .kiro/settings/mcp.json\n const { removeMcpServersConfig } = await Promise.resolve().then(() => require('../installer/common.js'));\n const mcpPath = path.join(target, '.kiro', 'settings', 'mcp.json');\n if (removeMcpServersConfig(mcpPath)) {\n console.log(` ${green}\u2713${reset} Removed kirograph from .kiro/settings/mcp.json`);\n }\n }\n\n if (removeIntegration && (integration === 'claude' || integration === 'all')) {\n const { uninitClaude } = await Promise.resolve().then(() => require('../installer/targets/claude.js'));\n uninitClaude(target);\n }\n\n if (removeIntegration && (integration === 'codex' || integration === 'all')) {\n const { uninitCodex } = await Promise.resolve().then(() => require('../installer/targets/codex.js'));\n uninitCodex(target);\n }\n\n console.log(`\\n ${dim}Done. Run ${violet}kirograph install --target ${integration === 'all' ? 'kiro' : integration}${reset}${dim} to come back anytime.${reset}\\n`);\n}\n\nexport function register(program: Command): void {\n program\n .command('uninit [projectPath]')\n .description('Remove KiroGraph from a project')\n .option('--force', 'Skip confirmation')\n .option('--target <target>', 'Integration target to clean up: kiro, claude, codex, or all', 'kiro')\n .action(runUninit);\n\n program\n .command('uninstall [projectPath]')\n .description('Alias for uninit. Remove KiroGraph from a project')\n .option('--force', 'Skip confirmation')\n .option('--target <target>', 'Integration target to clean up: kiro, claude, codex, or all', 'kiro')\n .action(runUninit);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,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S;AACrB;",
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport * as readline from 'readline';\nimport { printBanner } from '../banner';\nimport { dim, reset, violet, bold, green } from '../ui';\nimport { askToggle } from '../installer/prompts';\n\nexport const UNINIT_FAREWELLS = [\n \"Oh. So it's come to this.\",\n \"We're sorry to see you go. (Are we? Yes. We are.)\",\n \"Deleting months of carefully indexed knowledge. Bold move.\",\n \"Fine. We'll just sit here in the dark.\",\n \"You can always come back. We won't mention this.\",\n \"The graph remembers everything. Except, soon, anything.\",\n \"Somewhere a tree-sitter is crying.\",\n \"Uninstalling... and pretending it doesn't hurt.\",\n \"574 embeddings. Gone. Just like that.\",\n \"See you on the other side of `kirograph install`.\",\n];\n\ntype UninitTarget = 'kiro' | 'claude' | 'codex' | 'all';\n\nconst UNINIT_TARGETS: UninitTarget[] = ['kiro', 'claude', 'codex', 'all'];\n\nasync function runUninit(projectPath: string | undefined, opts: { force?: boolean; target?: string }): Promise<void> {\n const target = path.resolve(projectPath ?? process.cwd());\n const integration = (opts.target ?? 'kiro').toLowerCase() as UninitTarget;\n if (!UNINIT_TARGETS.includes(integration)) {\n console.error(`Unknown uninit target: ${opts.target}. Choose from: kiro, claude, codex, all`);\n process.exit(1);\n }\n const dir = path.join(target, '.kirograph');\n if (!fs.existsSync(dir)) { console.log('Not initialized.'); return; }\n\n let removeIntegration = true;\n let removeGraph = opts.force === true;\n\n if (!opts.force) {\n printBanner();\n const farewell = UNINIT_FAREWELLS[Math.floor(Math.random() * UNINIT_FAREWELLS.length)]!;\n console.log(` ${violet}${bold}${farewell}${reset}`);\n console.log(`\\n ${dim}This can remove ${integration} integration files and, separately, the shared .kirograph/ data.${reset}`);\n console.log(` ${dim}Your source code is untouched.${reset}`);\n\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n\n removeIntegration = await askToggle(rl, `Remove ${integration} integration files?`, 'Removes hooks, steering, MCP config, and agent instructions for this target.', false);\n removeGraph = await askToggle(rl, 'Remove shared .kirograph/ data too?', 'Deletes the graph database, snapshots, and all indexed data. Cannot be undone.', false);\n\n rl.close();\n\n if (!removeIntegration && !removeGraph) {\n console.log(`\\n ${dim}Cancelled. Nothing removed.${reset}\\n`);\n return;\n }\n console.log();\n }\n\n if (removeGraph) {\n fs.rmSync(dir, { recursive: true, force: true });\n console.log(` ${green}\u2713${reset} Removed .kirograph/`);\n }\n\n if (removeIntegration && (integration === 'kiro' || integration === 'all')) {\n // Remove .kiro hooks created by kirograph\n const kiroHooks = [\n 'kirograph-mark-dirty-on-save.kiro.hook',\n 'kirograph-mark-dirty-on-create.kiro.hook',\n 'kirograph-sync-on-delete.kiro.hook',\n 'kirograph-sync-if-dirty.kiro.hook',\n 'kirograph-compress-hint.kiro.hook',\n 'kirograph-mem-capture.kiro.hook',\n // Legacy .json filenames\n 'kirograph-mark-dirty-on-save.json',\n 'kirograph-mark-dirty-on-create.json',\n 'kirograph-sync-on-delete.json',\n 'kirograph-sync-if-dirty.json',\n 'kirograph-sync-on-save.json',\n 'kirograph-sync-on-create.json',\n 'kirograph-compress-hint.json',\n 'kirograph-mem-capture.json',\n ];\n const hooksDir = path.join(target, '.kiro', 'hooks');\n let removedHooks = 0;\n for (const hook of kiroHooks) {\n const p = path.join(hooksDir, hook);\n if (fs.existsSync(p)) { fs.unlinkSync(p); removedHooks++; }\n }\n if (removedHooks > 0) console.log(` ${green}\u2713${reset} Removed ${removedHooks} hook(s) from .kiro/hooks/`);\n\n // Remove .kiro/steering/kirograph.md\n const steeringPath = path.join(target, '.kiro', 'steering', 'kirograph.md');\n if (fs.existsSync(steeringPath)) {\n fs.unlinkSync(steeringPath);\n console.log(` ${green}\u2713${reset} Removed .kiro/steering/kirograph.md`);\n }\n\n // Remove .kiro/agents/kirograph.json\n const agentPath = path.join(target, '.kiro', 'agents', 'kirograph.json');\n if (fs.existsSync(agentPath)) {\n fs.unlinkSync(agentPath);\n console.log(` ${green}\u2713${reset} Removed .kiro/agents/kirograph.json`);\n }\n\n // Remove kirograph server from .kiro/settings/mcp.json\n const { removeMcpServersConfig } = await Promise.resolve().then(() => require('../installer/common.js'));\n const mcpPath = path.join(target, '.kiro', 'settings', 'mcp.json');\n if (removeMcpServersConfig(mcpPath)) {\n console.log(` ${green}\u2713${reset} Removed kirograph from .kiro/settings/mcp.json`);\n }\n }\n\n if (removeIntegration && (integration === 'claude' || integration === 'all')) {\n const { uninitClaude } = await Promise.resolve().then(() => require('../installer/targets/claude.js'));\n uninitClaude(target);\n }\n\n if (removeIntegration && (integration === 'codex' || integration === 'all')) {\n const { uninitCodex } = await Promise.resolve().then(() => require('../installer/targets/codex.js'));\n uninitCodex(target);\n }\n\n console.log(`\\n ${dim}Done. Run ${violet}kirograph install --target ${integration === 'all' ? 'kiro' : integration}${reset}${dim} to come back anytime.${reset}\\n`);\n}\n\nexport function register(program: Command): void {\n program\n .command('uninit [projectPath]')\n .description('Remove KiroGraph from a project')\n .option('--force', 'Skip confirmation')\n .option('--target <target>', 'Integration target to clean up: kiro, claude, codex, or all', 'kiro')\n .action(runUninit);\n\n program\n .command('uninstall [projectPath]')\n .description('Alias for uninit. Remove KiroGraph from a project')\n .option('--force', 'Skip confirmation')\n .option('--target <target>', 'Integration target to clean up: kiro, claude, codex, or all', 'kiro')\n .action(runUninit);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,WAAsB;AACtB,SAAoB;AACpB,eAA0B;AAC1B,oBAA4B;AAC5B,gBAAgD;AAChD,qBAA0B;AAEnB,MAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIA,MAAM,iBAAiC,CAAC,QAAQ,UAAU,SAAS,KAAK;AAExE,eAAe,UAAU,aAAiC,MAA2D;AACnH,QAAM,SAAS,KAAK,QAA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E,aAAa,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,gCAAgC,CAAC;AACrG,iBAAa,MAAM;AAAA,EACrB;AAEA,MAAI,sBAAsB,gBAAgB,WAAW,gBAAgB,QAAQ;AAC3E,UAAM,EAAE,YAAY,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,+BAA+B,CAAC;AACnG,gBAAY,MAAM;AAAA,EACpB;AAEA,UAAQ,IAAI;AAAA,IAAO,aAAG,aAAa,gBAAM,8BAA8B,gBAAgB,QAAQ,SAAS,WAAW,GAAG,eAAK,GAAG,aAAG,yBAAyB,eAAK;AAAA,CAAI;AACrK;AAEO,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,sBAAsB,EAC9B,YAAY,iCAAiC,EAC7C,OAAO,WAAW,mBAAmB,EACrC,OAAO,qBAAqB,+DAA+D,MAAM,EACjG,OAAO,SAAS;AAEnB,UACG,QAAQ,yBAAyB,EACjC,YAAY,mDAAmD,EAC/D,OAAO,WAAW,mBAAmB,EACrC,OAAO,qBAAqB,+DAA+D,MAAM,EACjG,OAAO,SAAS;AACrB;",
6
6
  "names": []
7
7
  }
@@ -57,16 +57,17 @@ const PRESET_MODELS = [
57
57
  }
58
58
  ];
59
59
  async function promptConfigOptions(rl) {
60
- const enableEmbeddings = await (0, import_prompts.askBool)(
60
+ (0, import_prompts.printSection)("\u{1F50D}", "Semantic Search");
61
+ const enableEmbeddings = await (0, import_prompts.askToggle)(
61
62
  rl,
62
- "Enable semantic embeddings for similarity search? (requires a local embedding model)",
63
- "Enables semantic/similarity-based code search. Increases indexing time; the chosen embedding model is downloaded automatically on first use."
63
+ "Semantic embeddings (similarity search):",
64
+ "Enables natural-language code search via vector embeddings. A local model (~130MB) is downloaded on first use."
64
65
  );
65
- const patch = { enableEmbeddings, useVecIndex: false, semanticEngine: "cosine", typesenseDashboard: false, qdrantDashboard: false, extractDocstrings: true, trackCallSites: true, enableArchitecture: false, cavemanMode: "off", shellCompressionLevel: "normal" };
66
+ const patch = { enableEmbeddings, useVecIndex: false, semanticEngine: "cosine", typesenseDashboard: false, qdrantDashboard: false, extractDocstrings: true, trackCallSites: true, enableArchitecture: false, cavemanMode: "off", shellCompressionLevel: "normal", enableMemory: false, enableDocs: false, docsContextLimit: 0 };
66
67
  if (enableEmbeddings) {
67
68
  const modelChoice = await (0, import_prompts.arrowSelect)(
68
69
  rl,
69
- "Choose an embedding model:",
70
+ "Embedding model:",
70
71
  PRESET_MODELS.map((m) => ({ value: m.value, label: m.label, description: m.description }))
71
72
  );
72
73
  let embeddingModel;
@@ -100,7 +101,7 @@ async function promptConfigOptions(rl) {
100
101
  }
101
102
  patch.embeddingModel = embeddingModel;
102
103
  patch.embeddingDim = embeddingDim;
103
- const semanticEngine = await (0, import_prompts.arrowSelect)(rl, "Choose the semantic search engine:", [
104
+ const semanticEngine = await (0, import_prompts.arrowSelect)(rl, "Vector search engine:", [
104
105
  { value: "cosine", label: "cosine", description: "In-process cosine similarity. No extra deps. Best for small/medium projects." },
105
106
  { value: "sqlite-vec", label: "sqlite-vec", description: "ANN index. Sub-linear search. Best for large codebases. Needs: better-sqlite3, sqlite-vec (native)." },
106
107
  { value: "orama", label: "orama", description: "Hybrid search (full-text + vector). Pure JS. Needs: @orama/orama, @orama/plugin-data-persistence." },
@@ -112,49 +113,78 @@ async function promptConfigOptions(rl) {
112
113
  patch.semanticEngine = semanticEngine;
113
114
  patch.useVecIndex = semanticEngine === "sqlite-vec";
114
115
  if (semanticEngine === "typesense") {
115
- patch.typesenseDashboard = await (0, import_prompts.askBool)(
116
+ patch.typesenseDashboard = await (0, import_prompts.askToggle)(
116
117
  rl,
117
- "Open Typesense dashboard after indexing?",
118
- "Serves the Typesense Dashboard locally and opens it in your browser after indexing completes."
118
+ "Typesense dashboard:",
119
+ "Serves the Typesense Dashboard locally and opens it in your browser after indexing completes.",
120
+ false
119
121
  );
120
122
  }
121
123
  if (semanticEngine === "qdrant") {
122
- patch.qdrantDashboard = await (0, import_prompts.askBool)(
124
+ patch.qdrantDashboard = await (0, import_prompts.askToggle)(
123
125
  rl,
124
- "Open Qdrant dashboard after indexing?",
125
- "Downloads the Qdrant Web UI (first time only) and opens it in your browser after indexing completes."
126
+ "Qdrant dashboard:",
127
+ "Downloads the Qdrant Web UI (first time only) and opens it in your browser after indexing completes.",
128
+ false
126
129
  );
127
130
  }
128
131
  }
129
- patch.extractDocstrings = await (0, import_prompts.askBool)(
132
+ (0, import_prompts.printSection)("\u{1F4CA}", "Graph Features");
133
+ patch.extractDocstrings = await (0, import_prompts.askToggle)(
130
134
  rl,
131
- "Extract docstrings from source files?",
135
+ "Docstring extraction:",
132
136
  "Enriches symbol metadata and improves context quality. Slightly increases indexing time."
133
137
  );
134
- patch.trackCallSites = await (0, import_prompts.askBool)(
138
+ patch.trackCallSites = await (0, import_prompts.askToggle)(
135
139
  rl,
136
- "Track call sites to enable caller/callee graph traversal?",
137
- "Enables the kirograph_callers and kirograph_callees MCP tools for graph traversal. Increases index size."
140
+ "Call site tracking (caller/callee graph):",
141
+ "Enables kirograph_callers and kirograph_callees MCP tools. Increases index size."
138
142
  );
139
- patch.enableArchitecture = await (0, import_prompts.askBool)(
143
+ patch.enableArchitecture = await (0, import_prompts.askToggle)(
140
144
  rl,
141
- "Enable architecture analysis (package graph + layer detection)?",
142
- "Detects packages from manifests (package.json, go.mod, Cargo.toml, etc.) and architectural layers (api, service, data, ui, shared) from file structure. Enables kirograph_architecture, kirograph_coupling, and kirograph_package MCP tools."
145
+ "Architecture analysis (packages + layers):",
146
+ "Detects packages from manifests and architectural layers. Enables kirograph_architecture, kirograph_coupling, kirograph_package.",
147
+ false
143
148
  );
144
- const cavemanChoice = await (0, import_prompts.arrowSelect)(rl, "Caveman mode: agent communication style:", [
145
- { value: "off", label: "off", description: "Normal responses" },
149
+ (0, import_prompts.printSection)("\u{1F4D6}", "Documentation");
150
+ patch.enableDocs = await (0, import_prompts.askToggle)(
151
+ rl,
152
+ "Documentation indexing (section-level retrieval):",
153
+ "Indexes docs by heading structure. Enables kirograph_docs_toc, kirograph_docs_search, kirograph_docs_section, kirograph_docs_outline, kirograph_docs_refs.",
154
+ false
155
+ );
156
+ if (patch.enableDocs) {
157
+ const contextChoice = await (0, import_prompts.arrowSelect)(rl, "Include doc sections in kirograph_context results?", [
158
+ { value: 0, label: "0 (disabled)", description: "Docs stay separate \u2014 use kirograph_docs_* tools explicitly (recommended)" },
159
+ { value: 3, label: "3 sections", description: "Include up to 3 relevant doc sections in context results" },
160
+ { value: 5, label: "5 sections", description: "Include up to 5 relevant doc sections in context results" },
161
+ { value: 10, label: "10 sections", description: "Include up to 10 relevant doc sections in context results" }
162
+ ]);
163
+ patch.docsContextLimit = contextChoice;
164
+ }
165
+ (0, import_prompts.printSection)("\u{1F916}", "Agent Behavior");
166
+ const cavemanChoice = await (0, import_prompts.arrowSelect)(rl, "Communication style (caveman mode):", [
167
+ { value: "off", label: "off", description: "Normal responses \u2014 no compression" },
146
168
  { value: "lite", label: "lite", description: "Compact, no filler, full sentences" },
147
169
  { value: "full", label: "full", description: "Fragments, no articles, short synonyms" },
148
170
  { value: "ultra", label: "ultra", description: "Max compression, abbreviations, \u2192 for causality" }
149
171
  ]);
150
172
  patch.cavemanMode = cavemanChoice;
151
- const compressionChoice = await (0, import_prompts.arrowSelect)(rl, "Shell compression: default level for kirograph_exec:", [
173
+ const compressionChoice = await (0, import_prompts.arrowSelect)(rl, "Shell compression (kirograph_exec default level):", [
152
174
  { value: "off", label: "off", description: "No compression hook or steering (tool still available)" },
153
175
  { value: "normal", label: "normal", description: "Balanced: removes noise, keeps structure (recommended)" },
154
176
  { value: "aggressive", label: "aggressive", description: "More compact: groups by category, limits output" },
155
177
  { value: "ultra", label: "ultra", description: "Maximum compression: counts and summaries only" }
156
178
  ]);
157
179
  patch.shellCompressionLevel = compressionChoice;
180
+ (0, import_prompts.printSection)("\u{1F9E0}", "Memory");
181
+ patch.enableMemory = await (0, import_prompts.askToggle)(
182
+ rl,
183
+ "Persistent memory (cross-session observations):",
184
+ "Stores decisions, errors, and patterns across sessions. Compressed (if caveman is on), linked to code symbols, searchable via kirograph_mem_* tools. Zero LLM tokens on write.",
185
+ false
186
+ // Requires explicit enable
187
+ );
158
188
  return patch;
159
189
  }
160
190
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/bin/installer/config-prompt.ts"],
4
- "sourcesContent": ["/**\n * KiroGraph Installer \u2014 configuration prompting\n */\n\nimport * as readline from 'readline';\nimport { KiroGraphConfig } from '../../config';\ntype CavemanMode = 'lite' | 'full' | 'ultra';\nimport { ask, askBool, arrowSelect, dim, reset, violet } from './prompts';\nexport type ConfigPatch = Pick<KiroGraphConfig, 'enableEmbeddings' | 'useVecIndex' | 'semanticEngine' | 'typesenseDashboard' | 'qdrantDashboard' | 'extractDocstrings' | 'trackCallSites' | 'enableArchitecture' | 'cavemanMode' | 'shellCompressionLevel'> & { embeddingModel?: string; embeddingDim?: number };\nexport type SemanticEngine = KiroGraphConfig['semanticEngine'];\n\nexport const DEFAULT_EMBEDDING_MODEL = 'nomic-ai/nomic-embed-text-v1.5';\n\n/** Well-known embedding models with their output dimensions. */\nconst PRESET_MODELS = [\n {\n value: 'nomic-ai/nomic-embed-text-v1.5',\n label: 'nomic-embed-text-v1.5',\n dim: 768,\n description: '768-dim \u00B7 ~130MB \u00B7 Best quality for code search (recommended)',\n },\n {\n value: 'onnx-community/embeddinggemma-300m-ONNX',\n label: 'embeddinggemma-300m',\n dim: 768,\n description: '768-dim \u00B7 ~300MB \u00B7 Google Gemma-based, multilingual, 2048-token context',\n },\n {\n value: 'Xenova/all-MiniLM-L6-v2',\n label: 'all-MiniLM-L6-v2',\n dim: 384,\n description: '384-dim \u00B7 ~23MB \u00B7 Fast and lightweight, lower accuracy',\n },\n {\n value: 'BAAI/bge-base-en-v1.5',\n label: 'bge-base-en-v1.5',\n dim: 768,\n description: '768-dim \u00B7 ~110MB \u00B7 Strong general-purpose alternative to nomic',\n },\n {\n value: '__other__',\n label: 'Other',\n dim: 768,\n description: 'Enter a custom HuggingFace model ID and embedding dimension',\n },\n] as const;\n\nexport async function promptConfigOptions(rl: readline.Interface): Promise<ConfigPatch> {\n const enableEmbeddings = await askBool(\n rl,\n 'Enable semantic embeddings for similarity search? (requires a local embedding model)',\n 'Enables semantic/similarity-based code search. Increases indexing time; the chosen embedding model is downloaded automatically on first use.',\n );\n\n const patch: ConfigPatch = { enableEmbeddings, useVecIndex: false, semanticEngine: 'cosine', typesenseDashboard: false, qdrantDashboard: false, extractDocstrings: true, trackCallSites: true, enableArchitecture: false, cavemanMode: 'off', shellCompressionLevel: 'normal' };\n\n if (enableEmbeddings) {\n // \u2500\u2500 Model selection \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 const modelChoice = await arrowSelect<string>(\n rl,\n 'Choose an embedding model:',\n PRESET_MODELS.map(m => ({ value: m.value, label: m.label, description: m.description })),\n );\n\n let embeddingModel: string;\n let embeddingDim: number;\n\n if (modelChoice === '__other__') {\n console.log(`\\n ${dim}Enter a HuggingFace model ID in the format org/model-name.${reset}`);\n while (true) {\n const raw = (await ask(rl, ` ${violet}Model identifier:${reset} `)).trim();\n if (raw.includes('/')) { embeddingModel = raw; break; }\n console.log(` Expected a HuggingFace model ID in the format org/model-name (e.g. nomic-ai/nomic-embed-text-v1.5).`);\n }\n console.log(`\\n ${dim}Enter the embedding output dimension for this model (check the model card on HuggingFace).${reset}`);\n while (true) {\n const raw = (await ask(rl, ` ${violet}Embedding dimension (e.g. 768, 384):${reset} `)).trim();\n const n = parseInt(raw, 10);\n if (!isNaN(n) && n > 0) { embeddingDim = n; break; }\n console.log(` Expected a positive integer (e.g. 768, 384, 1536).`);\n }\n } else {\n const preset = PRESET_MODELS.find(m => m.value === modelChoice)!;\n embeddingModel = preset.value;\n embeddingDim = preset.dim;\n }\n\n patch.embeddingModel = embeddingModel;\n patch.embeddingDim = embeddingDim;\n\n // \u2500\u2500 Engine selection \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 const semanticEngine = await arrowSelect<SemanticEngine>(rl, 'Choose the semantic search engine:', [\n { value: 'cosine', label: 'cosine', description: 'In-process cosine similarity. No extra deps. Best for small/medium projects.' },\n { value: 'sqlite-vec', label: 'sqlite-vec', description: 'ANN index. Sub-linear search. Best for large codebases. Needs: better-sqlite3, sqlite-vec (native).' },\n { value: 'orama', label: 'orama', description: 'Hybrid search (full-text + vector). Pure JS. Needs: @orama/orama, @orama/plugin-data-persistence.' },\n { value: 'pglite', label: 'pglite', description: 'Hybrid search via PostgreSQL + pgvector. Exact results. Pure WASM. Needs: @electric-sql/pglite.' },\n { value: 'lancedb', label: 'lancedb', description: 'ANN search via LanceDB (Apache Lance columnar format). Pure JS. Needs: @lancedb/lancedb.' },\n { value: 'qdrant', label: 'qdrant', description: 'ANN search via Qdrant embedded binary (HNSW index, Cosine). Needs: qdrant-local.' },\n { value: 'typesense', label: 'typesense', description: 'ANN search via Typesense (auto-downloaded binary, HNSW, Cosine). Needs: typesense.' },\n ]);\n patch.semanticEngine = semanticEngine;\n patch.useVecIndex = semanticEngine === 'sqlite-vec';\n\n if (semanticEngine === 'typesense') {\n patch.typesenseDashboard = await askBool(\n rl,\n 'Open Typesense dashboard after indexing?',\n 'Serves the Typesense Dashboard locally and opens it in your browser after indexing completes.',\n );\n }\n\n if (semanticEngine === 'qdrant') {\n patch.qdrantDashboard = await askBool(\n rl,\n 'Open Qdrant dashboard after indexing?',\n 'Downloads the Qdrant Web UI (first time only) and opens it in your browser after indexing completes.',\n );\n }\n }\n\n patch.extractDocstrings = await askBool(\n rl,\n 'Extract docstrings from source files?',\n 'Enriches symbol metadata and improves context quality. Slightly increases indexing time.',\n );\n\n patch.trackCallSites = await askBool(\n rl,\n 'Track call sites to enable caller/callee graph traversal?',\n 'Enables the kirograph_callers and kirograph_callees MCP tools for graph traversal. Increases index size.',\n );\n\n patch.enableArchitecture = await askBool(\n rl,\n 'Enable architecture analysis (package graph + layer detection)?',\n 'Detects packages from manifests (package.json, go.mod, Cargo.toml, etc.) and architectural layers (api, service, data, ui, shared) from file structure. Enables kirograph_architecture, kirograph_coupling, and kirograph_package MCP tools.',\n );\n\n const cavemanChoice = await arrowSelect(rl, 'Caveman mode: agent communication style:', [\n { value: 'off', label: 'off', description: 'Normal responses' },\n { value: 'lite', label: 'lite', description: 'Compact, no filler, full sentences' },\n { value: 'full', label: 'full', description: 'Fragments, no articles, short synonyms' },\n { value: 'ultra', label: 'ultra', description: 'Max compression, abbreviations, \u2192 for causality' },\n ]);\n patch.cavemanMode = cavemanChoice as CavemanMode | 'off';\n\n const compressionChoice = await arrowSelect(rl, 'Shell compression: default level for kirograph_exec:', [\n { value: 'off', label: 'off', description: 'No compression hook or steering (tool still available)' },\n { value: 'normal', label: 'normal', description: 'Balanced: removes noise, keeps structure (recommended)' },\n { value: 'aggressive', label: 'aggressive', description: 'More compact: groups by category, limits output' },\n { value: 'ultra', label: 'ultra', description: 'Maximum compression: counts and summaries only' },\n ]);\n patch.shellCompressionLevel = compressionChoice as KiroGraphConfig['shellCompressionLevel'];\n\n return patch;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;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kB,UAAM;AAAA,QAC5B;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,oBAAoB,UAAM;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,iBAAiB,UAAM;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,qBAAqB,UAAM;AAAA,IAC/B;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,gBAAgB,UAAM,4BAAY,IAAI,4CAA4C;AAAA,IACtF,EAAE,OAAO,OAAS,OAAO,OAAS,aAAa,mBAAmB;AAAA,IAClE,EAAE,OAAO,QAAS,OAAO,QAAS,aAAa,qCAAqC;AAAA,IACpF,EAAE,OAAO,QAAS,OAAO,QAAS,aAAa,yCAAyC;AAAA,IACxF,EAAE,OAAO,SAAS,OAAO,SAAS,aAAa,uDAAkD;AAAA,EACnG,CAAC;AACD,QAAM,cAAc;AAEpB,QAAM,oBAAoB,UAAM,4BAAY,IAAI,wDAAwD;AAAA,IACtG,EAAE,OAAO,OAAc,OAAO,OAAc,aAAa,yDAAyD;AAAA,IAClH,EAAE,OAAO,UAAc,OAAO,UAAc,aAAa,yDAAyD;AAAA,IAClH,EAAE,OAAO,cAAc,OAAO,cAAc,aAAa,kDAAkD;AAAA,IAC3G,EAAE,OAAO,SAAc,OAAO,SAAc,aAAa,iDAAiD;AAAA,EAC5G,CAAC;AACD,QAAM,wBAAwB;AAE9B,SAAO;AACT;",
4
+ "sourcesContent": ["/**\n * KiroGraph Installer \u2014 configuration prompting\n */\n\nimport * as readline from 'readline';\nimport { KiroGraphConfig } from '../../config';\ntype CavemanMode = 'lite' | 'full' | 'ultra';\nimport { ask, askToggle, arrowSelect, printSection, printSeparator, dim, reset, violet } from './prompts';\nexport type ConfigPatch = Pick<KiroGraphConfig, 'enableEmbeddings' | 'useVecIndex' | 'semanticEngine' | 'typesenseDashboard' | 'qdrantDashboard' | 'extractDocstrings' | 'trackCallSites' | 'enableArchitecture' | 'cavemanMode' | 'shellCompressionLevel' | 'enableMemory' | 'enableDocs' | 'docsContextLimit'> & { embeddingModel?: string; embeddingDim?: number };\nexport type SemanticEngine = KiroGraphConfig['semanticEngine'];\n\nexport const DEFAULT_EMBEDDING_MODEL = 'nomic-ai/nomic-embed-text-v1.5';\n\n/** Well-known embedding models with their output dimensions. */\nconst PRESET_MODELS = [\n {\n value: 'nomic-ai/nomic-embed-text-v1.5',\n label: 'nomic-embed-text-v1.5',\n dim: 768,\n description: '768-dim \u00B7 ~130MB \u00B7 Best quality for code search (recommended)',\n },\n {\n value: 'onnx-community/embeddinggemma-300m-ONNX',\n label: 'embeddinggemma-300m',\n dim: 768,\n description: '768-dim \u00B7 ~300MB \u00B7 Google Gemma-based, multilingual, 2048-token context',\n },\n {\n value: 'Xenova/all-MiniLM-L6-v2',\n label: 'all-MiniLM-L6-v2',\n dim: 384,\n description: '384-dim \u00B7 ~23MB \u00B7 Fast and lightweight, lower accuracy',\n },\n {\n value: 'BAAI/bge-base-en-v1.5',\n label: 'bge-base-en-v1.5',\n dim: 768,\n description: '768-dim \u00B7 ~110MB \u00B7 Strong general-purpose alternative to nomic',\n },\n {\n value: '__other__',\n label: 'Other',\n dim: 768,\n description: 'Enter a custom HuggingFace model ID and embedding dimension',\n },\n] as const;\n\nexport async function promptConfigOptions(rl: readline.Interface): Promise<ConfigPatch> {\n // \u2500\u2500 Semantic Search \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 printSection('\uD83D\uDD0D', 'Semantic Search');\n\n const enableEmbeddings = await askToggle(\n rl,\n 'Semantic embeddings (similarity search):',\n 'Enables natural-language code search via vector embeddings. A local model (~130MB) is downloaded on first use.',\n );\n\n const patch: ConfigPatch = { enableEmbeddings, useVecIndex: false, semanticEngine: 'cosine', typesenseDashboard: false, qdrantDashboard: false, extractDocstrings: true, trackCallSites: true, enableArchitecture: false, cavemanMode: 'off', shellCompressionLevel: 'normal', enableMemory: false, enableDocs: false, docsContextLimit: 0 };\n\n if (enableEmbeddings) {\n // \u2500\u2500 Model selection \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 const modelChoice = await arrowSelect<string>(\n rl,\n 'Embedding model:',\n PRESET_MODELS.map(m => ({ value: m.value, label: m.label, description: m.description })),\n );\n\n let embeddingModel: string;\n let embeddingDim: number;\n\n if (modelChoice === '__other__') {\n console.log(`\\n ${dim}Enter a HuggingFace model ID in the format org/model-name.${reset}`);\n while (true) {\n const raw = (await ask(rl, ` ${violet}Model identifier:${reset} `)).trim();\n if (raw.includes('/')) { embeddingModel = raw; break; }\n console.log(` Expected a HuggingFace model ID in the format org/model-name (e.g. nomic-ai/nomic-embed-text-v1.5).`);\n }\n console.log(`\\n ${dim}Enter the embedding output dimension for this model (check the model card on HuggingFace).${reset}`);\n while (true) {\n const raw = (await ask(rl, ` ${violet}Embedding dimension (e.g. 768, 384):${reset} `)).trim();\n const n = parseInt(raw, 10);\n if (!isNaN(n) && n > 0) { embeddingDim = n; break; }\n console.log(` Expected a positive integer (e.g. 768, 384, 1536).`);\n }\n } else {\n const preset = PRESET_MODELS.find(m => m.value === modelChoice)!;\n embeddingModel = preset.value;\n embeddingDim = preset.dim;\n }\n\n patch.embeddingModel = embeddingModel;\n patch.embeddingDim = embeddingDim;\n\n // \u2500\u2500 Engine selection \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 const semanticEngine = await arrowSelect<SemanticEngine>(rl, 'Vector search engine:', [\n { value: 'cosine', label: 'cosine', description: 'In-process cosine similarity. No extra deps. Best for small/medium projects.' },\n { value: 'sqlite-vec', label: 'sqlite-vec', description: 'ANN index. Sub-linear search. Best for large codebases. Needs: better-sqlite3, sqlite-vec (native).' },\n { value: 'orama', label: 'orama', description: 'Hybrid search (full-text + vector). Pure JS. Needs: @orama/orama, @orama/plugin-data-persistence.' },\n { value: 'pglite', label: 'pglite', description: 'Hybrid search via PostgreSQL + pgvector. Exact results. Pure WASM. Needs: @electric-sql/pglite.' },\n { value: 'lancedb', label: 'lancedb', description: 'ANN search via LanceDB (Apache Lance columnar format). Pure JS. Needs: @lancedb/lancedb.' },\n { value: 'qdrant', label: 'qdrant', description: 'ANN search via Qdrant embedded binary (HNSW index, Cosine). Needs: qdrant-local.' },\n { value: 'typesense', label: 'typesense', description: 'ANN search via Typesense (auto-downloaded binary, HNSW, Cosine). Needs: typesense.' },\n ]);\n patch.semanticEngine = semanticEngine;\n patch.useVecIndex = semanticEngine === 'sqlite-vec';\n\n if (semanticEngine === 'typesense') {\n patch.typesenseDashboard = await askToggle(rl,\n 'Typesense dashboard:',\n 'Serves the Typesense Dashboard locally and opens it in your browser after indexing completes.',\n false,\n );\n }\n\n if (semanticEngine === 'qdrant') {\n patch.qdrantDashboard = await askToggle(rl,\n 'Qdrant dashboard:',\n 'Downloads the Qdrant Web UI (first time only) and opens it in your browser after indexing completes.',\n false,\n );\n }\n }\n\n // \u2500\u2500 Graph Features \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 printSection('\uD83D\uDCCA', 'Graph Features');\n\n patch.extractDocstrings = await askToggle(rl,\n 'Docstring extraction:',\n 'Enriches symbol metadata and improves context quality. Slightly increases indexing time.',\n );\n\n patch.trackCallSites = await askToggle(rl,\n 'Call site tracking (caller/callee graph):',\n 'Enables kirograph_callers and kirograph_callees MCP tools. Increases index size.',\n );\n\n patch.enableArchitecture = await askToggle(rl,\n 'Architecture analysis (packages + layers):',\n 'Detects packages from manifests and architectural layers. Enables kirograph_architecture, kirograph_coupling, kirograph_package.',\n false,\n );\n\n // \u2500\u2500 Documentation \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 printSection('\uD83D\uDCD6', 'Documentation');\n\n (patch as any).enableDocs = await askToggle(rl,\n 'Documentation indexing (section-level retrieval):',\n 'Indexes docs by heading structure. Enables kirograph_docs_toc, kirograph_docs_search, kirograph_docs_section, kirograph_docs_outline, kirograph_docs_refs.',\n false,\n );\n\n if ((patch as any).enableDocs) {\n const contextChoice = await arrowSelect<number>(rl, 'Include doc sections in kirograph_context results?', [\n { value: 0, label: '0 (disabled)', description: 'Docs stay separate \u2014 use kirograph_docs_* tools explicitly (recommended)' },\n { value: 3, label: '3 sections', description: 'Include up to 3 relevant doc sections in context results' },\n { value: 5, label: '5 sections', description: 'Include up to 5 relevant doc sections in context results' },\n { value: 10, label: '10 sections', description: 'Include up to 10 relevant doc sections in context results' },\n ]);\n (patch as any).docsContextLimit = contextChoice;\n }\n\n // \u2500\u2500 Agent Behavior \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 printSection('\uD83E\uDD16', 'Agent Behavior');\n\n const cavemanChoice = await arrowSelect(rl, 'Communication style (caveman mode):', [\n { value: 'off', label: 'off', description: 'Normal responses \u2014 no compression' },\n { value: 'lite', label: 'lite', description: 'Compact, no filler, full sentences' },\n { value: 'full', label: 'full', description: 'Fragments, no articles, short synonyms' },\n { value: 'ultra', label: 'ultra', description: 'Max compression, abbreviations, \u2192 for causality' },\n ]);\n patch.cavemanMode = cavemanChoice as CavemanMode | 'off';\n\n const compressionChoice = await arrowSelect(rl, 'Shell compression (kirograph_exec default level):', [\n { value: 'off', label: 'off', description: 'No compression hook or steering (tool still available)' },\n { value: 'normal', label: 'normal', description: 'Balanced: removes noise, keeps structure (recommended)' },\n { value: 'aggressive', label: 'aggressive', description: 'More compact: groups by category, limits output' },\n { value: 'ultra', label: 'ultra', description: 'Maximum compression: counts and summaries only' },\n ]);\n patch.shellCompressionLevel = compressionChoice as KiroGraphConfig['shellCompressionLevel'];\n\n // \u2500\u2500 Memory \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 printSection('\uD83E\uDDE0', 'Memory');\n\n (patch as any).enableMemory = await askToggle(rl,\n 'Persistent memory (cross-session observations):',\n 'Stores decisions, errors, and patterns across sessions. Compressed (if caveman is on), linked to code symbols, searchable via kirograph_mem_* tools. Zero LLM tokens on write.',\n false, // Requires explicit enable\n );\n\n return patch;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,qBAA8F;AAIvF,MAAM,0BAA0B;AAGvC,MAAM,gBAAgB;AAAA,EACpB;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,EACf;AACF;AAEA,eAAsB,oBAAoB,IAA8C;AAEtF,mCAAa,aAAM,iBAAiB;AAEpC,QAAM,mBAAmB,UAAM;AAAA,IAC7B;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAqB,EAAE,kBAAkB,aAAa,OAAO,gBAAgB,UAAU,oBAA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AAE,OAAO,GAAI,OAAO,cAAgB,aAAa,2DAA2D;AAAA,MAC5G,EAAE,OAAO,IAAI,OAAO,eAAgB,aAAa,4DAA4D;AAAA,IAC/G,CAAC;AACD,IAAC,MAAc,mBAAmB;AAAA,EACpC;AAGA,mCAAa,aAAM,gBAAgB;AAEnC,QAAM,gBAAgB,UAAM,4BAAY,IAAI,uCAAuC;AAAA,IACjF,EAAE,OAAO,OAAS,OAAO,OAAS,aAAa,yCAAoC;AAAA,IACnF,EAAE,OAAO,QAAS,OAAO,QAAS,aAAa,qCAAqC;AAAA,IACpF,EAAE,OAAO,QAAS,OAAO,QAAS,aAAa,yCAAyC;AAAA,IACxF,EAAE,OAAO,SAAS,OAAO,SAAS,aAAa,uDAAkD;AAAA,EACnG,CAAC;AACD,QAAM,cAAc;AAEpB,QAAM,oBAAoB,UAAM,4BAAY,IAAI,qDAAqD;AAAA,IACnG,EAAE,OAAO,OAAc,OAAO,OAAc,aAAa,yDAAyD;AAAA,IAClH,EAAE,OAAO,UAAc,OAAO,UAAc,aAAa,yDAAyD;AAAA,IAClH,EAAE,OAAO,cAAc,OAAO,cAAc,aAAa,kDAAkD;AAAA,IAC3G,EAAE,OAAO,SAAc,OAAO,SAAc,aAAa,iDAAiD;AAAA,EAC5G,CAAC;AACD,QAAM,wBAAwB;AAG9B,mCAAa,aAAM,QAAQ;AAE3B,EAAC,MAAc,eAAe,UAAM;AAAA,IAAU;AAAA,IAC5C;AAAA,IACA;AAAA,IACA;AAAA;AAAA,EACF;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -43,7 +43,7 @@ const HOOKS = [
43
43
  version: "1.0.0",
44
44
  description: "Sync the KiroGraph index when the agent stops, picking up any file edits, creates, or deletes from the session.",
45
45
  when: { type: "agentStop" },
46
- then: { type: "askAgent", prompt: "If any source file was created, edited, or deleted during this session, run kirograph_exec with command 'kirograph sync --quiet' to sync the index. If no files were changed, do nothing. Do not explain, just run the tool silently." }
46
+ then: { type: "runCommand", command: "kirograph sync --quiet 2>&1 > /dev/null" }
47
47
  }
48
48
  },
49
49
  {
@@ -58,6 +58,19 @@ const HOOKS = [
58
58
  prompt: "If this shell command is a git operation, GitHub CLI, test runner, linter, build tool, file listing, grep/rg, docker/kubectl, AWS CLI, or package manager command, consider using the kirograph_exec MCP tool instead for 60-90% token savings. The tool compresses output automatically while preserving error details."
59
59
  }
60
60
  }
61
+ },
62
+ {
63
+ filename: `kirograph-mem-capture${HOOK_EXT}`,
64
+ hook: {
65
+ name: "KiroGraph Memory Capture",
66
+ version: "1.0.0",
67
+ description: "Prompt the agent to store important observations in memory at the end of each session.",
68
+ when: { type: "agentStop" },
69
+ then: {
70
+ type: "askAgent",
71
+ prompt: "Before ending, review what happened in this session. If there were any important decisions, bug root causes, architecture insights, error patterns, or lessons learned, store them using kirograph_mem_store with the appropriate kind (decision, error, pattern, architecture, note). Keep observations concise \u2014 one fact per observation. Skip if nothing noteworthy happened."
72
+ }
73
+ }
61
74
  }
62
75
  ];
63
76
  function ensureDir(p) {
@@ -126,6 +139,7 @@ function writeHooks(kiroDir, opts) {
126
139
  "kirograph-sync-on-delete.json",
127
140
  "kirograph-sync-if-dirty.json",
128
141
  "kirograph-compress-hint.json",
142
+ "kirograph-mem-capture.json",
129
143
  // Removed per-file hooks (consolidated into agentStop sync)
130
144
  `kirograph-mark-dirty-on-save${HOOK_EXT}`,
131
145
  `kirograph-mark-dirty-on-create${HOOK_EXT}`,
@@ -141,6 +155,11 @@ function writeHooks(kiroDir, opts) {
141
155
  if (fs.existsSync(p)) fs.unlinkSync(p);
142
156
  continue;
143
157
  }
158
+ if (filename === `kirograph-mem-capture${HOOK_EXT}` && !opts?.enableMemory) {
159
+ const p = path.join(hooksDir, filename);
160
+ if (fs.existsSync(p)) fs.unlinkSync(p);
161
+ continue;
162
+ }
144
163
  writeJson(path.join(hooksDir, filename), hook);
145
164
  }
146
165
  console.log(` \u2713 Auto-sync hooks written to ${hooksDir}`);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/bin/installer/hooks.ts"],
4
- "sourcesContent": ["/**\n * KiroGraph Installer \u2014 Kiro hook file management\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { logWarn } from '../../errors';\n\n// \u2500\u2500 Constants \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\nconst HOOK_EXT = '.kiro.hook';\n\nconst HOOKS: Array<{ filename: string; hook: object }> = [\n {\n filename: `kirograph-sync-if-dirty${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Sync on Agent Stop',\n version: '1.0.0',\n description: 'Sync the KiroGraph index when the agent stops, picking up any file edits, creates, or deletes from the session.',\n when: { type: 'agentStop' },\n then: { type: 'askAgent', prompt: \"If any source file was created, edited, or deleted during this session, run kirograph_exec with command 'kirograph sync --quiet' to sync the index. If no files were changed, do nothing. Do not explain, just run the tool silently.\" },\n },\n },\n {\n filename: `kirograph-compress-hint${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Compression Hint',\n version: '1.0.0',\n description: 'Remind the agent to use kirograph_exec for shell commands that benefit from token compression (git, gh, test, lint, build, docker, aws, grep).',\n when: { type: 'preToolUse', toolTypes: ['shell'] },\n then: {\n type: 'askAgent',\n prompt: 'If this shell command is a git operation, GitHub CLI, test runner, linter, build tool, file listing, grep/rg, docker/kubectl, AWS CLI, or package manager command, consider using the kirograph_exec MCP tool instead for 60-90% token savings. The tool compresses output automatically while preserving error details.',\n },\n },\n },\n];\n\n// \u2500\u2500 Helpers \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\nfunction ensureDir(p: string): void {\n fs.mkdirSync(p, { recursive: true });\n}\n\nfunction writeJson(p: string, data: unknown): void {\n fs.writeFileSync(p, JSON.stringify(data, null, 2) + '\\n');\n}\n\nfunction migrateOnIdleHooks(hooksDir: string): void {\n if (!fs.existsSync(hooksDir)) return;\n let files: string[];\n try {\n files = fs.readdirSync(hooksDir).filter(f => f.endsWith('.json') || f.endsWith(HOOK_EXT));\n } catch {\n return;\n }\n for (const file of files) {\n const filePath = path.join(hooksDir, file);\n let raw: string;\n try {\n raw = fs.readFileSync(filePath, 'utf8');\n } catch {\n logWarn(`KiroGraph installer: could not read hook file ${filePath}`);\n continue;\n }\n let obj: any;\n try {\n obj = JSON.parse(raw);\n } catch {\n logWarn(`KiroGraph installer: could not parse hook file ${filePath}`);\n continue;\n }\n let changed = false;\n if (obj?.when?.type === 'onIdle') {\n obj.when.type = 'agentStop';\n changed = true;\n }\n // Migrate .json \u2192 .kiro.hook extension\n if (file.endsWith('.json') && file.startsWith('kirograph-')) {\n const newName = file.replace(/\\.json$/, HOOK_EXT);\n const newPath = path.join(hooksDir, newName);\n try {\n fs.writeFileSync(newPath, JSON.stringify(obj, null, 2) + '\\n');\n fs.unlinkSync(filePath);\n } catch {\n logWarn(`KiroGraph installer: could not migrate hook file ${filePath} \u2192 ${newName}`);\n }\n } else if (changed) {\n try {\n fs.writeFileSync(filePath, JSON.stringify(obj, null, 2) + '\\n');\n } catch {\n logWarn(`KiroGraph installer: could not write migrated hook file ${filePath}`);\n }\n }\n }\n}\n\n// \u2500\u2500 Public \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 function writeHooks(kiroDir: string, opts?: { enableCompression?: boolean }): void {\n const hooksDir = path.join(kiroDir, 'hooks');\n ensureDir(hooksDir);\n\n migrateOnIdleHooks(hooksDir);\n\n const oldHooks = [\n 'kirograph-sync-on-save.json', 'kirograph-sync-on-create.json',\n // Legacy .json versions (migrated to .kiro.hook)\n 'kirograph-mark-dirty-on-save.json', 'kirograph-mark-dirty-on-create.json',\n 'kirograph-sync-on-delete.json', 'kirograph-sync-if-dirty.json',\n 'kirograph-compress-hint.json',\n // Removed per-file hooks (consolidated into agentStop sync)\n `kirograph-mark-dirty-on-save${HOOK_EXT}`,\n `kirograph-mark-dirty-on-create${HOOK_EXT}`,\n `kirograph-sync-on-delete${HOOK_EXT}`,\n ];\n for (const old of oldHooks) {\n const p = path.join(hooksDir, old);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n }\n\n for (const { filename, hook } of HOOKS) {\n // Skip compression hook if compression is disabled\n if (filename === `kirograph-compress-hint${HOOK_EXT}` && opts?.enableCompression === false) {\n // Remove the hook file if it exists from a previous install\n const p = path.join(hooksDir, filename);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n continue;\n }\n writeJson(path.join(hooksDir, filename), hook);\n }\n\n console.log(` \u2713 Auto-sync hooks written to ${hooksDir}`);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;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QAAI,aAAa,0BAA0B,QAAQ,MAAM,MAAM,sBAAsB,OAAO;AAE1F,YAAM,IAAI,KAAK,KAAK,UAAU,QAAQ;AACtC,UAAI,GAAG,WAAW,CAAC,EAAG,IAAG,WAAW,CAAC;AACrC;AAAA,IACF;AACA,cAAU,KAAK,KAAK,UAAU,QAAQ,GAAG,IAAI;AAAA,EAC/C;AAEA,UAAQ,IAAI,uCAAkC,QAAQ,EAAE;AAC1D;",
4
+ "sourcesContent": ["/**\n * KiroGraph Installer \u2014 Kiro hook file management\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { logWarn } from '../../errors';\n\n// \u2500\u2500 Constants \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\nconst HOOK_EXT = '.kiro.hook';\n\nconst HOOKS: Array<{ filename: string; hook: object }> = [\n {\n filename: `kirograph-sync-if-dirty${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Sync on Agent Stop',\n version: '1.0.0',\n description: 'Sync the KiroGraph index when the agent stops, picking up any file edits, creates, or deletes from the session.',\n when: { type: 'agentStop' },\n then: { type: 'runCommand', command: 'kirograph sync --quiet 2>&1 > /dev/null' },\n },\n },\n {\n filename: `kirograph-compress-hint${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Compression Hint',\n version: '1.0.0',\n description: 'Remind the agent to use kirograph_exec for shell commands that benefit from token compression (git, gh, test, lint, build, docker, aws, grep).',\n when: { type: 'preToolUse', toolTypes: ['shell'] },\n then: {\n type: 'askAgent',\n prompt: 'If this shell command is a git operation, GitHub CLI, test runner, linter, build tool, file listing, grep/rg, docker/kubectl, AWS CLI, or package manager command, consider using the kirograph_exec MCP tool instead for 60-90% token savings. The tool compresses output automatically while preserving error details.',\n },\n },\n },\n {\n filename: `kirograph-mem-capture${HOOK_EXT}`,\n hook: {\n name: 'KiroGraph Memory Capture',\n version: '1.0.0',\n description: 'Prompt the agent to store important observations in memory at the end of each session.',\n when: { type: 'agentStop' },\n then: {\n type: 'askAgent',\n prompt: 'Before ending, review what happened in this session. If there were any important decisions, bug root causes, architecture insights, error patterns, or lessons learned, store them using kirograph_mem_store with the appropriate kind (decision, error, pattern, architecture, note). Keep observations concise \u2014 one fact per observation. Skip if nothing noteworthy happened.',\n },\n },\n },\n];\n\n// \u2500\u2500 Helpers \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\nfunction ensureDir(p: string): void {\n fs.mkdirSync(p, { recursive: true });\n}\n\nfunction writeJson(p: string, data: unknown): void {\n fs.writeFileSync(p, JSON.stringify(data, null, 2) + '\\n');\n}\n\nfunction migrateOnIdleHooks(hooksDir: string): void {\n if (!fs.existsSync(hooksDir)) return;\n let files: string[];\n try {\n files = fs.readdirSync(hooksDir).filter(f => f.endsWith('.json') || f.endsWith(HOOK_EXT));\n } catch {\n return;\n }\n for (const file of files) {\n const filePath = path.join(hooksDir, file);\n let raw: string;\n try {\n raw = fs.readFileSync(filePath, 'utf8');\n } catch {\n logWarn(`KiroGraph installer: could not read hook file ${filePath}`);\n continue;\n }\n let obj: any;\n try {\n obj = JSON.parse(raw);\n } catch {\n logWarn(`KiroGraph installer: could not parse hook file ${filePath}`);\n continue;\n }\n let changed = false;\n if (obj?.when?.type === 'onIdle') {\n obj.when.type = 'agentStop';\n changed = true;\n }\n // Migrate .json \u2192 .kiro.hook extension\n if (file.endsWith('.json') && file.startsWith('kirograph-')) {\n const newName = file.replace(/\\.json$/, HOOK_EXT);\n const newPath = path.join(hooksDir, newName);\n try {\n fs.writeFileSync(newPath, JSON.stringify(obj, null, 2) + '\\n');\n fs.unlinkSync(filePath);\n } catch {\n logWarn(`KiroGraph installer: could not migrate hook file ${filePath} \u2192 ${newName}`);\n }\n } else if (changed) {\n try {\n fs.writeFileSync(filePath, JSON.stringify(obj, null, 2) + '\\n');\n } catch {\n logWarn(`KiroGraph installer: could not write migrated hook file ${filePath}`);\n }\n }\n }\n}\n\n// \u2500\u2500 Public \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 function writeHooks(kiroDir: string, opts?: { enableCompression?: boolean; enableMemory?: boolean }): void {\n const hooksDir = path.join(kiroDir, 'hooks');\n ensureDir(hooksDir);\n\n migrateOnIdleHooks(hooksDir);\n\n const oldHooks = [\n 'kirograph-sync-on-save.json', 'kirograph-sync-on-create.json',\n // Legacy .json versions (migrated to .kiro.hook)\n 'kirograph-mark-dirty-on-save.json', 'kirograph-mark-dirty-on-create.json',\n 'kirograph-sync-on-delete.json', 'kirograph-sync-if-dirty.json',\n 'kirograph-compress-hint.json', 'kirograph-mem-capture.json',\n // Removed per-file hooks (consolidated into agentStop sync)\n `kirograph-mark-dirty-on-save${HOOK_EXT}`,\n `kirograph-mark-dirty-on-create${HOOK_EXT}`,\n `kirograph-sync-on-delete${HOOK_EXT}`,\n ];\n for (const old of oldHooks) {\n const p = path.join(hooksDir, old);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n }\n\n for (const { filename, hook } of HOOKS) {\n // Skip compression hook if compression is disabled\n if (filename === `kirograph-compress-hint${HOOK_EXT}` && opts?.enableCompression === false) {\n const p = path.join(hooksDir, filename);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n continue;\n }\n // Skip memory hook if memory is disabled\n if (filename === `kirograph-mem-capture${HOOK_EXT}` && !opts?.enableMemory) {\n const p = path.join(hooksDir, filename);\n if (fs.existsSync(p)) fs.unlinkSync(p);\n continue;\n }\n writeJson(path.join(hooksDir, filename), hook);\n }\n\n console.log(` \u2713 Auto-sync hooks written to ${hooksDir}`);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAoB;AACpB,WAAsB;AACtB,oBAAwB;AAIxB,MAAM,WAAW;AAEjB,MAAM,QAAmD;AAAA,EACvD;AAAA,IACE,UAAU,0BAA0B,QAAQ;AAAA,IAC5C,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM,EAAE,MAAM,YAAY;AAAA,MAC1B,MAAM,EAAE,MAAM,cAAc,SAAS,0CAA0C;AAAA,IACjF;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU,0BAA0B,QAAQ;AAAA,IAC5C,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,MAAM,EAAE,MAAM,cAAc,WAAW,CAAC,OAAO,EAAE;AAAA,MACjD,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU,wBAA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AU,QAAQ,GAAG,IAAI;AAAA,EAC/C;AAEA,UAAQ,IAAI,uCAAkC,QAAQ,EAAE;AAC1D;",
6
6
  "names": []
7
7
  }
@@ -52,8 +52,8 @@ async function runInstaller(target = "kiro") {
52
52
  const installer = (0, import_targets.getTargetInstaller)(target);
53
53
  console.log(` Workspace: ${cwd}
54
54
  `);
55
- const proceed = await (0, import_prompts.ask)(rl, ` Install KiroGraph for ${installer.label}? (Y/n) `);
56
- if (proceed.toLowerCase() === "n") {
55
+ const proceed = await (0, import_prompts.askToggle)(rl, `Install KiroGraph for ${installer.label}?`, "Registers the MCP server and writes integration files for this workspace.");
56
+ if (!proceed) {
57
57
  console.log(" Cancelled.");
58
58
  rl.close();
59
59
  return;
@@ -63,6 +63,8 @@ async function runInstaller(target = "kiro") {
63
63
  const alreadyInitialized = fs.existsSync(path.join(cwd, ".kirograph"));
64
64
  let cavemanMode = "off";
65
65
  let shellCompressionLevel = "normal";
66
+ let enableMemory = false;
67
+ let enableDocs = false;
66
68
  let shouldOfferIndex = false;
67
69
  let typesenseDashboard = false;
68
70
  let qdrantDashboard = false;
@@ -71,18 +73,24 @@ async function runInstaller(target = "kiro") {
71
73
  const config = await (0, import_config.loadConfig)(cwd);
72
74
  cavemanMode = config.cavemanMode ?? "off";
73
75
  shellCompressionLevel = config.shellCompressionLevel ?? "normal";
76
+ enableMemory = config.enableMemory ?? false;
77
+ enableDocs = config.enableDocs ?? false;
74
78
  console.log(` \u2713 Reusing existing KiroGraph data in ${cwd}/.kirograph/`);
75
79
  console.log(` \u2022 semanticEngine: ${config.semanticEngine}`);
76
80
  console.log(` \u2022 enableEmbeddings: ${config.enableEmbeddings}`);
77
81
  console.log(` \u2022 enableArchitecture: ${config.enableArchitecture}`);
78
82
  console.log(` \u2022 cavemanMode: ${cavemanMode}`);
79
83
  console.log(` \u2022 shellCompressionLevel: ${shellCompressionLevel}`);
84
+ console.log(` \u2022 enableMemory: ${enableMemory}`);
85
+ console.log(` \u2022 enableDocs: ${enableDocs}`);
80
86
  } else {
81
87
  shouldOfferIndex = true;
82
88
  const patch = await (0, import_config_prompt.promptConfigOptions)(rl);
83
89
  await (0, import_config.updateConfig)(cwd, patch);
84
90
  cavemanMode = patch.cavemanMode ?? "off";
85
91
  shellCompressionLevel = patch.shellCompressionLevel ?? "normal";
92
+ enableMemory = patch.enableMemory ?? false;
93
+ enableDocs = patch.enableDocs ?? false;
86
94
  typesenseDashboard = patch.typesenseDashboard;
87
95
  qdrantDashboard = patch.qdrantDashboard;
88
96
  console.log(`
@@ -161,8 +169,10 @@ async function runInstaller(target = "kiro") {
161
169
  console.log(` \u2022 enableArchitecture: ${patch.enableArchitecture}`);
162
170
  console.log(` \u2022 cavemanMode: ${cavemanMode}`);
163
171
  console.log(` \u2022 shellCompressionLevel: ${shellCompressionLevel}`);
172
+ console.log(` \u2022 enableMemory: ${enableMemory}`);
173
+ console.log(` \u2022 enableDocs: ${enableDocs}`);
164
174
  }
165
- installer.installLate(cwd, cavemanMode, shellCompressionLevel);
175
+ installer.installLate(cwd, cavemanMode, shellCompressionLevel, enableMemory, enableDocs);
166
176
  } catch (err) {
167
177
  const reason = err instanceof Error ? err.message : String(err);
168
178
  console.error(`
@@ -172,7 +182,7 @@ async function runInstaller(target = "kiro") {
172
182
  if (qdrantDashboard) {
173
183
  await (0, import_qdrant_dashboard.ensureQdrantUI)(cwd);
174
184
  }
175
- if (shouldOfferIndex && (await (0, import_prompts.ask)(rl, "\n Initialize and index this project now? (Y/n) ")).toLowerCase() !== "n") {
185
+ if (shouldOfferIndex && await (0, import_prompts.askToggle)(rl, "Initialize and index this project now?", "Creates .kirograph/ and indexes all source files. Takes a few seconds for small projects, longer for large ones.")) {
176
186
  const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
177
187
  const fileBytes = /* @__PURE__ */ new Map();
178
188
  const modelProgress = (file, loaded, total, done) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/bin/installer/index.ts"],
4
- "sourcesContent": ["/**\n * KiroGraph Installer\n *\n * The default target wires up Kiro:\n * 1. .kiro/settings/mcp.json \u2014 registers the MCP server (IDE + CLI)\n * 2. .kiro/hooks/*.json \u2014 auto-sync hooks for Kiro IDE\n * 3. .kiro/steering/kirograph.md \u2014 teaches Kiro to use the graph tools (IDE + CLI)\n * 4. .kiro/agents/kirograph.json \u2014 custom agent config for Kiro CLI\n */\n\nimport * as readline from 'readline';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { spawnSync } from 'child_process';\nimport { loadConfig, updateConfig } from '../../config';\nimport { printBanner } from '../banner';\nimport { renderIndexProgress } from '../progress';\nimport { dim, reset } from '../ui';\nimport { ask } from './prompts';\nimport { promptConfigOptions } from './config-prompt';\nimport { openTypesenseDashboard } from './dashboard';\nimport { ensureQdrantUI, openQdrantDashboard } from './qdrant-dashboard';\nimport type { InstallTarget } from './common';\nimport { getTargetInstaller } from './targets';\nimport type { CavemanMode } from './caveman';\n\nexport async function runInstaller(target: InstallTarget = 'kiro'): Promise<void> {\n printBanner();\n\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n\n try {\n const cwd = process.cwd();\n const installer = getTargetInstaller(target);\n\n console.log(` Workspace: ${cwd}\\n`);\n\n const proceed = await ask(rl, ` Install KiroGraph for ${installer.label}? (Y/n) `);\n if (proceed.toLowerCase() === 'n') { console.log(' Cancelled.'); rl.close(); return; }\n console.log();\n\n installer.installEarly(cwd);\n\n const alreadyInitialized = fs.existsSync(path.join(cwd, '.kirograph'));\n let cavemanMode: CavemanMode | 'off' = 'off';\n let shellCompressionLevel: 'off' | 'normal' | 'aggressive' | 'ultra' = 'normal';\n let shouldOfferIndex = false;\n let typesenseDashboard = false;\n let qdrantDashboard = false;\n\n try {\n if (alreadyInitialized) {\n const config = await loadConfig(cwd);\n cavemanMode = config.cavemanMode ?? 'off';\n shellCompressionLevel = config.shellCompressionLevel ?? 'normal';\n console.log(` \u2713 Reusing existing KiroGraph data in ${cwd}/.kirograph/`);\n console.log(` \u2022 semanticEngine: ${config.semanticEngine}`);\n console.log(` \u2022 enableEmbeddings: ${config.enableEmbeddings}`);\n console.log(` \u2022 enableArchitecture: ${config.enableArchitecture}`);\n console.log(` \u2022 cavemanMode: ${cavemanMode}`);\n console.log(` \u2022 shellCompressionLevel: ${shellCompressionLevel}`);\n } else {\n shouldOfferIndex = true;\n const patch = await promptConfigOptions(rl);\n await updateConfig(cwd, patch);\n cavemanMode = patch.cavemanMode ?? 'off';\n shellCompressionLevel = patch.shellCompressionLevel ?? 'normal';\n typesenseDashboard = patch.typesenseDashboard;\n qdrantDashboard = patch.qdrantDashboard;\n\n console.log(`\\n Configuration saved to ${cwd}/.kirograph/config.json`);\n console.log(` \u2022 enableEmbeddings: ${patch.enableEmbeddings}`);\n if ('embeddingModel' in patch) {\n console.log(` \u2022 embeddingModel: ${patch.embeddingModel} ${dim}(${patch.embeddingDim}-dim)${reset}`);\n }\n if (patch.enableEmbeddings) {\n console.log(` \u2022 semanticEngine: ${patch.semanticEngine}`);\n if (patch.semanticEngine === 'sqlite-vec') {\n console.log(`\\n Installing sqlite-vec dependencies...`);\n const result = spawnSync('npm', ['install', 'better-sqlite3', 'sqlite-vec'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 better-sqlite3 and sqlite-vec installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install better-sqlite3 sqlite-vec`);\n }\n } else if (patch.semanticEngine === 'orama') {\n console.log(`\\n Installing Orama dependencies...`);\n const result = spawnSync('npm', ['install', '@orama/orama', '@orama/plugin-data-persistence'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @orama/orama and @orama/plugin-data-persistence installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @orama/orama @orama/plugin-data-persistence`);\n }\n } else if (patch.semanticEngine === 'pglite') {\n console.log(`\\n Installing PGlite dependencies...`);\n const result = spawnSync('npm', ['install', '@electric-sql/pglite'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @electric-sql/pglite installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @electric-sql/pglite`);\n }\n } else if (patch.semanticEngine === 'lancedb') {\n console.log(`\\n Installing LanceDB dependencies...`);\n const result = spawnSync('npm', ['install', '@lancedb/lancedb'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @lancedb/lancedb installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @lancedb/lancedb`);\n }\n } else if (patch.semanticEngine === 'qdrant') {\n console.log(`\\n Installing Qdrant dependencies...`);\n const result = spawnSync('npm', ['install', 'qdrant-local'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 qdrant-local installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install qdrant-local`);\n }\n } else if (patch.semanticEngine === 'typesense') {\n console.log(`\\n Installing Typesense dependencies...`);\n const result = spawnSync('npm', ['install', 'typesense'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 typesense installed`);\n console.log(` \u2139 The Typesense binary (~37MB) will be auto-downloaded on first index run.`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install typesense`);\n }\n }\n }\n console.log(` \u2022 extractDocstrings: ${patch.extractDocstrings}`);\n console.log(` \u2022 trackCallSites: ${patch.trackCallSites}`);\n console.log(` \u2022 enableArchitecture: ${patch.enableArchitecture}`);\n console.log(` \u2022 cavemanMode: ${cavemanMode}`);\n console.log(` \u2022 shellCompressionLevel: ${shellCompressionLevel}`);\n }\n\n installer.installLate(cwd, cavemanMode, shellCompressionLevel);\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err);\n console.error(`\\n \u2717 Failed to write configuration: ${reason}`);\n process.exit(1);\n }\n\n // 5. Pre-download Qdrant UI before indexing so Qdrant starts with static content dir\n if (qdrantDashboard) {\n await ensureQdrantUI(cwd);\n }\n\n // 6. Optionally init + index\n if (shouldOfferIndex && (await ask(rl, '\\n Initialize and index this project now? (Y/n) ')).toLowerCase() !== 'n') {\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const fileBytes = new Map<string, { loaded: number; total: number }>();\n const modelProgress = (file: string, loaded: number, total: number, done: boolean): void => {\n const entry = fileBytes.get(file) ?? { loaded: 0, total: 0 };\n if (total > 0) entry.total = total;\n entry.loaded = done ? entry.total : loaded;\n fileBytes.set(file, entry);\n\n // Only count files where we know the size (content-length was present)\n const knownFiles = Array.from(fileBytes.values()).filter(f => f.total > 0);\n const totalLoaded = knownFiles.reduce((s, f) => s + f.loaded, 0);\n const totalBytes = knownFiles.reduce((s, f) => s + f.total, 0);\n const pct = totalBytes > 0 ? Math.min((totalLoaded / totalBytes) * 100, 100) : 0;\n\n const filled = Math.round(pct / 5);\n const bar = '\u2588'.repeat(filled) + '\u2591'.repeat(20 - filled);\n const mb = (totalLoaded / 1024 / 1024).toFixed(1);\n const totalMb = (totalBytes / 1024 / 1024).toFixed(1);\n process.stdout.write(`\\r [${bar}] ${pct.toFixed(0).padStart(3)}% ${mb} / ${totalMb} MB `);\n };\n\n // Suppress noisy internal warnings from @huggingface/transformers during download\n const originalStderrWrite = process.stderr.write.bind(process.stderr);\n const stderrFilter = (chunk: unknown, ...args: unknown[]): boolean => {\n const str = typeof chunk === 'string' ? chunk : String(chunk);\n if (str.includes('content-length') || str.includes('dtype not specified')) return true;\n return (originalStderrWrite as (...a: unknown[]) => boolean)(chunk, ...args);\n };\n process.stderr.write = stderrFilter as typeof process.stderr.write;\n\n let cg;\n try {\n if (!KiroGraph.isInitialized(cwd)) {\n process.stdout.write(' Downloading embedding model\u2026\\n');\n cg = await KiroGraph.init(cwd, undefined, modelProgress);\n process.stdout.write('\\n');\n console.log(' \u2713 Created .kirograph/');\n } else {\n cg = await KiroGraph.open(cwd, modelProgress);\n if (fileBytes.size > 0) process.stdout.write('\\n');\n }\n } finally {\n process.stderr.write = originalStderrWrite;\n }\n console.log(' Indexing...');\n const result = await cg.indexAll({ onProgress: renderIndexProgress });\n process.stdout.write('\\n');\n console.log(` \u2713 Indexed ${result.filesIndexed} files, ${result.nodesCreated} symbols, ${result.edgesCreated} edges`);\n cg.close();\n\n if (typesenseDashboard) {\n const dashboardServer = await openTypesenseDashboard(cwd);\n console.log(` ${dim}Press Ctrl+C to stop the dashboard server when done.${reset}`);\n await new Promise<void>(resolve => {\n process.on('SIGINT', () => {\n if (dashboardServer) {\n dashboardServer.close(() => resolve());\n } else {\n resolve();\n }\n });\n });\n return; // rl.close() handled in finally\n }\n\n if (qdrantDashboard) {\n await openQdrantDashboard(cwd);\n }\n }\n\n installer.printNextSteps(cwd);\n } finally {\n rl.close();\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,eAA0B;AAC1B,SAAoB;AACpB,WAAsB;AACtB,2BAA0B;AAC1B,oBAAyC;AACzC,oBAA4B;AAC5B,sBAAoC;AACpC,gBAA2B;AAC3B,qBAAoB;AACpB,2BAAoC;AACpC,uBAAuC;AACvC,8BAAoD;AAEpD,qBAAmC;AAGnC,eAAsB,aAAa,SAAwB,QAAuB;AAChF,iCAAY;AAEZ,QAAM,KAAK,SAAS,gBAAgB,EAAE,OAAO,QAAQ,OAAO,QAAQ,QAAQ,OAAO,CAAC;AAEpF,MAAI;AACF,UAAM,MAAM,QAAQ,IAAI;AACxB,UAAM,gBAAY,mCAAmB,MAAM;AAE3C,YAAQ,IAAI,gBAAgB,GAAG;AAAA,CAAI;AAEnC,UAAM,UAAU,UAAM,oBAAI,IAAI,2BAA2B,UAAU,KAAK,UAAU;AAClF,QAAI,QAAQ,YAAY,MAAM,KAAK;AAAE,c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AEA,cAAU,eAAe,GAAG;AAAA,EAC9B,UAAE;AACA,OAAG,MAAM;AAAA,EACX;AACF;",
4
+ "sourcesContent": ["/**\n * KiroGraph Installer\n *\n * The default target wires up Kiro:\n * 1. .kiro/settings/mcp.json \u2014 registers the MCP server (IDE + CLI)\n * 2. .kiro/hooks/*.kiro.hook \u2014 auto-sync hooks for Kiro IDE\n * 3. .kiro/steering/kirograph.md \u2014 teaches Kiro to use the graph tools (IDE + CLI)\n * 4. .kiro/agents/kirograph.json \u2014 custom agent config for Kiro CLI\n */\n\nimport * as readline from 'readline';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { spawnSync } from 'child_process';\nimport { loadConfig, updateConfig } from '../../config';\nimport { printBanner } from '../banner';\nimport { renderIndexProgress } from '../progress';\nimport { dim, reset } from '../ui';\nimport { ask, askToggle } from './prompts';\nimport { promptConfigOptions } from './config-prompt';\nimport { openTypesenseDashboard } from './dashboard';\nimport { ensureQdrantUI, openQdrantDashboard } from './qdrant-dashboard';\nimport type { InstallTarget } from './common';\nimport { getTargetInstaller } from './targets';\nimport type { CavemanMode } from './caveman';\n\nexport async function runInstaller(target: InstallTarget = 'kiro'): Promise<void> {\n printBanner();\n\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n\n try {\n const cwd = process.cwd();\n const installer = getTargetInstaller(target);\n\n console.log(` Workspace: ${cwd}\\n`);\n\n const proceed = await askToggle(rl, `Install KiroGraph for ${installer.label}?`, 'Registers the MCP server and writes integration files for this workspace.');\n if (!proceed) { console.log(' Cancelled.'); rl.close(); return; }\n console.log();\n\n installer.installEarly(cwd);\n\n const alreadyInitialized = fs.existsSync(path.join(cwd, '.kirograph'));\n let cavemanMode: CavemanMode | 'off' = 'off';\n let shellCompressionLevel: 'off' | 'normal' | 'aggressive' | 'ultra' = 'normal';\n let enableMemory = false;\n let enableDocs = false;\n let shouldOfferIndex = false;\n let typesenseDashboard = false;\n let qdrantDashboard = false;\n\n try {\n if (alreadyInitialized) {\n const config = await loadConfig(cwd);\n cavemanMode = config.cavemanMode ?? 'off';\n shellCompressionLevel = config.shellCompressionLevel ?? 'normal';\n enableMemory = config.enableMemory ?? false;\n enableDocs = config.enableDocs ?? false;\n console.log(` \u2713 Reusing existing KiroGraph data in ${cwd}/.kirograph/`);\n console.log(` \u2022 semanticEngine: ${config.semanticEngine}`);\n console.log(` \u2022 enableEmbeddings: ${config.enableEmbeddings}`);\n console.log(` \u2022 enableArchitecture: ${config.enableArchitecture}`);\n console.log(` \u2022 cavemanMode: ${cavemanMode}`);\n console.log(` \u2022 shellCompressionLevel: ${shellCompressionLevel}`);\n console.log(` \u2022 enableMemory: ${enableMemory}`);\n console.log(` \u2022 enableDocs: ${enableDocs}`);\n } else {\n shouldOfferIndex = true;\n const patch = await promptConfigOptions(rl);\n await updateConfig(cwd, patch);\n cavemanMode = patch.cavemanMode ?? 'off';\n shellCompressionLevel = patch.shellCompressionLevel ?? 'normal';\n enableMemory = patch.enableMemory ?? false;\n enableDocs = patch.enableDocs ?? false;\n typesenseDashboard = patch.typesenseDashboard;\n qdrantDashboard = patch.qdrantDashboard;\n\n console.log(`\\n Configuration saved to ${cwd}/.kirograph/config.json`);\n console.log(` \u2022 enableEmbeddings: ${patch.enableEmbeddings}`);\n if ('embeddingModel' in patch) {\n console.log(` \u2022 embeddingModel: ${patch.embeddingModel} ${dim}(${patch.embeddingDim}-dim)${reset}`);\n }\n if (patch.enableEmbeddings) {\n console.log(` \u2022 semanticEngine: ${patch.semanticEngine}`);\n if (patch.semanticEngine === 'sqlite-vec') {\n console.log(`\\n Installing sqlite-vec dependencies...`);\n const result = spawnSync('npm', ['install', 'better-sqlite3', 'sqlite-vec'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 better-sqlite3 and sqlite-vec installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install better-sqlite3 sqlite-vec`);\n }\n } else if (patch.semanticEngine === 'orama') {\n console.log(`\\n Installing Orama dependencies...`);\n const result = spawnSync('npm', ['install', '@orama/orama', '@orama/plugin-data-persistence'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @orama/orama and @orama/plugin-data-persistence installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @orama/orama @orama/plugin-data-persistence`);\n }\n } else if (patch.semanticEngine === 'pglite') {\n console.log(`\\n Installing PGlite dependencies...`);\n const result = spawnSync('npm', ['install', '@electric-sql/pglite'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @electric-sql/pglite installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @electric-sql/pglite`);\n }\n } else if (patch.semanticEngine === 'lancedb') {\n console.log(`\\n Installing LanceDB dependencies...`);\n const result = spawnSync('npm', ['install', '@lancedb/lancedb'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 @lancedb/lancedb installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install @lancedb/lancedb`);\n }\n } else if (patch.semanticEngine === 'qdrant') {\n console.log(`\\n Installing Qdrant dependencies...`);\n const result = spawnSync('npm', ['install', 'qdrant-local'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 qdrant-local installed`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install qdrant-local`);\n }\n } else if (patch.semanticEngine === 'typesense') {\n console.log(`\\n Installing Typesense dependencies...`);\n const result = spawnSync('npm', ['install', 'typesense'], { stdio: 'inherit', shell: true });\n if (result.status === 0) {\n console.log(` \u2713 typesense installed`);\n console.log(` \u2139 The Typesense binary (~37MB) will be auto-downloaded on first index run.`);\n } else {\n console.warn(` \u2717 npm install failed (exit ${result.status}). Run manually:`);\n console.warn(` npm install typesense`);\n }\n }\n }\n console.log(` \u2022 extractDocstrings: ${patch.extractDocstrings}`);\n console.log(` \u2022 trackCallSites: ${patch.trackCallSites}`);\n console.log(` \u2022 enableArchitecture: ${patch.enableArchitecture}`);\n console.log(` \u2022 cavemanMode: ${cavemanMode}`);\n console.log(` \u2022 shellCompressionLevel: ${shellCompressionLevel}`);\n console.log(` \u2022 enableMemory: ${enableMemory}`);\n console.log(` \u2022 enableDocs: ${enableDocs}`);\n }\n\n installer.installLate(cwd, cavemanMode, shellCompressionLevel, enableMemory, enableDocs);\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err);\n console.error(`\\n \u2717 Failed to write configuration: ${reason}`);\n process.exit(1);\n }\n\n // 5. Pre-download Qdrant UI before indexing so Qdrant starts with static content dir\n if (qdrantDashboard) {\n await ensureQdrantUI(cwd);\n }\n\n // 6. Optionally init + index\n if (shouldOfferIndex && await askToggle(rl, 'Initialize and index this project now?', 'Creates .kirograph/ and indexes all source files. Takes a few seconds for small projects, longer for large ones.')) {\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const fileBytes = new Map<string, { loaded: number; total: number }>();\n const modelProgress = (file: string, loaded: number, total: number, done: boolean): void => {\n const entry = fileBytes.get(file) ?? { loaded: 0, total: 0 };\n if (total > 0) entry.total = total;\n entry.loaded = done ? entry.total : loaded;\n fileBytes.set(file, entry);\n\n // Only count files where we know the size (content-length was present)\n const knownFiles = Array.from(fileBytes.values()).filter(f => f.total > 0);\n const totalLoaded = knownFiles.reduce((s, f) => s + f.loaded, 0);\n const totalBytes = knownFiles.reduce((s, f) => s + f.total, 0);\n const pct = totalBytes > 0 ? Math.min((totalLoaded / totalBytes) * 100, 100) : 0;\n\n const filled = Math.round(pct / 5);\n const bar = '\u2588'.repeat(filled) + '\u2591'.repeat(20 - filled);\n const mb = (totalLoaded / 1024 / 1024).toFixed(1);\n const totalMb = (totalBytes / 1024 / 1024).toFixed(1);\n process.stdout.write(`\\r [${bar}] ${pct.toFixed(0).padStart(3)}% ${mb} / ${totalMb} MB `);\n };\n\n // Suppress noisy internal warnings from @huggingface/transformers during download\n const originalStderrWrite = process.stderr.write.bind(process.stderr);\n const stderrFilter = (chunk: unknown, ...args: unknown[]): boolean => {\n const str = typeof chunk === 'string' ? chunk : String(chunk);\n if (str.includes('content-length') || str.includes('dtype not specified')) return true;\n return (originalStderrWrite as (...a: unknown[]) => boolean)(chunk, ...args);\n };\n process.stderr.write = stderrFilter as typeof process.stderr.write;\n\n let cg;\n try {\n if (!KiroGraph.isInitialized(cwd)) {\n process.stdout.write(' Downloading embedding model\u2026\\n');\n cg = await KiroGraph.init(cwd, undefined, modelProgress);\n process.stdout.write('\\n');\n console.log(' \u2713 Created .kirograph/');\n } else {\n cg = await KiroGraph.open(cwd, modelProgress);\n if (fileBytes.size > 0) process.stdout.write('\\n');\n }\n } finally {\n process.stderr.write = originalStderrWrite;\n }\n console.log(' Indexing...');\n const result = await cg.indexAll({ onProgress: renderIndexProgress });\n process.stdout.write('\\n');\n console.log(` \u2713 Indexed ${result.filesIndexed} files, ${result.nodesCreated} symbols, ${result.edgesCreated} edges`);\n cg.close();\n\n if (typesenseDashboard) {\n const dashboardServer = await openTypesenseDashboard(cwd);\n console.log(` ${dim}Press Ctrl+C to stop the dashboard server when done.${reset}`);\n await new Promise<void>(resolve => {\n process.on('SIGINT', () => {\n if (dashboardServer) {\n dashboardServer.close(() => resolve());\n } else {\n resolve();\n }\n });\n });\n return; // rl.close() handled in finally\n }\n\n if (qdrantDashboard) {\n await openQdrantDashboard(cwd);\n }\n }\n\n installer.printNextSteps(cwd);\n } finally {\n rl.close();\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,eAA0B;AAC1B,SAAoB;AACpB,WAAsB;AACtB,2BAA0B;AAC1B,oBAAyC;AACzC,oBAA4B;AAC5B,sBAAoC;AACpC,gBAA2B;AAC3B,qBAA+B;AAC/B,2BAAoC;AACpC,uBAAuC;AACvC,8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AM,IAAI;AAAA,QACnD;AAAA,MACF,UAAE;AACA,gBAAQ,OAAO,QAAQ;AAAA,MACzB;AACA,cAAQ,IAAI,eAAe;AAC3B,YAAM,SAAS,MAAM,GAAG,SAAS,EAAE,YAAY,oCAAoB,CAAC;AACpE,cAAQ,OAAO,MAAM,IAAI;AACzB,cAAQ,IAAI,oBAAe,OAAO,YAAY,WAAW,OAAO,YAAY,aAAa,OAAO,YAAY,QAAQ;AACpH,SAAG,MAAM;AAET,UAAI,oBAAoB;AACtB,cAAM,kBAAkB,UAAM,yCAAuB,GAAG;AACxD,gBAAQ,IAAI,KAAK,aAAG,uDAAuD,eAAK,EAAE;AAClF,cAAM,IAAI,QAAc,aAAW;AACjC,kBAAQ,GAAG,UAAU,MAAM;AACzB,gBAAI,iBAAiB;AACnB,8BAAgB,MAAM,MAAM,QAAQ,CAAC;AAAA,YACvC,OAAO;AACL,sBAAQ;AAAA,YACV;AAAA,UACF,CAAC;AAAA,QACH,CAAC;AACD;AAAA,MACF;AAEA,UAAI,iBAAiB;AACnB,kBAAM,6CAAoB,GAAG;AAAA,MAC/B;AAAA,IACF;AAEA,cAAU,eAAe,GAAG;AAAA,EAC9B,UAAE;AACA,OAAG,MAAM;AAAA,EACX;AACF;",
6
6
  "names": []
7
7
  }
@@ -22,7 +22,11 @@ __export(prompts_exports, {
22
22
  ask: () => ask,
23
23
  askBool: () => askBool,
24
24
  askString: () => askString,
25
+ askToggle: () => askToggle,
25
26
  dim: () => dim,
27
+ printFeature: () => printFeature,
28
+ printSection: () => printSection,
29
+ printSeparator: () => printSeparator,
26
30
  reset: () => reset,
27
31
  violet: () => violet
28
32
  });
@@ -32,6 +36,8 @@ const reset = "\x1B[0m";
32
36
  const dim = "\x1B[2m";
33
37
  const bold = "\x1B[1m";
34
38
  const green = "\x1B[32m";
39
+ const yellow = "\x1B[33m";
40
+ const cyan = "\x1B[36m";
35
41
  function ask(rl, question) {
36
42
  return new Promise((resolve) => rl.question(question, resolve));
37
43
  }
@@ -47,12 +53,32 @@ async function askBool(rl, question, description, defaultYes = true) {
47
53
  console.log(` Please enter y or n.`);
48
54
  }
49
55
  }
56
+ async function askToggle(rl, label, description, defaultEnabled = true) {
57
+ return arrowSelect(rl, label, [
58
+ { value: true, label: "yes", description },
59
+ { value: false, label: "no", description: "Skip" }
60
+ ], defaultEnabled ? 0 : 1);
61
+ }
50
62
  async function askString(rl, question, description, defaultValue) {
51
63
  console.log(`
52
64
  ${dim}${description}${reset}`);
53
65
  const raw = await ask(rl, ` ${violet}${question}${reset} ${dim}(${defaultValue})${reset} `);
54
66
  return raw === "" ? defaultValue : raw;
55
67
  }
68
+ function printSection(icon, title) {
69
+ console.log(`
70
+ ${violet}${bold}${icon} ${title}${reset}`);
71
+ console.log(` ${violet}${"\u2500".repeat(title.length + 4)}${reset}`);
72
+ }
73
+ function printSeparator() {
74
+ console.log(`
75
+ ${dim}${"\xB7".repeat(50)}${reset}`);
76
+ }
77
+ function printFeature(enabled, label) {
78
+ const icon = enabled ? `${green}\u2713${reset}` : `${dim}\u2717${reset}`;
79
+ const text = enabled ? label : `${dim}${label}${reset}`;
80
+ console.log(` ${icon} ${text}`);
81
+ }
56
82
  async function arrowSelect(rl, label, options, defaultIndex = 0) {
57
83
  const CURSOR_UP = "\x1B[A";
58
84
  const CURSOR_DOWN = "\x1B[B";
@@ -101,15 +127,16 @@ async function arrowSelect(rl, label, options, defaultIndex = 0) {
101
127
  if (wasTTY) stdin.setRawMode(false);
102
128
  stdin.pause();
103
129
  rl.resume();
130
+ const totalLines = options.length + prevDescLines + 2;
104
131
  process.stdout.write(`\x1B[${options.length + prevDescLines}A`);
105
- for (let i = 0; i < options.length; i++) {
106
- const active = i === selected;
107
- const cursor = active ? `${green}${bold}\u276F${reset}` : " ";
108
- const text = active ? `${green}${bold}${options[i].label}${reset}` : `${dim}${options[i].label}${reset}`;
109
- process.stdout.write(`${CLEAR_LINE} ${cursor} ${text}
132
+ process.stdout.write(`\x1B[1A`);
133
+ process.stdout.write(`\x1B[1A`);
134
+ for (let i = 0; i < totalLines; i++) {
135
+ process.stdout.write(`${CLEAR_LINE}
110
136
  `);
111
137
  }
112
- process.stdout.write(`${CLEAR_LINE}
138
+ process.stdout.write(`\x1B[${totalLines}A`);
139
+ process.stdout.write(`${CLEAR_LINE} ${green}${bold}\u2713${reset} ${label} ${green}${bold}${options[selected].label}${reset}
113
140
  `);
114
141
  resolve(options[selected].value);
115
142
  } else if (key === "") {
@@ -127,7 +154,11 @@ async function arrowSelect(rl, label, options, defaultIndex = 0) {
127
154
  ask,
128
155
  askBool,
129
156
  askString,
157
+ askToggle,
130
158
  dim,
159
+ printFeature,
160
+ printSection,
161
+ printSeparator,
131
162
  reset,
132
163
  violet
133
164
  });