kirograph 1.1.1 → 1.2.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.
Files changed (40) hide show
  1. package/README.md +3 -2
  2. package/dist/bin/commands/memory.js +12 -2
  3. package/dist/bin/commands/memory.js.map +2 -2
  4. package/dist/bin/commands/wiki.js +3 -2
  5. package/dist/bin/commands/wiki.js.map +2 -2
  6. package/dist/bin/kirograph.js +1 -1
  7. package/dist/config.js +8 -0
  8. package/dist/config.js.map +2 -2
  9. package/dist/db/memory-schema.sql +2 -1
  10. package/dist/mcp/handlers/memory.js +2 -1
  11. package/dist/mcp/handlers/memory.js.map +2 -2
  12. package/dist/mcp/handlers/wiki.js +4 -2
  13. package/dist/mcp/handlers/wiki.js.map +2 -2
  14. package/dist/mcp/tools.js +2 -1
  15. package/dist/mcp/tools.js.map +2 -2
  16. package/dist/memory/database.js +17 -4
  17. package/dist/memory/database.js.map +2 -2
  18. package/dist/memory/index.js +18 -1
  19. package/dist/memory/index.js.map +2 -2
  20. package/dist/memory/schema.js +35 -0
  21. package/dist/memory/schema.js.map +2 -2
  22. package/dist/memory/types.js.map +1 -1
  23. package/dist/patterns/loader.js +2 -146
  24. package/dist/patterns/loader.js.map +3 -3
  25. package/dist/security/manifest/plugins/maven.js +33 -3
  26. package/dist/security/manifest/plugins/maven.js.map +2 -2
  27. package/dist/security/manifest/plugins/npm.js +32 -3
  28. package/dist/security/manifest/plugins/npm.js.map +2 -2
  29. package/dist/shared/json-schema.js +136 -0
  30. package/dist/shared/json-schema.js.map +7 -0
  31. package/dist/shared/yaml.js +174 -0
  32. package/dist/shared/yaml.js.map +7 -0
  33. package/dist/wiki/index.js +3 -1
  34. package/dist/wiki/index.js.map +2 -2
  35. package/dist/wiki/lint.js +14 -1
  36. package/dist/wiki/lint.js.map +2 -2
  37. package/dist/wiki/typed-pages.js +67 -0
  38. package/dist/wiki/typed-pages.js.map +7 -0
  39. package/dist/wiki/types.js.map +1 -1
  40. package/package.json +1 -1
package/README.md CHANGED
@@ -43,9 +43,9 @@ The result is fewer tool calls, less context used, and faster responses on compl
43
43
  | <h4>Security</h4> | |
44
44
  | 🔒 **Security (KiroGraph-Sec opt-in module)** | Goes beyond "this dependency has a CVE" — uses the call graph to determine if vulnerable code is **actually reachable** from your entry points. Maps your **attack surface** (which HTTP routes reach vulnerable deps). Detects **hardcoded secrets** and shows how many entry points expose them. **SAST-lite** finds SQL injection, path traversal, and dangerous eval in your code. **AST-based SAST (opt-in via `enablePatterns`)** runs 10 bundled structural pattern rules via `@ast-grep/napi` — matches actual code structure, not just symbol names. **Supply chain health** checks OpenSSF Scorecard scores and detects dependency confusion attacks. Covers 14 ecosystems, outputs CycloneDX SBOM/VEX and CI-ready SARIF reports. |
45
45
  | <h4>Knowledge & Data</h4> | |
