kirograph 0.14.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +239 -20
  3. package/dist/assets/logo.png +0 -0
  4. package/dist/bin/commands/docs.js +357 -0
  5. package/dist/bin/commands/docs.js.map +7 -0
  6. package/dist/bin/commands/help.js +3 -0
  7. package/dist/bin/commands/help.js.map +2 -2
  8. package/dist/bin/commands/uninit.js +10 -13
  9. package/dist/bin/commands/uninit.js.map +2 -2
  10. package/dist/bin/installer/config-prompt.js +53 -23
  11. package/dist/bin/installer/config-prompt.js.map +2 -2
  12. package/dist/bin/installer/hooks.js +20 -1
  13. package/dist/bin/installer/hooks.js.map +2 -2
  14. package/dist/bin/installer/index.js +14 -4
  15. package/dist/bin/installer/index.js.map +2 -2
  16. package/dist/bin/installer/prompts.js +37 -6
  17. package/dist/bin/installer/prompts.js.map +2 -2
  18. package/dist/bin/installer/steering.js +40 -0
  19. package/dist/bin/installer/steering.js.map +2 -2
  20. package/dist/bin/installer/targets/aider.js +72 -0
  21. package/dist/bin/installer/targets/aider.js.map +7 -0
  22. package/dist/bin/installer/targets/amp.js +91 -0
  23. package/dist/bin/installer/targets/amp.js.map +7 -0
  24. package/dist/bin/installer/targets/antigravity.js +109 -0
  25. package/dist/bin/installer/targets/antigravity.js.map +7 -0
  26. package/dist/bin/installer/targets/augment.js +81 -0
  27. package/dist/bin/installer/targets/augment.js.map +7 -0
  28. package/dist/bin/installer/targets/claude.js +1 -1
  29. package/dist/bin/installer/targets/claude.js.map +2 -2
  30. package/dist/bin/installer/targets/cline.js +91 -0
  31. package/dist/bin/installer/targets/cline.js.map +7 -0
  32. package/dist/bin/installer/targets/codex.js +1 -1
  33. package/dist/bin/installer/targets/codex.js.map +2 -2
  34. package/dist/bin/installer/targets/continue.js +107 -0
  35. package/dist/bin/installer/targets/continue.js.map +7 -0
  36. package/dist/bin/installer/targets/copilot.js +123 -0
  37. package/dist/bin/installer/targets/copilot.js.map +7 -0
  38. package/dist/bin/installer/targets/cursor.js +143 -0
  39. package/dist/bin/installer/targets/cursor.js.map +7 -0
  40. package/dist/bin/installer/targets/devin.js +148 -0
  41. package/dist/bin/installer/targets/devin.js.map +7 -0
  42. package/dist/bin/installer/targets/gemini-cli.js +126 -0
  43. package/dist/bin/installer/targets/gemini-cli.js.map +7 -0
  44. package/dist/bin/installer/targets/generic.js +120 -0
  45. package/dist/bin/installer/targets/generic.js.map +7 -0
  46. package/dist/bin/installer/targets/goose.js +72 -0
  47. package/dist/bin/installer/targets/goose.js.map +7 -0
  48. package/dist/bin/installer/targets/index.js.map +1 -1
  49. package/dist/bin/installer/targets/junie.js +105 -0
  50. package/dist/bin/installer/targets/junie.js.map +7 -0
  51. package/dist/bin/installer/targets/kilo.js +122 -0
  52. package/dist/bin/installer/targets/kilo.js.map +7 -0
  53. package/dist/bin/installer/targets/kiro.js +3 -3
  54. package/dist/bin/installer/targets/kiro.js.map +2 -2
  55. package/dist/bin/installer/targets/opencode.js +135 -0
  56. package/dist/bin/installer/targets/opencode.js.map +7 -0
  57. package/dist/bin/installer/targets/openhands.js +90 -0
  58. package/dist/bin/installer/targets/openhands.js.map +7 -0
  59. package/dist/bin/installer/targets/replit.js +72 -0
  60. package/dist/bin/installer/targets/replit.js.map +7 -0
  61. package/dist/bin/installer/targets/roo.js +96 -0
  62. package/dist/bin/installer/targets/roo.js.map +7 -0
  63. package/dist/bin/installer/targets/tabnine.js +82 -0
  64. package/dist/bin/installer/targets/tabnine.js.map +7 -0
  65. package/dist/bin/installer/targets/trae.js +84 -0
  66. package/dist/bin/installer/targets/trae.js.map +7 -0
  67. package/dist/bin/installer/targets/warp.js +97 -0
  68. package/dist/bin/installer/targets/warp.js.map +7 -0
  69. package/dist/bin/installer/targets/windsurf.js +141 -0
  70. package/dist/bin/installer/targets/windsurf.js.map +7 -0
  71. package/dist/bin/kirograph.js +5 -1
  72. package/dist/bin/kirograph.js.map +3 -3
  73. package/dist/compression/naive-cost.js +33 -0
  74. package/dist/compression/naive-cost.js.map +2 -2
  75. package/dist/compression/tracker.js +27 -4
  76. package/dist/compression/tracker.js.map +2 -2
  77. package/dist/compression/types.js.map +1 -1
  78. package/dist/config.js +66 -1
  79. package/dist/config.js.map +2 -2
  80. package/dist/core/pipeline.js +23 -0
  81. package/dist/core/pipeline.js.map +2 -2
  82. package/dist/db/database.js +28 -0
  83. package/dist/db/database.js.map +2 -2
  84. package/dist/db/docs-schema.sql +50 -0
  85. package/dist/docs/formats/asciidoc.js +108 -0
  86. package/dist/docs/formats/asciidoc.js.map +7 -0
  87. package/dist/docs/formats/html.js +100 -0
  88. package/dist/docs/formats/html.js.map +7 -0
  89. package/dist/docs/formats/index.js +81 -0
  90. package/dist/docs/formats/index.js.map +7 -0
  91. package/dist/docs/formats/markdown.js +146 -0
  92. package/dist/docs/formats/markdown.js.map +7 -0
  93. package/dist/docs/formats/openapi.js +228 -0
  94. package/dist/docs/formats/openapi.js.map +7 -0
  95. package/dist/docs/formats/org.js +117 -0
  96. package/dist/docs/formats/org.js.map +7 -0
  97. package/dist/docs/formats/plaintext.js +119 -0
  98. package/dist/docs/formats/plaintext.js.map +7 -0
  99. package/dist/docs/formats/rdoc.js +105 -0
  100. package/dist/docs/formats/rdoc.js.map +7 -0
  101. package/dist/docs/formats/rst.js +121 -0
  102. package/dist/docs/formats/rst.js.map +7 -0
  103. package/dist/docs/indexer.js +340 -0
  104. package/dist/docs/indexer.js.map +7 -0
  105. package/dist/docs/linker.js +151 -0
  106. package/dist/docs/linker.js.map +7 -0
  107. package/dist/docs/lint.js +92 -0
  108. package/dist/docs/lint.js.map +7 -0
  109. package/dist/docs/queries.js +295 -0
  110. package/dist/docs/queries.js.map +7 -0
  111. package/dist/docs/section-id.js +57 -0
  112. package/dist/docs/section-id.js.map +7 -0
  113. package/dist/docs/summarizer.js +55 -0
  114. package/dist/docs/summarizer.js.map +7 -0
  115. package/dist/docs/types.js +17 -0
  116. package/dist/docs/types.js.map +7 -0
  117. package/dist/docs/vectors.js +217 -0
  118. package/dist/docs/vectors.js.map +7 -0
  119. package/dist/index.js +3 -0
  120. package/dist/index.js.map +2 -2
  121. package/dist/mcp/tool-names.js +10 -1
  122. package/dist/mcp/tool-names.js.map +2 -2
  123. package/dist/mcp/tools.js +476 -3
  124. package/dist/mcp/tools.js.map +2 -2
  125. package/package.json +1 -1
