kirograph 0.28.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/architecture/index.js +4 -1
- package/dist/architecture/index.js.map +2 -2
- package/dist/architecture/manifest/index.js +13 -2
- package/dist/architecture/manifest/index.js.map +2 -2
- package/dist/architecture/manifest/python.js +2 -2
- package/dist/architecture/manifest/python.js.map +2 -2
- package/dist/bin/commands/help.js +3 -1
- package/dist/bin/commands/help.js.map +2 -2
- package/dist/bin/commands/install.js +2 -1
- package/dist/bin/commands/install.js.map +2 -2
- package/dist/bin/commands/memory.js +18 -8
- package/dist/bin/commands/memory.js.map +2 -2
- package/dist/bin/commands/reachability.js +7 -2
- package/dist/bin/commands/reachability.js.map +2 -2
- package/dist/bin/commands/status.js +2 -1
- package/dist/bin/commands/status.js.map +2 -2
- package/dist/bin/commands/uninit.js +2 -1
- package/dist/bin/commands/uninit.js.map +2 -2
- package/dist/bin/commands/vulns.js +26 -6
- package/dist/bin/commands/vulns.js.map +2 -2
- package/dist/bin/commands/wiki.js +56 -0
- package/dist/bin/commands/wiki.js.map +2 -2
- package/dist/bin/installer/common.js +7 -1
- package/dist/bin/installer/common.js.map +2 -2
- package/dist/bin/installer/detect.js +10 -0
- package/dist/bin/installer/detect.js.map +2 -2
- package/dist/bin/installer/hooks.js +13 -8
- package/dist/bin/installer/hooks.js.map +2 -2
- package/dist/bin/installer/steering.js +9 -0
- package/dist/bin/installer/steering.js.map +2 -2
- package/dist/bin/installer/targets/antigravity.js +1 -1
- package/dist/bin/installer/targets/antigravity.js.map +2 -2
- package/dist/bin/installer/targets/claude.js +1 -1
- package/dist/bin/installer/targets/claude.js.map +2 -2
- package/dist/bin/installer/targets/codex.js +1 -1
- package/dist/bin/installer/targets/codex.js.map +2 -2
- package/dist/bin/installer/targets/commandcode.js +84 -0
- package/dist/bin/installer/targets/commandcode.js.map +7 -0
- package/dist/bin/installer/targets/copilot.js +1 -1
- package/dist/bin/installer/targets/copilot.js.map +2 -2
- package/dist/bin/installer/targets/cursor.js +2 -2
- package/dist/bin/installer/targets/cursor.js.map +2 -2
- package/dist/bin/installer/targets/devin.js +1 -1
- package/dist/bin/installer/targets/devin.js.map +2 -2
- package/dist/bin/installer/targets/gemini-cli.js +1 -1
- package/dist/bin/installer/targets/gemini-cli.js.map +2 -2
- package/dist/bin/installer/targets/index.js +10 -0
- package/dist/bin/installer/targets/index.js.map +2 -2
- package/dist/bin/installer/targets/opencode.js +1 -1
- package/dist/bin/installer/targets/opencode.js.map +2 -2
- package/dist/bin/installer/targets/windsurf.js +1 -1
- package/dist/bin/installer/targets/windsurf.js.map +2 -2
- package/dist/bin/kirograph.js +1 -1
- package/dist/bin/kirograph.js.map +1 -1
- package/dist/config.js +25 -1
- package/dist/config.js.map +2 -2
- package/dist/core/pipeline.js +18 -6
- package/dist/core/pipeline.js.map +2 -2
- package/dist/extraction/extractor.js +88 -26
- package/dist/extraction/extractor.js.map +2 -2
- package/dist/extraction/grammars.js +38 -3
- package/dist/extraction/grammars.js.map +2 -2
- package/dist/extraction/notebook.js +15 -7
- package/dist/extraction/notebook.js.map +2 -2
- package/dist/extraction/wasm/tree-sitter-bash.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-c.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cpp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-csharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-css.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-dart.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-elisp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-elixir.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-elm.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-embedded_template.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-embeddedtemplate.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-go.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-html.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-java.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-javascript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-json.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-objc.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-ocaml.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-php.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-python.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-ql.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-rescript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-ruby.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-rust.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-solidity.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-swift.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-systemrdl.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-tlaplus.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-toml.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-tsx.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-typescript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-vue.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-yaml.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-zig.wasm +0 -0
- package/dist/frameworks/index.js +68 -7
- package/dist/frameworks/index.js.map +2 -2
- package/dist/jev/client.js +99 -0
- package/dist/jev/client.js.map +7 -0
- package/dist/jev/types.js +17 -0
- package/dist/jev/types.js.map +7 -0
- package/dist/mcp/handlers/memory.js +14 -8
- package/dist/mcp/handlers/memory.js.map +2 -2
- package/dist/mcp/handlers/security.js +5 -3
- package/dist/mcp/handlers/security.js.map +2 -2
- package/dist/mcp/tools.js +1 -1
- package/dist/mcp/tools.js.map +1 -1
- package/dist/memory/index.js +13 -1
- package/dist/memory/index.js.map +3 -3
- package/dist/memory/relation-jev.js +59 -0
- package/dist/memory/relation-jev.js.map +7 -0
- package/dist/memory/schema.js +57 -0
- package/dist/memory/schema.js.map +7 -0
- package/dist/security/auth-detection-jev.js +47 -0
- package/dist/security/auth-detection-jev.js.map +7 -0
- package/dist/security/manifest/adapter.js +34 -5
- package/dist/security/manifest/adapter.js.map +3 -3
- package/dist/security/manifest/parser.js +2 -2
- package/dist/security/manifest/parser.js.map +2 -2
- package/dist/security/manifest/plugins/cargo.js +23 -0
- package/dist/security/manifest/plugins/cargo.js.map +2 -2
- package/dist/security/manifest/plugins/composer.js +12 -0
- package/dist/security/manifest/plugins/composer.js.map +2 -2
- package/dist/security/manifest/plugins/gradle.js +12 -0
- package/dist/security/manifest/plugins/gradle.js.map +2 -2
- package/dist/security/manifest/plugins/hex.js +12 -0
- package/dist/security/manifest/plugins/hex.js.map +2 -2
- package/dist/security/manifest/plugins/maven.js +68 -1
- package/dist/security/manifest/plugins/maven.js.map +2 -2
- package/dist/security/manifest/plugins/npm.js +86 -0
- package/dist/security/manifest/plugins/npm.js.map +2 -2
- package/dist/security/manifest/plugins/nuget.js +13 -0
- package/dist/security/manifest/plugins/nuget.js.map +2 -2
- package/dist/security/manifest/plugins/pubspec.js +12 -0
- package/dist/security/manifest/plugins/pubspec.js.map +2 -2
- package/dist/security/manifest/plugins/pyproject.js +12 -0
- package/dist/security/manifest/plugins/pyproject.js.map +2 -2
- package/dist/security/manifest/plugins/rubygems.js +12 -0
- package/dist/security/manifest/plugins/rubygems.js.map +2 -2
- package/dist/security/pipeline.js +5 -2
- package/dist/security/pipeline.js.map +2 -2
- package/dist/security/reachability.js +115 -50
- package/dist/security/reachability.js.map +2 -2
- package/dist/security/types.js.map +1 -1
- package/dist/security/vuln/client.js +45 -1
- package/dist/security/vuln/client.js.map +2 -2
- package/dist/security/vuln/epss-client.js +1 -1
- package/dist/security/vuln/epss-client.js.map +1 -1
- package/dist/security/vuln/osv-adapter.js +144 -32
- package/dist/security/vuln/osv-adapter.js.map +2 -2
- package/dist/sync/index.js +9 -2
- package/dist/sync/index.js.map +2 -2
- package/dist/vectors/libsql-index.js +287 -0
- package/dist/vectors/libsql-index.js.map +7 -0
- package/dist/vectors/turso-index.js +307 -0
- package/dist/vectors/turso-index.js.map +7 -0
- package/dist/wiki/contradiction-jev.js +49 -0
- package/dist/wiki/contradiction-jev.js.map +7 -0
- package/dist/wiki/index.js +13 -0
- package/dist/wiki/index.js.map +2 -2
- package/dist/wiki/ingest.js +2 -0
- package/dist/wiki/ingest.js.map +2 -2
- package/dist/wiki/links.js +53 -0
- package/dist/wiki/links.js.map +7 -0
- package/dist/wiki/lint.js +3 -6
- package/dist/wiki/lint.js.map +2 -2
- package/dist/wiki/rename.js +103 -0
- package/dist/wiki/rename.js.map +7 -0
- package/package.json +3 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/commands/memory.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * KiroGraph Memory CLI \u2014 mirrors MCP tools + maintenance commands\n *\n * kirograph mem search <query>\n * kirograph mem store <content>\n * kirograph mem timeline\n * kirograph mem status\n * kirograph mem prune\n * kirograph mem export\n * kirograph mem import\n * kirograph mem reembed\n * kirograph mem lint\n */\n\nimport { Command } from 'commander';\nimport { dim, reset, violet, bold, section } from '../ui';\n\nexport function register(program: Command): void {\n const mem = program\n .command('mem')\n .description('Persistent cross-session memory (requires enableMemory: true)');\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\n\n mem\n .command('search <query>')\n .description('Search memory observations (hybrid FTS + vector)')\n .option('--kind <kind>', 'Filter by kind: decision, error, pattern, architecture, summary, note')\n .option('--limit <n>', 'Max results', '10')\n .option('--session <id>', 'Filter to specific session')\n .option('--format <fmt>', 'Output format: text, json', 'text')\n .action(async (query: string, opts: { kind?: string; limit: string; session?: string; format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const { trackCliToolSaving } = await Promise.resolve().then(() => require('./utils.js'));\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled. Set enableMemory: true in .kirograph/config.json');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const results = await mem.search(query, {\n limit: parseInt(opts.limit),\n kind: opts.kind as any,\n sessionId: opts.session,\n });\n\n if (opts.format === 'json') {\n console.log(JSON.stringify(results.map(r => ({\n id: r.observation.id,\n kind: r.observation.kind,\n content: r.observation.content,\n score: r.score,\n createdAt: r.observation.createdAt,\n sessionId: r.observation.sessionId,\n })), null, 2));\n } else {\n if (results.length === 0) {\n console.log(`\\n ${dim}No observations found for \"${query}\"${reset}\\n`);\n } else {\n console.log(`\\n ${section('Memory Search:')} ${violet}${bold}${query}${reset}\\n`);\n for (const r of results) {\n const age = formatAge(r.observation.createdAt);\n console.log(` ${violet}[${r.observation.kind}]${reset} ${r.observation.content}`);\n if (r.relations && r.relations.length > 0) {\n const annotations = r.relations\n .filter(rel => rel.judgmentStatus !== 'ignored')\n .map(rel => {\n const icon = rel.relation === 'conflicts_with' ? '\u26A1' : rel.relation === 'supersedes' ? '\u21A9' : '~';\n return `${icon} ${rel.relation}`;\n })\n .join(' ');\n if (annotations) console.log(` ${dim}${annotations}${reset}`);\n }\n console.log(` ${dim}${age} \u00B7 score: ${r.score.toFixed(3)}${reset}\\n`);\n }\n }\n }\n\n const output = results.map(r => `[${r.observation.kind}] ${r.observation.content}`).join('\\n');\n trackCliToolSaving(cwd, 'kirograph_mem_search', output, { limit: parseInt(opts.limit) });\n cg.close();\n });\n\n // \u2500\u2500 store \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('store [content]')\n .description('Store an observation in memory')\n .option('--kind <kind>', 'Observation kind', 'note')\n .option('--topic-key <key>', 'Stable semantic key (e.g. architecture/auth-model)')\n .option('--review-after <ms>', 'Epoch ms: schedule re-evaluation after this timestamp')\n .action(async (content: string | undefined, opts: { kind: string; topicKey?: string; reviewAfter?: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled. Set enableMemory: true in .kirograph/config.json');\n process.exit(1);\n }\n\n // Read from stdin if no content argument\n let text = content;\n if (!text) {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) {\n chunks.push(chunk);\n }\n text = Buffer.concat(chunks).toString('utf8').trim();\n }\n\n if (!text) {\n console.error(' \u2716 No content provided. Pass as argument or pipe from stdin.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const result = await mem.store({\n content: text,\n kind: opts.kind as any,\n source: 'manual',\n topicKey: opts.topicKey,\n reviewAfter: opts.reviewAfter ? parseInt(opts.reviewAfter) : undefined,\n });\n\n if (!result) {\n console.log(` ${dim}Duplicate observation \u2014 already stored.${reset}`);\n } else if (typeof result === 'object' && result.watchmenReady) {\n console.log(` \u2713 Stored observation ${dim}${result.id}${reset} [${violet}${opts.kind}${reset}]`);\n console.log(`\\n ${violet}\u26A1 Watchmen ready${reset} \u2014 ${result.pendingCount} observations since last synthesis`);\n console.log(` Target files:`);\n for (const f of result.targetFiles) {\n console.log(` ${dim}\u00B7${reset} ${f}`);\n }\n if (result.skillTargetDir) {\n console.log(` Skill dir: ${dim}${result.skillTargetDir}/watchmen-<slug>.md${reset} (inclusion: manual)`);\n }\n console.log(`\\n ${dim}Run synthesis manually or let the agentStop hook handle it.${reset}`);\n } else {\n console.log(` \u2713 Stored observation ${dim}${result}${reset} [${violet}${opts.kind}${reset}]`);\n }\n\n cg.close();\n });\n\n // \u2500\u2500 timeline \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('timeline')\n .description('List recent sessions and observations')\n .option('--limit <n>', 'Number of sessions', '5')\n .option('--session <id>', 'Show observations for a specific session')\n .option('--format <fmt>', 'Output format: text, json', 'text')\n .action(async (opts: { limit: string; session?: string; format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const { trackCliToolSaving } = await Promise.resolve().then(() => require('./utils.js'));\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled. Set enableMemory: true in .kirograph/config.json');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const { sessions, observations } = mem.timeline({\n limit: parseInt(opts.limit),\n sessionId: opts.session,\n });\n\n if (opts.format === 'json') {\n console.log(JSON.stringify({\n sessions: sessions.map(s => ({\n id: s.id,\n ide: s.ide,\n startedAt: s.startedAt,\n endedAt: s.endedAt,\n observations: (observations.get(s.id) ?? []).map(o => ({\n id: o.id, kind: o.kind, content: o.content, createdAt: o.createdAt,\n })),\n })),\n }, null, 2));\n } else {\n if (sessions.length === 0) {\n console.log(`\\n ${dim}No memory sessions found.${reset}\\n`);\n } else {\n console.log(`\\n ${section('Memory Timeline')}\\n`);\n for (const session of sessions) {\n const start = new Date(session.startedAt).toISOString().slice(0, 16).replace('T', ' ');\n const status = session.endedAt ? dim + 'ended' + reset : violet + 'active' + reset;\n const obs = observations.get(session.id) ?? [];\n console.log(` ${bold}${start}${reset} [${session.ide ?? 'unknown'}] ${status} \u00B7 ${obs.length} observations`);\n for (const o of obs.slice(0, 5)) {\n console.log(` ${dim}\u00B7${reset} ${violet}[${o.kind}]${reset} ${o.content.slice(0, 100)}`);\n }\n if (obs.length > 5) console.log(` ${dim}\u2026and ${obs.length - 5} more${reset}`);\n console.log('');\n }\n }\n }\n\n const output = sessions.map(s => s.id).join('\\n');\n trackCliToolSaving(cwd, 'kirograph_mem_timeline', output, { limit: parseInt(opts.limit) });\n cg.close();\n });\n\n // \u2500\u2500 status \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('status')\n .description('Show memory subsystem health')\n .action(async () => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled. Set enableMemory: true in .kirograph/config.json');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const stats = mem.getStats();\n console.log(`\\n ${section('Memory Status')}\\n`);\n console.log(` Sessions: ${bold}${stats.sessions}${reset} (${stats.activeSessions} active)`);\n console.log(` Observations: ${bold}${stats.observations}${reset}`);\n console.log(` Symbol links: ${bold}${stats.links}${reset}`);\n console.log(` Embeddings: ${bold}${stats.vectors}${reset} / ${stats.embeddableCount}`);\n console.log(` Relations: ${bold}${stats.relations}${reset} (${stats.pendingConflicts} pending)`);\n console.log(` Model mismatch: ${stats.modelMismatch ? violet + '\u26A0 yes \u2014 run kirograph mem reembed' + reset : dim + 'no' + reset}`);\n console.log(` Compression: ${config.cavemanMode !== 'off' ? violet + config.cavemanMode + reset : dim + 'off (storing raw)' + reset}`);\n console.log('');\n\n cg.close();\n });\n\n // \u2500\u2500 prune \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('prune')\n .description('Remove old observations')\n .option('--older-than <duration>', 'Duration (e.g. 90d, 6m)', '90d')\n .action(async (opts: { olderThan: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n\n const ms = parseDuration(opts.olderThan);\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const deleted = mem.prune(ms);\n console.log(` \u2713 Pruned ${deleted} observation(s) older than ${opts.olderThan}`);\n\n cg.close();\n });\n\n // \u2500\u2500 export \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('export')\n .description('Export memory observations')\n .option('--format <fmt>', 'Output format: jsonl, md', 'jsonl')\n .action(async (opts: { format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const { sessions, observations } = mem.timeline({ limit: 1000 });\n\n if (opts.format === 'jsonl') {\n for (const session of sessions) {\n const obs = observations.get(session.id) ?? [];\n for (const o of obs) {\n console.log(JSON.stringify({\n id: o.id,\n content: o.content,\n content_raw: o.contentRaw,\n kind: o.kind,\n tags: o.tags,\n created_at: o.createdAt,\n session_id: o.sessionId,\n }));\n }\n }\n } else {\n // Markdown format\n for (const session of sessions) {\n const start = new Date(session.startedAt).toISOString().slice(0, 10);\n console.log(`## Session ${start} (${session.ide ?? 'unknown'})\\n`);\n const obs = observations.get(session.id) ?? [];\n for (const o of obs) {\n const time = new Date(o.createdAt).toISOString().slice(11, 16);\n console.log(`### [${o.kind}] ${time}`);\n console.log(o.content);\n console.log('');\n }\n }\n }\n\n cg.close();\n });\n\n // \u2500\u2500 import \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('import <file>')\n .description('Import observations from JSONL backup')\n .action(async (file: string) => {\n const fs = await import('fs');\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n\n if (!fs.existsSync(file)) {\n console.error(` \u2716 File not found: ${file}`);\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const lines = fs.readFileSync(file, 'utf8').split('\\n').filter(l => l.trim());\n let imported = 0;\n let skipped = 0;\n\n for (const line of lines) {\n try {\n const data = JSON.parse(line);\n const id = await mem.store({\n content: data.content_raw || data.content,\n kind: data.kind ?? 'note',\n source: 'manual',\n tags: data.tags,\n });\n if (id) imported++;\n else skipped++;\n } catch {\n skipped++;\n }\n }\n\n console.log(` \u2713 Imported ${imported} observation(s), skipped ${skipped} (duplicates/errors)`);\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\n\n mem\n .command('reembed')\n .description('Re-embed all observations with the current model')\n .option('--batch <n>', 'Batch size', '32')\n .action(async (opts: { batch: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n console.log(' Re-embedding all observations...');\n const count = await mem.reembed(parseInt(opts.batch));\n console.log(` \u2713 Re-embedded ${count} observation(s)`);\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\n\n mem\n .command('lint')\n .description('Health check: find stale links, model mismatch, orphans')\n .option('--fix', 'Auto-fix issues (remove stale links, close stale sessions)')\n .action(async (opts: { fix?: boolean }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const result = mem.lint();\n\n console.log(`\\n ${section('Memory Lint')}\\n`);\n console.log(` Stale links: ${result.staleLinks > 0 ? violet + result.staleLinks + reset : dim + '0' + reset}`);\n console.log(` Model mismatch: ${result.modelMismatch ? violet + 'yes' + reset : dim + 'no' + reset}`);\n console.log(` Stale sessions: ${result.staleSessions > 0 ? violet + String(result.staleSessions) + ' (auto-closed)' + reset : dim + '0' + reset}`);\n\n if (opts.fix && result.staleLinks > 0) {\n const removed = mem.removeStaleLinks();\n console.log(`\\n \u2713 Removed ${removed} stale link(s)`);\n } else if (result.staleLinks > 0) {\n console.log(`\\n ${dim}Run with --fix to remove stale links${reset}`);\n }\n\n if (result.modelMismatch) {\n console.log(` ${dim}Run 'kirograph mem reembed' to fix model mismatch${reset}`);\n }\n\n console.log('');\n cg.close();\n });\n\n // \u2500\u2500 review \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('review')\n .description('List observations past their review_after date')\n .option('--limit <n>', 'Max results', '20')\n .option('--format <fmt>', 'Output format: text, json', 'text')\n .action(async (opts: { limit: string; format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const obs = mem.getObservationsForReview(parseInt(opts.limit));\n if (opts.format === 'json') {\n console.log(JSON.stringify(obs));\n } else if (obs.length === 0) {\n console.log(`\\n ${dim}No overdue observations.${reset}\\n`);\n } else {\n console.log(`\\n ${section('Memory Review Queue')} \u2014 ${obs.length} overdue\\n`);\n const now = Date.now();\n for (const o of obs) {\n const daysOverdue = Math.floor((now - (o.reviewAfter ?? now)) / 86400000);\n console.log(` ${violet}[${o.kind}]${reset}${o.topicKey ? ` ${dim}(${o.topicKey})${reset}` : ''} ${o.content.slice(0, 120)}`);\n console.log(` ${dim}Overdue by ${daysOverdue}d \u00B7 ID: ${o.id}${reset}\\n`);\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 mark-reviewed \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('mark-reviewed <id>')\n .description('Mark an observation as reviewed \u2014 clears its review_after date')\n .action(async (id: string) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n mem.markReviewed(id);\n console.log(` \u2713 Observation ${dim}${id}${reset} marked as reviewed`);\n cg.close();\n });\n\n // \u2500\u2500 suggest-topic-key \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('suggest-topic-key')\n .description('Suggest a stable topic_key for an observation')\n .requiredOption('--kind <kind>', 'Observation kind: decision, error, pattern, architecture, summary, note')\n .requiredOption('--title <title>', 'Short title or first sentence')\n .action(async (opts: { kind: string; title: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const key = mem.suggestTopicKey(opts.kind, opts.title);\n console.log(` ${violet}${key}${reset}`);\n cg.close();\n });\n\n // \u2500\u2500 capture \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('capture [content]')\n .description('Extract and store structured learnings from text (## Key Learnings, ## Decisions, etc.)')\n .action(async (content: string | undefined) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n let text = content;\n if (!text) {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) chunks.push(chunk);\n text = Buffer.concat(chunks).toString('utf8').trim();\n }\n if (!text) { console.error(' \u2716 No content provided.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const results = mem.capturePassive(text);\n if (results.length === 0) {\n console.log(` ${dim}No structured sections found. Use ## Key Learnings, ## Observations, ## Decisions headings.${reset}`);\n } else {\n console.log(`\\n ${section('Passive Capture')} \u2014 ${results.length} observation(s)\\n`);\n for (const r of results) {\n console.log(` ${violet}[${r.kind}]${reset} ${r.content.slice(0, 100)}${r.id ? '' : ` ${dim}(duplicate)${reset}`}`);\n }\n console.log('');\n }\n cg.close();\n });\n\n // \u2500\u2500 save-prompt \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('save-prompt [content]')\n .description('Save the current user prompt to session memory')\n .action(async (content: string | undefined) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n let text = content;\n if (!text) {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) chunks.push(chunk);\n text = Buffer.concat(chunks).toString('utf8').trim();\n }\n if (!text) { console.error(' \u2716 No content provided.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const id = await mem.savePrompt(text);\n console.log(` \u2713 Prompt saved ${dim}${id}${reset}`);\n cg.close();\n });\n\n // \u2500\u2500 conflicts \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n const conflicts = mem\n .command('conflicts')\n .description('Manage conflict relations between memory observations');\n\n conflicts\n .command('list')\n .description('List pending conflict relations')\n .option('--limit <n>', 'Max results', '20')\n .option('--format <fmt>', 'Output format: text, json', 'text')\n .action(async (opts: { limit: string; format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const pending = mem.getPendingRelations(parseInt(opts.limit));\n if (opts.format === 'json') {\n console.log(JSON.stringify(pending, null, 2));\n } else if (pending.length === 0) {\n console.log(`\\n ${dim}No pending conflict relations.${reset}\\n`);\n } else {\n console.log(`\\n ${section('Pending Relations')} \u2014 ${pending.length}\\n`);\n for (const r of pending) {\n console.log(` ${violet}${r.relation}${reset} [${dim}${r.id}${reset}]`);\n console.log(` A: ${r.observationA}`);\n console.log(` B: ${r.observationB}`);\n if (r.reason) console.log(` Reason: ${dim}${r.reason}${reset}`);\n console.log('');\n }\n }\n cg.close();\n });\n\n conflicts\n .command('scan')\n .description('Scan recent observations for potential conflicts using FTS similarity')\n .option('--limit <n>', 'Max observations to scan', '50')\n .option('--format <fmt>', 'Output format: text, json', 'text')\n .action(async (opts: { limit: string; format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const candidates = mem.scanConflicts(parseInt(opts.limit));\n if (opts.format === 'json') {\n console.log(JSON.stringify(candidates.map(c => ({ a: c.observationA.id, b: c.observationB.id, similarity: c.similarity })), null, 2));\n } else if (candidates.length === 0) {\n console.log(`\\n ${dim}No potential conflicts found.${reset}\\n`);\n } else {\n console.log(`\\n ${section('Conflict Scan')} \u2014 ${candidates.length} candidate(s)\\n`);\n for (const c of candidates) {\n console.log(` ${violet}\u2194${reset} [${c.observationA.kind}] \"${c.observationA.content.slice(0, 80)}\"`);\n console.log(` [${c.observationB.kind}] \"${c.observationB.content.slice(0, 80)}\"`);\n console.log(` ${dim}Similarity: ${c.similarity.toFixed(2)} \u00B7 Use 'kirograph mem compare' to establish a relation${reset}\\n`);\n }\n }\n cg.close();\n });\n\n conflicts\n .command('compare <observationA> <observationB>')\n .description('Establish a typed relation between two observations (IDs or topic_keys)')\n .requiredOption('--relation <type>', 'Relation: supersedes, conflicts_with, compatible, scoped, related, not_conflict')\n .option('--confidence <n>', 'Confidence 0.0\u20131.0', '1.0')\n .option('--reason <text>', 'Explanation')\n .option('--evidence <text>', 'Supporting evidence')\n .action(async (observationA: string, observationB: string, opts: { relation: string; confidence: string; reason?: string; evidence?: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const id = mem.compareObservations({\n observationA,\n observationB,\n relation: opts.relation as any,\n confidence: parseFloat(opts.confidence),\n reason: opts.reason,\n evidence: opts.evidence,\n });\n console.log(` \u2713 Relation ${dim}${id}${reset} created: ${violet}${opts.relation}${reset} (confidence: ${opts.confidence})`);\n cg.close();\n });\n\n conflicts\n .command('judge <relationId>')\n .description('Finalize a pending relation')\n .requiredOption('--relation <type>', 'Final relation type')\n .requiredOption('--confidence <n>', 'Final confidence 0.0\u20131.0')\n .option('--reason <text>', 'Reasoning')\n .option('--evidence <text>', 'Evidence')\n .action(async (relationId: string, opts: { relation: string; confidence: string; reason?: string; evidence?: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n mem.judgeRelation(relationId, opts.relation as any, parseFloat(opts.confidence), opts.reason, opts.evidence);\n console.log(` \u2713 Relation ${dim}${relationId}${reset} judged as ${violet}${opts.relation}${reset} (confidence: ${opts.confidence})`);\n cg.close();\n });\n\n conflicts\n .command('ignore <relationId>')\n .description('Ignore a pending relation (mark as not relevant)')\n .action(async (relationId: string) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n mem.ignoreRelation(relationId);\n console.log(` \u2713 Relation ${dim}${relationId}${reset} ignored`);\n cg.close();\n });\n\n // \u2500\u2500 watchmen \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n const watchmen = mem\n .command('watchmen')\n .description('Watchmen \u2014 workspace brief synthesis from memory observations (requires enableWatchmen: true)');\n\n watchmen\n .command('status')\n .description('Show pending observation count and which files would be written on next synthesis')\n .action(async () => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { WatchmenChecker } = await Promise.resolve().then(() => require('../../watchmen/index.js'));\n const { MemoryDatabase } = await Promise.resolve().then(() => require('../../memory/database.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled. Set enableMemory: true in .kirograph/config.json');\n process.exit(1);\n }\n if (!config.enableWatchmen) {\n console.error(' \u2716 Watchmen is not enabled. Set enableWatchmen: true in .kirograph/config.json');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const memDb = new MemoryDatabase(db.getRawDb());\n memDb.initialize();\n\n const checker = new WatchmenChecker(config.watchmenThreshold);\n const { ready, pendingCount } = checker.shouldSynthesize(memDb);\n const { targetFiles } = checker.buildReadyResponse('', pendingCount, cwd);\n\n console.log(`\\n ${section('Watchmen Status')}\\n`);\n console.log(` Pending observations: ${bold}${pendingCount}${reset} / ${config.watchmenThreshold} threshold`);\n console.log(` Ready to synthesize: ${ready ? violet + 'yes' + reset : dim + 'no' + reset}`);\n console.log(` Target files:`);\n for (const f of targetFiles) {\n console.log(` ${dim}\u00B7${reset} ${f}`);\n }\n console.log('');\n\n cg.close();\n });\n\n watchmen\n .command('synthesize')\n .description('Run local model synthesis immediately (requires watchmenSynthesisMode: local)')\n .option('--force', 'Run even if below threshold')\n .option('--quiet', 'Suppress output (used by runCommand hook)')\n .action(async (opts: { force?: boolean; quiet?: boolean }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { WatchmenChecker } = await Promise.resolve().then(() => require('../../watchmen/index.js'));\n const { MemoryDatabase } = await Promise.resolve().then(() => require('../../memory/database.js'));\n const { runLocalSynthesis } = await Promise.resolve().then(() => require('../../watchmen/synthesize.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n if (!opts.quiet) console.error(' \u2716 KiroGraph is not initialized.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory || !config.enableWatchmen) {\n if (!opts.quiet) console.error(' \u2716 Watchmen is not enabled (enableMemory + enableWatchmen required).');\n process.exit(1);\n }\n if (config.watchmenSynthesisMode !== 'local') {\n if (!opts.quiet) console.error(' \u2716 watchmenSynthesisMode is not \"local\" \u2014 use the agent hook instead.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const memDb = new MemoryDatabase(db.getRawDb());\n memDb.initialize();\n\n const checker = new WatchmenChecker(config.watchmenThreshold);\n const { ready, pendingCount } = checker.shouldSynthesize(memDb);\n\n if (!ready && !opts.force) {\n if (!opts.quiet) console.log(` ${dim}Watchmen: ${pendingCount}/${config.watchmenThreshold} observations \u2014 threshold not reached.${reset}`);\n cg.close();\n return;\n }\n\n const observations = memDb.getObservationsSinceLastSummary(50);\n if (observations.length === 0) {\n if (!opts.quiet) console.log(` ${dim}No observations to synthesize.${reset}`);\n cg.close();\n return;\n }\n\n if (!opts.quiet) {\n console.log(`\\n ${section('Watchmen Synthesis')}\\n`);\n console.log(` Synthesizing ${observations.length} observations with ${dim}${config.watchmenLocalModel}${reset}`);\n const cacheDir = require('path').join(require('os').homedir(), '.kirograph', 'models');\n const cached = require('fs').existsSync(require('path').join(cacheDir, config.watchmenLocalModel));\n if (!cached) console.log(` ${dim}Downloading model \u2014 first run only (cached in ~/.kirograph/models/)${reset}`);\n console.log('');\n }\n\n const readyResult = checker.buildReadyResponse('', pendingCount, cwd);\n const result = await runLocalSynthesis(observations, readyResult, config.watchmenLocalModel, cwd, !!opts.quiet);\n\n // Store summary observation to reset counter\n const mgr = new MemoryManager(config, db.getRawDb(), cwd);\n mgr.initialize();\n await mgr.store({ content: result.summaryObservation, kind: 'summary', source: 'agent' });\n\n if (!opts.quiet) {\n if (result.filesWritten.length) console.log(` \u2713 Brief written to: ${result.filesWritten.map(f => violet + f + reset).join(', ')}`);\n if (result.skillsWritten.length) console.log(` \u2713 Skills written: ${result.skillsWritten.map(f => violet + f + reset).join(', ')}`);\n if (result.skillsPruned.length) console.log(` ${dim}\u2717 Pruned stale: ${result.skillsPruned.join(', ')}${reset}`);\n console.log('');\n }\n\n cg.close();\n });\n\n watchmen\n .command('reset')\n .description('Store a summary observation to reset the synthesis counter without running synthesis')\n .action(async () => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n if (!config.enableWatchmen) {\n console.error(' \u2716 Watchmen is not enabled.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mgr = new MemoryManager(config, db.getRawDb(), cwd);\n mgr.initialize();\n\n // Bypass watchmen check by storing directly as summary\n const id = await mgr.store({ content: `Watchmen counter reset manually via CLI at ${new Date().toISOString()}.`, kind: 'summary', source: 'manual' });\n if (id) {\n console.log(` \u2713 Counter reset \u2014 pending observations set back to 0`);\n } else {\n console.log(` ${dim}Already at zero \u2014 nothing to reset.${reset}`);\n }\n\n cg.close();\n });\n\n // \u2500\u2500 session management (for hooks) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('session-start')\n .description('Start a new memory session (called by hooks)')\n .option('--ide <name>', 'IDE name', 'kiro')\n .action(async (opts: { ide: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) return;\n const config = await loadConfig(cwd);\n if (!config.enableMemory) return;\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n // getOrCreateSession handles auto-creation\n const { MemoryDatabase } = await Promise.resolve().then(() => require('../../memory/database.js'));\n const memDb = new MemoryDatabase(db.getRawDb());\n memDb.initialize();\n const sessionId = memDb.getOrCreateSession(opts.ide, cwd);\n console.log(sessionId);\n\n cg.close();\n });\n\n mem\n .command('session-end')\n .description('End the current memory session (called by hooks)')\n .option('--ide <name>', 'IDE name', 'kiro')\n .action(async (opts: { ide: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) return;\n const config = await loadConfig(cwd);\n if (!config.enableMemory) return;\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n mem.endCurrentSession(opts.ide);\n\n cg.close();\n });\n}\n\n// \u2500\u2500 Helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction formatAge(timestamp: number): string {\n const diff = Date.now() - timestamp;\n const minutes = Math.floor(diff / 60000);\n if (minutes < 60) return `${minutes}m ago`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours}h ago`;\n const days = Math.floor(hours / 24);\n if (days < 7) return `${days}d ago`;\n const weeks = Math.floor(days / 7);\n if (weeks < 5) return `${weeks}w ago`;\n const months = Math.floor(days / 30);\n return `${months}mo ago`;\n}\n\nfunction parseDuration(duration: string): number {\n const match = duration.match(/^(\\d+)(d|m|w|h)$/);\n if (!match) return 90 * 24 * 60 * 60 * 1000; // default 90 days\n\n const value = parseInt(match[1]);\n switch (match[2]) {\n case 'h': return value * 60 * 60 * 1000;\n case 'd': return value * 24 * 60 * 60 * 1000;\n case 'w': return value * 7 * 24 * 60 * 60 * 1000;\n case 'm': return value * 30 * 24 * 60 * 60 * 1000;\n default: return 90 * 24 * 60 * 60 * 1000;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,gBAAkD;AAE3C,SAAS,SAAS,SAAwB;AAC/C,QAAM,MAAM,QACT,QAAQ,KAAK,EACb,YAAY,+DAA+D;AAI9E,MACG,QAAQ,gBAAgB,EACxB,YAAY,kDAAkD,EAC9D,OAAO,iBAAiB,uEAAuE,EAC/F,OAAO,eAAe,eAAe,IAAI,EACzC,OAAO,kBAAkB,4BAA4B,EACrD,OAAO,kBAA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CAAC,GAAG;AAAA,IAChB,KAAK;AAAK,aAAO,QAAQ,KAAK,KAAK;AAAA,IACnC,KAAK;AAAK,aAAO,QAAQ,KAAK,KAAK,KAAK;AAAA,IACxC,KAAK;AAAK,aAAO,QAAQ,IAAI,KAAK,KAAK,KAAK;AAAA,IAC5C,KAAK;AAAK,aAAO,QAAQ,KAAK,KAAK,KAAK,KAAK;AAAA,IAC7C;AAAS,aAAO,KAAK,KAAK,KAAK,KAAK;AAAA,EACtC;AACF;",
|
|
4
|
+
"sourcesContent": ["/**\n * KiroGraph Memory CLI \u2014 mirrors MCP tools + maintenance commands\n *\n * kirograph mem search <query>\n * kirograph mem store <content>\n * kirograph mem timeline\n * kirograph mem status\n * kirograph mem prune\n * kirograph mem export\n * kirograph mem import\n * kirograph mem reembed\n * kirograph mem lint\n */\n\nimport { Command } from 'commander';\nimport { dim, reset, violet, bold, section } from '../ui';\n\nexport function register(program: Command): void {\n const mem = program\n .command('mem')\n .description('Persistent cross-session memory (requires enableMemory: true)');\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\n\n mem\n .command('search <query>')\n .description('Search memory observations (hybrid FTS + vector)')\n .option('--kind <kind>', 'Filter by kind: decision, error, pattern, architecture, summary, note')\n .option('--limit <n>', 'Max results', '10')\n .option('--session <id>', 'Filter to specific session')\n .option('--format <fmt>', 'Output format: text, json', 'text')\n .action(async (query: string, opts: { kind?: string; limit: string; session?: string; format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const { trackCliToolSaving } = await Promise.resolve().then(() => require('./utils.js'));\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled. Set enableMemory: true in .kirograph/config.json');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const results = await mem.search(query, {\n limit: parseInt(opts.limit),\n kind: opts.kind as any,\n sessionId: opts.session,\n });\n\n if (opts.format === 'json') {\n console.log(JSON.stringify(results.map(r => ({\n id: r.observation.id,\n kind: r.observation.kind,\n content: r.observation.content,\n score: r.score,\n createdAt: r.observation.createdAt,\n sessionId: r.observation.sessionId,\n })), null, 2));\n } else {\n if (results.length === 0) {\n console.log(`\\n ${dim}No observations found for \"${query}\"${reset}\\n`);\n } else {\n console.log(`\\n ${section('Memory Search:')} ${violet}${bold}${query}${reset}\\n`);\n for (const r of results) {\n const age = formatAge(r.observation.createdAt);\n console.log(` ${violet}[${r.observation.kind}]${reset} ${r.observation.content}`);\n if (r.relations && r.relations.length > 0) {\n const annotations = r.relations\n .filter(rel => rel.judgmentStatus !== 'ignored')\n .map(rel => {\n const icon = rel.relation === 'conflicts_with' ? '\u26A1' : rel.relation === 'supersedes' ? '\u21A9' : '~';\n return `${icon} ${rel.relation}`;\n })\n .join(' ');\n if (annotations) console.log(` ${dim}${annotations}${reset}`);\n }\n console.log(` ${dim}${age} \u00B7 score: ${r.score.toFixed(3)}${reset}\\n`);\n }\n }\n }\n\n const output = results.map(r => `[${r.observation.kind}] ${r.observation.content}`).join('\\n');\n trackCliToolSaving(cwd, 'kirograph_mem_search', output, { limit: parseInt(opts.limit) });\n cg.close();\n });\n\n // \u2500\u2500 store \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('store [content]')\n .description('Store an observation in memory')\n .option('--kind <kind>', 'Observation kind', 'note')\n .option('--topic-key <key>', 'Stable semantic key (e.g. architecture/auth-model)')\n .option('--review-after <ms>', 'Epoch ms: schedule re-evaluation after this timestamp')\n .action(async (content: string | undefined, opts: { kind: string; topicKey?: string; reviewAfter?: string }) => {\n const { MemoryManager, MemorySchemaError } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled. Set enableMemory: true in .kirograph/config.json');\n process.exit(1);\n }\n\n // Read from stdin if no content argument\n let text = content;\n if (!text) {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) {\n chunks.push(chunk);\n }\n text = Buffer.concat(chunks).toString('utf8').trim();\n }\n\n if (!text) {\n console.error(' \u2716 No content provided. Pass as argument or pipe from stdin.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n let result;\n try {\n result = await mem.store({\n content: text,\n kind: opts.kind as any,\n source: 'manual',\n topicKey: opts.topicKey,\n reviewAfter: opts.reviewAfter ? parseInt(opts.reviewAfter) : undefined,\n });\n } catch (err) {\n if (err instanceof MemorySchemaError) {\n console.error(` \u2716 ${err.message}`);\n cg.close(); process.exit(1);\n }\n throw err;\n }\n\n if (!result) {\n console.log(` ${dim}Duplicate observation \u2014 already stored.${reset}`);\n } else if (typeof result === 'object' && result.watchmenReady) {\n console.log(` \u2713 Stored observation ${dim}${result.id}${reset} [${violet}${opts.kind}${reset}]`);\n console.log(`\\n ${violet}\u26A1 Watchmen ready${reset} \u2014 ${result.pendingCount} observations since last synthesis`);\n console.log(` Target files:`);\n for (const f of result.targetFiles) {\n console.log(` ${dim}\u00B7${reset} ${f}`);\n }\n if (result.skillTargetDir) {\n console.log(` Skill dir: ${dim}${result.skillTargetDir}/watchmen-<slug>.md${reset} (inclusion: manual)`);\n }\n console.log(`\\n ${dim}Run synthesis manually or let the agentStop hook handle it.${reset}`);\n } else {\n console.log(` \u2713 Stored observation ${dim}${result}${reset} [${violet}${opts.kind}${reset}]`);\n }\n\n cg.close();\n });\n\n // \u2500\u2500 timeline \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('timeline')\n .description('List recent sessions and observations')\n .option('--limit <n>', 'Number of sessions', '5')\n .option('--session <id>', 'Show observations for a specific session')\n .option('--format <fmt>', 'Output format: text, json', 'text')\n .action(async (opts: { limit: string; session?: string; format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const { trackCliToolSaving } = await Promise.resolve().then(() => require('./utils.js'));\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled. Set enableMemory: true in .kirograph/config.json');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const { sessions, observations } = mem.timeline({\n limit: parseInt(opts.limit),\n sessionId: opts.session,\n });\n\n if (opts.format === 'json') {\n console.log(JSON.stringify({\n sessions: sessions.map(s => ({\n id: s.id,\n ide: s.ide,\n startedAt: s.startedAt,\n endedAt: s.endedAt,\n observations: (observations.get(s.id) ?? []).map(o => ({\n id: o.id, kind: o.kind, content: o.content, createdAt: o.createdAt,\n })),\n })),\n }, null, 2));\n } else {\n if (sessions.length === 0) {\n console.log(`\\n ${dim}No memory sessions found.${reset}\\n`);\n } else {\n console.log(`\\n ${section('Memory Timeline')}\\n`);\n for (const session of sessions) {\n const start = new Date(session.startedAt).toISOString().slice(0, 16).replace('T', ' ');\n const status = session.endedAt ? dim + 'ended' + reset : violet + 'active' + reset;\n const obs = observations.get(session.id) ?? [];\n console.log(` ${bold}${start}${reset} [${session.ide ?? 'unknown'}] ${status} \u00B7 ${obs.length} observations`);\n for (const o of obs.slice(0, 5)) {\n console.log(` ${dim}\u00B7${reset} ${violet}[${o.kind}]${reset} ${o.content.slice(0, 100)}`);\n }\n if (obs.length > 5) console.log(` ${dim}\u2026and ${obs.length - 5} more${reset}`);\n console.log('');\n }\n }\n }\n\n const output = sessions.map(s => s.id).join('\\n');\n trackCliToolSaving(cwd, 'kirograph_mem_timeline', output, { limit: parseInt(opts.limit) });\n cg.close();\n });\n\n // \u2500\u2500 status \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('status')\n .description('Show memory subsystem health')\n .action(async () => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled. Set enableMemory: true in .kirograph/config.json');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const stats = mem.getStats();\n console.log(`\\n ${section('Memory Status')}\\n`);\n console.log(` Sessions: ${bold}${stats.sessions}${reset} (${stats.activeSessions} active)`);\n console.log(` Observations: ${bold}${stats.observations}${reset}`);\n console.log(` Symbol links: ${bold}${stats.links}${reset}`);\n console.log(` Embeddings: ${bold}${stats.vectors}${reset} / ${stats.embeddableCount}`);\n console.log(` Relations: ${bold}${stats.relations}${reset} (${stats.pendingConflicts} pending)`);\n console.log(` Model mismatch: ${stats.modelMismatch ? violet + '\u26A0 yes \u2014 run kirograph mem reembed' + reset : dim + 'no' + reset}`);\n console.log(` Compression: ${config.cavemanMode !== 'off' ? violet + config.cavemanMode + reset : dim + 'off (storing raw)' + reset}`);\n console.log('');\n\n cg.close();\n });\n\n // \u2500\u2500 prune \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('prune')\n .description('Remove old observations')\n .option('--older-than <duration>', 'Duration (e.g. 90d, 6m)', '90d')\n .action(async (opts: { olderThan: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n\n const ms = parseDuration(opts.olderThan);\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const deleted = mem.prune(ms);\n console.log(` \u2713 Pruned ${deleted} observation(s) older than ${opts.olderThan}`);\n\n cg.close();\n });\n\n // \u2500\u2500 export \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('export')\n .description('Export memory observations')\n .option('--format <fmt>', 'Output format: jsonl, md', 'jsonl')\n .action(async (opts: { format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const { sessions, observations } = mem.timeline({ limit: 1000 });\n\n if (opts.format === 'jsonl') {\n for (const session of sessions) {\n const obs = observations.get(session.id) ?? [];\n for (const o of obs) {\n console.log(JSON.stringify({\n id: o.id,\n content: o.content,\n content_raw: o.contentRaw,\n kind: o.kind,\n tags: o.tags,\n created_at: o.createdAt,\n session_id: o.sessionId,\n }));\n }\n }\n } else {\n // Markdown format\n for (const session of sessions) {\n const start = new Date(session.startedAt).toISOString().slice(0, 10);\n console.log(`## Session ${start} (${session.ide ?? 'unknown'})\\n`);\n const obs = observations.get(session.id) ?? [];\n for (const o of obs) {\n const time = new Date(o.createdAt).toISOString().slice(11, 16);\n console.log(`### [${o.kind}] ${time}`);\n console.log(o.content);\n console.log('');\n }\n }\n }\n\n cg.close();\n });\n\n // \u2500\u2500 import \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('import <file>')\n .description('Import observations from JSONL backup')\n .action(async (file: string) => {\n const fs = await import('fs');\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n\n if (!fs.existsSync(file)) {\n console.error(` \u2716 File not found: ${file}`);\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const lines = fs.readFileSync(file, 'utf8').split('\\n').filter(l => l.trim());\n let imported = 0;\n let skipped = 0;\n\n for (const line of lines) {\n try {\n const data = JSON.parse(line);\n const id = await mem.store({\n content: data.content_raw || data.content,\n kind: data.kind ?? 'note',\n source: 'manual',\n tags: data.tags,\n });\n if (id) imported++;\n else skipped++;\n } catch {\n skipped++;\n }\n }\n\n console.log(` \u2713 Imported ${imported} observation(s), skipped ${skipped} (duplicates/errors)`);\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\n\n mem\n .command('reembed')\n .description('Re-embed all observations with the current model')\n .option('--batch <n>', 'Batch size', '32')\n .action(async (opts: { batch: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n console.log(' Re-embedding all observations...');\n const count = await mem.reembed(parseInt(opts.batch));\n console.log(` \u2713 Re-embedded ${count} observation(s)`);\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\n\n mem\n .command('lint')\n .description('Health check: find stale links, model mismatch, orphans')\n .option('--fix', 'Auto-fix issues (remove stale links, close stale sessions)')\n .action(async (opts: { fix?: boolean }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n const result = mem.lint();\n\n console.log(`\\n ${section('Memory Lint')}\\n`);\n console.log(` Stale links: ${result.staleLinks > 0 ? violet + result.staleLinks + reset : dim + '0' + reset}`);\n console.log(` Model mismatch: ${result.modelMismatch ? violet + 'yes' + reset : dim + 'no' + reset}`);\n console.log(` Stale sessions: ${result.staleSessions > 0 ? violet + String(result.staleSessions) + ' (auto-closed)' + reset : dim + '0' + reset}`);\n\n if (opts.fix && result.staleLinks > 0) {\n const removed = mem.removeStaleLinks();\n console.log(`\\n \u2713 Removed ${removed} stale link(s)`);\n } else if (result.staleLinks > 0) {\n console.log(`\\n ${dim}Run with --fix to remove stale links${reset}`);\n }\n\n if (result.modelMismatch) {\n console.log(` ${dim}Run 'kirograph mem reembed' to fix model mismatch${reset}`);\n }\n\n console.log('');\n cg.close();\n });\n\n // \u2500\u2500 review \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('review')\n .description('List observations past their review_after date')\n .option('--limit <n>', 'Max results', '20')\n .option('--format <fmt>', 'Output format: text, json', 'text')\n .action(async (opts: { limit: string; format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const obs = mem.getObservationsForReview(parseInt(opts.limit));\n if (opts.format === 'json') {\n console.log(JSON.stringify(obs));\n } else if (obs.length === 0) {\n console.log(`\\n ${dim}No overdue observations.${reset}\\n`);\n } else {\n console.log(`\\n ${section('Memory Review Queue')} \u2014 ${obs.length} overdue\\n`);\n const now = Date.now();\n for (const o of obs) {\n const daysOverdue = Math.floor((now - (o.reviewAfter ?? now)) / 86400000);\n console.log(` ${violet}[${o.kind}]${reset}${o.topicKey ? ` ${dim}(${o.topicKey})${reset}` : ''} ${o.content.slice(0, 120)}`);\n console.log(` ${dim}Overdue by ${daysOverdue}d \u00B7 ID: ${o.id}${reset}\\n`);\n }\n }\n cg.close();\n });\n\n // \u2500\u2500 mark-reviewed \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('mark-reviewed <id>')\n .description('Mark an observation as reviewed \u2014 clears its review_after date')\n .action(async (id: string) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n mem.markReviewed(id);\n console.log(` \u2713 Observation ${dim}${id}${reset} marked as reviewed`);\n cg.close();\n });\n\n // \u2500\u2500 suggest-topic-key \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('suggest-topic-key')\n .description('Suggest a stable topic_key for an observation')\n .requiredOption('--kind <kind>', 'Observation kind: decision, error, pattern, architecture, summary, note')\n .requiredOption('--title <title>', 'Short title or first sentence')\n .action(async (opts: { kind: string; title: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const key = mem.suggestTopicKey(opts.kind, opts.title);\n console.log(` ${violet}${key}${reset}`);\n cg.close();\n });\n\n // \u2500\u2500 capture \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('capture [content]')\n .description('Extract and store structured learnings from text (## Key Learnings, ## Decisions, etc.)')\n .action(async (content: string | undefined) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n let text = content;\n if (!text) {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) chunks.push(chunk);\n text = Buffer.concat(chunks).toString('utf8').trim();\n }\n if (!text) { console.error(' \u2716 No content provided.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const results = mem.capturePassive(text);\n if (results.length === 0) {\n console.log(` ${dim}No structured sections found. Use ## Key Learnings, ## Observations, ## Decisions headings.${reset}`);\n } else {\n console.log(`\\n ${section('Passive Capture')} \u2014 ${results.length} observation(s)\\n`);\n for (const r of results) {\n console.log(` ${violet}[${r.kind}]${reset} ${r.content.slice(0, 100)}${r.id ? '' : ` ${dim}(duplicate)${reset}`}`);\n }\n console.log('');\n }\n cg.close();\n });\n\n // \u2500\u2500 save-prompt \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('save-prompt [content]')\n .description('Save the current user prompt to session memory')\n .action(async (content: string | undefined) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n let text = content;\n if (!text) {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) chunks.push(chunk);\n text = Buffer.concat(chunks).toString('utf8').trim();\n }\n if (!text) { console.error(' \u2716 No content provided.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const id = await mem.savePrompt(text);\n console.log(` \u2713 Prompt saved ${dim}${id}${reset}`);\n cg.close();\n });\n\n // \u2500\u2500 conflicts \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n const conflicts = mem\n .command('conflicts')\n .description('Manage conflict relations between memory observations');\n\n conflicts\n .command('list')\n .description('List pending conflict relations')\n .option('--limit <n>', 'Max results', '20')\n .option('--format <fmt>', 'Output format: text, json', 'text')\n .action(async (opts: { limit: string; format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const pending = mem.getPendingRelations(parseInt(opts.limit));\n if (opts.format === 'json') {\n console.log(JSON.stringify(pending, null, 2));\n } else if (pending.length === 0) {\n console.log(`\\n ${dim}No pending conflict relations.${reset}\\n`);\n } else {\n console.log(`\\n ${section('Pending Relations')} \u2014 ${pending.length}\\n`);\n for (const r of pending) {\n console.log(` ${violet}${r.relation}${reset} [${dim}${r.id}${reset}]`);\n console.log(` A: ${r.observationA}`);\n console.log(` B: ${r.observationB}`);\n if (r.reason) console.log(` Reason: ${dim}${r.reason}${reset}`);\n console.log('');\n }\n }\n cg.close();\n });\n\n conflicts\n .command('scan')\n .description('Scan recent observations for potential conflicts using FTS similarity')\n .option('--limit <n>', 'Max observations to scan', '50')\n .option('--format <fmt>', 'Output format: text, json', 'text')\n .action(async (opts: { limit: string; format: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const candidates = mem.scanConflicts(parseInt(opts.limit));\n if (opts.format === 'json') {\n console.log(JSON.stringify(candidates.map(c => ({ a: c.observationA.id, b: c.observationB.id, similarity: c.similarity })), null, 2));\n } else if (candidates.length === 0) {\n console.log(`\\n ${dim}No potential conflicts found.${reset}\\n`);\n } else {\n console.log(`\\n ${section('Conflict Scan')} \u2014 ${candidates.length} candidate(s)\\n`);\n for (const c of candidates) {\n console.log(` ${violet}\u2194${reset} [${c.observationA.kind}] \"${c.observationA.content.slice(0, 80)}\"`);\n console.log(` [${c.observationB.kind}] \"${c.observationB.content.slice(0, 80)}\"`);\n console.log(` ${dim}Similarity: ${c.similarity.toFixed(2)} \u00B7 Use 'kirograph mem compare' to establish a relation${reset}\\n`);\n }\n }\n cg.close();\n });\n\n conflicts\n .command('compare <observationA> <observationB>')\n .description('Establish a typed relation between two observations (IDs or topic_keys)')\n .requiredOption('--relation <type>', 'Relation: supersedes, conflicts_with, compatible, scoped, related, not_conflict')\n .option('--confidence <n>', 'Confidence 0.0\u20131.0', '1.0')\n .option('--reason <text>', 'Explanation')\n .option('--evidence <text>', 'Supporting evidence')\n .action(async (observationA: string, observationB: string, opts: { relation: string; confidence: string; reason?: string; evidence?: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n const id = mem.compareObservations({\n observationA,\n observationB,\n relation: opts.relation as any,\n confidence: parseFloat(opts.confidence),\n reason: opts.reason,\n evidence: opts.evidence,\n });\n console.log(` \u2713 Relation ${dim}${id}${reset} created: ${violet}${opts.relation}${reset} (confidence: ${opts.confidence})`);\n cg.close();\n });\n\n conflicts\n .command('judge <relationId>')\n .description('Finalize a pending relation')\n .requiredOption('--relation <type>', 'Final relation type')\n .requiredOption('--confidence <n>', 'Final confidence 0.0\u20131.0')\n .option('--reason <text>', 'Reasoning')\n .option('--evidence <text>', 'Evidence')\n .action(async (relationId: string, opts: { relation: string; confidence: string; reason?: string; evidence?: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n mem.judgeRelation(relationId, opts.relation as any, parseFloat(opts.confidence), opts.reason, opts.evidence);\n console.log(` \u2713 Relation ${dim}${relationId}${reset} judged as ${violet}${opts.relation}${reset} (confidence: ${opts.confidence})`);\n cg.close();\n });\n\n conflicts\n .command('ignore <relationId>')\n .description('Ignore a pending relation (mark as not relevant)')\n .action(async (relationId: string) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) { console.error(' \u2716 Not initialized.'); process.exit(1); }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) { console.error(' \u2716 Memory not enabled.'); process.exit(1); }\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase(); db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb()); mem.initialize();\n mem.ignoreRelation(relationId);\n console.log(` \u2713 Relation ${dim}${relationId}${reset} ignored`);\n cg.close();\n });\n\n // \u2500\u2500 watchmen \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n const watchmen = mem\n .command('watchmen')\n .description('Watchmen \u2014 workspace brief synthesis from memory observations (requires enableWatchmen: true)');\n\n watchmen\n .command('status')\n .description('Show pending observation count and which files would be written on next synthesis')\n .action(async () => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { WatchmenChecker } = await Promise.resolve().then(() => require('../../watchmen/index.js'));\n const { MemoryDatabase } = await Promise.resolve().then(() => require('../../memory/database.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled. Set enableMemory: true in .kirograph/config.json');\n process.exit(1);\n }\n if (!config.enableWatchmen) {\n console.error(' \u2716 Watchmen is not enabled. Set enableWatchmen: true in .kirograph/config.json');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const memDb = new MemoryDatabase(db.getRawDb());\n memDb.initialize();\n\n const checker = new WatchmenChecker(config.watchmenThreshold);\n const { ready, pendingCount } = checker.shouldSynthesize(memDb);\n const { targetFiles } = checker.buildReadyResponse('', pendingCount, cwd);\n\n console.log(`\\n ${section('Watchmen Status')}\\n`);\n console.log(` Pending observations: ${bold}${pendingCount}${reset} / ${config.watchmenThreshold} threshold`);\n console.log(` Ready to synthesize: ${ready ? violet + 'yes' + reset : dim + 'no' + reset}`);\n console.log(` Target files:`);\n for (const f of targetFiles) {\n console.log(` ${dim}\u00B7${reset} ${f}`);\n }\n console.log('');\n\n cg.close();\n });\n\n watchmen\n .command('synthesize')\n .description('Run local model synthesis immediately (requires watchmenSynthesisMode: local)')\n .option('--force', 'Run even if below threshold')\n .option('--quiet', 'Suppress output (used by runCommand hook)')\n .action(async (opts: { force?: boolean; quiet?: boolean }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { WatchmenChecker } = await Promise.resolve().then(() => require('../../watchmen/index.js'));\n const { MemoryDatabase } = await Promise.resolve().then(() => require('../../memory/database.js'));\n const { runLocalSynthesis } = await Promise.resolve().then(() => require('../../watchmen/synthesize.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n if (!opts.quiet) console.error(' \u2716 KiroGraph is not initialized.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory || !config.enableWatchmen) {\n if (!opts.quiet) console.error(' \u2716 Watchmen is not enabled (enableMemory + enableWatchmen required).');\n process.exit(1);\n }\n if (config.watchmenSynthesisMode !== 'local') {\n if (!opts.quiet) console.error(' \u2716 watchmenSynthesisMode is not \"local\" \u2014 use the agent hook instead.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const memDb = new MemoryDatabase(db.getRawDb());\n memDb.initialize();\n\n const checker = new WatchmenChecker(config.watchmenThreshold);\n const { ready, pendingCount } = checker.shouldSynthesize(memDb);\n\n if (!ready && !opts.force) {\n if (!opts.quiet) console.log(` ${dim}Watchmen: ${pendingCount}/${config.watchmenThreshold} observations \u2014 threshold not reached.${reset}`);\n cg.close();\n return;\n }\n\n const observations = memDb.getObservationsSinceLastSummary(50);\n if (observations.length === 0) {\n if (!opts.quiet) console.log(` ${dim}No observations to synthesize.${reset}`);\n cg.close();\n return;\n }\n\n if (!opts.quiet) {\n console.log(`\\n ${section('Watchmen Synthesis')}\\n`);\n console.log(` Synthesizing ${observations.length} observations with ${dim}${config.watchmenLocalModel}${reset}`);\n const cacheDir = require('path').join(require('os').homedir(), '.kirograph', 'models');\n const cached = require('fs').existsSync(require('path').join(cacheDir, config.watchmenLocalModel));\n if (!cached) console.log(` ${dim}Downloading model \u2014 first run only (cached in ~/.kirograph/models/)${reset}`);\n console.log('');\n }\n\n const readyResult = checker.buildReadyResponse('', pendingCount, cwd);\n const result = await runLocalSynthesis(observations, readyResult, config.watchmenLocalModel, cwd, !!opts.quiet);\n\n // Store summary observation to reset counter\n const mgr = new MemoryManager(config, db.getRawDb(), cwd);\n mgr.initialize();\n await mgr.store({ content: result.summaryObservation, kind: 'summary', source: 'agent' });\n\n if (!opts.quiet) {\n if (result.filesWritten.length) console.log(` \u2713 Brief written to: ${result.filesWritten.map(f => violet + f + reset).join(', ')}`);\n if (result.skillsWritten.length) console.log(` \u2713 Skills written: ${result.skillsWritten.map(f => violet + f + reset).join(', ')}`);\n if (result.skillsPruned.length) console.log(` ${dim}\u2717 Pruned stale: ${result.skillsPruned.join(', ')}${reset}`);\n console.log('');\n }\n\n cg.close();\n });\n\n watchmen\n .command('reset')\n .description('Store a summary observation to reset the synthesis counter without running synthesis')\n .action(async () => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) {\n console.error(' \u2716 KiroGraph is not initialized. Run `kirograph init` first.');\n process.exit(1);\n }\n const config = await loadConfig(cwd);\n if (!config.enableMemory) {\n console.error(' \u2716 Memory is not enabled.');\n process.exit(1);\n }\n if (!config.enableWatchmen) {\n console.error(' \u2716 Watchmen is not enabled.');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mgr = new MemoryManager(config, db.getRawDb(), cwd);\n mgr.initialize();\n\n // Bypass watchmen check by storing directly as summary\n const id = await mgr.store({ content: `Watchmen counter reset manually via CLI at ${new Date().toISOString()}.`, kind: 'summary', source: 'manual' });\n if (id) {\n console.log(` \u2713 Counter reset \u2014 pending observations set back to 0`);\n } else {\n console.log(` ${dim}Already at zero \u2014 nothing to reset.${reset}`);\n }\n\n cg.close();\n });\n\n // \u2500\u2500 session management (for hooks) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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\n mem\n .command('session-start')\n .description('Start a new memory session (called by hooks)')\n .option('--ide <name>', 'IDE name', 'kiro')\n .action(async (opts: { ide: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) return;\n const config = await loadConfig(cwd);\n if (!config.enableMemory) return;\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n\n // getOrCreateSession handles auto-creation\n const { MemoryDatabase } = await Promise.resolve().then(() => require('../../memory/database.js'));\n const memDb = new MemoryDatabase(db.getRawDb());\n memDb.initialize();\n const sessionId = memDb.getOrCreateSession(opts.ide, cwd);\n console.log(sessionId);\n\n cg.close();\n });\n\n mem\n .command('session-end')\n .description('End the current memory session (called by hooks)')\n .option('--ide <name>', 'IDE name', 'kiro')\n .action(async (opts: { ide: string }) => {\n const { MemoryManager } = await Promise.resolve().then(() => require('../../memory/index.js'));\n const { loadConfig } = await Promise.resolve().then(() => require('../../config.js'));\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n\n const cwd = process.cwd();\n if (!KiroGraph.isInitialized(cwd)) return;\n const config = await loadConfig(cwd);\n if (!config.enableMemory) return;\n\n const cg = await KiroGraph.open(cwd);\n const db = cg.getDatabase();\n db.applyMemorySchema();\n const mem = new MemoryManager(config, db.getRawDb());\n mem.initialize();\n mem.endCurrentSession(opts.ide);\n\n cg.close();\n });\n}\n\n// \u2500\u2500 Helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction formatAge(timestamp: number): string {\n const diff = Date.now() - timestamp;\n const minutes = Math.floor(diff / 60000);\n if (minutes < 60) return `${minutes}m ago`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours}h ago`;\n const days = Math.floor(hours / 24);\n if (days < 7) return `${days}d ago`;\n const weeks = Math.floor(days / 7);\n if (weeks < 5) return `${weeks}w ago`;\n const months = Math.floor(days / 30);\n return `${months}mo ago`;\n}\n\nfunction parseDuration(duration: string): number {\n const match = duration.match(/^(\\d+)(d|m|w|h)$/);\n if (!match) return 90 * 24 * 60 * 60 * 1000; // default 90 days\n\n const value = parseInt(match[1]);\n switch (match[2]) {\n case 'h': return value * 60 * 60 * 1000;\n case 'd': return value * 24 * 60 * 60 * 1000;\n case 'w': return value * 7 * 24 * 60 * 60 * 1000;\n case 'm': return value * 30 * 24 * 60 * 60 * 1000;\n default: return 90 * 24 * 60 * 60 * 1000;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,gBAAkD;AAE3C,SAAS,SAAS,SAAwB;AAC/C,QAAM,MAAM,QACT,QAAQ,KAAK,EACb,YAAY,+DAA+D;AAI9E,MACG,QAAQ,gBAAgB,EACxB,YAAY,kDAAkD,EAC9D,OAAO,iBAAiB,uEAAuE,EAC/F,OAAO,eAAe,eAAe,IAAI,EACzC,OAAO,kBAAkB,4BAA4B,EACrD,OAAO,kBAAkB,6BAA6B,MAAM,EAC5D,OAAO,OAAO,OAAe,SAA6E;AACzG,UAAM,EAAE,cAAc,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,uBAAuB,CAAC;AAC7F,UAAM,EAAE,WAAW,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,iBAAiB,CAAC;AACpF,UAAM,aAAa,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,gBAAgB,CAAC,GAAG;AAClF,UAAM,EAAE,mBAAmB,IAAI,M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,IAAI,KAAK,KAAK,KAAK;AAAA,IAC5C,KAAK;AAAK,aAAO,QAAQ,KAAK,KAAK,KAAK,KAAK;AAAA,IAC7C;AAAS,aAAO,KAAK,KAAK,KAAK,KAAK;AAAA,EACtC;AACF;",
|
|
6
6
|
"names": ["mem"]
|
|
7
7
|
}
|
|
@@ -37,7 +37,7 @@ var import_ui = require("../ui");
|
|
|
37
37
|
const red = "\x1B[31m";
|
|
38
38
|
const yellow = "\x1B[33m";
|
|
39
39
|
function register(program) {
|
|
40
|
-
program.command("reachability <target> [projectPath]").description("Check reachability for a dependency or CVE: verdict, call paths, impact summary").action(async (target, projectPath) => {
|
|
40
|
+
program.command("reachability <target> [projectPath]").description("Check reachability for a dependency or CVE: verdict, call paths, impact summary").option("--explain", "Print a plain-English explanation of why the verdict was reached").action(async (target, projectPath, opts) => {
|
|
41
41
|
const projectRoot = path.resolve(projectPath ?? process.cwd());
|
|
42
42
|
const config = await (0, import_config.loadConfig)(projectRoot);
|
|
43
43
|
if (!config.enableSecurity) {
|
|
@@ -93,7 +93,7 @@ function register(program) {
|
|
|
93
93
|
process.exit(1);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
const { ReachabilityAnalyzer } = await Promise.resolve().then(() => require("../../security/reachability.js"));
|
|
96
|
+
const { ReachabilityAnalyzer, explainReachability } = await Promise.resolve().then(() => require("../../security/reachability.js"));
|
|
97
97
|
const analyzer = new ReachabilityAnalyzer(db, config);
|
|
98
98
|
const result = await analyzer.analyze(vulnerabilityNodeId);
|
|
99
99
|
let verdictColor;
|
|
@@ -112,6 +112,11 @@ function register(program) {
|
|
|
112
112
|
${import_ui.violet}${import_ui.bold}Reachability:${import_ui.reset} ${targetLabel}`);
|
|
113
113
|
console.log(` ${import_ui.dim}Verdict:${import_ui.reset} ${verdictColor}${import_ui.bold}${verdictLabel}${import_ui.reset}`);
|
|
114
114
|
console.log(` ${import_ui.dim}Reaching entry points:${import_ui.reset} ${import_ui.bold}${result.reachingEntryPointCount}${import_ui.reset}`);
|
|
115
|
+
if (opts.explain) {
|
|
116
|
+
console.log(`
|
|
117
|
+
${import_ui.violet}${import_ui.bold}Explanation${import_ui.reset}`);
|
|
118
|
+
console.log(` ${import_ui.dim}${explainReachability(result)}${import_ui.reset}`);
|
|
119
|
+
}
|
|
115
120
|
if (result.paths.length > 0) {
|
|
116
121
|
console.log(`
|
|
117
122
|
${import_ui.violet}${import_ui.bold}Call Paths${import_ui.reset} ${import_ui.dim}(showing up to 5)${import_ui.reset}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/commands/reachability.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport * as path from 'path';\nimport { loadConfig } from '../../config';\nimport { dim, reset, violet, bold, green } from '../ui';\n\nconst red = '\\x1b[31m';\nconst yellow = '\\x1b[33m';\n\nexport function register(program: Command): void {\n program\n .command('reachability <target> [projectPath]')\n .description('Check reachability for a dependency or CVE: verdict, call paths, impact summary')\n .action(async (target: string, projectPath: string | undefined) => {\n const projectRoot = path.resolve(projectPath ?? process.cwd());\n const config = await loadConfig(projectRoot);\n\n if (!config.enableSecurity) {\n console.error(`\\n ${yellow}\u26A0 Security analysis is disabled.${reset}`);\n console.error(` ${dim}Enable it in .kirograph/config.json:${reset} ${violet}${bold}\"enableSecurity\": true${reset}`);\n console.error(` ${dim}Then re-run:${reset} ${violet}${bold}kirograph index${reset}\\n`);\n process.exit(1);\n }\n\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n if (!KiroGraph.isInitialized(projectRoot)) {\n console.error(' \u2716 KiroGraph not initialized. Run: kirograph init');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(projectRoot);\n const db = cg.getDatabase();\n db.applySecuritySchema();\n const rawDb = db.getRawDb();\n\n // Resolve target to a vulnerability node ID (CVE ID or package name)\n let vulnerabilityNodeId: string | null = null;\n let targetLabel = target;\n\n const vulnRow: { node_id: string } | undefined = rawDb.get(\n `SELECT node_id FROM sec_vulnerabilities WHERE cve_id = ?`,\n [target],\n );\n\n if (vulnRow) {\n vulnerabilityNodeId = vulnRow.node_id;\n } else {\n const depRow: { node_id: string; package_name: string } | undefined = rawDb.get(\n `SELECT node_id, package_name FROM sec_dependencies WHERE package_name = ?`,\n [target],\n );\n\n if (depRow) {\n targetLabel = depRow.package_name;\n const vulnEdge: { target: string } | undefined = rawDb.get(\n `SELECT target FROM edges WHERE source = ? AND kind = 'has_vulnerability' LIMIT 1`,\n [depRow.node_id],\n );\n\n if (vulnEdge) {\n vulnerabilityNodeId = vulnEdge.target;\n } else {\n console.error(`\\n ${dim}No vulnerabilities found for dependency \"${target}\". The dependency exists but has no known CVEs.${reset}\\n`);\n cg.close();\n process.exit(0);\n }\n } else {\n console.error(`\\n \u2716 Target \"${target}\" not found. Provide a valid CVE ID or dependency package name.\\n`);\n cg.close();\n process.exit(1);\n }\n }\n\n const { ReachabilityAnalyzer } = await Promise.resolve().then(() => require('../../security/reachability.js'));\n const analyzer = new ReachabilityAnalyzer(db, config);\n const result = await analyzer.analyze(vulnerabilityNodeId);\n\n // Verdict line\n let verdictColor: string;\n let verdictLabel: string;\n if (result.verdict === 'affected') {\n verdictColor = red; verdictLabel = 'affected';\n } else if (result.verdict === 'not_affected') {\n verdictColor = green; verdictLabel = 'not affected';\n } else {\n verdictColor = yellow; verdictLabel = 'under investigation';\n }\n\n console.log(`\\n ${violet}${bold}Reachability:${reset} ${targetLabel}`);\n console.log(` ${dim}Verdict:${reset} ${verdictColor}${bold}${verdictLabel}${reset}`);\n console.log(` ${dim}Reaching entry points:${reset} ${bold}${result.reachingEntryPointCount}${reset}`);\n\n // Call paths\n if (result.paths.length > 0) {\n console.log(`\\n ${violet}${bold}Call Paths${reset} ${dim}(showing up to 5)${reset}\\n`);\n for (const p of result.paths.slice(0, 5)) {\n console.log(` ${dim}from${reset} ${violet}${p.entryPoint}${reset}`);\n console.log(` ${p.path.join(` ${dim}\u2192${reset} `)}`);\n }\n if (result.paths.length > 5) {\n console.log(`\\n ${dim}\u2026and ${result.paths.length - 5} more paths${reset}`);\n }\n }\n\n // Unresolved symbols\n if (result.unresolvedSymbols.length > 0) {\n console.log(`\\n ${yellow}Unresolved Symbols${reset} ${dim}(${result.unresolvedSymbols.length} total, showing up to 10)${reset}\\n`);\n for (const sym of result.unresolvedSymbols.slice(0, 10)) {\n console.log(` ${dim}\u00B7${reset} ${sym}`);\n }\n if (result.unresolvedSymbols.length > 10) {\n console.log(` ${dim}\u2026and ${result.unresolvedSymbols.length - 10} more${reset}`);\n }\n }\n\n // Impact summary (only when affected)\n if (result.verdict === 'affected') {\n const impact = await analyzer.getImpactSummary(vulnerabilityNodeId);\n if (impact) {\n console.log(`\\n ${violet}${bold}Impact Summary${reset}\\n`);\n if (impact.affectedLayers.length > 0) {\n console.log(` ${dim}Affected layers:${reset} ${impact.affectedLayers.join(', ')}`);\n }\n console.log(` ${dim}Affected entry points:${reset} ${bold}${impact.affectedEntryPoints.length}${reset}`);\n console.log(` ${dim}Distinct paths:${reset} ${bold}${impact.distinctPathCount}${reset}`);\n }\n }\n\n console.log();\n cg.close();\n });\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,WAAsB;AACtB,oBAA2B;AAC3B,gBAAgD;AAEhD,MAAM,MAAS;AACf,MAAM,SAAS;AAER,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,qCAAqC,EAC7C,YAAY,iFAAiF,EAC7F,OAAO,OAAO,QAAgB,
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport * as path from 'path';\nimport { loadConfig } from '../../config';\nimport { dim, reset, violet, bold, green } from '../ui';\n\nconst red = '\\x1b[31m';\nconst yellow = '\\x1b[33m';\n\nexport function register(program: Command): void {\n program\n .command('reachability <target> [projectPath]')\n .description('Check reachability for a dependency or CVE: verdict, call paths, impact summary')\n .option('--explain', 'Print a plain-English explanation of why the verdict was reached')\n .action(async (target: string, projectPath: string | undefined, opts: { explain?: boolean }) => {\n const projectRoot = path.resolve(projectPath ?? process.cwd());\n const config = await loadConfig(projectRoot);\n\n if (!config.enableSecurity) {\n console.error(`\\n ${yellow}\u26A0 Security analysis is disabled.${reset}`);\n console.error(` ${dim}Enable it in .kirograph/config.json:${reset} ${violet}${bold}\"enableSecurity\": true${reset}`);\n console.error(` ${dim}Then re-run:${reset} ${violet}${bold}kirograph index${reset}\\n`);\n process.exit(1);\n }\n\n const KiroGraph = (await Promise.resolve().then(() => require('../../index.js'))).default;\n if (!KiroGraph.isInitialized(projectRoot)) {\n console.error(' \u2716 KiroGraph not initialized. Run: kirograph init');\n process.exit(1);\n }\n\n const cg = await KiroGraph.open(projectRoot);\n const db = cg.getDatabase();\n db.applySecuritySchema();\n const rawDb = db.getRawDb();\n\n // Resolve target to a vulnerability node ID (CVE ID or package name)\n let vulnerabilityNodeId: string | null = null;\n let targetLabel = target;\n\n const vulnRow: { node_id: string } | undefined = rawDb.get(\n `SELECT node_id FROM sec_vulnerabilities WHERE cve_id = ?`,\n [target],\n );\n\n if (vulnRow) {\n vulnerabilityNodeId = vulnRow.node_id;\n } else {\n const depRow: { node_id: string; package_name: string } | undefined = rawDb.get(\n `SELECT node_id, package_name FROM sec_dependencies WHERE package_name = ?`,\n [target],\n );\n\n if (depRow) {\n targetLabel = depRow.package_name;\n const vulnEdge: { target: string } | undefined = rawDb.get(\n `SELECT target FROM edges WHERE source = ? AND kind = 'has_vulnerability' LIMIT 1`,\n [depRow.node_id],\n );\n\n if (vulnEdge) {\n vulnerabilityNodeId = vulnEdge.target;\n } else {\n console.error(`\\n ${dim}No vulnerabilities found for dependency \"${target}\". The dependency exists but has no known CVEs.${reset}\\n`);\n cg.close();\n process.exit(0);\n }\n } else {\n console.error(`\\n \u2716 Target \"${target}\" not found. Provide a valid CVE ID or dependency package name.\\n`);\n cg.close();\n process.exit(1);\n }\n }\n\n const { ReachabilityAnalyzer, explainReachability } = await Promise.resolve().then(() => require('../../security/reachability.js'));\n const analyzer = new ReachabilityAnalyzer(db, config);\n const result = await analyzer.analyze(vulnerabilityNodeId);\n\n // Verdict line\n let verdictColor: string;\n let verdictLabel: string;\n if (result.verdict === 'affected') {\n verdictColor = red; verdictLabel = 'affected';\n } else if (result.verdict === 'not_affected') {\n verdictColor = green; verdictLabel = 'not affected';\n } else {\n verdictColor = yellow; verdictLabel = 'under investigation';\n }\n\n console.log(`\\n ${violet}${bold}Reachability:${reset} ${targetLabel}`);\n console.log(` ${dim}Verdict:${reset} ${verdictColor}${bold}${verdictLabel}${reset}`);\n console.log(` ${dim}Reaching entry points:${reset} ${bold}${result.reachingEntryPointCount}${reset}`);\n\n if (opts.explain) {\n console.log(`\\n ${violet}${bold}Explanation${reset}`);\n console.log(` ${dim}${explainReachability(result)}${reset}`);\n }\n\n // Call paths\n if (result.paths.length > 0) {\n console.log(`\\n ${violet}${bold}Call Paths${reset} ${dim}(showing up to 5)${reset}\\n`);\n for (const p of result.paths.slice(0, 5)) {\n console.log(` ${dim}from${reset} ${violet}${p.entryPoint}${reset}`);\n console.log(` ${p.path.join(` ${dim}\u2192${reset} `)}`);\n }\n if (result.paths.length > 5) {\n console.log(`\\n ${dim}\u2026and ${result.paths.length - 5} more paths${reset}`);\n }\n }\n\n // Unresolved symbols\n if (result.unresolvedSymbols.length > 0) {\n console.log(`\\n ${yellow}Unresolved Symbols${reset} ${dim}(${result.unresolvedSymbols.length} total, showing up to 10)${reset}\\n`);\n for (const sym of result.unresolvedSymbols.slice(0, 10)) {\n console.log(` ${dim}\u00B7${reset} ${sym}`);\n }\n if (result.unresolvedSymbols.length > 10) {\n console.log(` ${dim}\u2026and ${result.unresolvedSymbols.length - 10} more${reset}`);\n }\n }\n\n // Impact summary (only when affected)\n if (result.verdict === 'affected') {\n const impact = await analyzer.getImpactSummary(vulnerabilityNodeId);\n if (impact) {\n console.log(`\\n ${violet}${bold}Impact Summary${reset}\\n`);\n if (impact.affectedLayers.length > 0) {\n console.log(` ${dim}Affected layers:${reset} ${impact.affectedLayers.join(', ')}`);\n }\n console.log(` ${dim}Affected entry points:${reset} ${bold}${impact.affectedEntryPoints.length}${reset}`);\n console.log(` ${dim}Distinct paths:${reset} ${bold}${impact.distinctPathCount}${reset}`);\n }\n }\n\n console.log();\n cg.close();\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,WAAsB;AACtB,oBAA2B;AAC3B,gBAAgD;AAEhD,MAAM,MAAS;AACf,MAAM,SAAS;AAER,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,qCAAqC,EAC7C,YAAY,iFAAiF,EAC7F,OAAO,aAAa,kEAAkE,EACtF,OAAO,OAAO,QAAgB,aAAiC,SAAgC;AAC9F,UAAM,cAAc,KAAK,QAAQ,eAAe,QAAQ,IAAI,CAAC;AAC7D,UAAM,SAAS,UAAM,0BAAW,WAAW;AAE3C,QAAI,CAAC,OAAO,gBAAgB;AAC1B,cAAQ,MAAM;AAAA,IAAO,MAAM,wCAAmC,eAAK,EAAE;AACrE,cAAQ,MAAM,KAAK,aAAG,uCAAuC,eAAK,IAAI,gBAAM,GAAG,cAAI,yBAAyB,eAAK,EAAE;AACnH,cAAQ,MAAM,KAAK,aAAG,eAAe,eAAK,IAAI,gBAAM,GAAG,cAAI,kBAAkB,eAAK;AAAA,CAAI;AACtF,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,UAAM,aAAa,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,gBAAgB,CAAC,GAAG;AAClF,QAAI,CAAC,UAAU,cAAc,WAAW,GAAG;AACzC,cAAQ,MAAM,yDAAoD;AAClE,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,UAAM,KAAK,MAAM,UAAU,KAAK,WAAW;AAC3C,UAAM,KAAK,GAAG,YAAY;AAC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I,KAAK,aAAG,aAAQ,OAAO,kBAAkB,SAAS,EAAE,QAAQ,eAAK,EAAE;AAAA,MACjF;AAAA,IACF;AAGA,QAAI,OAAO,YAAY,YAAY;AACjC,YAAM,SAAS,MAAM,SAAS,iBAAiB,mBAAmB;AAClE,UAAI,QAAQ;AACV,gBAAQ,IAAI;AAAA,IAAO,gBAAM,GAAG,cAAI,iBAAiB,eAAK;AAAA,CAAI;AAC1D,YAAI,OAAO,eAAe,SAAS,GAAG;AACpC,kBAAQ,IAAI,KAAK,aAAG,mBAAmB,eAAK,UAAU,OAAO,eAAe,KAAK,IAAI,CAAC,EAAE;AAAA,QAC1F;AACA,gBAAQ,IAAI,KAAK,aAAG,yBAAyB,eAAK,IAAI,cAAI,GAAG,OAAO,oBAAoB,MAAM,GAAG,eAAK,EAAE;AACxG,gBAAQ,IAAI,KAAK,aAAG,kBAAkB,eAAK,WAAW,cAAI,GAAG,OAAO,iBAAiB,GAAG,eAAK,EAAE;AAAA,MACjG;AAAA,IACF;AAEA,YAAQ,IAAI;AACZ,OAAG,MAAM;AAAA,EACX,CAAC;AACL;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -206,7 +206,8 @@ async function showIntegrations(projectRoot) {
|
|
|
206
206
|
"amp": { path: path.join(projectRoot, ".amp", "config.json"), key: "mcpServers" },
|
|
207
207
|
"cline": { path: path.join(projectRoot, ".cline", "mcp_settings.json"), key: "mcpServers" },
|
|
208
208
|
"qoder": { path: path.join(projectRoot, ".qoder", "mcp.json"), key: "mcpServers" },
|
|
209
|
-
"qwen": { path: path.join(home, ".qwen", "settings.json"), key: "mcpServers" }
|
|
209
|
+
"qwen": { path: path.join(home, ".qwen", "settings.json"), key: "mcpServers" },
|
|
210
|
+
"commandcode": { path: path.join(projectRoot, ".mcp.json"), key: "mcpServers" }
|
|
210
211
|
};
|
|
211
212
|
function isConfigured(target) {
|
|
212
213
|
const check = configChecks[target];
|