46
- | 🧠 **Persistent Memory (KiroGraph-Mem opt-in module)** | Cross-session observations — decisions, errors, patterns — auto-linked to code symbols. **Conflict detection**: typed relations between observations (`supersedes`, `conflicts_with`, `compatible`) with agent judgment workflow (`kirograph_mem_compare`, `kirograph_mem_judge`). **Stale review**: schedule observations for re-evaluation (`review_after` + `kirograph_mem_review`). **Passive capture**: extract learnings from structured text. **Prompt saving**: session context reconstruction. **Topic key**: stable semantic addressing. **Strict writes (opt-in via `memoryStrictWrites`)**: rejects an unknown `kind` or blank tags instead of silently corrupting the store. Inspired by [Engram](https://github.com/Gentleman-Programming/engram) and [IWE](https://github.com/iwe-org/iwe)'s schema-validated agent writes. |
46
+ | 🧠 **Persistent Memory (KiroGraph-Mem opt-in module)** | Cross-session observations — decisions, errors, patterns — auto-linked to code symbols. **Conflict detection**: typed relations between observations (`supersedes`, `conflicts_with`, `compatible`) with agent judgment workflow (`kirograph_mem_compare`, `kirograph_mem_judge`). **Stale review**: schedule observations for re-evaluation (`review_after` + `kirograph_mem_review`). **Passive capture**: extract learnings from structured text. **Prompt saving**: session context reconstruction. **Topic key**: stable semantic addressing. **Strict writes (opt-in via `memoryStrictWrites`)**: rejects an unknown `kind` or blank tags instead of silently corrupting the store. **Typed fields (opt-in via `memorySchemaValidation`)**: observations can carry structured `fields` beyond free-text `content`, validated per `kind` against a JSON Schema registered at `.kirograph/memory-schemas/<kind>.schema.json` — a kind with no schema is never validated. Inspired by [Engram](https://github.com/Gentleman-Programming/engram), [IWE](https://github.com/iwe-org/iwe)'s schema-validated agent writes, and [tmd](https://github.com/alfonsograziano/tmd)'s per-type schema registration. |
47
47
  | 👁️ **Watchmen (KiroGraph-Watchmen opt-in module)** ⚠️ *experimental* | Auto-synthesizes accumulated memory observations into workspace briefs and `inclusion: manual` skill files. Fires via the `watchmenReady` signal in `kirograph_mem_store` when threshold is reached. **Local model** (default, `watchmenSynthesisMode: 'local'`): runs `gemma-4-E4B-it-ONNX` on-device via `@huggingface/transformers` — ~3–4 GB one-time download, ~3–5 GB RAM, 8–15 s on Apple Silicon M1+. No API key, no background daemon, no external calls. **Agent mode** also available for Kiro (`watchmenSynthesisMode: 'agent'`, uses active session). ⚠️ **Experimental:** output quality in local mode depends heavily on the model chosen and your hardware. Smaller models or slower machines may produce incomplete briefs and lower-quality skill files. Use `agent` mode for best results. |
48
- | 📚 **Wiki (KiroGraph-Wiki opt-in module)** | Karpathy-style LLM wiki — a set of markdown pages that compound knowledge across sessions. Three ops: **ingest** (build structured prompt from source text), **apply-diff** (write LLM-generated WIKI_DIFF to SQLite + disk), **lint** (broken links, orphan pages, contradictions). **Link graph** (`kirograph wiki links <slug>`): outgoing/broken/incoming `[[slug]]` backlinks for a page. **Rename** (`kirograph wiki rename <from> <to>`): moves a page's file and rewrites every `[[slug]]` reference to it across the wiki — a CLI-first port of the navigation/refactor features [IWE](https://github.com/iwe-org/iwe) gets from a full LSP. Context enrichment: `kirograph_context` auto-includes relevant wiki pages above score threshold. Two synthesis modes: `agent` (IDE LLM) or `local` (HuggingFace, same infra as Watchmen). Conflict resolution: deterministic by source date when `wikiAutoResolveConflicts: true`. Inspired by [Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) and [IWE](https://github.com/iwe-org/iwe). |
48
+ | 📚 **Wiki (KiroGraph-Wiki opt-in module)** | Karpathy-style LLM wiki — a set of markdown pages that compound knowledge across sessions. Three ops: **ingest** (build structured prompt from source text), **apply-diff** (write LLM-generated WIKI_DIFF to SQLite + disk), **lint** (broken links, orphan pages, contradictions). **Link graph** (`kirograph wiki links <slug>`): outgoing/broken/incoming `[[slug]]` backlinks for a page. **Rename** (`kirograph wiki rename <from> <to>`): moves a page's file and rewrites every `[[slug]]` reference to it across the wiki — a CLI-first port of the navigation/refactor features [IWE](https://github.com/iwe-org/iwe) gets from a full LSP. Context enrichment: `kirograph_context` auto-includes relevant wiki pages above score threshold. Two synthesis modes: `agent` (IDE LLM) or `local` (HuggingFace, same infra as Watchmen). Conflict resolution: deterministic by source date when `wikiAutoResolveConflicts: true`. **Typed pages (opt-in via `wikiTypedPages`)**: a page may declare `_type: <type>` in a YAML frontmatter block, validated by `wiki lint` against a JSON Schema registered at `.kirograph/wiki-schemas/<type>.schema.json` — pages with no frontmatter, or a `_type` with no schema, are never validated. Inspired by [Karpathy's LLM Wiki pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f), [IWE](https://github.com/iwe-org/iwe), and [tmd](https://github.com/alfonsograziano/tmd)'s per-type schema registration. |
49
49
  | 📖 **Documentation Indexing (KiroGraph-Doc opt-in module)** | Section-level retrieval from Markdown, MDX, RST, AsciiDoc, OpenAPI — 92-97% token savings |
50
50
  | 📊 **Data Navigation (KiroGraph-Data opt-in module)** | Query CSV/JSON/Excel/Parquet/**PDF** with filters, aggregations, joins — all server-side in SQLite |
51
51
  | <h4>Token Optimization</h4> | |
@@ -177,6 +177,7 @@ KiroGraph is inspired by [CodeGraph](https://github.com/colbymchenry/codegraph)
177
177
  - [watchmen](https://github.com/firstbatchxyz/watchmen) by [firstbatch](https://github.com/firstbatchxyz): the watchmen module's session-mining concept, workspace brief generation, and `AGENTS.md` mirroring pattern.
178
178
  - [LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) by [Andrej Karpathy](https://karpathy.ai/): the wiki module's three-op pattern (ingest → apply → lint), WIKI_DIFF block format, two-tool ingest flow, and the principle of knowledge compounding rather than accumulating.
179
179
  - [IWE](https://github.com/iwe-org/iwe): a markdown knowledge-graph tool with a full LSP integration and schema-validated agent writes (`expect` guards, per-type document schemas) over MCP. `memoryStrictWrites` (opt-in observation schema validation) and `kirograph wiki links`/`kirograph wiki rename` (link-graph navigation and rename-with-reference-updates, ported to the CLI rather than a full LSP server) both scale down ideas from IWE to fit KiroGraph's existing memory and wiki modules.
180
+ - [tmd](https://github.com/alfonsograziano/tmd) by [Alfonso Graziano](https://github.com/alfonsograziano): a zero-dependency typed-markdown format that registers a type just by dropping a JSON Schema file in a folder, validated by a linter. `memorySchemaValidation` and `wikiTypedPages` (opt-in per-kind/per-type JSON Schema validation of structured fields) scale that per-type schema registration idea down to KiroGraph's existing memory and wiki modules, rather than adopting tmd's own file-naming/id conventions wholesale.
180
181
  - [jDocMunch-MCP](https://github.com/jgravelle/jdocmunch-mcp) by [J. Gravelle](https://www.linkedin.com/in/j-gravelle-2778223/): the documentation module's section-first retrieval approach, stable section IDs, and byte-offset addressing.
181
182
  - [jDataMunch-MCP](https://github.com/jgravelle/jdatamunch-mcp) by [J. Gravelle](https://www.linkedin.com/in/j-gravelle-2778223/): the data module's column profiling, streaming parsers, and server-side aggregation approach.
182
183
  - [rtk](https://github.com/rtk-ai/rtk) by [rtk-ai](https://github.com/rtk-ai): the shell compression module's command-family approach and token-optimized output patterns.
@@ -96,7 +96,7 @@ function register(program) {
96
96
  trackCliToolSaving(cwd, "kirograph_mem_search", output, { limit: parseInt(opts.limit) });
97
97
  cg.close();
98
98
  });
99
- mem.command("store [content]").description("Store an observation in memory").option("--kind <kind>", "Observation kind", "note").option("--topic-key <key>", "Stable semantic key (e.g. architecture/auth-model)").option("--review-after <ms>", "Epoch ms: schedule re-evaluation after this timestamp").action(async (content, opts) => {
99
+ mem.command("store [content]").description("Store an observation in memory").option("--kind <kind>", "Observation kind", "note").option("--topic-key <key>", "Stable semantic key (e.g. architecture/auth-model)").option("--review-after <ms>", "Epoch ms: schedule re-evaluation after this timestamp").option("--fields <json>", "Structured extra fields as a JSON object, validated against .kirograph/memory-schemas/<kind>.schema.json when memorySchemaValidation is enabled").action(async (content, opts) => {
100
100
  const { MemoryManager, MemorySchemaError } = await Promise.resolve().then(() => require("../../memory/index.js"));
101
101
  const { loadConfig } = await Promise.resolve().then(() => require("../../config.js"));
102
102
  const KiroGraph = (await Promise.resolve().then(() => require("../../index.js"))).default;
@@ -122,6 +122,15 @@ function register(program) {
122
122
  console.error(" \u2716 No content provided. Pass as argument or pipe from stdin.");
123
123
  process.exit(1);
124
124
  }
125
+ let fields;
126
+ if (opts.fields) {
127
+ try {
128
+ fields = JSON.parse(opts.fields);
129
+ } catch {
130
+ console.error(` \u2716 --fields must be valid JSON (e.g. '{"key":"value"}')`);
131
+ process.exit(1);
132
+ }
133
+ }
125
134
  const cg = await KiroGraph.open(cwd);
126
135
  const db = cg.getDatabase();
127
136
  db.applyMemorySchema();
@@ -134,7 +143,8 @@ function register(program) {
134
143
  kind: opts.kind,
135
144
  source: "manual",
136
145
  topicKey: opts.topicKey,
137
- reviewAfter: opts.reviewAfter ? parseInt(opts.reviewAfter) : void 0
146
+ reviewAfter: opts.reviewAfter ? parseInt(opts.reviewAfter) : void 0,
147
+ fields
138
148
  });
139
149
  } catch (err) {
140
150
  if (err instanceof MemorySchemaError) {
@@ -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, 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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GAAK;AACvC,MAAI,UAAU,GAAI,QAAO,GAAG,OAAO;AACnC,QAAM,QAAQ,KAAK,MAAM,UAAU,EAAE;AACrC,MAAI,QAAQ,GAAI,QAAO,GAAG,KAAK;AAC/B,QAAM,OAAO,KAAK,MAAM,QAAQ,EAAE;AAClC,MAAI,OAAO,EAAG,QAAO,GAAG,IAAI;AAC5B,QAAM,QAAQ,KAAK,MAAM,OAAO,CAAC;AACjC,MAAI,QAAQ,EAAG,QAAO,GAAG,KAAK;AAC9B,QAAM,SAAS,KAAK,MAAM,OAAO,EAAE;AACnC,SAAO,GAAG,MAAM;AAClB;AAEA,SAAS,cAAc,UAA0B;AAC/C,QAAM,QAAQ,SAAS,MAAM,kBAAkB;AAC/C,MAAI,CAAC,MAAO,QAAO,KAAK,KAAK,KAAK,KAAK;AAEvC,QAAM,QAAQ,SAAS,MAAM,CAAC,CAAC;AAC/B,UAAQ,MAAM,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 .option('--fields <json>', 'Structured extra fields as a JSON object, validated against .kirograph/memory-schemas/<kind>.schema.json when memorySchemaValidation is enabled')\n .action(async (content: string | undefined, opts: { kind: string; topicKey?: string; reviewAfter?: string; fields?: 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 let fields: Record<string, unknown> | undefined;\n if (opts.fields) {\n try {\n fields = JSON.parse(opts.fields);\n } catch {\n console.error(' \u2716 --fields must be valid JSON (e.g. \\'{\"key\":\"value\"}\\')');\n process.exit(1);\n }\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 fields,\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 * 1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wd) {
52
52
  db.applyWikiSchema();
53
53
  const kirographDir = `${cwd}/.kirograph`;
54
54
  const wiki = new KiroGraphWiki(db.getRawDb(), kirographDir, {
55
- autoResolveConflicts: config.wikiAutoResolveConflicts
55
+ autoResolveConflicts: config.wikiAutoResolveConflicts,
56
+ typedPages: config.wikiTypedPages
56
57
  });
57
58
  wiki.initialize();
58
59
  return wiki;
@@ -221,7 +222,7 @@ function register(program) {
221
222
  ${(0, import_ui.section)("Wiki Lint")} ${yellow}${issues.length} issue(s)${import_ui.reset}
222
223
  `);
223
224
  for (const issue of issues) {
224
- const icon = issue.kind === "contradiction" ? "\u26A1" : issue.kind === "orphan" ? "\u25CB" : issue.kind === "broken_link" ? "\u{1F517}" : "\u26A0";
225
+ const icon = issue.kind === "contradiction" ? "\u26A1" : issue.kind === "orphan" ? "\u25CB" : issue.kind === "broken_link" ? "\u{1F517}" : issue.kind === "schema_error" ? "\u2716" : "\u26A0";
225
226
  console.log(` ${icon} ${import_ui.dim}[${issue.kind}]${import_ui.reset} ${import_ui.violet}${issue.slug}${import_ui.reset}`);
226
227
  console.log(` ${issue.detail}`);
227
228
  console.log();