@@ -0,0 +1,357 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var docs_exports = {};
20
+ __export(docs_exports, {
21
+ register: () => register
22
+ });
23
+ module.exports = __toCommonJS(docs_exports);
24
+ var import_config = require("../../config");
25
+ var import_ui = require("../ui");
26
+ function safeCloseAndExit(cg, code = 0) {
27
+ try {
28
+ cg.close();
29
+ } catch {
30
+ }
31
+ try {
32
+ const fs = require("fs");
33
+ if (process.stdout.writableEnded === false) process.stdout.write("");
34
+ if (process.stderr.writableEnded === false) process.stderr.write("");
35
+ fs.closeSync(2);
36
+ fs.closeSync(1);
37
+ } catch {
38
+ }
39
+ process.exit(code);
40
+ }
41
+ function register(program) {
42
+ const docs = program.command("docs").description("Documentation navigation (requires enableDocs: true)");
43
+ docs.command("toc [file]").description("Print table of contents for a file or the whole project").option("--tree", "Show nested tree structure").option("--json", "Output as JSON").action(async (file, opts) => {
44
+ const cwd = process.cwd();
45
+ const config = await (0, import_config.loadConfig)(cwd);
46
+ if (!config.enableDocs) {
47
+ console.error(` \u2716 Documentation indexing is not enabled. Set ${import_ui.violet}${import_ui.bold}enableDocs: true${import_ui.reset} in .kirograph/config.json`);
48
+ console.error(` ${import_ui.dim}Then re-run:${import_ui.reset} ${import_ui.violet}${import_ui.bold}kirograph index${import_ui.reset}`);
49
+ process.exit(1);
50
+ }
51
+ const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
52
+ if (!KiroGraph.isInitialized(cwd)) {
53
+ console.error(" \u2716 KiroGraph not initialized. Run: kirograph init");
54
+ process.exit(1);
55
+ }
56
+ const cg = await KiroGraph.open(cwd);
57
+ const db = cg.getDatabase();
58
+ db.applyDocsSchema();
59
+ const { DocsQueries } = await Promise.resolve().then(() => require("../../docs/queries.js"));
60
+ const queries = new DocsQueries(db.getRawDb(), cwd);
61
+ const toc = queries.getToc({ file, tree: opts.tree });
62
+ if (toc.length === 0) {
63
+ console.log(` ${import_ui.dim}No documentation sections found.${import_ui.reset} Run ${import_ui.violet}${import_ui.bold}kirograph index${import_ui.reset} first.`);
64
+ cg.close();
65
+ return;
66
+ }
67
+ if (opts.json) {
68
+ console.log(JSON.stringify(toc, null, 2));
69
+ } else {
70
+ for (const entry of toc) {
71
+ const prefix = "#".repeat(entry.level || 1);
72
+ const summary = entry.summary ? ` ${import_ui.dim}\u2014 ${entry.summary}${import_ui.reset}` : "";
73
+ console.log(` ${prefix} ${import_ui.bold}${entry.title}${import_ui.reset}${summary}`);
74
+ console.log(` ${import_ui.dim}${entry.id}${import_ui.reset}`);
75
+ }
76
+ }
77
+ cg.close();
78
+ });
79
+ docs.command("search <query>").description("Search documentation sections").option("--file <path>", "Narrow search to a specific file").option("--limit <n>", "Max results", "10").option("--json", "Output as JSON").action(async (query, opts) => {
80
+ const cwd = process.cwd();
81
+ const config = await (0, import_config.loadConfig)(cwd);
82
+ if (!config.enableDocs) {
83
+ console.error(` \u2716 Documentation indexing is not enabled. Set ${import_ui.violet}${import_ui.bold}enableDocs: true${import_ui.reset} in .kirograph/config.json`);
84
+ process.exit(1);
85
+ }
86
+ const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
87
+ if (!KiroGraph.isInitialized(cwd)) {
88
+ console.error(" \u2716 KiroGraph not initialized.");
89
+ process.exit(1);
90
+ }
91
+ const cg = await KiroGraph.open(cwd);
92
+ const db = cg.getDatabase();
93
+ db.applyDocsSchema();
94
+ const { DocsQueries } = await Promise.resolve().then(() => require("../../docs/queries.js"));
95
+ const queries = new DocsQueries(db.getRawDb(), cwd, config);
96
+ const results = await queries.searchSections(query, { file: opts.file, limit: parseInt(opts.limit ?? "10", 10) });
97
+ if (results.length === 0) {
98
+ console.log(` ${import_ui.dim}No sections found matching "${query}".${import_ui.reset}`);
99
+ cg.close();
100
+ return;
101
+ }
102
+ if (opts.json) {
103
+ console.log(JSON.stringify(results, null, 2));
104
+ } else {
105
+ for (const r of results) {
106
+ const summary = r.section.summary ? `
107
+ ${import_ui.dim}${r.section.summary}${import_ui.reset}` : "";
108
+ console.log(` ${import_ui.green}\u25CF${import_ui.reset} ${import_ui.bold}${r.section.title}${import_ui.reset} ${import_ui.dim}[${r.section.filePath}]${import_ui.reset}${summary}`);
109
+ console.log(` ${import_ui.dim}ID: ${r.section.id}${import_ui.reset}`);
110
+ }
111
+ }
112
+ cg.close();
113
+ });
114
+ docs.command("section <id>").description("Print full content of a section by ID").option("--context", "Include ancestor headings and child summaries").action(async (id, opts) => {
115
+ const cwd = process.cwd();
116
+ const config = await (0, import_config.loadConfig)(cwd);
117
+ if (!config.enableDocs) {
118
+ console.error(` \u2716 Documentation indexing is not enabled. Set ${import_ui.violet}${import_ui.bold}enableDocs: true${import_ui.reset} in .kirograph/config.json`);
119
+ process.exit(1);
120
+ }
121
+ const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
122
+ if (!KiroGraph.isInitialized(cwd)) {
123
+ console.error(" \u2716 KiroGraph not initialized.");
124
+ process.exit(1);
125
+ }
126
+ const cg = await KiroGraph.open(cwd);
127
+ const db = cg.getDatabase();
128
+ db.applyDocsSchema();
129
+ const { DocsQueries } = await Promise.resolve().then(() => require("../../docs/queries.js"));
130
+ const queries = new DocsQueries(db.getRawDb(), cwd);
131
+ const result = queries.getSection(id, { context: opts.context });
132
+ if (!result) {
133
+ const rawDb = db.getRawDb();
134
+ const idParts = id.split("::");
135
+ const filePath = idParts[0] ?? "";
136
+ const searchSlug = (idParts[1] ?? "").replace(/#\d+$/, "").split("/").pop() ?? "";
137
+ let suggestions = [];
138
+ if (searchSlug) {
139
+ suggestions = rawDb.all(
140
+ `SELECT id, title FROM doc_sections WHERE file_path = ? AND id LIKE ? LIMIT 5`,
141
+ [filePath, `%${searchSlug}%`]
142
+ );
143
+ }
144
+ if (suggestions.length === 0 && filePath) {
145
+ suggestions = rawDb.all(
146
+ `SELECT id, title FROM doc_sections WHERE file_path = ? ORDER BY position LIMIT 5`,
147
+ [filePath]
148
+ );
149
+ }
150
+ console.error(` \u2716 Section "${id}" not found.`);
151
+ if (suggestions.length > 0) {
152
+ console.error(`
153
+ ${import_ui.dim}Did you mean:${import_ui.reset}`);
154
+ for (const s of suggestions) {
155
+ console.error(` ${s.id} ${import_ui.dim}(${s.title})${import_ui.reset}`);
156
+ }
157
+ } else {
158
+ console.error(`
159
+ ${import_ui.dim}Use ${import_ui.violet}kirograph docs toc${import_ui.reset}${import_ui.dim} to list available section IDs.${import_ui.reset}`);
160
+ }
161
+ safeCloseAndExit(cg, 1);
162
+ }
163
+ if (result.ancestors?.length) {
164
+ console.log(` ${import_ui.dim}${result.ancestors.map((a) => a.title).join(" > ")} > ${result.section.title}${import_ui.reset}
165
+ `);
166
+ }
167
+ console.log(result.content);
168
+ if (result.children?.length) {
169
+ console.log(`
170
+ ${import_ui.dim}Child sections:${import_ui.reset}`);
171
+ for (const child of result.children) {
172
+ const summary = child.summary ? ` \u2014 ${child.summary}` : "";
173
+ console.log(` ${import_ui.dim}\u2022${import_ui.reset} ${child.title}${summary}`);
174
+ }
175
+ }
176
+ cg.close();
177
+ });
178
+ docs.command("outline <file>").description("Print heading hierarchy for a document").action(async (file) => {
179
+ const cwd = process.cwd();
180
+ const config = await (0, import_config.loadConfig)(cwd);
181
+ if (!config.enableDocs) {
182
+ console.error(` \u2716 Documentation indexing is not enabled. Set ${import_ui.violet}${import_ui.bold}enableDocs: true${import_ui.reset} in .kirograph/config.json`);
183
+ process.exit(1);
184
+ }
185
+ const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
186
+ if (!KiroGraph.isInitialized(cwd)) {
187
+ console.error(" \u2716 KiroGraph not initialized.");
188
+ process.exit(1);
189
+ }
190
+ const cg = await KiroGraph.open(cwd);
191
+ const db = cg.getDatabase();
192
+ db.applyDocsSchema();
193
+ const { DocsQueries } = await Promise.resolve().then(() => require("../../docs/queries.js"));
194
+ const queries = new DocsQueries(db.getRawDb(), cwd);
195
+ const outline = queries.getOutline(file);
196
+ if (outline.length === 0) {
197
+ console.log(` ${import_ui.dim}No sections found in "${file}".${import_ui.reset}`);
198
+ cg.close();
199
+ return;
200
+ }
201
+ console.log(`
202
+ ${import_ui.bold}${file}${import_ui.reset}
203
+ `);
204
+ const render = (entries, indent) => {
205
+ for (const entry of entries) {
206
+ const summary = entry.summary ? ` ${import_ui.dim}\u2014 ${entry.summary}${import_ui.reset}` : "";
207
+ console.log(`${indent} ${"#".repeat(entry.level || 1)} ${entry.title}${summary}`);
208
+ if (entry.children?.length) render(entry.children, indent + " ");
209
+ }
210
+ };
211
+ render(outline, "");
212
+ cg.close();
213
+ });
214
+ docs.command("refs <id>").description("Show code \u2194 doc cross-references").action(async (id) => {
215
+ const cwd = process.cwd();
216
+ const config = await (0, import_config.loadConfig)(cwd);
217
+ if (!config.enableDocs) {
218
+ console.error(` \u2716 Documentation indexing is not enabled. Set ${import_ui.violet}${import_ui.bold}enableDocs: true${import_ui.reset} in .kirograph/config.json`);
219
+ process.exit(1);
220
+ }
221
+ const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
222
+ if (!KiroGraph.isInitialized(cwd)) {
223
+ console.error(" \u2716 KiroGraph not initialized.");
224
+ process.exit(1);
225
+ }
226
+ const cg = await KiroGraph.open(cwd);
227
+ const db = cg.getDatabase();
228
+ db.applyDocsSchema();
229
+ const { DocsQueries } = await Promise.resolve().then(() => require("../../docs/queries.js"));
230
+ const queries = new DocsQueries(db.getRawDb(), cwd);
231
+ let refs = queries.getRefs({ sectionId: id });
232
+ if (refs.length === 0) {
233
+ refs = queries.getRefs({ qualifiedName: id });
234
+ }
235
+ if (refs.length === 0) {
236
+ console.log(` ${import_ui.dim}No cross-references found for "${id}".${import_ui.reset}`);
237
+ cg.close();
238
+ return;
239
+ }
240
+ for (const r of refs) {
241
+ console.log(` [${r.refType}] ${r.qualifiedName} ${import_ui.dim}(confidence: ${r.confidence.toFixed(2)})${import_ui.reset}`);
242
+ }
243
+ cg.close();
244
+ });
245
+ docs.command("reindex").description("Force re-index all documentation files").action(async () => {
246
+ const cwd = process.cwd();
247
+ const config = await (0, import_config.loadConfig)(cwd);
248
+ if (!config.enableDocs) {
249
+ console.error(` \u2716 Documentation indexing is not enabled. Set ${import_ui.violet}${import_ui.bold}enableDocs: true${import_ui.reset} in .kirograph/config.json`);
250
+ process.exit(1);
251
+ }
252
+ const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
253
+ if (!KiroGraph.isInitialized(cwd)) {
254
+ console.error(" \u2716 KiroGraph not initialized.");
255
+ process.exit(1);
256
+ }
257
+ const cg = await KiroGraph.open(cwd);
258
+ const db = cg.getDatabase();
259
+ db.applyDocsSchema();
260
+ const { DocsIndexer } = await Promise.resolve().then(() => require("../../docs/indexer.js"));
261
+ const indexer = new DocsIndexer(db.getRawDb(), config, cwd);
262
+ console.log(` ${import_ui.dim}Re-indexing documentation...${import_ui.reset}`);
263
+ const result = await indexer.indexAll({ force: true, onProgress: (msg) => console.log(` ${import_ui.dim}${msg}${import_ui.reset}`) });
264
+ console.log(` ${import_ui.green}\u2713${import_ui.reset} ${(0, import_ui.value)(String(result.filesIndexed))} ${import_ui.dim}files,${import_ui.reset} ${(0, import_ui.value)(String(result.sectionsCreated))} ${import_ui.dim}sections created,${import_ui.reset} ${(0, import_ui.value)(String(result.sectionsUpdated))} ${import_ui.dim}updated,${import_ui.reset} ${(0, import_ui.value)(String(result.sectionsRemoved))} ${import_ui.dim}removed${import_ui.reset} ${import_ui.dim}(${result.duration}ms)${import_ui.reset}`);
265
+ if (result.errors.length) {
266
+ console.warn(` \x1B[33m\u26A0 ${result.errors.length} error(s)\x1B[0m`);
267
+ for (const err of result.errors.slice(0, 5)) console.warn(` ${err}`);
268
+ }
269
+ cg.close();
270
+ });
271
+ docs.command("lint").description("Find broken refs, stale sections, FTS desync").action(async () => {
272
+ const cwd = process.cwd();
273
+ const config = await (0, import_config.loadConfig)(cwd);
274
+ if (!config.enableDocs) {
275
+ console.error(` \u2716 Documentation indexing is not enabled. Set ${import_ui.violet}${import_ui.bold}enableDocs: true${import_ui.reset} in .kirograph/config.json`);
276
+ process.exit(1);
277
+ }
278
+ const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
279
+ if (!KiroGraph.isInitialized(cwd)) {
280
+ console.error(" \u2716 KiroGraph not initialized.");
281
+ process.exit(1);
282
+ }
283
+ const cg = await KiroGraph.open(cwd);
284
+ const db = cg.getDatabase();
285
+ db.applyDocsSchema();
286
+ const { docsLint } = await Promise.resolve().then(() => require("../../docs/lint.js"));
287
+ const result = docsLint(db.getRawDb(), cwd);
288
+ if (result.totalIssues === 0) {
289
+ console.log(` ${import_ui.green}\u2713${import_ui.reset} No issues found.`);
290
+ cg.close();
291
+ return;
292
+ }
293
+ console.log(` Found ${result.totalIssues} issue(s):
294
+ `);
295
+ if (result.brokenRefs.length > 0) {
296
+ console.log(` ${import_ui.bold}Broken code refs:${import_ui.reset} ${result.brokenRefs.length}`);
297
+ for (const ref of result.brokenRefs.slice(0, 10)) {
298
+ console.log(` ${import_ui.dim}${ref.sectionId} \u2192 ${ref.qualifiedName}${import_ui.reset}`);
299
+ }
300
+ if (result.brokenRefs.length > 10) console.log(` ${import_ui.dim}\u2026and ${result.brokenRefs.length - 10} more${import_ui.reset}`);
301
+ }
302
+ if (result.staleSections.length > 0) {
303
+ console.log(` ${import_ui.bold}Stale sections:${import_ui.reset} ${result.staleSections.length}`);
304
+ for (const s of result.staleSections.slice(0, 10)) {
305
+ console.log(` ${import_ui.dim}${s.filePath} \u2014 ${s.id}${import_ui.reset}`);
306
+ }
307
+ if (result.staleSections.length > 10) console.log(` ${import_ui.dim}\u2026and ${result.staleSections.length - 10} more${import_ui.reset}`);
308
+ }
309
+ if (result.ftsDesync) {
310
+ console.log(` ${import_ui.bold}FTS desync:${import_ui.reset} ${result.ftsDesync.sections} sections vs ${result.ftsDesync.ftsRows} FTS rows`);
311
+ }
312
+ if (result.orphanRefs > 0) {
313
+ console.log(` ${import_ui.bold}Orphan refs:${import_ui.reset} ${result.orphanRefs}`);
314
+ }
315
+ console.log(`
316
+ ${import_ui.dim}Run ${import_ui.violet}${import_ui.bold}kirograph docs reindex${import_ui.reset}${import_ui.dim} to fix stale sections.${import_ui.reset}`);
317
+ cg.close();
318
+ });
319
+ docs.command("reembed").description("Re-embed all doc sections with the current model").action(async () => {
320
+ const cwd = process.cwd();
321
+ const config = await (0, import_config.loadConfig)(cwd);
322
+ if (!config.enableDocs) {
323
+ console.error(` \u2716 Documentation indexing is not enabled. Set ${import_ui.violet}${import_ui.bold}enableDocs: true${import_ui.reset} in .kirograph/config.json`);
324
+ process.exit(1);
325
+ }
326
+ if (!config.enableEmbeddings) {
327
+ console.error(` \u2716 Embeddings are not enabled. Set ${import_ui.violet}${import_ui.bold}enableEmbeddings: true${import_ui.reset} in .kirograph/config.json`);
328
+ process.exit(1);
329
+ }
330
+ const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
331
+ if (!KiroGraph.isInitialized(cwd)) {
332
+ console.error(" \u2716 KiroGraph not initialized.");
333
+ process.exit(1);
334
+ }
335
+ const cg = await KiroGraph.open(cwd);
336
+ const db = cg.getDatabase();
337
+ db.applyDocsSchema();
338
+ const rawDb = db.getRawDb();
339
+ const sections = rawDb.all("SELECT id, title, summary FROM doc_sections");
340
+ if (sections.length === 0) {
341
+ console.log(` ${import_ui.dim}No doc sections to embed. Run ${import_ui.violet}${import_ui.bold}kirograph docs reindex${import_ui.reset}${import_ui.dim} first.${import_ui.reset}`);
342
+ cg.close();
343
+ return;
344
+ }
345
+ console.log(` ${import_ui.dim}Re-embedding ${sections.length} doc sections...${import_ui.reset}`);
346
+ const { DocsVectorManager } = await Promise.resolve().then(() => require("../../docs/vectors.js"));
347
+ const vectorMgr = new DocsVectorManager(config, rawDb);
348
+ const embedded = await vectorMgr.reembed();
349
+ console.log(` ${import_ui.green}\u2713${import_ui.reset} Embedded ${(0, import_ui.value)(String(embedded))} doc sections with model ${import_ui.dim}${config.embeddingModel}${import_ui.reset}`);
350
+ cg.close();
351
+ });
352
+ }
353
+ // Annotate the CommonJS export names for ESM import in node:
354
+ 0 && (module.exports = {
355
+ register
356
+ });
357
+ //# sourceMappingURL=docs.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/bin/commands/docs.ts"],
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport * as path from 'path';\nimport { loadConfig } from '../../config';\nimport { dim, reset, violet, bold, green, value } from '../ui';\n\n/** Safely close KiroGraph and exit cleanly. */\nfunction safeCloseAndExit(cg: any, code = 0): never {\n try { cg.close(); } catch { /* ignore */ }\n // Suppress any post-exit WASM crash output and exit cleanly\n try {\n const fs = require('fs');\n // Flush stdout/stderr, then close fd 2 to suppress libc++abi messages\n if (process.stdout.writableEnded === false) process.stdout.write('');\n if (process.stderr.writableEnded === false) process.stderr.write('');\n fs.closeSync(2);\n fs.closeSync(1);\n } catch { /* ignore */ }\n process.exit(code);\n}\n\nexport function register(program: Command): void {\n const docs = program\n .command('docs')\n .description('Documentation navigation (requires enableDocs: true)');\n\n // \u2500\u2500 toc \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 docs\n .command('toc [file]')\n .description('Print table of contents for a file or the whole project')\n .option('--tree', 'Show nested tree structure')\n .option('--json', 'Output as JSON')\n .action(async (file: string | undefined, opts: { tree?: boolean; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableDocs) {\n console.error(` \u2716 Documentation indexing is not enabled. Set ${violet}${bold}enableDocs: true${reset} in .kirograph/config.json`);\n console.error(` ${dim}Then re-run:${reset} ${violet}${bold}kirograph index${reset}`);\n process.exit(1);\n }\n\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 KiroGraph not initialized. Run: kirograph init'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyDocsSchema();\n\n const { DocsQueries } = await Promise.resolve().then(() => require('../../docs/queries.js'));\n const queries = new DocsQueries(db.getRawDb(), cwd);\n const toc = queries.getToc({ file, tree: opts.tree });\n\n if (toc.length === 0) {\n console.log(` ${dim}No documentation sections found.${reset} Run ${violet}${bold}kirograph index${reset} first.`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(toc, null, 2));\n } else {\n for (const entry of toc) {\n const prefix = '#'.repeat(entry.level || 1);\n const summary = entry.summary ? ` ${dim}\u2014 ${entry.summary}${reset}` : '';\n console.log(` ${prefix} ${bold}${entry.title}${reset}${summary}`);\n console.log(` ${dim}${entry.id}${reset}`);\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n docs\n .command('search <query>')\n .description('Search documentation sections')\n .option('--file <path>', 'Narrow search to a specific file')\n .option('--limit <n>', 'Max results', '10')\n .option('--json', 'Output as JSON')\n .action(async (query: string, opts: { file?: string; limit?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableDocs) {\n console.error(` \u2716 Documentation indexing is not enabled. Set ${violet}${bold}enableDocs: true${reset} in .kirograph/config.json`);\n process.exit(1);\n }\n\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 KiroGraph not initialized.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyDocsSchema();\n\n const { DocsQueries } = await Promise.resolve().then(() => require('../../docs/queries.js'));\n const queries = new DocsQueries(db.getRawDb(), cwd, config);\n const results = await queries.searchSections(query, { file: opts.file, limit: parseInt(opts.limit ?? '10', 10) });\n\n if (results.length === 0) {\n console.log(` ${dim}No sections found matching \"${query}\".${reset}`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(results, null, 2));\n } else {\n for (const r of results) {\n const summary = r.section.summary ? `\\n ${dim}${r.section.summary}${reset}` : '';\n console.log(` ${green}\u25CF${reset} ${bold}${r.section.title}${reset} ${dim}[${r.section.filePath}]${reset}${summary}`);\n console.log(` ${dim}ID: ${r.section.id}${reset}`);\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 section \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 docs\n .command('section <id>')\n .description('Print full content of a section by ID')\n .option('--context', 'Include ancestor headings and child summaries')\n .action(async (id: string, opts: { context?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableDocs) {\n console.error(` \u2716 Documentation indexing is not enabled. Set ${violet}${bold}enableDocs: true${reset} in .kirograph/config.json`);\n process.exit(1);\n }\n\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 KiroGraph not initialized.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyDocsSchema();\n\n const { DocsQueries } = await Promise.resolve().then(() => require('../../docs/queries.js'));\n const queries = new DocsQueries(db.getRawDb(), cwd);\n const result = queries.getSection(id, { context: opts.context });\n\n if (!result) {\n // Suggest similar section IDs\n const rawDb = db.getRawDb();\n const idParts = id.split('::');\n const filePath = idParts[0] ?? '';\n const searchSlug = (idParts[1] ?? '').replace(/#\\d+$/, '').split('/').pop() ?? '';\n\n let suggestions: Array<{ id: string; title: string }> = [];\n if (searchSlug) {\n suggestions = rawDb.all(\n `SELECT id, title FROM doc_sections WHERE file_path = ? AND id LIKE ? LIMIT 5`,\n [filePath, `%${searchSlug}%`],\n ) as Array<{ id: string; title: string }>;\n }\n if (suggestions.length === 0 && filePath) {\n suggestions = rawDb.all(\n `SELECT id, title FROM doc_sections WHERE file_path = ? ORDER BY position LIMIT 5`,\n [filePath],\n ) as Array<{ id: string; title: string }>;\n }\n\n console.error(` \u2716 Section \"${id}\" not found.`);\n if (suggestions.length > 0) {\n console.error(`\\n ${dim}Did you mean:${reset}`);\n for (const s of suggestions) {\n console.error(` ${s.id} ${dim}(${s.title})${reset}`);\n }\n } else {\n console.error(`\\n ${dim}Use ${violet}kirograph docs toc${reset}${dim} to list available section IDs.${reset}`);\n }\n safeCloseAndExit(cg, 1);\n }\n\n if (result.ancestors?.length) {\n console.log(` ${dim}${result.ancestors.map(a => a.title).join(' > ')} > ${result.section.title}${reset}\\n`);\n }\n\n console.log(result.content);\n\n if (result.children?.length) {\n console.log(`\\n ${dim}Child sections:${reset}`);\n for (const child of result.children) {\n const summary = child.summary ? ` \u2014 ${child.summary}` : '';\n console.log(` ${dim}\u2022${reset} ${child.title}${summary}`);\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 outline \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 docs\n .command('outline <file>')\n .description('Print heading hierarchy for a document')\n .action(async (file: string) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableDocs) {\n console.error(` \u2716 Documentation indexing is not enabled. Set ${violet}${bold}enableDocs: true${reset} in .kirograph/config.json`);\n process.exit(1);\n }\n\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 KiroGraph not initialized.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyDocsSchema();\n\n const { DocsQueries } = await Promise.resolve().then(() => require('../../docs/queries.js'));\n const queries = new DocsQueries(db.getRawDb(), cwd);\n const outline = queries.getOutline(file);\n\n if (outline.length === 0) {\n console.log(` ${dim}No sections found in \"${file}\".${reset}`);\n cg.close(); return;\n }\n\n console.log(`\\n ${bold}${file}${reset}\\n`);\n const render = (entries: any[], indent: string) => {\n for (const entry of entries) {\n const summary = entry.summary ? ` ${dim}\u2014 ${entry.summary}${reset}` : '';\n console.log(`${indent} ${'#'.repeat(entry.level || 1)} ${entry.title}${summary}`);\n if (entry.children?.length) render(entry.children, indent + ' ');\n }\n };\n render(outline, '');\n cg.close();\n });\n\n // \u2500\u2500 refs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 docs\n .command('refs <id>')\n .description('Show code \u2194 doc cross-references')\n .action(async (id: string) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableDocs) {\n console.error(` \u2716 Documentation indexing is not enabled. Set ${violet}${bold}enableDocs: true${reset} in .kirograph/config.json`);\n process.exit(1);\n }\n\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 KiroGraph not initialized.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyDocsSchema();\n\n const { DocsQueries } = await Promise.resolve().then(() => require('../../docs/queries.js'));\n const queries = new DocsQueries(db.getRawDb(), cwd);\n\n // Try as section ID first, then as qualified name\n let refs = queries.getRefs({ sectionId: id });\n if (refs.length === 0) {\n refs = queries.getRefs({ qualifiedName: id });\n }\n\n if (refs.length === 0) {\n console.log(` ${dim}No cross-references found for \"${id}\".${reset}`);\n cg.close(); return;\n }\n\n for (const r of refs) {\n console.log(` [${r.refType}] ${r.qualifiedName} ${dim}(confidence: ${r.confidence.toFixed(2)})${reset}`);\n }\n cg.close();\n });\n\n // \u2500\u2500 reindex \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 docs\n .command('reindex')\n .description('Force re-index all documentation files')\n .action(async () => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableDocs) {\n console.error(` \u2716 Documentation indexing is not enabled. Set ${violet}${bold}enableDocs: true${reset} in .kirograph/config.json`);\n process.exit(1);\n }\n\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 KiroGraph not initialized.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyDocsSchema();\n\n const { DocsIndexer } = await Promise.resolve().then(() => require('../../docs/indexer.js'));\n const indexer = new DocsIndexer(db.getRawDb(), config, cwd);\n\n console.log(` ${dim}Re-indexing documentation...${reset}`);\n const result = await indexer.indexAll({ force: true, onProgress: msg => console.log(` ${dim}${msg}${reset}`) });\n\n console.log(` ${green}\u2713${reset} ${value(String(result.filesIndexed))} ${dim}files,${reset} ${value(String(result.sectionsCreated))} ${dim}sections created,${reset} ${value(String(result.sectionsUpdated))} ${dim}updated,${reset} ${value(String(result.sectionsRemoved))} ${dim}removed${reset} ${dim}(${result.duration}ms)${reset}`);\n if (result.errors.length) {\n console.warn(` \\x1b[33m\u26A0 ${result.errors.length} error(s)\\x1b[0m`);\n for (const err of result.errors.slice(0, 5)) console.warn(` ${err}`);\n }\n cg.close();\n });\n\n // \u2500\u2500 lint \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 docs\n .command('lint')\n .description('Find broken refs, stale sections, FTS desync')\n .action(async () => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableDocs) {\n console.error(` \u2716 Documentation indexing is not enabled. Set ${violet}${bold}enableDocs: true${reset} in .kirograph/config.json`);\n process.exit(1);\n }\n\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 KiroGraph not initialized.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyDocsSchema();\n\n const { docsLint } = await Promise.resolve().then(() => require('../../docs/lint.js'));\n const result = docsLint(db.getRawDb(), cwd);\n\n if (result.totalIssues === 0) {\n console.log(` ${green}\u2713${reset} No issues found.`);\n cg.close(); return;\n }\n\n console.log(` Found ${result.totalIssues} issue(s):\\n`);\n\n if (result.brokenRefs.length > 0) {\n console.log(` ${bold}Broken code refs:${reset} ${result.brokenRefs.length}`);\n for (const ref of result.brokenRefs.slice(0, 10)) {\n console.log(` ${dim}${ref.sectionId} \u2192 ${ref.qualifiedName}${reset}`);\n }\n if (result.brokenRefs.length > 10) console.log(` ${dim}\u2026and ${result.brokenRefs.length - 10} more${reset}`);\n }\n\n if (result.staleSections.length > 0) {\n console.log(` ${bold}Stale sections:${reset} ${result.staleSections.length}`);\n for (const s of result.staleSections.slice(0, 10)) {\n console.log(` ${dim}${s.filePath} \u2014 ${s.id}${reset}`);\n }\n if (result.staleSections.length > 10) console.log(` ${dim}\u2026and ${result.staleSections.length - 10} more${reset}`);\n }\n\n if (result.ftsDesync) {\n console.log(` ${bold}FTS desync:${reset} ${result.ftsDesync.sections} sections vs ${result.ftsDesync.ftsRows} FTS rows`);\n }\n\n if (result.orphanRefs > 0) {\n console.log(` ${bold}Orphan refs:${reset} ${result.orphanRefs}`);\n }\n\n console.log(`\\n ${dim}Run ${violet}${bold}kirograph docs reindex${reset}${dim} to fix stale sections.${reset}`);\n cg.close();\n });\n\n // \u2500\u2500 reembed \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 docs\n .command('reembed')\n .description('Re-embed all doc sections with the current model')\n .action(async () => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableDocs) {\n console.error(` \u2716 Documentation indexing is not enabled. Set ${violet}${bold}enableDocs: true${reset} in .kirograph/config.json`);\n process.exit(1);\n }\n if (!config.enableEmbeddings) {\n console.error(` \u2716 Embeddings are not enabled. Set ${violet}${bold}enableEmbeddings: true${reset} in .kirograph/config.json`);\n process.exit(1);\n }\n\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 KiroGraph not initialized.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyDocsSchema();\n\n const rawDb = db.getRawDb();\n const sections = rawDb.all('SELECT id, title, summary FROM doc_sections') as Array<{ id: string; title: string; summary: string | null }>;\n\n if (sections.length === 0) {\n console.log(` ${dim}No doc sections to embed. Run ${violet}${bold}kirograph docs reindex${reset}${dim} first.${reset}`);\n cg.close(); return;\n }\n\n console.log(` ${dim}Re-embedding ${sections.length} doc sections...${reset}`);\n const { DocsVectorManager } = await Promise.resolve().then(() => require('../../docs/vectors.js'));\n const vectorMgr = new DocsVectorManager(config, rawDb);\n const embedded = await vectorMgr.reembed();\n console.log(` ${green}\u2713${reset} Embedded ${value(String(embedded))} doc sections with model ${dim}${config.embeddingModel}${reset}`);\n cg.close();\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAC3B,gBAAuD;AAGvD,SAAS,iBAAiB,IAAS,OAAO,GAAU;AAClD,MAAI;AAAE,OAAG,MAAM;AAAA,EAAG,QAAQ;AAAA,EAAe;AAEzC,MAAI;AACF,UAAM,KAAK,QAAQ,IAAI;AAEvB,QAAI,QAAQ,OAAO,kBAAkB,MAAO,SAAQ,OAAO,MAAM,EAAE;AACnE,QAAI,QAAQ,OAAO,kBAAkB,MAAO,SAAQ,OAAO,MAAM,EAAE;AACnE,OAAG,UAAU,CAAC;AACd,OAAG,UAAU,CAAC;AAAA,EAChB,QAAQ;AAAA,EAAe;AACvB,UAAQ,KAAK,IAAI;AACnB;AAEO,SAAS,SAAS,SAAwB;AAC/C,QAAM,OA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AM,GAAG,cAAI,yBAAyB,eAAK,GAAG,aAAG,UAAU,eAAK,EAAE;AACvH,SAAG,MAAM;AAAG;AAAA,IACd;AAEA,YAAQ,IAAI,KAAK,aAAG,gBAAgB,SAAS,MAAM,mBAAmB,eAAK,EAAE;AAC7E,UAAM,EAAE,kBAAkB,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,uBAAuB,CAAC;AACjG,UAAM,YAAY,IAAI,kBAAkB,QAAQ,KAAK;AACrD,UAAM,WAAW,MAAM,UAAU,QAAQ;AACzC,YAAQ,IAAI,KAAK,eAAK,SAAI,eAAK,iBAAa,iBAAM,OAAO,QAAQ,CAAC,CAAC,4BAA4B,aAAG,GAAG,OAAO,cAAc,GAAG,eAAK,EAAE;AACpI,OAAG,MAAM;AAAA,EACX,CAAC;AACL;",
6
+ "names": []
7
+ }
@@ -92,6 +92,7 @@ function printColoredHelp() {
92
92
  { name: "compression", args: "[level]", desc: "Set shell compression level (off | normal | aggressive | ultra)" },
93
93
  { name: "exec", args: "<command...>", desc: "Run a shell command with token-optimized output", opts: ["-l, --level <l> normal | aggressive | ultra", "-t, --timeout <s> Timeout in seconds (default 60)", "--raw Show raw + compressed for comparison", "--json Output as JSON"] },
94
94
  { name: "gain", desc: "Show token savings from compressed command outputs", opts: ["--graph ASCII graph (last 30 days)", "--history Recent command history", "--daily Day-by-day breakdown", "--period <p> session | today | week | all"] },
95
+ { name: "mem", args: "<command>", desc: "Persistent memory (search, store, timeline, status, prune, lint, reembed)" },
95
96
  { name: "serve", desc: "Start the MCP server", opts: ["--mcp Run as MCP stdio server", "--path <p> Project path"] },
96
97
  { name: "dashboard", desc: "Manage the Qdrant or Typesense dashboard server", opts: ["start [path] Start server and open dashboard", "stop [path] Stop the running server"] }
97
98
  ]
@@ -193,6 +194,8 @@ ${c.bold}${c.paleLavender}USAGE${c.reset}`);
193
194
  ["kirograph exec --level ultra npm test", "Run tests with ultra compression"],
194
195
  ["kirograph exec --raw cargo build", "Show raw vs compressed comparison"],
195
196
  ["kirograph gain --graph", "Show token savings graph"],
197
+ ['kirograph mem search "auth decision"', "Search memory for past decisions"],
198
+ ['kirograph mem store "use idempotency keys" --kind decision', "Store a decision"],
196
199
  ["kirograph serve --mcp", "Start the MCP server"]
197
200
  ]
198
201
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/bin/commands/help.ts"],
4
- "sourcesContent": ["import { Command } from 'commander';\nimport { printBanner } from '../banner';\n\ntype CommandEntry = { name: string; args?: string; desc: string; opts?: string[] };\ntype Group = { title: string; commands: CommandEntry[] };\n\nexport function printColoredHelp(): void {\n const c = {\n reset: '\\x1b[0m',\n bold: '\\x1b[1m',\n dim: '\\x1b[2m',\n violet: '\\x1b[38;5;99m',\n purple: '\\x1b[38;5;135m',\n lavender: '\\x1b[38;5;141m',\n paleLavender: '\\x1b[38;5;183m',\n gray: '\\x1b[90m',\n brown: '\\x1b[38;5;130m',\n };\n\n const groups: Group[] = [\n {\n title: '\uD83D\uDD27 Workspace Setup',\n commands: [\n { name: 'install', desc: 'Wire up MCP/instructions for an agent workspace', opts: ['--target <t> kiro | claude | codex'] },\n { name: 'init', args: '[path]', desc: 'Initialize KiroGraph in a project', opts: ['-i, --index Index immediately after init'] },\n { name: 'uninit', args: '[path]', desc: 'Remove KiroGraph from a project', opts: ['--force Skip confirmation', '--target <t> kiro | claude | codex | all'] },\n { name: 'uninstall', args: '[path]', desc: 'Alias for uninit', opts: ['--force Skip confirmation', '--target <t> kiro | claude | codex | all'] },\n ],\n },\n {\n title: '\uD83D\uDCE6 Indexing',\n commands: [\n { name: 'index', args: '[path]', desc: 'Full re-index of a project', opts: ['--force Force re-index all files'] },\n { name: 'sync', args: '[path]', desc: 'Incremental sync of changed files', opts: ['--files <f> Specific files to sync'] },\n { name: 'sync-if-dirty', args: '[path]', desc: 'Sync only if a dirty marker is present', opts: ['-q, --quiet Suppress output'] },\n { name: 'mark-dirty', args: '[path]', desc: 'Write a dirty marker for deferred sync' },\n { name: 'unlock', args: '[path]', desc: 'Force-release a stale lock file' },\n ],\n },\n {\n title: '\uD83D\uDD0D Search & Exploration',\n commands: [\n { name: 'status', args: '[path]', desc: 'Show index statistics and health' },\n { name: 'query', args: '<search>', desc: 'Search for symbols by name', opts: ['--kind <k> Filter by kind', '--limit <n> Max results (default 10)'] },\n { name: 'context', args: '<task>', desc: 'Build relevant code context for a task', opts: ['--max-nodes <n> Max symbols (default 20)', '--no-code Exclude code snippets', '--format <fmt> markdown | json'] },\n { name: 'files', args: '[path]', desc: 'Show project file structure from the index', opts: ['--format <fmt> tree | flat | grouped', '--filter <path> Filter by directory prefix', '--pattern <glob> Filter by glob', '--max-depth <n> Limit tree depth', '--json Output as JSON'] },\n { name: 'path', args: '<from> <to>', desc: 'Find the shortest path between two symbols', opts: ['--format <fmt> table | json'] },\n { name: 'export build', args: '[path]', desc: 'Generate the interactive graph dashboard (.kirograph/export/)', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'export start', args: '[path]', desc: 'Generate and open the dashboard in the browser', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'affected', args: '[files...]', desc: 'Find test files affected by changed source files', opts: ['--stdin Read file list from stdin', '-d, --depth <n> Max traversal depth (default 5)', '-f, --filter <g> Custom test file glob', '-j, --json Output as JSON', '-q, --quiet File paths only'] },\n ],\n },\n {\n title: '\uD83D\uDCCA Graph Insights',\n commands: [\n { name: 'hotspots', args: '[path]', desc: 'Find most-connected symbols by edge degree', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'surprising', args: '[path]', desc: 'Find non-obvious cross-file connections', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'dead-code', args: '[path]', desc: 'Find unexported symbols with no incoming references', opts: ['--limit <n> Max results (default 50)', '--format <f> table | json'] },\n { name: 'snapshot', desc: 'Save or list graph snapshots for structural diffing', opts: ['save [label] Save current graph state', 'list List saved snapshots', 'diff [label] Diff current graph vs a snapshot --format summary|full|json'] },\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture Analysis',\n commands: [\n { name: 'architecture', args: '[path]', desc: 'Show package graph and layer map', opts: ['--packages Show packages only', '--layers Show layers only', '--format <f> json'] },\n { name: 'coupling', args: '[path]', desc: 'Show coupling metrics per package', opts: ['--sort <s> instability | ca | ce | name', '--package <n> Detail view for one package', '--format <f> json'] },\n { name: 'package', args: '<name>', desc: 'Inspect a package: deps, files, metrics', opts: ['--no-files Omit file list', '--format <f> json'] },\n ],\n },\n {\n title: '\u2699\uFE0F Agent & Configuration',\n commands: [\n { name: 'caveman', args: '[mode]', desc: 'Set agent communication style (off | lite | full | ultra)' },\n { name: 'compression', args: '[level]', desc: 'Set shell compression level (off | normal | aggressive | ultra)' },\n { name: 'exec', args: '<command...>', desc: 'Run a shell command with token-optimized output', opts: ['-l, --level <l> normal | aggressive | ultra', '-t, --timeout <s> Timeout in seconds (default 60)', '--raw Show raw + compressed for comparison', '--json Output as JSON'] },\n { name: 'gain', desc: 'Show token savings from compressed command outputs', opts: ['--graph ASCII graph (last 30 days)', '--history Recent command history', '--daily Day-by-day breakdown', '--period <p> session | today | week | all'] },\n { name: 'serve', desc: 'Start the MCP server', opts: ['--mcp Run as MCP stdio server', '--path <p> Project path'] },\n { name: 'dashboard', desc: 'Manage the Qdrant or Typesense dashboard server', opts: ['start [path] Start server and open dashboard', 'stop [path] Stop the running server'] },\n ],\n },\n ];\n\n console.log(`\\n${c.bold}${c.paleLavender}USAGE${c.reset}`);\n console.log(` ${c.lavender}kirograph${c.reset} ${c.gray}<command>${c.reset} ${c.dim}[options]${c.reset}\\n`);\n\n // Compute max name+args width across ALL groups for alignment\n const allCmds = groups.flatMap(g => g.commands);\n const nameWidth = Math.max(...allCmds.map(cmd => (cmd.name + (cmd.args ? ' ' + cmd.args : '')).length)) + 2;\n\n for (const group of groups) {\n console.log(`${c.bold}${c.paleLavender}${group.title.toUpperCase()}${c.reset}\\n`);\n for (const cmd of group.commands) {\n const signature = cmd.name + (cmd.args ? ' ' + cmd.args : '');\n const isCaveman = cmd.name === 'caveman';\n const nameColor = isCaveman ? c.brown : c.lavender;\n const prefix = isCaveman ? '\uD83E\uDEA8 ' : ' ';\n const namePart = `${nameColor}${cmd.name}${c.reset}${cmd.args ? ' ' + c.dim + cmd.args + c.reset : ''}`;\n const pad = ' '.repeat(Math.max(0, nameWidth - signature.length));\n console.log(`${prefix}${namePart}${pad}${c.gray}${cmd.desc}${c.reset}`);\n if (isCaveman) {\n // desc starts at: emoji prefix (3 display cols: \uD83E\uDEA8 + space) + nameWidth\n const inspiredPad = ' '.repeat(3 + nameWidth);\n console.log(`${inspiredPad}${c.dim}Inspired by Caveman , original idea by github.com/JuliusBrussee/caveman${c.reset}`);\n console.log();\n }\n if (cmd.opts) {\n for (const opt of cmd.opts) {\n const [flag, ...rest] = opt.split(/ +/);\n const optPad = ' '.repeat(nameWidth + 2);\n console.log(` ${optPad}${c.purple}${flag}${c.reset}${rest.length ? ' ' + c.dim + rest.join(' ') + c.reset : ''}`);\n }\n console.log();\n }\n }\n if (!groups[groups.length - 1].commands.includes(group.commands[group.commands.length - 1])) {\n // extra spacing between groups handled by opts blank line; add one if no opts\n const lastHasOpts = group.commands[group.commands.length - 1].opts;\n if (!lastHasOpts) console.log();\n }\n }\n\n console.log(`${c.bold}${c.paleLavender}GLOBAL FLAGS${c.reset}\\n`);\n console.log(` ${c.purple}-h, --help${c.reset} ${c.gray}Show this help${c.reset}`);\n console.log(` ${c.purple}-V, --version${c.reset} ${c.gray}Show version number${c.reset}\\n`);\n\n console.log(`${c.bold}${c.paleLavender}EXAMPLES${c.reset}\\n`);\n\n const exampleGroups: Array<{ title: string; examples: [string, string][] }> = [\n {\n title: '\uD83D\uDD27 Setup & indexing',\n examples: [\n ['kirograph install', 'Wire up Kiro MCP + hooks + steering for the current workspace'],\n ['kirograph install --target claude', 'Wire up Claude Code MCP + project memory'],\n ['kirograph install --target codex', 'Install Codex project instructions and print MCP config'],\n ['kirograph init --index', 'Init and immediately index the project'],\n ['kirograph sync', 'Incremental sync of changed files'],\n ],\n },\n {\n title: '\uD83D\uDD0D Search & exploration',\n examples: [\n ['kirograph query useState', 'Find all symbols named useState'],\n ['kirograph context \"add dark mode\"', 'Get relevant code context for a task'],\n ['kirograph files --format grouped', 'Show files grouped by directory'],\n ['kirograph path LoginController DatabasePool', 'Find how two symbols are connected'],\n ['kirograph affected src/auth.ts', 'Find tests affected by a change'],\n ['git diff --name-only | kirograph affected --stdin', 'Affected tests from a git diff'],\n ['kirograph export start', 'Open the interactive graph dashboard in the browser'],\n ['kirograph export build -o /tmp/graph', 'Export the dashboard to a custom directory'],\n ],\n },\n {\n title: '\uD83D\uDCCA Graph insights',\n examples: [\n ['kirograph hotspots --limit 10', 'Top 10 most-connected symbols'],\n ['kirograph surprising', 'Find unexpected cross-module connections'],\n ['kirograph dead-code', 'Find unreferenced unexported symbols'],\n ['kirograph snapshot save pre-refactor', 'Save a named snapshot before a refactor'],\n ['kirograph snapshot diff pre-refactor', 'Diff current graph vs the named snapshot'],\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture',\n examples: [\n ['kirograph architecture --packages', 'List all detected packages'],\n ['kirograph coupling --sort instability', 'Show packages ranked by instability'],\n ['kirograph package src/auth', 'Inspect the auth package'],\n ],\n },\n {\n title: '\u2699\uFE0F Agent',\n examples: [\n ['kirograph caveman full', 'Enable full caveman mode for the agent'],\n ['kirograph caveman off', 'Disable caveman mode'],\n ['kirograph compression aggressive', 'Set compression to aggressive level'],\n ['kirograph compression off', 'Disable compression hook (tool still available)'],\n ['kirograph exec git status', 'Run git status with compression'],\n ['kirograph exec --level ultra npm test', 'Run tests with ultra compression'],\n ['kirograph exec --raw cargo build', 'Show raw vs compressed comparison'],\n ['kirograph gain --graph', 'Show token savings graph'],\n ['kirograph serve --mcp', 'Start the MCP server'],\n ],\n },\n ];\n\n for (const eg of exampleGroups) {\n console.log(` ${c.dim}${eg.title}${c.reset}`);\n for (const [ex, desc] of eg.examples) {\n console.log(` ${c.violet}$${c.reset} ${c.lavender}${ex}${c.reset}`);\n console.log(` ${c.dim}${desc}${c.reset}`);\n }\n console.log();\n }\n}\n\nexport function register(program: Command): void {\n program.configureHelp({ formatHelp: () => '' });\n program.addHelpText('afterAll', '');\n program.helpInformation = () => {\n printBanner();\n printColoredHelp();\n return '';\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA4B;AAKrB,SAAS,mBAAyB;AACvC,QAAM,IAAI;AAAA,IACR,OAAc;AAAA,IACd,MAAc;AAAA,IACd,KAAc;AAAA,IACd,QAAc;AAAA,IACd,QAAc;AAAA,IACd,UAAc;AAAA,IACd,cAAc;AAAA,IACd,MAAc;AAAA,IACd,OAAc;AAAA,EAChB;AAEA,QAAM,SAAkB;AAAA,IACtB;AAAA,MACE,OAAO;AAAA,MACP,UAAU;AAAA,QACR,EAAE,MAAM,WAAiB,MAAM,mDAAmD,MAAM,CAAC,qCAAqC,EAAE;AAAA,QAChI,EAAE,MAAM,QAAiB,MAAM,UAAU,MAAM,qCAAqC,MAAM,CAAC,2CAA2C,EAAE;AAAA,QACxI,EAAE,MAAM,UAAiB,MAAM,UAAU,MAAM,mCAAqC,MAAM,CAAC,kCAAkC,2CAA2C,EAAE;AAAA,QAC1K,EAAE,MAAM,aAAiB,MAAM,UAAU,MAAM,oBAAqC,MAAM,CAAC,kCAAkC,2CAA2C,EAAE;AAAA,MAC5K;AAAA,IACF;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,UAAU;AAAA,QACR,EAAE,MAAM,SAAiB,MAAM,UAAU,MAAM,8BAA0C,MAAM,CAAC,sCAAsC,EAAE;AAAA,QACxI,EAAE,MAAM,QAAiB,MAAM,UAAU,MAAM,qCAA2C,MAAM,CAAC,oCAAoC,EAAE;AAAA,QACvI,EA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,CAAC,IAAI,IAAI,KAAK,GAAG,UAAU;AACpC,cAAQ,IAAI,KAAK,EAAE,MAAM,IAAI,EAAE,KAAK,IAAI,EAAE,QAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE;AACnE,cAAQ,IAAI,OAAO,EAAE,GAAG,GAAG,IAAI,GAAG,EAAE,KAAK,EAAE;AAAA,IAC7C;AACA,YAAQ,IAAI;AAAA,EACd;AACF;AAEO,SAAS,SAAS,SAAwB;AAC/C,UAAQ,cAAc,EAAE,YAAY,MAAM,GAAG,CAAC;AAC9C,UAAQ,YAAY,YAAY,EAAE;AAClC,UAAQ,kBAAkB,MAAM;AAC9B,mCAAY;AACZ,qBAAiB;AACjB,WAAO;AAAA,EACT;AACF;",
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport { printBanner } from '../banner';\n\ntype CommandEntry = { name: string; args?: string; desc: string; opts?: string[] };\ntype Group = { title: string; commands: CommandEntry[] };\n\nexport function printColoredHelp(): void {\n const c = {\n reset: '\\x1b[0m',\n bold: '\\x1b[1m',\n dim: '\\x1b[2m',\n violet: '\\x1b[38;5;99m',\n purple: '\\x1b[38;5;135m',\n lavender: '\\x1b[38;5;141m',\n paleLavender: '\\x1b[38;5;183m',\n gray: '\\x1b[90m',\n brown: '\\x1b[38;5;130m',\n };\n\n const groups: Group[] = [\n {\n title: '\uD83D\uDD27 Workspace Setup',\n commands: [\n { name: 'install', desc: 'Wire up MCP/instructions for an agent workspace', opts: ['--target <t> kiro | claude | codex'] },\n { name: 'init', args: '[path]', desc: 'Initialize KiroGraph in a project', opts: ['-i, --index Index immediately after init'] },\n { name: 'uninit', args: '[path]', desc: 'Remove KiroGraph from a project', opts: ['--force Skip confirmation', '--target <t> kiro | claude | codex | all'] },\n { name: 'uninstall', args: '[path]', desc: 'Alias for uninit', opts: ['--force Skip confirmation', '--target <t> kiro | claude | codex | all'] },\n ],\n },\n {\n title: '\uD83D\uDCE6 Indexing',\n commands: [\n { name: 'index', args: '[path]', desc: 'Full re-index of a project', opts: ['--force Force re-index all files'] },\n { name: 'sync', args: '[path]', desc: 'Incremental sync of changed files', opts: ['--files <f> Specific files to sync'] },\n { name: 'sync-if-dirty', args: '[path]', desc: 'Sync only if a dirty marker is present', opts: ['-q, --quiet Suppress output'] },\n { name: 'mark-dirty', args: '[path]', desc: 'Write a dirty marker for deferred sync' },\n { name: 'unlock', args: '[path]', desc: 'Force-release a stale lock file' },\n ],\n },\n {\n title: '\uD83D\uDD0D Search & Exploration',\n commands: [\n { name: 'status', args: '[path]', desc: 'Show index statistics and health' },\n { name: 'query', args: '<search>', desc: 'Search for symbols by name', opts: ['--kind <k> Filter by kind', '--limit <n> Max results (default 10)'] },\n { name: 'context', args: '<task>', desc: 'Build relevant code context for a task', opts: ['--max-nodes <n> Max symbols (default 20)', '--no-code Exclude code snippets', '--format <fmt> markdown | json'] },\n { name: 'files', args: '[path]', desc: 'Show project file structure from the index', opts: ['--format <fmt> tree | flat | grouped', '--filter <path> Filter by directory prefix', '--pattern <glob> Filter by glob', '--max-depth <n> Limit tree depth', '--json Output as JSON'] },\n { name: 'path', args: '<from> <to>', desc: 'Find the shortest path between two symbols', opts: ['--format <fmt> table | json'] },\n { name: 'export build', args: '[path]', desc: 'Generate the interactive graph dashboard (.kirograph/export/)', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'export start', args: '[path]', desc: 'Generate and open the dashboard in the browser', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'affected', args: '[files...]', desc: 'Find test files affected by changed source files', opts: ['--stdin Read file list from stdin', '-d, --depth <n> Max traversal depth (default 5)', '-f, --filter <g> Custom test file glob', '-j, --json Output as JSON', '-q, --quiet File paths only'] },\n ],\n },\n {\n title: '\uD83D\uDCCA Graph Insights',\n commands: [\n { name: 'hotspots', args: '[path]', desc: 'Find most-connected symbols by edge degree', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'surprising', args: '[path]', desc: 'Find non-obvious cross-file connections', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'dead-code', args: '[path]', desc: 'Find unexported symbols with no incoming references', opts: ['--limit <n> Max results (default 50)', '--format <f> table | json'] },\n { name: 'snapshot', desc: 'Save or list graph snapshots for structural diffing', opts: ['save [label] Save current graph state', 'list List saved snapshots', 'diff [label] Diff current graph vs a snapshot --format summary|full|json'] },\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture Analysis',\n commands: [\n { name: 'architecture', args: '[path]', desc: 'Show package graph and layer map', opts: ['--packages Show packages only', '--layers Show layers only', '--format <f> json'] },\n { name: 'coupling', args: '[path]', desc: 'Show coupling metrics per package', opts: ['--sort <s> instability | ca | ce | name', '--package <n> Detail view for one package', '--format <f> json'] },\n { name: 'package', args: '<name>', desc: 'Inspect a package: deps, files, metrics', opts: ['--no-files Omit file list', '--format <f> json'] },\n ],\n },\n {\n title: '\u2699\uFE0F Agent & Configuration',\n commands: [\n { name: 'caveman', args: '[mode]', desc: 'Set agent communication style (off | lite | full | ultra)' },\n { name: 'compression', args: '[level]', desc: 'Set shell compression level (off | normal | aggressive | ultra)' },\n { name: 'exec', args: '<command...>', desc: 'Run a shell command with token-optimized output', opts: ['-l, --level <l> normal | aggressive | ultra', '-t, --timeout <s> Timeout in seconds (default 60)', '--raw Show raw + compressed for comparison', '--json Output as JSON'] },\n { name: 'gain', desc: 'Show token savings from compressed command outputs', opts: ['--graph ASCII graph (last 30 days)', '--history Recent command history', '--daily Day-by-day breakdown', '--period <p> session | today | week | all'] },\n { name: 'mem', args: '<command>', desc: 'Persistent memory (search, store, timeline, status, prune, lint, reembed)' },\n { name: 'serve', desc: 'Start the MCP server', opts: ['--mcp Run as MCP stdio server', '--path <p> Project path'] },\n { name: 'dashboard', desc: 'Manage the Qdrant or Typesense dashboard server', opts: ['start [path] Start server and open dashboard', 'stop [path] Stop the running server'] },\n ],\n },\n ];\n\n console.log(`\\n${c.bold}${c.paleLavender}USAGE${c.reset}`);\n console.log(` ${c.lavender}kirograph${c.reset} ${c.gray}<command>${c.reset} ${c.dim}[options]${c.reset}\\n`);\n\n // Compute max name+args width across ALL groups for alignment\n const allCmds = groups.flatMap(g => g.commands);\n const nameWidth = Math.max(...allCmds.map(cmd => (cmd.name + (cmd.args ? ' ' + cmd.args : '')).length)) + 2;\n\n for (const group of groups) {\n console.log(`${c.bold}${c.paleLavender}${group.title.toUpperCase()}${c.reset}\\n`);\n for (const cmd of group.commands) {\n const signature = cmd.name + (cmd.args ? ' ' + cmd.args : '');\n const isCaveman = cmd.name === 'caveman';\n const nameColor = isCaveman ? c.brown : c.lavender;\n const prefix = isCaveman ? '\uD83E\uDEA8 ' : ' ';\n const namePart = `${nameColor}${cmd.name}${c.reset}${cmd.args ? ' ' + c.dim + cmd.args + c.reset : ''}`;\n const pad = ' '.repeat(Math.max(0, nameWidth - signature.length));\n console.log(`${prefix}${namePart}${pad}${c.gray}${cmd.desc}${c.reset}`);\n if (isCaveman) {\n // desc starts at: emoji prefix (3 display cols: \uD83E\uDEA8 + space) + nameWidth\n const inspiredPad = ' '.repeat(3 + nameWidth);\n console.log(`${inspiredPad}${c.dim}Inspired by Caveman , original idea by github.com/JuliusBrussee/caveman${c.reset}`);\n console.log();\n }\n if (cmd.opts) {\n for (const opt of cmd.opts) {\n const [flag, ...rest] = opt.split(/ +/);\n const optPad = ' '.repeat(nameWidth + 2);\n console.log(` ${optPad}${c.purple}${flag}${c.reset}${rest.length ? ' ' + c.dim + rest.join(' ') + c.reset : ''}`);\n }\n console.log();\n }\n }\n if (!groups[groups.length - 1].commands.includes(group.commands[group.commands.length - 1])) {\n // extra spacing between groups handled by opts blank line; add one if no opts\n const lastHasOpts = group.commands[group.commands.length - 1].opts;\n if (!lastHasOpts) console.log();\n }\n }\n\n console.log(`${c.bold}${c.paleLavender}GLOBAL FLAGS${c.reset}\\n`);\n console.log(` ${c.purple}-h, --help${c.reset} ${c.gray}Show this help${c.reset}`);\n console.log(` ${c.purple}-V, --version${c.reset} ${c.gray}Show version number${c.reset}\\n`);\n\n console.log(`${c.bold}${c.paleLavender}EXAMPLES${c.reset}\\n`);\n\n const exampleGroups: Array<{ title: string; examples: [string, string][] }> = [\n {\n title: '\uD83D\uDD27 Setup & indexing',\n examples: [\n ['kirograph install', 'Wire up Kiro MCP + hooks + steering for the current workspace'],\n ['kirograph install --target claude', 'Wire up Claude Code MCP + project memory'],\n ['kirograph install --target codex', 'Install Codex project instructions and print MCP config'],\n ['kirograph init --index', 'Init and immediately index the project'],\n ['kirograph sync', 'Incremental sync of changed files'],\n ],\n },\n {\n title: '\uD83D\uDD0D Search & exploration',\n examples: [\n ['kirograph query useState', 'Find all symbols named useState'],\n ['kirograph context \"add dark mode\"', 'Get relevant code context for a task'],\n ['kirograph files --format grouped', 'Show files grouped by directory'],\n ['kirograph path LoginController DatabasePool', 'Find how two symbols are connected'],\n ['kirograph affected src/auth.ts', 'Find tests affected by a change'],\n ['git diff --name-only | kirograph affected --stdin', 'Affected tests from a git diff'],\n ['kirograph export start', 'Open the interactive graph dashboard in the browser'],\n ['kirograph export build -o /tmp/graph', 'Export the dashboard to a custom directory'],\n ],\n },\n {\n title: '\uD83D\uDCCA Graph insights',\n examples: [\n ['kirograph hotspots --limit 10', 'Top 10 most-connected symbols'],\n ['kirograph surprising', 'Find unexpected cross-module connections'],\n ['kirograph dead-code', 'Find unreferenced unexported symbols'],\n ['kirograph snapshot save pre-refactor', 'Save a named snapshot before a refactor'],\n ['kirograph snapshot diff pre-refactor', 'Diff current graph vs the named snapshot'],\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture',\n examples: [\n ['kirograph architecture --packages', 'List all detected packages'],\n ['kirograph coupling --sort instability', 'Show packages ranked by instability'],\n ['kirograph package src/auth', 'Inspect the auth package'],\n ],\n },\n {\n title: '\u2699\uFE0F Agent',\n examples: [\n ['kirograph caveman full', 'Enable full caveman mode for the agent'],\n ['kirograph caveman off', 'Disable caveman mode'],\n ['kirograph compression aggressive', 'Set compression to aggressive level'],\n ['kirograph compression off', 'Disable compression hook (tool still available)'],\n ['kirograph exec git status', 'Run git status with compression'],\n ['kirograph exec --level ultra npm test', 'Run tests with ultra compression'],\n ['kirograph exec --raw cargo build', 'Show raw vs compressed comparison'],\n ['kirograph gain --graph', 'Show token savings graph'],\n ['kirograph mem search \"auth decision\"', 'Search memory for past decisions'],\n ['kirograph mem store \"use idempotency keys\" --kind decision', 'Store a decision'],\n ['kirograph serve --mcp', 'Start the MCP server'],\n ],\n },\n ];\n\n for (const eg of exampleGroups) {\n console.log(` ${c.dim}${eg.title}${c.reset}`);\n for (const [ex, desc] of eg.examples) {\n console.log(` ${c.violet}$${c.reset} ${c.lavender}${ex}${c.reset}`);\n console.log(` ${c.dim}${desc}${c.reset}`);\n }\n console.log();\n }\n}\n\nexport function register(program: Command): void {\n program.configureHelp({ formatHelp: () => '' });\n program.addHelpText('afterAll', '');\n program.helpInformation = () => {\n printBanner();\n printColoredHelp();\n return '';\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA4B;AAKrB,SAAS,mBAAyB;AACvC,QAAM,IAAI;AAAA,IACR,OAAc;AAAA,IACd,MAAc;AAAA,IACd,KAAc;AAAA,IACd,QAAc;AAAA,IACd,QAAc;AAAA,IACd,UAAc;AAAA,IACd,cAAc;AAAA,IACd,MAAc;AAAA,IACd,OAAc;AAAA,EAChB;AAEA,QAAM,SAAkB;AAAA,IACtB;AAAA,MACE,OAAO;AAAA,MACP,UAAU;AAAA,QACR,EAAE,MAAM,WAAiB,MAAM,mDAAmD,MAAM,CAAC,qCAAqC,EAAE;AAAA,QAChI,EAAE,MAAM,QAAiB,MAAM,UAAU,MAAM,qCAAqC,MAAM,CAAC,2CAA2C,EAAE;AAAA,QACxI,EAAE,MAAM,UAAiB,MAAM,UAAU,MAAM,mCAAqC,MAAM,CAAC,kCAAkC,2CAA2C,EAAE;A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B;AAAA,QACzE,CAAC,oCAAiD,qCAAqC;AAAA,QACvF,CAAC,6BAAkD,iDAAiD;AAAA,QACpG,CAAC,6BAAkD,iCAAiC;AAAA,QACpF,CAAC,yCAAkD,kCAAkC;AAAA,QACrF,CAAC,oCAAkD,mCAAmC;AAAA,QACtF,CAAC,0BAAkD,0BAA0B;AAAA,QAC7E,CAAC,wCAAmD,kCAAkC;AAAA,QACtF,CAAC,8DAA8D,kBAAkB;AAAA,QACjF,CAAC,yBAAkD,sBAAsB;AAAA,MAC3E;AAAA,IACF;AAAA,EACF;AAEA,aAAW,MAAM,eAAe;AAC9B,YAAQ,IAAI,KAAK,EAAE,GAAG,GAAG,GAAG,KAAK,GAAG,EAAE,KAAK,EAAE;AAC7C,eAAW,CAAC,IAAI,IAAI,KAAK,GAAG,UAAU;AACpC,cAAQ,IAAI,KAAK,EAAE,MAAM,IAAI,EAAE,KAAK,IAAI,EAAE,QAAQ,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE;AACnE,cAAQ,IAAI,OAAO,EAAE,GAAG,GAAG,IAAI,GAAG,EAAE,KAAK,EAAE;AAAA,IAC7C;AACA,YAAQ,IAAI;AAAA,EACd;AACF;AAEO,SAAS,SAAS,SAAwB;AAC/C,UAAQ,cAAc,EAAE,YAAY,MAAM,GAAG,CAAC;AAC9C,UAAQ,YAAY,YAAY,EAAE;AAClC,UAAQ,kBAAkB,MAAM;AAC9B,mCAAY;AACZ,qBAAiB;AACjB,WAAO;AAAA,EACT;AACF;",
6
6
  "names": []
7
7
  }
@@ -34,8 +34,10 @@ __export(uninit_exports, {
34
34
  module.exports = __toCommonJS(uninit_exports);
35
35
  var path = __toESM(require("path"));
36
36
  var fs = __toESM(require("fs"));
37
+ var readline = __toESM(require("readline"));
37
38
  var import_banner = require("../banner");
38
39
  var import_ui = require("../ui");
40
+ var import_prompts = require("../installer/prompts");
39
41
  const UNINIT_FAREWELLS = [
40
42
  "Oh. So it's come to this.",
41
43
  "We're sorry to see you go. (Are we? Yes. We are.)",
@@ -49,14 +51,6 @@ const UNINIT_FAREWELLS = [
49
51
  "See you on the other side of `kirograph install`."
50
52
  ];
51
53
  const UNINIT_TARGETS = ["kiro", "claude", "codex", "all"];
52
- async function confirm(question) {
53
- const readline = await import("readline");
54
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
55
- return new Promise((resolve) => rl.question(question, (ans) => {
56
- rl.close();
57
- resolve(ans.toLowerCase() === "y");
58
- }));
59
- }
60
54
  async function runUninit(projectPath, opts) {
61
55
  const target = path.resolve(projectPath ?? process.cwd());
62
56
  const integration = (opts.target ?? "kiro").toLowerCase();
@@ -77,10 +71,11 @@ async function runUninit(projectPath, opts) {
77
71
  console.log(` ${import_ui.violet}${import_ui.bold}${farewell}${import_ui.reset}`);
78
72
  console.log(`
79
73
  ${import_ui.dim}This can remove ${integration} integration files and, separately, the shared .kirograph/ data.${import_ui.reset}`);
80
- console.log(` ${import_ui.dim}Your source code is untouched.${import_ui.reset}
81
- `);
82
- removeIntegration = await confirm(` ${import_ui.violet}Remove ${integration} integration files?${import_ui.reset} ${import_ui.dim}(y/N)${import_ui.reset} `);
83
- removeGraph = await confirm(` ${import_ui.violet}Remove shared .kirograph/ data too?${import_ui.reset} ${import_ui.dim}(y/N)${import_ui.reset} `);
74
+ console.log(` ${import_ui.dim}Your source code is untouched.${import_ui.reset}`);
75
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
76
+ removeIntegration = await (0, import_prompts.askToggle)(rl, `Remove ${integration} integration files?`, "Removes hooks, steering, MCP config, and agent instructions for this target.", false);
77
+ removeGraph = await (0, import_prompts.askToggle)(rl, "Remove shared .kirograph/ data too?", "Deletes the graph database, snapshots, and all indexed data. Cannot be undone.", false);
78
+ rl.close();
84
79
  if (!removeIntegration && !removeGraph) {
85
80
  console.log(`
86
81
  ${import_ui.dim}Cancelled. Nothing removed.${import_ui.reset}
@@ -100,6 +95,7 @@ async function runUninit(projectPath, opts) {
100
95
  "kirograph-sync-on-delete.kiro.hook",
101
96
  "kirograph-sync-if-dirty.kiro.hook",
102
97
  "kirograph-compress-hint.kiro.hook",
98
+ "kirograph-mem-capture.kiro.hook",
103
99
  // Legacy .json filenames
104
100
  "kirograph-mark-dirty-on-save.json",
105
101
  "kirograph-mark-dirty-on-create.json",
@@ -107,7 +103,8 @@ async function runUninit(projectPath, opts) {
107
103
  "kirograph-sync-if-dirty.json",
108
104
  "kirograph-sync-on-save.json",
109
105
  "kirograph-sync-on-create.json",
110
- "kirograph-compress-hint.json"
106
+ "kirograph-compress-hint.json",
107
+ "kirograph-mem-capture.json"
111
108
  ];
112
109
  const hooksDir = path.join(target, ".kiro", "hooks");
113
110
  let removedHooks = 0;