kirograph 0.20.1 โ†’ 0.22.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 (58) hide show
  1. package/README.md +4 -3
  2. package/dist/bin/commands/data.js +52 -0
  3. package/dist/bin/commands/data.js.map +2 -2
  4. package/dist/bin/commands/docs.js +2 -1
  5. package/dist/bin/commands/docs.js.map +2 -2
  6. package/dist/bin/commands/gain.js +21 -1
  7. package/dist/bin/commands/gain.js.map +2 -2
  8. package/dist/bin/commands/status.js +23 -1
  9. package/dist/bin/commands/status.js.map +2 -2
  10. package/dist/bin/installer/config-prompt.js +30 -1
  11. package/dist/bin/installer/config-prompt.js.map +2 -2
  12. package/dist/bin/installer/index.js +108 -0
  13. package/dist/bin/installer/index.js.map +2 -2
  14. package/dist/bin/kirograph.js +1 -1
  15. package/dist/config.js +19 -2
  16. package/dist/config.js.map +2 -2
  17. package/dist/core/pipeline.js +3 -1
  18. package/dist/core/pipeline.js.map +2 -2
  19. package/dist/data/indexer.js +4 -4
  20. package/dist/data/indexer.js.map +2 -2
  21. package/dist/data/linker.js +9 -5
  22. package/dist/data/linker.js.map +2 -2
  23. package/dist/data/linker.test.js +60 -0
  24. package/dist/data/linker.test.js.map +7 -0
  25. package/dist/data/parsers/__fixtures__/pdf-inspector-stub.js +41 -0
  26. package/dist/data/parsers/__fixtures__/pdf-inspector-stub.js.map +7 -0
  27. package/dist/data/parsers/index.js +3 -1
  28. package/dist/data/parsers/index.js.map +2 -2
  29. package/dist/data/parsers/pdf.js +95 -0
  30. package/dist/data/parsers/pdf.js.map +7 -0
  31. package/dist/data/parsers/pdf.test.js +125 -0
  32. package/dist/data/parsers/pdf.test.js.map +7 -0
  33. package/dist/data/queries.js +39 -2
  34. package/dist/data/queries.js.map +2 -2
  35. package/dist/data/types.js.map +1 -1
  36. package/dist/db/data-schema.sql +2 -1
  37. package/dist/db/database.js +7 -0
  38. package/dist/db/database.js.map +2 -2
  39. package/dist/docs/indexer.js +2 -1
  40. package/dist/docs/indexer.js.map +2 -2
  41. package/dist/docs/queries.js +2 -1
  42. package/dist/docs/queries.js.map +2 -2
  43. package/dist/docs/vectors.js +46 -5
  44. package/dist/docs/vectors.js.map +2 -2
  45. package/dist/index.js +1 -0
  46. package/dist/index.js.map +2 -2
  47. package/dist/mcp/tools.js +1 -1
  48. package/dist/mcp/tools.js.map +2 -2
  49. package/dist/memory/index.js +2 -1
  50. package/dist/memory/index.js.map +2 -2
  51. package/dist/memory/vectors.js +52 -8
  52. package/dist/memory/vectors.js.map +3 -3
  53. package/dist/types.js.map +2 -2
  54. package/dist/vectors/index.js +66 -3
  55. package/dist/vectors/index.js.map +2 -2
  56. package/dist/vectors/turbovec-index.js +189 -0
  57. package/dist/vectors/turbovec-index.js.map +7 -0
  58. package/package.json +7 -1
package/README.md CHANGED
@@ -33,7 +33,9 @@ The result is fewer tool calls, less context used, and faster responses on compl
33
33
  | ๐Ÿงช **Affected Tests** | Find test files impacted by source changes โ€” useful in CI and pre-commit hooks |
34
34
  | ๐ŸŒ **Graph Export** | Interactive browser dashboard with search, clustering, path finding, and analytics |
35
35
  | <h4>Semantic Search</h4> | |
36
- | โšก **7 Semantic Engines** | Cosine, sqlite-vec, Orama, PGlite, LanceDB, Qdrant, Typesense โ€” pick the best fit for your project |
36
+ | โšก **9 Semantic Engines** | Cosine, TurboQuant, TurboVec, sqlite-vec, Orama, PGlite, LanceDB, Qdrant, Typesense โ€” pick the best fit for your project |
37
+ | ๐Ÿ—œ๏ธ **TurboQuant Embedding Compression** | Compresses embeddings 20โ€“30ร— at index time using [Google's TurboQuant algorithm](https://research.google/blog/turboquant-redefining-ai-efficiency-with-extreme-compression/) (Walsh-Hadamard rotation + Lloyd-Max quantization). A 768-dim `Float32` vector (3,072 bytes) becomes ~120 bytes โ€” 300 MB of raw embeddings shrinks to ~12 MB in RAM. ANN search with **zero native dependencies**, pure TypeScript. Configurable via `turboquantBits`. Powered by [turboquant-js](https://github.com/danilodevhub/turboquant-js) by Danilo Dev. |
38
+ | โšก **TurboVec (Rust/SIMD)** | Same TurboQuant algorithm in Rust via napi-rs โ€” NEON on ARM64, AVX-512BW on x86. Faster search at the cost of a one-time Rust build. Configurable via `turbovecBits` (2โ€“4). Powered by [turbovec](https://github.com/RyanCodrai/turbovec) by Ryan Codrai. The native addon (`native/turbovec-node/`) is a Rust crate with its own Cargo build โ€” it lives outside `src/` because it is not TypeScript. `kirograph install` builds it automatically. |
37
39
  | ๐Ÿค– **Custom Embedding Models** | Use any HuggingFace `feature-extraction` model โ€” nomic, Gemma, MiniLM, BGE, or bring your own |
38
40
  | <h4>Architecture (KiroGraph-Arch opt-in module)</h4> | |
39
41
  | ๐Ÿ›๏ธ **Architecture Analysis** | Package graph, layer detection, coupling metrics (Ca/Ce/instability) |
@@ -44,7 +46,7 @@ The result is fewer tool calls, less context used, and faster responses on compl
44
46
  | ๐Ÿง  **Persistent Memor (KiroGraph-Mem opt-in module)** | Cross-session observations โ€” decisions, errors, patterns โ€” auto-linked to code symbols |
45
47
  | ๐Ÿ‘๏ธ **Watchmen (KiroGraph-Watchmen opt-in module)** โš ๏ธ *experimental* | Auto-synthesizes accumulated memory observations into workspace briefs and `inclusion: manual` skill files. Fires via the `watchmenReady` signal in `kirograph_mem_store` when threshold is reached. **Local model** (default, `watchmenSynthesisMode: 'local'`): runs `gemma-4-E4B-it-ONNX` on-device via `@huggingface/transformers` โ€” ~3โ€“4 GB one-time download, ~3โ€“5 GB RAM, 8โ€“15 s on Apple Silicon M1+. No API key, no background daemon, no external calls. **Agent mode** also available for Kiro (`watchmenSynthesisMode: 'agent'`, uses active session). โš ๏ธ **Experimental:** output quality in local mode depends heavily on the model chosen and your hardware. Smaller models or slower machines may produce incomplete briefs and lower-quality skill files. Use `agent` mode for best results. |
46
48
  | ๐Ÿ“– **Documentation Indexing (KiroGraph-Doc opt-in module)** | Section-level retrieval from Markdown, MDX, RST, AsciiDoc, OpenAPI โ€” 92-97% token savings |
47
- | ๐Ÿ“Š **Data Navigation (KiroGraph-Data opt-in module)** | Query CSV/JSON/Excel/Parquet with filters, aggregations, joins โ€” all server-side in SQLite |
49
+ | ๐Ÿ“Š **Data Navigation (KiroGraph-Data opt-in module)** | Query CSV/JSON/Excel/Parquet/**PDF** with filters, aggregations, joins โ€” all server-side in SQLite |
48
50
  | <h4>Token Optimization</h4> | |
49
51
  | ๐Ÿ—œ๏ธ **Shell Compression (KiroGraph-RTK opt-in module)** | Token-optimized command output (git, tests, linters, docker, AWS) โ€” 60-90% savings |
50
52
  | ๐Ÿชจ **Caveman Mode (KiroGraph-Caveman opt-in module)** ๐Ÿชจ | Agent prose compression (lite โ†’ ultra) โ€” fewer tokens on explanations without touching code |
@@ -52,7 +54,6 @@ The result is fewer tool calls, less context used, and faster responses on compl
52
54
  | <h4>Integration (KiroGraph-Integration core module)</h4> | |
53
55
  | ๐Ÿ”Œ **Multi-tool Support** | Native Kiro + 32 experimental targets (Cursor, Copilot, Claude Code, Codex, Windsurf, Cline, and more) |
54
56
 
55
-
56
57
  ## Quick Start
57
58
 
58
59
  ```bash
@@ -620,6 +620,58 @@ function register(program) {
620
620
  }
621
621
  cg.close();
622
622
  });
623
+ data.command("classify <file>").description("Classify a PDF file before indexing (fast, no full parse)").option("--json", "Output as JSON").action(async (file, opts) => {
624
+ const path = require("path");
625
+ const fs = require("fs");
626
+ const absPath = path.isAbsolute(file) ? file : path.join(process.cwd(), file);
627
+ if (!fs.existsSync(absPath)) {
628
+ console.error(` \u2716 File not found: ${absPath}`);
629
+ process.exit(1);
630
+ }
631
+ if (!absPath.toLowerCase().endsWith(".pdf")) {
632
+ console.error(` \u2716 Not a PDF file: ${file}`);
633
+ process.exit(1);
634
+ }
635
+ let pdfModule;
636
+ try {
637
+ pdfModule = require("@firecrawl/pdf-inspector");
638
+ } catch {
639
+ console.error(` \u2716 @firecrawl/pdf-inspector is not installed.`);
640
+ console.error(` ${import_ui.dim}Install with:${import_ui.reset} npm install --save-optional @firecrawl/pdf-inspector`);
641
+ process.exit(1);
642
+ }
643
+ const buffer = fs.readFileSync(absPath);
644
+ let result;
645
+ try {
646
+ result = pdfModule.classifyPdf(buffer);
647
+ } catch {
648
+ try {
649
+ const meta = pdfModule.processPdf(buffer);
650
+ result = {
651
+ pdfType: meta.pdfType,
652
+ pageCount: meta.pageCount ?? null,
653
+ pagesNeedingOcr: meta.pagesNeedingOcr ?? [],
654
+ confidence: meta.confidence ?? null
655
+ };
656
+ } catch (err) {
657
+ console.error(` \u2716 Classification failed: ${err instanceof Error ? err.message : String(err)}`);
658
+ process.exit(1);
659
+ }
660
+ }
661
+ if (opts.json) {
662
+ console.log(JSON.stringify(result, null, 2));
663
+ } else {
664
+ const ocrPages = result.pagesNeedingOcr ?? [];
665
+ console.log(`
666
+ ${import_ui.bold}PDF Classification${import_ui.reset}: ${import_ui.green}${path.basename(file)}${import_ui.reset}
667
+ `);
668
+ console.log(` ${import_ui.dim}Type:${import_ui.reset} ${result.pdfType ?? "unknown"}`);
669
+ if (result.confidence != null) console.log(` ${import_ui.dim}Confidence:${import_ui.reset} ${result.confidence}`);
670
+ if (result.pageCount != null) console.log(` ${import_ui.dim}Pages:${import_ui.reset} ${result.pageCount}`);
671
+ console.log(` ${import_ui.dim}OCR needed:${import_ui.reset} ${ocrPages.length === 0 ? "none" : ocrPages.length + " pages"}`);
672
+ console.log();
673
+ }
674
+ });
623
675
  data.command("lint").description("Validate data index integrity").option("--json", "Output as JSON").action(async (opts) => {
624
676
  const cwd = process.cwd();
625
677
  const config = await (0, import_config.loadConfig)(cwd);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/bin/commands/data.ts"],
4
- "sourcesContent": ["import { Command } from 'commander';\nimport { loadConfig } from '../../config';\nimport { dim, reset, violet, bold, green, value } from '../ui';\n\nexport function register(program: Command): void {\n const data = program\n .command('data')\n .description('Tabular data navigation (requires enableData: true)');\n\n // \u2500\u2500 list \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('list')\n .description('List all indexed datasets')\n .option('--json', 'Output as JSON')\n .action(async (opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const datasets = dq.listDatasets();\n\n if (datasets.length === 0) {\n console.log(` ${dim}No datasets indexed.${reset} Run ${violet}${bold}kirograph index${reset} first.`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(datasets, null, 2));\n } else {\n console.log(`\\n ${bold}Indexed Datasets${reset} (${datasets.length})\\n`);\n for (const ds of datasets) {\n const sizeMb = (ds.fileSize / 1024 / 1024).toFixed(2);\n console.log(` ${green}${ds.id}${reset}`);\n console.log(` ${dim}File:${reset} ${ds.filePath} ${dim}Format:${reset} ${ds.format}`);\n console.log(` ${dim}Rows:${reset} ${ds.rowCount.toLocaleString()} ${dim}Columns:${reset} ${ds.columnCount} ${dim}Size:${reset} ${sizeMb} MB`);\n console.log();\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 describe \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('describe <dataset>')\n .description('Show schema and column profiles for a dataset')\n .option('--column <name>', 'Deep dive on a single column')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { column?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n\n if (opts.column) {\n const col = dq.describeColumn(dataset, opts.column);\n if (!col) {\n console.error(` \u2716 Column \"${opts.column}\" not found in dataset \"${dataset}\".`);\n cg.close(); process.exit(1);\n }\n if (opts.json) {\n console.log(JSON.stringify(col, null, 2));\n } else {\n console.log(`\\n ${bold}${col.name}${reset} ${dim}(${col.inferredType})${reset}`);\n console.log(` ${dim}Position:${reset} ${col.position}`);\n console.log(` ${dim}Nullable:${reset} ${col.nullable ? 'yes' : 'no'} (${col.nullPct.toFixed(1)}% null, ${col.nullCount} nulls)`);\n console.log(` ${dim}Cardinality:${reset} ${col.cardinality}`);\n if (col.minValue != null) console.log(` ${dim}Min:${reset} ${col.minValue}`);\n if (col.maxValue != null) console.log(` ${dim}Max:${reset} ${col.maxValue}`);\n if (col.meanValue != null) console.log(` ${dim}Mean:${reset} ${col.meanValue.toFixed(4)}`);\n if (col.sampleValues.length > 0) console.log(` ${dim}Samples:${reset} ${col.sampleValues.join(', ')}`);\n console.log();\n }\n cg.close(); return;\n }\n\n const info = dq.describeDataset(dataset);\n if (!info) {\n console.error(` \u2716 Dataset \"${dataset}\" not found. Run ${violet}${bold}kirograph data list${reset} to see available datasets.`);\n cg.close(); process.exit(1);\n }\n\n if (opts.json) {\n console.log(JSON.stringify(info, null, 2));\n } else {\n const ds = info.dataset;\n const sizeMb = (ds.fileSize / 1024 / 1024).toFixed(2);\n console.log(`\\n ${bold}${ds.id}${reset}`);\n console.log(` ${dim}File:${reset} ${ds.filePath} ${dim}Format:${reset} ${ds.format} ${dim}Size:${reset} ${sizeMb} MB`);\n console.log(` ${dim}Rows:${reset} ${ds.rowCount.toLocaleString()} ${dim}Columns:${reset} ${ds.columnCount}`);\n console.log(`\\n ${bold}Columns:${reset}\\n`);\n\n const maxNameLen = Math.max(...info.columns.map(c => c.name.length), 4);\n console.log(` ${'Name'.padEnd(maxNameLen)} ${'Type'.padEnd(8)} ${'Null%'.padEnd(6)} ${'Card'.padEnd(6)} Samples`);\n console.log(` ${'-'.repeat(maxNameLen)} ${'-'.repeat(8)} ${'-'.repeat(6)} ${'-'.repeat(6)} -------`);\n for (const col of info.columns) {\n const nullPct = col.nullPct > 0 ? `${col.nullPct.toFixed(1)}%` : '0%';\n const samples = col.sampleValues.slice(0, 3).join(', ');\n console.log(` ${col.name.padEnd(maxNameLen)} ${col.inferredType.padEnd(8)} ${nullPct.padEnd(6)} ${String(col.cardinality).padEnd(6)} ${dim}${samples}${reset}`);\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 query \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('query <dataset>')\n .description('Query rows with filters')\n .option('--filter <expr...>', 'Filters in format column:op:value (e.g. age:gt:18)')\n .option('--columns <cols>', 'Comma-separated column names to project')\n .option('--limit <n>', 'Max rows to return', '20')\n .option('--offset <n>', 'Offset for pagination', '0')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { filter?: string[]; columns?: string; limit?: string; offset?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n\n // Parse filters\n const filters = (opts.filter ?? []).map(f => {\n const parts = f.split(':');\n if (parts.length < 3) {\n console.error(` \u2716 Invalid filter format: \"${f}\". Expected column:op:value`);\n process.exit(1);\n }\n const column = parts[0]!;\n const op = parts[1]! as any;\n const val = parts.slice(2).join(':'); // value may contain colons\n return { column, op, value: val };\n });\n\n const columns = opts.columns ? opts.columns.split(',').map(c => c.trim()) : undefined;\n const limit = parseInt(opts.limit ?? '20', 10);\n const offset = parseInt(opts.offset ?? '0', 10);\n\n const result = dq.queryRows(dataset, { filters, columns, limit, offset });\n if (!result) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${dim}Showing ${result.rows.length} of ${result.totalMatching} matching rows${reset}\\n`);\n if (result.rows.length > 0) {\n // Simple table output\n const keys = Object.keys(result.rows[0]!).filter(k => k !== 'rowid');\n const widths = keys.map(k => Math.max(k.length, ...result.rows.map(r => String(r[k] ?? '').slice(0, 30).length)));\n // Header\n console.log(' ' + keys.map((k, i) => k.padEnd(widths[i]!)).join(' '));\n console.log(' ' + widths.map(w => '-'.repeat(w)).join(' '));\n // Rows\n for (const row of result.rows) {\n console.log(' ' + keys.map((k, i) => String(row[k] ?? '').slice(0, 30).padEnd(widths[i]!)).join(' '));\n }\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 aggregate \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('aggregate <dataset>')\n .description('Server-side aggregation (GROUP BY)')\n .requiredOption('--group-by <cols>', 'Comma-separated columns to group by')\n .requiredOption('--metric <expr...>', 'Metrics in format op:column (e.g. sum:amount, avg:price)')\n .option('--filter <expr...>', 'Filters in format column:op:value')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { groupBy: string; metric: string[]; filter?: string[]; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n\n const groupBy = opts.groupBy.split(',').map(c => c.trim());\n const metrics = opts.metric.map(m => {\n const [op, ...colParts] = m.split(':');\n const column = colParts.join(':');\n if (!op || !column) {\n console.error(` \u2716 Invalid metric format: \"${m}\". Expected op:column (e.g. sum:amount)`);\n process.exit(1);\n }\n return { op: op as any, column };\n });\n\n const filters = (opts.filter ?? []).map(f => {\n const parts = f.split(':');\n if (parts.length < 3) { console.error(` \u2716 Invalid filter: \"${f}\"`); process.exit(1); }\n return { column: parts[0]!, op: parts[1]! as any, value: parts.slice(2).join(':') };\n });\n\n const result = dq.aggregate(dataset, { groupBy, metrics, filters });\n if (!result) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${dim}${result.rows.length} groups${reset}\\n`);\n if (result.rows.length > 0) {\n const keys = Object.keys(result.rows[0]!);\n const widths = keys.map(k => Math.max(k.length, ...result.rows.map(r => String(r[k] ?? '').slice(0, 20).length)));\n console.log(' ' + keys.map((k, i) => k.padEnd(widths[i]!)).join(' '));\n console.log(' ' + widths.map(w => '-'.repeat(w)).join(' '));\n for (const row of result.rows) {\n console.log(' ' + keys.map((k, i) => String(row[k] ?? '').slice(0, 20).padEnd(widths[i]!)).join(' '));\n }\n }\n console.log();\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 data\n .command('search <dataset> <query>')\n .description('Search column names and sample values by keyword')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, query: string, opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const results = dq.searchColumns(dataset, query);\n\n if (results.length === 0) {\n console.log(` ${dim}No columns matching \"${query}\" in dataset \"${dataset}\".${reset}`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(results, null, 2));\n } else {\n console.log(`\\n ${bold}Columns matching \"${query}\"${reset} (${results.length})\\n`);\n for (const col of results) {\n const samples = col.sampleValues.slice(0, 5).join(', ');\n console.log(` ${green}${col.name}${reset} ${dim}(${col.inferredType})${reset}`);\n console.log(` ${dim}Cardinality:${reset} ${col.cardinality} ${dim}Null:${reset} ${col.nullPct.toFixed(1)}%`);\n if (samples) console.log(` ${dim}Samples:${reset} ${samples}`);\n console.log();\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 index \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('index')\n .description('Index all data files (incremental)')\n .option('--json', 'Output as JSON')\n .action(async (opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataIndexer } = await Promise.resolve().then(() => require('../../data/indexer.js'));\n const indexer = new DataIndexer(db.getRawDb(), config, cwd);\n const result = await indexer.indexAll({\n onProgress: (msg) => { if (!opts.json) console.log(` ${dim}${msg}${reset}`); },\n });\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${green}\u2713${reset} Indexed ${bold}${result.datasetsIndexed}${reset} datasets, ${result.rowsIndexed.toLocaleString()} rows, ${result.columnsProfiled} columns (${result.duration}ms)`);\n if (result.errors.length > 0) {\n console.log(` ${dim}Errors (${result.errors.length}):${reset}`);\n for (const err of result.errors.slice(0, 5)) {\n console.log(` \u2716 ${err}`);\n }\n }\n console.log();\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 data\n .command('reindex')\n .description('Force re-index all data files (ignores content hashes)')\n .option('--json', 'Output as JSON')\n .action(async (opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataIndexer } = await Promise.resolve().then(() => require('../../data/indexer.js'));\n const indexer = new DataIndexer(db.getRawDb(), config, cwd);\n const result = await indexer.indexAll({\n force: true,\n onProgress: (msg) => { if (!opts.json) console.log(` ${dim}${msg}${reset}`); },\n });\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${green}\u2713${reset} Re-indexed ${bold}${result.datasetsIndexed}${reset} datasets, ${result.rowsIndexed.toLocaleString()} rows, ${result.columnsProfiled} columns (${result.duration}ms)`);\n if (result.errors.length > 0) {\n console.log(` ${dim}Errors (${result.errors.length}):${reset}`);\n for (const err of result.errors.slice(0, 5)) {\n console.log(` \u2716 ${err}`);\n }\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 join \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('join <left> <right>')\n .description('SQL JOIN across two indexed datasets')\n .requiredOption('--left-col <col>', 'Join column from left dataset')\n .requiredOption('--right-col <col>', 'Join column from right dataset')\n .option('--type <type>', 'Join type: inner, left, right', 'inner')\n .option('--columns <cols>', 'Comma-separated column projection (prefix with dataset ID)')\n .option('--limit <n>', 'Max rows', '100')\n .option('--json', 'Output as JSON')\n .action(async (left: string, right: string, opts: { leftCol: string; rightCol: string; type?: string; columns?: string; limit?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n\n try {\n const result = dq.join({\n left,\n right,\n leftColumn: opts.leftCol,\n rightColumn: opts.rightCol,\n type: (opts.type as any) ?? 'inner',\n columns: opts.columns ? opts.columns.split(',').map(c => c.trim()) : undefined,\n limit: parseInt(opts.limit ?? '100', 10),\n });\n\n if (!result) {\n console.error(` \u2716 One or both datasets not found. Run ${violet}${bold}kirograph data list${reset} to see available datasets.`);\n cg.close(); process.exit(1);\n }\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${dim}${opts.type?.toUpperCase() ?? 'INNER'} JOIN: ${left}.${opts.leftCol} = ${right}.${opts.rightCol}${reset}`);\n console.log(` ${dim}Showing ${result.rows.length} of ${result.totalMatching} matching rows${reset}\\n`);\n if (result.rows.length > 0) {\n const keys = Object.keys(result.rows[0]!);\n const widths = keys.map(k => Math.max(k.length, ...result.rows.map(r => String(r[k] ?? '').slice(0, 25).length)));\n console.log(' ' + keys.map((k, i) => k.padEnd(widths[i]!)).join(' '));\n console.log(' ' + widths.map(w => '-'.repeat(w)).join(' '));\n for (const row of result.rows) {\n console.log(' ' + keys.map((k, i) => String(row[k] ?? '').slice(0, 25).padEnd(widths[i]!)).join(' '));\n }\n }\n console.log();\n }\n } catch (err) {\n console.error(` \u2716 ${err instanceof Error ? err.message : String(err)}`);\n cg.close(); process.exit(1);\n }\n cg.close();\n });\n\n // \u2500\u2500 correlations \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('correlations <dataset>')\n .description('Pairwise Pearson correlations between numeric columns')\n .option('--threshold <n>', 'Min absolute correlation to include', '0.3')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { threshold?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const threshold = parseFloat(opts.threshold ?? '0.3');\n const pairs = dq.correlations(dataset, threshold);\n\n if (pairs === null) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (pairs.length === 0) {\n console.log(` ${dim}No correlations above threshold ${threshold}.${reset}`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(pairs, null, 2));\n } else {\n console.log(`\\n ${bold}Correlations${reset} (threshold: ${threshold}, ${pairs.length} pairs)\\n`);\n for (const p of pairs) {\n const sign = p.correlation > 0 ? '+' : '';\n const bar = '\u2588'.repeat(Math.round(Math.abs(p.correlation) * 10));\n const color = p.strength === 'strong' ? green : dim;\n console.log(` ${color}${bar}${reset} ${sign}${p.correlation.toFixed(4)} ${p.column1} \u2194 ${p.column2} ${dim}(${p.strength})${reset}`);\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 quality \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('quality <dataset>')\n .description('Data quality triage: rank columns by risk')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const quality = dq.quality(dataset);\n\n if (quality === null) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (quality.length === 0) {\n console.log(` ${green}\u2713${reset} No quality issues detected. All columns look healthy.`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(quality, null, 2));\n } else {\n console.log(`\\n ${bold}Quality Report${reset} (${quality.length} columns with issues)\\n`);\n for (const q of quality) {\n const pct = (q.riskScore * 100).toFixed(0);\n const bar = '\u2588'.repeat(Math.round(q.riskScore * 10));\n console.log(` ${bar} ${pct}% ${bold}${q.column}${reset}`);\n for (const issue of q.issues) {\n console.log(` ${dim}\u2022 ${issue}${reset}`);\n }\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 history \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('history <dataset>')\n .description('Show history of schema changes for a dataset')\n .option('--limit <n>', 'Max snapshots to show', '10')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { limit?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const limit = parseInt(opts.limit ?? '10', 10);\n const history = dq.getHistory(dataset, limit);\n\n if (history === null) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (history.length === 0) {\n console.log(` ${dim}No history snapshots for \"${dataset}\".${reset}`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(history, null, 2));\n } else {\n console.log(`\\n ${bold}Schema History${reset} for ${green}${dataset}${reset} (${history.length} snapshots)\\n`);\n for (const snap of history) {\n const date = new Date(snap.snapshotAt).toISOString().replace('T', ' ').slice(0, 19);\n console.log(` ${bold}${date}${reset}`);\n console.log(` ${dim}Rows:${reset} ${snap.rowCount.toLocaleString()} ${dim}Columns:${reset} ${snap.columnCount} ${dim}Hash:${reset} ${snap.contentHash.slice(0, 12)}\u2026`);\n const colNames = snap.columns.map(c => c.name).join(', ');\n console.log(` ${dim}Schema:${reset} ${colNames}`);\n console.log();\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 drift \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('drift <dataset>')\n .description('Show schema drift between last two indexes')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const drift = dq.detectDrift(dataset);\n\n if (drift === null) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (opts.json) {\n console.log(JSON.stringify(drift, null, 2));\n } else {\n if (!drift.hasDrift) {\n console.log(`\\n ${green}\u2713${reset} No schema drift detected for \"${dataset}\".`);\n if (drift.rowCountDelta !== 0) {\n const sign = drift.rowCountDelta > 0 ? '+' : '';\n console.log(` ${dim}Row count change:${reset} ${sign}${drift.rowCountDelta}`);\n }\n } else {\n console.log(`\\n ${bold}Schema Drift${reset} for ${green}${dataset}${reset}\\n`);\n if (drift.addedColumns.length > 0) {\n console.log(` ${green}+ Added columns:${reset} ${drift.addedColumns.join(', ')}`);\n }\n if (drift.removedColumns.length > 0) {\n console.log(` ${value}\u2212 Removed columns:${reset} ${drift.removedColumns.join(', ')}`);\n }\n if (drift.changedColumns.length > 0) {\n console.log(` ${bold}~ Changed columns:${reset}`);\n for (const col of drift.changedColumns) {\n console.log(` ${col.name}: ${col.changes.join(', ')}`);\n }\n }\n if (drift.rowCountDelta !== 0) {\n const sign = drift.rowCountDelta > 0 ? '+' : '';\n console.log(`\\n ${dim}Row count change:${reset} ${sign}${drift.rowCountDelta}`);\n }\n }\n console.log();\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 data\n .command('lint')\n .description('Validate data index integrity')\n .option('--json', 'Output as JSON')\n .action(async (opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataLinter } = await Promise.resolve().then(() => require('../../data/lint.js'));\n const linter = new DataLinter(db.getRawDb(), cwd);\n const result = linter.lint();\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${bold}Data Lint${reset} \u2014 ${result.datasetsChecked} datasets checked, ${result.healthy} healthy\\n`);\n if (result.issues.length === 0) {\n console.log(` ${green}\u2713${reset} No issues found. Index is healthy.`);\n } else {\n for (const issue of result.issues) {\n const icon = issue.severity === 'error' ? '\u2716' : issue.severity === 'warning' ? '\u26A0' : '\u2139';\n const prefix = issue.dataset ? `[${issue.dataset}] ` : '';\n console.log(` ${icon} ${prefix}${issue.message}`);\n }\n }\n console.log();\n }\n cg.close();\n });\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;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B,CAAC,GAAG;AAClF,QAAI,CAAC,UAAU,cAAc,GAAG,GAAG;AAAE,cAAQ,MAAM,qCAAgC;AAAG,cAAQ,KAAK,CAAC;AAAA,IAAG;AACvG,UAAM,KAAK,MAAM,UAAU,KAAK,GAAG;AACnC,UAAM,KAAK,GAAG,YAAY;AAC1B,OAAG,gBAAgB;AAEnB,UAAM,EAAE,WAAW,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,oBAAoB,CAAC;AACvF,UAAM,SAAS,IAAI,WAAW,GAAG,SAAS,GAAG,GAAG;AAChD,UAAM,SAAS,OAAO,KAAK;AAE3B,QAAI,KAAK,MAAM;AACb,cAAQ,IAAI,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AAAA,IAC7C,OAAO;AACL,cAAQ,IAAI;AAAA,IAAO,cAAI,YAAY,eAAK,WAAM,OAAO,eAAe,sBAAsB,OAAO,OAAO;AAAA,CAAY;AACpH,UAAI,OAAO,OAAO,WAAW,GAAG;AAC9B,gBAAQ,IAAI,KAAK,eAAK,SAAI,eAAK,qCAAqC;AAAA,MACtE,OAAO;AACL,mBAAW,SAAS,OAAO,QAAQ;AACjC,gBAAM,OAAO,MAAM,aAAa,UAAU,WAAM,MAAM,aAAa,YAAY,WAAM;AACrF,gBAAM,SAAS,MAAM,UAAU,IAAI,MAAM,OAAO,OAAO;AACvD,kBAAQ,IAAI,KAAK,IAAI,IAAI,MAAM,GAAG,MAAM,OAAO,EAAE;AAAA,QACnD;AAAA,MACF;AACA,cAAQ,IAAI;AAAA,IACd;AACA,OAAG,MAAM;AAAA,EACX,CAAC;AACL;",
4
+ "sourcesContent": ["import { Command } from 'commander';\nimport { loadConfig } from '../../config';\nimport { dim, reset, violet, bold, green, value } from '../ui';\n\nexport function register(program: Command): void {\n const data = program\n .command('data')\n .description('Tabular data navigation (requires enableData: true)');\n\n // \u2500\u2500 list \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('list')\n .description('List all indexed datasets')\n .option('--json', 'Output as JSON')\n .action(async (opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const datasets = dq.listDatasets();\n\n if (datasets.length === 0) {\n console.log(` ${dim}No datasets indexed.${reset} Run ${violet}${bold}kirograph index${reset} first.`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(datasets, null, 2));\n } else {\n console.log(`\\n ${bold}Indexed Datasets${reset} (${datasets.length})\\n`);\n for (const ds of datasets) {\n const sizeMb = (ds.fileSize / 1024 / 1024).toFixed(2);\n console.log(` ${green}${ds.id}${reset}`);\n console.log(` ${dim}File:${reset} ${ds.filePath} ${dim}Format:${reset} ${ds.format}`);\n console.log(` ${dim}Rows:${reset} ${ds.rowCount.toLocaleString()} ${dim}Columns:${reset} ${ds.columnCount} ${dim}Size:${reset} ${sizeMb} MB`);\n console.log();\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 describe \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('describe <dataset>')\n .description('Show schema and column profiles for a dataset')\n .option('--column <name>', 'Deep dive on a single column')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { column?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n\n if (opts.column) {\n const col = dq.describeColumn(dataset, opts.column);\n if (!col) {\n console.error(` \u2716 Column \"${opts.column}\" not found in dataset \"${dataset}\".`);\n cg.close(); process.exit(1);\n }\n if (opts.json) {\n console.log(JSON.stringify(col, null, 2));\n } else {\n console.log(`\\n ${bold}${col.name}${reset} ${dim}(${col.inferredType})${reset}`);\n console.log(` ${dim}Position:${reset} ${col.position}`);\n console.log(` ${dim}Nullable:${reset} ${col.nullable ? 'yes' : 'no'} (${col.nullPct.toFixed(1)}% null, ${col.nullCount} nulls)`);\n console.log(` ${dim}Cardinality:${reset} ${col.cardinality}`);\n if (col.minValue != null) console.log(` ${dim}Min:${reset} ${col.minValue}`);\n if (col.maxValue != null) console.log(` ${dim}Max:${reset} ${col.maxValue}`);\n if (col.meanValue != null) console.log(` ${dim}Mean:${reset} ${col.meanValue.toFixed(4)}`);\n if (col.sampleValues.length > 0) console.log(` ${dim}Samples:${reset} ${col.sampleValues.join(', ')}`);\n console.log();\n }\n cg.close(); return;\n }\n\n const info = dq.describeDataset(dataset);\n if (!info) {\n console.error(` \u2716 Dataset \"${dataset}\" not found. Run ${violet}${bold}kirograph data list${reset} to see available datasets.`);\n cg.close(); process.exit(1);\n }\n\n if (opts.json) {\n console.log(JSON.stringify(info, null, 2));\n } else {\n const ds = info.dataset;\n const sizeMb = (ds.fileSize / 1024 / 1024).toFixed(2);\n console.log(`\\n ${bold}${ds.id}${reset}`);\n console.log(` ${dim}File:${reset} ${ds.filePath} ${dim}Format:${reset} ${ds.format} ${dim}Size:${reset} ${sizeMb} MB`);\n console.log(` ${dim}Rows:${reset} ${ds.rowCount.toLocaleString()} ${dim}Columns:${reset} ${ds.columnCount}`);\n console.log(`\\n ${bold}Columns:${reset}\\n`);\n\n const maxNameLen = Math.max(...info.columns.map(c => c.name.length), 4);\n console.log(` ${'Name'.padEnd(maxNameLen)} ${'Type'.padEnd(8)} ${'Null%'.padEnd(6)} ${'Card'.padEnd(6)} Samples`);\n console.log(` ${'-'.repeat(maxNameLen)} ${'-'.repeat(8)} ${'-'.repeat(6)} ${'-'.repeat(6)} -------`);\n for (const col of info.columns) {\n const nullPct = col.nullPct > 0 ? `${col.nullPct.toFixed(1)}%` : '0%';\n const samples = col.sampleValues.slice(0, 3).join(', ');\n console.log(` ${col.name.padEnd(maxNameLen)} ${col.inferredType.padEnd(8)} ${nullPct.padEnd(6)} ${String(col.cardinality).padEnd(6)} ${dim}${samples}${reset}`);\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 query \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('query <dataset>')\n .description('Query rows with filters')\n .option('--filter <expr...>', 'Filters in format column:op:value (e.g. age:gt:18)')\n .option('--columns <cols>', 'Comma-separated column names to project')\n .option('--limit <n>', 'Max rows to return', '20')\n .option('--offset <n>', 'Offset for pagination', '0')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { filter?: string[]; columns?: string; limit?: string; offset?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n\n // Parse filters\n const filters = (opts.filter ?? []).map(f => {\n const parts = f.split(':');\n if (parts.length < 3) {\n console.error(` \u2716 Invalid filter format: \"${f}\". Expected column:op:value`);\n process.exit(1);\n }\n const column = parts[0]!;\n const op = parts[1]! as any;\n const val = parts.slice(2).join(':'); // value may contain colons\n return { column, op, value: val };\n });\n\n const columns = opts.columns ? opts.columns.split(',').map(c => c.trim()) : undefined;\n const limit = parseInt(opts.limit ?? '20', 10);\n const offset = parseInt(opts.offset ?? '0', 10);\n\n const result = dq.queryRows(dataset, { filters, columns, limit, offset });\n if (!result) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${dim}Showing ${result.rows.length} of ${result.totalMatching} matching rows${reset}\\n`);\n if (result.rows.length > 0) {\n // Simple table output\n const keys = Object.keys(result.rows[0]!).filter(k => k !== 'rowid');\n const widths = keys.map(k => Math.max(k.length, ...result.rows.map(r => String(r[k] ?? '').slice(0, 30).length)));\n // Header\n console.log(' ' + keys.map((k, i) => k.padEnd(widths[i]!)).join(' '));\n console.log(' ' + widths.map(w => '-'.repeat(w)).join(' '));\n // Rows\n for (const row of result.rows) {\n console.log(' ' + keys.map((k, i) => String(row[k] ?? '').slice(0, 30).padEnd(widths[i]!)).join(' '));\n }\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 aggregate \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('aggregate <dataset>')\n .description('Server-side aggregation (GROUP BY)')\n .requiredOption('--group-by <cols>', 'Comma-separated columns to group by')\n .requiredOption('--metric <expr...>', 'Metrics in format op:column (e.g. sum:amount, avg:price)')\n .option('--filter <expr...>', 'Filters in format column:op:value')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { groupBy: string; metric: string[]; filter?: string[]; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n\n const groupBy = opts.groupBy.split(',').map(c => c.trim());\n const metrics = opts.metric.map(m => {\n const [op, ...colParts] = m.split(':');\n const column = colParts.join(':');\n if (!op || !column) {\n console.error(` \u2716 Invalid metric format: \"${m}\". Expected op:column (e.g. sum:amount)`);\n process.exit(1);\n }\n return { op: op as any, column };\n });\n\n const filters = (opts.filter ?? []).map(f => {\n const parts = f.split(':');\n if (parts.length < 3) { console.error(` \u2716 Invalid filter: \"${f}\"`); process.exit(1); }\n return { column: parts[0]!, op: parts[1]! as any, value: parts.slice(2).join(':') };\n });\n\n const result = dq.aggregate(dataset, { groupBy, metrics, filters });\n if (!result) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${dim}${result.rows.length} groups${reset}\\n`);\n if (result.rows.length > 0) {\n const keys = Object.keys(result.rows[0]!);\n const widths = keys.map(k => Math.max(k.length, ...result.rows.map(r => String(r[k] ?? '').slice(0, 20).length)));\n console.log(' ' + keys.map((k, i) => k.padEnd(widths[i]!)).join(' '));\n console.log(' ' + widths.map(w => '-'.repeat(w)).join(' '));\n for (const row of result.rows) {\n console.log(' ' + keys.map((k, i) => String(row[k] ?? '').slice(0, 20).padEnd(widths[i]!)).join(' '));\n }\n }\n console.log();\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 data\n .command('search <dataset> <query>')\n .description('Search column names and sample values by keyword')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, query: string, opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const results = dq.searchColumns(dataset, query);\n\n if (results.length === 0) {\n console.log(` ${dim}No columns matching \"${query}\" in dataset \"${dataset}\".${reset}`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(results, null, 2));\n } else {\n console.log(`\\n ${bold}Columns matching \"${query}\"${reset} (${results.length})\\n`);\n for (const col of results) {\n const samples = col.sampleValues.slice(0, 5).join(', ');\n console.log(` ${green}${col.name}${reset} ${dim}(${col.inferredType})${reset}`);\n console.log(` ${dim}Cardinality:${reset} ${col.cardinality} ${dim}Null:${reset} ${col.nullPct.toFixed(1)}%`);\n if (samples) console.log(` ${dim}Samples:${reset} ${samples}`);\n console.log();\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 index \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('index')\n .description('Index all data files (incremental)')\n .option('--json', 'Output as JSON')\n .action(async (opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataIndexer } = await Promise.resolve().then(() => require('../../data/indexer.js'));\n const indexer = new DataIndexer(db.getRawDb(), config, cwd);\n const result = await indexer.indexAll({\n onProgress: (msg) => { if (!opts.json) console.log(` ${dim}${msg}${reset}`); },\n });\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${green}\u2713${reset} Indexed ${bold}${result.datasetsIndexed}${reset} datasets, ${result.rowsIndexed.toLocaleString()} rows, ${result.columnsProfiled} columns (${result.duration}ms)`);\n if (result.errors.length > 0) {\n console.log(` ${dim}Errors (${result.errors.length}):${reset}`);\n for (const err of result.errors.slice(0, 5)) {\n console.log(` \u2716 ${err}`);\n }\n }\n console.log();\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 data\n .command('reindex')\n .description('Force re-index all data files (ignores content hashes)')\n .option('--json', 'Output as JSON')\n .action(async (opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataIndexer } = await Promise.resolve().then(() => require('../../data/indexer.js'));\n const indexer = new DataIndexer(db.getRawDb(), config, cwd);\n const result = await indexer.indexAll({\n force: true,\n onProgress: (msg) => { if (!opts.json) console.log(` ${dim}${msg}${reset}`); },\n });\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${green}\u2713${reset} Re-indexed ${bold}${result.datasetsIndexed}${reset} datasets, ${result.rowsIndexed.toLocaleString()} rows, ${result.columnsProfiled} columns (${result.duration}ms)`);\n if (result.errors.length > 0) {\n console.log(` ${dim}Errors (${result.errors.length}):${reset}`);\n for (const err of result.errors.slice(0, 5)) {\n console.log(` \u2716 ${err}`);\n }\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 join \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('join <left> <right>')\n .description('SQL JOIN across two indexed datasets')\n .requiredOption('--left-col <col>', 'Join column from left dataset')\n .requiredOption('--right-col <col>', 'Join column from right dataset')\n .option('--type <type>', 'Join type: inner, left, right', 'inner')\n .option('--columns <cols>', 'Comma-separated column projection (prefix with dataset ID)')\n .option('--limit <n>', 'Max rows', '100')\n .option('--json', 'Output as JSON')\n .action(async (left: string, right: string, opts: { leftCol: string; rightCol: string; type?: string; columns?: string; limit?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n\n try {\n const result = dq.join({\n left,\n right,\n leftColumn: opts.leftCol,\n rightColumn: opts.rightCol,\n type: (opts.type as any) ?? 'inner',\n columns: opts.columns ? opts.columns.split(',').map(c => c.trim()) : undefined,\n limit: parseInt(opts.limit ?? '100', 10),\n });\n\n if (!result) {\n console.error(` \u2716 One or both datasets not found. Run ${violet}${bold}kirograph data list${reset} to see available datasets.`);\n cg.close(); process.exit(1);\n }\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${dim}${opts.type?.toUpperCase() ?? 'INNER'} JOIN: ${left}.${opts.leftCol} = ${right}.${opts.rightCol}${reset}`);\n console.log(` ${dim}Showing ${result.rows.length} of ${result.totalMatching} matching rows${reset}\\n`);\n if (result.rows.length > 0) {\n const keys = Object.keys(result.rows[0]!);\n const widths = keys.map(k => Math.max(k.length, ...result.rows.map(r => String(r[k] ?? '').slice(0, 25).length)));\n console.log(' ' + keys.map((k, i) => k.padEnd(widths[i]!)).join(' '));\n console.log(' ' + widths.map(w => '-'.repeat(w)).join(' '));\n for (const row of result.rows) {\n console.log(' ' + keys.map((k, i) => String(row[k] ?? '').slice(0, 25).padEnd(widths[i]!)).join(' '));\n }\n }\n console.log();\n }\n } catch (err) {\n console.error(` \u2716 ${err instanceof Error ? err.message : String(err)}`);\n cg.close(); process.exit(1);\n }\n cg.close();\n });\n\n // \u2500\u2500 correlations \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('correlations <dataset>')\n .description('Pairwise Pearson correlations between numeric columns')\n .option('--threshold <n>', 'Min absolute correlation to include', '0.3')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { threshold?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const threshold = parseFloat(opts.threshold ?? '0.3');\n const pairs = dq.correlations(dataset, threshold);\n\n if (pairs === null) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (pairs.length === 0) {\n console.log(` ${dim}No correlations above threshold ${threshold}.${reset}`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(pairs, null, 2));\n } else {\n console.log(`\\n ${bold}Correlations${reset} (threshold: ${threshold}, ${pairs.length} pairs)\\n`);\n for (const p of pairs) {\n const sign = p.correlation > 0 ? '+' : '';\n const bar = '\u2588'.repeat(Math.round(Math.abs(p.correlation) * 10));\n const color = p.strength === 'strong' ? green : dim;\n console.log(` ${color}${bar}${reset} ${sign}${p.correlation.toFixed(4)} ${p.column1} \u2194 ${p.column2} ${dim}(${p.strength})${reset}`);\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 quality \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('quality <dataset>')\n .description('Data quality triage: rank columns by risk')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const quality = dq.quality(dataset);\n\n if (quality === null) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (quality.length === 0) {\n console.log(` ${green}\u2713${reset} No quality issues detected. All columns look healthy.`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(quality, null, 2));\n } else {\n console.log(`\\n ${bold}Quality Report${reset} (${quality.length} columns with issues)\\n`);\n for (const q of quality) {\n const pct = (q.riskScore * 100).toFixed(0);\n const bar = '\u2588'.repeat(Math.round(q.riskScore * 10));\n console.log(` ${bar} ${pct}% ${bold}${q.column}${reset}`);\n for (const issue of q.issues) {\n console.log(` ${dim}\u2022 ${issue}${reset}`);\n }\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 history \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('history <dataset>')\n .description('Show history of schema changes for a dataset')\n .option('--limit <n>', 'Max snapshots to show', '10')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { limit?: string; json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const limit = parseInt(opts.limit ?? '10', 10);\n const history = dq.getHistory(dataset, limit);\n\n if (history === null) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (history.length === 0) {\n console.log(` ${dim}No history snapshots for \"${dataset}\".${reset}`);\n cg.close(); return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(history, null, 2));\n } else {\n console.log(`\\n ${bold}Schema History${reset} for ${green}${dataset}${reset} (${history.length} snapshots)\\n`);\n for (const snap of history) {\n const date = new Date(snap.snapshotAt).toISOString().replace('T', ' ').slice(0, 19);\n console.log(` ${bold}${date}${reset}`);\n console.log(` ${dim}Rows:${reset} ${snap.rowCount.toLocaleString()} ${dim}Columns:${reset} ${snap.columnCount} ${dim}Hash:${reset} ${snap.contentHash.slice(0, 12)}\u2026`);\n const colNames = snap.columns.map(c => c.name).join(', ');\n console.log(` ${dim}Schema:${reset} ${colNames}`);\n console.log();\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 drift \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('drift <dataset>')\n .description('Show schema drift between last two indexes')\n .option('--json', 'Output as JSON')\n .action(async (dataset: string, opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataQueries } = await Promise.resolve().then(() => require('../../data/queries.js'));\n const dq = new DataQueries(db.getRawDb());\n const drift = dq.detectDrift(dataset);\n\n if (drift === null) {\n console.error(` \u2716 Dataset \"${dataset}\" not found.`);\n cg.close(); process.exit(1);\n }\n\n if (opts.json) {\n console.log(JSON.stringify(drift, null, 2));\n } else {\n if (!drift.hasDrift) {\n console.log(`\\n ${green}\u2713${reset} No schema drift detected for \"${dataset}\".`);\n if (drift.rowCountDelta !== 0) {\n const sign = drift.rowCountDelta > 0 ? '+' : '';\n console.log(` ${dim}Row count change:${reset} ${sign}${drift.rowCountDelta}`);\n }\n } else {\n console.log(`\\n ${bold}Schema Drift${reset} for ${green}${dataset}${reset}\\n`);\n if (drift.addedColumns.length > 0) {\n console.log(` ${green}+ Added columns:${reset} ${drift.addedColumns.join(', ')}`);\n }\n if (drift.removedColumns.length > 0) {\n console.log(` ${value}\u2212 Removed columns:${reset} ${drift.removedColumns.join(', ')}`);\n }\n if (drift.changedColumns.length > 0) {\n console.log(` ${bold}~ Changed columns:${reset}`);\n for (const col of drift.changedColumns) {\n console.log(` ${col.name}: ${col.changes.join(', ')}`);\n }\n }\n if (drift.rowCountDelta !== 0) {\n const sign = drift.rowCountDelta > 0 ? '+' : '';\n console.log(`\\n ${dim}Row count change:${reset} ${sign}${drift.rowCountDelta}`);\n }\n }\n console.log();\n }\n cg.close();\n });\n\n // \u2500\u2500 classify \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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 data\n .command('classify <file>')\n .description('Classify a PDF file before indexing (fast, no full parse)')\n .option('--json', 'Output as JSON')\n .action(async (file: string, opts: { json?: boolean }) => {\n const path = require('path');\n const fs = require('fs');\n\n const absPath = path.isAbsolute(file) ? file : path.join(process.cwd(), file);\n if (!fs.existsSync(absPath)) {\n console.error(` \u2716 File not found: ${absPath}`);\n process.exit(1);\n }\n if (!absPath.toLowerCase().endsWith('.pdf')) {\n console.error(` \u2716 Not a PDF file: ${file}`);\n process.exit(1);\n }\n\n let pdfModule: any;\n try {\n pdfModule = require('@firecrawl/pdf-inspector');\n } catch {\n console.error(` \u2716 @firecrawl/pdf-inspector is not installed.`);\n console.error(` ${dim}Install with:${reset} npm install --save-optional @firecrawl/pdf-inspector`);\n process.exit(1);\n }\n\n const buffer = fs.readFileSync(absPath);\n let result: any;\n try {\n result = pdfModule.classifyPdf(buffer);\n } catch {\n // fall back to processPdf\n try {\n const meta = pdfModule.processPdf(buffer);\n result = {\n pdfType: meta.pdfType,\n pageCount: meta.pageCount ?? null,\n pagesNeedingOcr: meta.pagesNeedingOcr ?? [],\n confidence: meta.confidence ?? null,\n };\n } catch (err) {\n console.error(` \u2716 Classification failed: ${err instanceof Error ? err.message : String(err)}`);\n process.exit(1);\n }\n }\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n const ocrPages: number[] = result.pagesNeedingOcr ?? [];\n console.log(`\\n ${bold}PDF Classification${reset}: ${green}${path.basename(file)}${reset}\\n`);\n console.log(` ${dim}Type:${reset} ${result.pdfType ?? 'unknown'}`);\n if (result.confidence != null) console.log(` ${dim}Confidence:${reset} ${result.confidence}`);\n if (result.pageCount != null) console.log(` ${dim}Pages:${reset} ${result.pageCount}`);\n console.log(` ${dim}OCR needed:${reset} ${ocrPages.length === 0 ? 'none' : ocrPages.length + ' pages'}`);\n console.log();\n }\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 data\n .command('lint')\n .description('Validate data index integrity')\n .option('--json', 'Output as JSON')\n .action(async (opts: { json?: boolean }) => {\n const cwd = process.cwd();\n const config = await loadConfig(cwd);\n if (!config.enableData) {\n console.error(` \u2716 Data indexing is not enabled. Set ${violet}${bold}enableData: 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.applyDataSchema();\n\n const { DataLinter } = await Promise.resolve().then(() => require('../../data/lint.js'));\n const linter = new DataLinter(db.getRawDb(), cwd);\n const result = linter.lint();\n\n if (opts.json) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n console.log(`\\n ${bold}Data Lint${reset} \u2014 ${result.datasetsChecked} datasets checked, ${result.healthy} healthy\\n`);\n if (result.issues.length === 0) {\n console.log(` ${green}\u2713${reset} No issues found. Index is healthy.`);\n } else {\n for (const issue of result.issues) {\n const icon = issue.severity === 'error' ? '\u2716' : issue.severity === 'warning' ? '\u26A0' : '\u2139';\n const prefix = issue.dataset ? `[${issue.dataset}] ` : '';\n console.log(` ${icon} ${prefix}${issue.message}`);\n }\n }\n console.log();\n }\n cg.close();\n });\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA2B;AAC3B,gBAAuD;AAEhD,SAAS,SAAS,SAAwB;AAC/C,QAAM,OAAO,QACV,QAAQ,MAAM,EACd,YAAY,qDAAqD;AAGpE,OACG,QAAQ,MAAM,EACd,YAAY,2BAA2B,EACvC,OAAO,UAAU,gBAAgB,EACjC,OAAO,OAAO,SAA6B;AAC1C,UAAM,MAAM,QAAQ,IAAI;AACxB,UAAM,SAAS,UAAM,0BAAW,GAAG;AACnC,QAAI,CAAC,OAAO,YAAY;AACtB,cAAQ,MAAM,8CAAyC,gBAAM,GAAG,cAAI,mBAAmB,eAAK,4BAA4B;AACxH,cAAQ,MAAM,KAAK,aAAG,eAAe,eAAK,IAAI,gBAAM,GAAG,cAAI,kBAAkB,eAAK,EAAE;AACpF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,UAAM,aAAa,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,gBAAgB,CAAC,GAAG;AAClF,QAAI,CAAC,UAAU,cAAc,GAAG,GAAG;AAAE,cAAQ,MAAM,yDAAoD;AAAG,cAAQ,KAAK,CAAC;AAAA,IAAG;AAC3H,UAAM,KAAK,MAAM,UAAU,KAAK,GAAG;AACnC,UAAM,KAAK,GAAG,YAAY;AAC1B,OAAG,gBAAgB;AAEnB,UAAM,EAAE,YAAY,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,uBAAuB,CAAC;AAC3F,UAAM,KAAK,IAAI,YAAY,GAAG,SAAS,CAAC;AACxC,UAAM,WAAW,GAAG,aAAa;AAEjC,QAAI,SAAS,W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Q,IAAI,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AAAA,IAC7C,OAAO;AACL,cAAQ,IAAI;AAAA,IAAO,cAAI,YAAY,eAAK,WAAM,OAAO,eAAe,sBAAsB,OAAO,OAAO;AAAA,CAAY;AACpH,UAAI,OAAO,OAAO,WAAW,GAAG;AAC9B,gBAAQ,IAAI,KAAK,eAAK,SAAI,eAAK,qCAAqC;AAAA,MACtE,OAAO;AACL,mBAAW,SAAS,OAAO,QAAQ;AACjC,gBAAM,OAAO,MAAM,aAAa,UAAU,WAAM,MAAM,aAAa,YAAY,WAAM;AACrF,gBAAM,SAAS,MAAM,UAAU,IAAI,MAAM,OAAO,OAAO;AACvD,kBAAQ,IAAI,KAAK,IAAI,IAAI,MAAM,GAAG,MAAM,OAAO,EAAE;AAAA,QACnD;AAAA,MACF;AACA,cAAQ,IAAI;AAAA,IACd;AACA,OAAG,MAAM;AAAA,EACX,CAAC;AACL;",
6
6
  "names": []
7
7
  }
@@ -344,7 +344,8 @@ function register(program) {
344
344
  }
345
345
  console.log(` ${import_ui.dim}Re-embedding ${sections.length} doc sections...${import_ui.reset}`);
346
346
  const { DocsVectorManager } = await Promise.resolve().then(() => require("../../docs/vectors.js"));
347
- const vectorMgr = new DocsVectorManager(config, rawDb);
347
+ const kirographDir = require("path").join(cwd, ".kirograph");
348
+ const vectorMgr = new DocsVectorManager(config, rawDb, kirographDir);
348
349
  const embedded = await vectorMgr.reembed();
349
350
  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
351
  cg.close();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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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AACnC,UAAM,KAAK,GAAG,YAAY;AAC1B,OAAG,gBAAgB;AAEnB,UAAM,QAAQ,GAAG,SAAS;AAC1B,UAAM,WAAW,MAAM,IAAI,6CAA6C;AAExE,QAAI,SAAS,WAAW,GAAG;AACzB,cAAQ,IAAI,KAAK,aAAG,iCAAiC,gBAAM,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;",
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 kirographDir = require('path').join(cwd, '.kirograph');\n const vectorMgr = new DocsVectorManager(config, rawDb, kirographDir);\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,OAAO,QACV,QAAQ,MAAM,EACd,YAAY,sDAAsD;AAGrE,OACG,QAAQ,YAAY,EACpB,YAAY,yDAAyD,EACrE,OAAO,UAAU,4BAA4B,EAC7C,OAAO,UAAU,gBAAgB,EACjC,OA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