claude-conversation-memory-mcp 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +230 -31
  2. package/dist/mcp-server.d.ts.map +1 -1
  3. package/dist/mcp-server.js +12 -0
  4. package/dist/mcp-server.js.map +1 -1
  5. package/dist/parsers/CodexConversationParser.d.ts +51 -0
  6. package/dist/parsers/CodexConversationParser.d.ts.map +1 -0
  7. package/dist/parsers/CodexConversationParser.js +279 -0
  8. package/dist/parsers/CodexConversationParser.js.map +1 -0
  9. package/dist/parsers/ConversationParser.d.ts +1 -0
  10. package/dist/parsers/ConversationParser.d.ts.map +1 -1
  11. package/dist/parsers/ConversationParser.js.map +1 -1
  12. package/dist/storage/ConversationStorage.d.ts.map +1 -1
  13. package/dist/storage/ConversationStorage.js +3 -3
  14. package/dist/storage/ConversationStorage.js.map +1 -1
  15. package/dist/storage/GlobalIndex.d.ts +125 -0
  16. package/dist/storage/GlobalIndex.d.ts.map +1 -0
  17. package/dist/storage/GlobalIndex.js +243 -0
  18. package/dist/storage/GlobalIndex.js.map +1 -0
  19. package/dist/storage/SQLiteManager.d.ts +4 -0
  20. package/dist/storage/SQLiteManager.d.ts.map +1 -1
  21. package/dist/storage/SQLiteManager.js +36 -2
  22. package/dist/storage/SQLiteManager.js.map +1 -1
  23. package/dist/storage/schema.sql +26 -0
  24. package/dist/tools/ToolDefinitions.d.ts +117 -0
  25. package/dist/tools/ToolDefinitions.d.ts.map +1 -1
  26. package/dist/tools/ToolDefinitions.js +116 -0
  27. package/dist/tools/ToolDefinitions.js.map +1 -1
  28. package/dist/tools/ToolHandlers.d.ts +31 -0
  29. package/dist/tools/ToolHandlers.d.ts.map +1 -1
  30. package/dist/tools/ToolHandlers.js +302 -0
  31. package/dist/tools/ToolHandlers.js.map +1 -1
  32. package/dist/types/ToolTypes.d.ts +83 -0
  33. package/dist/types/ToolTypes.d.ts.map +1 -1
  34. package/package.json +2 -1
  35. package/scripts/changelog-check.sh +62 -0
package/README.md CHANGED
@@ -1,39 +1,113 @@
1
1
  # Claude Conversation Memory
2
2
 
3
- A Model Context Protocol (MCP) server that gives Claude Code long-term memory by indexing your conversation history with semantic search, decision tracking, and mistake prevention.
3
+ A Model Context Protocol (MCP) server that gives AI assistants long-term memory by indexing conversation history from **Claude Code CLI** and **Codex** with semantic search, decision tracking, mistake prevention, and **global cross-project search**.
4
4
 
5
5
  ## 💡 What It Does
6
6
 
7
+ ### Core Memory Features
7
8
  - **Remembers past conversations** - Search your chat history with natural language
8
9
  - **Tracks decisions** - Never forget why you made technical choices
9
10
  - **Prevents mistakes** - Learn from past errors and avoid repeating them
10
11
  - **Links to git commits** - Connect conversations to code changes
11
12
  - **Analyzes file history** - See the complete evolution of files with context
12
- - **Migrates conversation history** - Keep your history when renaming or moving projects
13
13
  - **Context transfer** - Recall past work and apply it to current tasks ("remember X, now do Y based on that")
14
- - **Forget selectively** - Delete conversations by topic/keyword with automatic backups
15
-
16
- ## ⚠️ Important: Claude Code CLI Only
17
-
18
- **This MCP server works ONLY with [Claude Code CLI](https://github.com/anthropics/claude-code).**
19
14
 
20
- It does NOT work with:
21
- - Claude Desktop
22
- - Claude Web
23
- - Other Claude integrations
15
+ ### Global Cross-Project Search ✨ NEW
16
+ - **Search across ALL projects** - Find conversations across your entire work history
17
+ - **Dual-source support** - Index from both Claude Code CLI AND Codex
18
+ - **Unified interface** - Search conversations from any source in one query
19
+ - **Project filtering** - Filter by source type (claude-code, codex, or all)
20
+ - **Hybrid architecture** - Per-project databases + global registry for fast, isolated access
24
21
 
25
- Claude Code CLI is required because it stores conversation history in `~/.claude/projects/` which this MCP indexes.
22
+ ### Project Management
23
+ - **Migrates conversation history** - Keep your history when renaming or moving projects
24
+ - **Forget selectively** - Delete conversations by topic/keyword with automatic backups
25
+ - **Cross-project insights** - Discover decisions and mistakes across all your work
26
+
27
+ ## 🎯 Dual Source Support
28
+
29
+ This MCP server works with **TWO** AI coding assistant platforms:
30
+
31
+ ### ✅ Claude Code CLI
32
+ - **Official support**: Primary platform
33
+ - **Storage location**: `~/.claude/projects/`
34
+ - **Per-project databases**: Each project gets its own isolated database
35
+ - **Website**: https://github.com/anthropics/claude-code
36
+
37
+ ### ✅ Codex
38
+ - **Full integration**: NEW in v1.5.0
39
+ - **Storage location**: `~/.codex/sessions/`
40
+ - **Date-hierarchical**: Sessions organized by `YYYY/MM/DD/`
41
+ - **Dedicated database**: Separate database at `~/.codex/.codex-conversations-memory.db`
42
+
43
+ ### ❌ Not Supported
44
+ - Claude Desktop (different conversation format)
45
+ - Claude Web (no local storage)
46
+ - Other Claude integrations
47
+
48
+ ## 🌐 Global Cross-Project Search
49
+
50
+ The hybrid architecture enables powerful cross-project search capabilities:
51
+
52
+ ### How It Works
53
+
54
+ ```
55
+ ┌─────────────────────────────────────────────────────────────┐
56
+ │ Global Architecture │
57
+ ├─────────────────────────────────────────────────────────────┤
58
+ │ │
59
+ │ ~/.claude/.claude-global-index.db (Central Registry) │
60
+ │ ┌─────────────────────────────────────────────────────┐ │
61
+ │ │ Tracks all indexed projects: │ │
62
+ │ │ • Project paths and source types │ │
63
+ │ │ • Database locations │ │
64
+ │ │ • Aggregate statistics │ │
65
+ │ │ • Last indexed timestamps │ │
66
+ │ └─────────────────────────────────────────────────────┘ │
67
+ │ │ │
68
+ │ ┌─────────────┼─────────────┐ │
69
+ │ ▼ ▼ ▼ │
70
+ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ │
71
+ │ │ Project A │ │ Project B │ │ Codex │ │
72
+ │ │ Database │ │ Database │ │ Database │ │
73
+ │ │ │ │ │ │ │ │
74
+ │ │ • Convos │ │ • Convos │ │ • Sessions │ │
75
+ │ │ • Messages │ │ • Messages │ │ • Messages │ │
76
+ │ │ • Decisions│ │ • Decisions│ │ • Tools │ │
77
+ │ │ • Mistakes │ │ • Mistakes │ │ • Commits │ │
78
+ │ └────────────┘ └────────────┘ └────────────┘ │
79
+ │ │
80
+ └─────────────────────────────────────────────────────────────┘
81
+ ```
82
+
83
+ ### Benefits
84
+
85
+ **Isolation**: Each project has its own database - no cross-contamination
86
+ **Speed**: Direct database access - no central bottleneck
87
+ **Privacy**: Projects stay separate until you explicitly search globally
88
+ **Scalability**: Add unlimited projects without performance degradation
89
+
90
+ ### Global Search Tools
91
+
92
+ Four new MCP tools enable cross-project search:
93
+
94
+ 1. **`index_all_projects`** - Index all Claude Code projects + Codex in one command
95
+ 2. **`search_all_conversations`** - Search messages across all indexed projects
96
+ 3. **`get_all_decisions`** - Find decisions from any project (coming soon)
97
+ 4. **`search_all_mistakes`** - Learn from mistakes across all work (coming soon)
26
98
 
27
99
  ## 📦 Installation
28
100
 
29
101
  ### Prerequisites
30
102
 
31
103
  **Required:**
32
- 1. **Claude Code CLI**: https://github.com/anthropics/claude-code
33
- 2. **Node.js**: Version 18 or higher
34
- 3. **sqlite-vec extension**: Automatically loaded (bundled with the package)
104
+ 1. **Node.js**: Version 18 or higher
105
+ 2. **Claude Code CLI** OR **Codex**: At least one AI assistant platform
106
+ - Claude Code: https://github.com/anthropics/claude-code
107
+ - Codex: Your Codex installation
108
+ 3. **sqlite-vec extension**: Automatically loaded (bundled with package)
35
109
 
36
- **Recommended for better semantic search quality:**
110
+ **Recommended for better semantic search:**
37
111
  4. **Ollama**: For high-quality local embeddings
38
112
  ```bash
39
113
  # macOS/Linux
@@ -177,12 +251,18 @@ claude-conversation-memory-mcp --server
177
251
  # View database status
178
252
  claude-conversation-memory-mcp status
179
253
 
180
- # Index conversations
254
+ # Index conversations (current project)
181
255
  claude-conversation-memory-mcp index --include-mcp
182
256
 
257
+ # Index ALL projects + Codex (NEW)
258
+ claude-conversation-memory-mcp index-all --codex --claude-code
259
+
183
260
  # Search for topics
184
261
  claude-conversation-memory-mcp "search database migration" --limit 3
185
262
 
263
+ # Search across ALL projects (NEW)
264
+ claude-conversation-memory-mcp "search-all authentication" --limit 10
265
+
186
266
  # Find past mistakes
187
267
  claude-conversation-memory-mcp mistakes "async" --type logic_error
188
268
 
@@ -223,8 +303,8 @@ claude-conversation-memory-mcp get provider
223
303
 
224
304
  ### Available Commands
225
305
 
226
- - **📥 Indexing**: `index`, `reindex`
227
- - **🔍 Search**: `search`, `decisions`, `mistakes`, `similar`
306
+ - **📥 Indexing**: `index`, `reindex`, `index-all` (NEW)
307
+ - **🔍 Search**: `search`, `search-all` (NEW), `decisions`, `mistakes`, `similar`
228
308
  - **📋 Files**: `check`, `history`
229
309
  - **🔗 Git**: `commits`
230
310
  - **📝 Other**: `requirements`, `tools`, `docs`
@@ -236,7 +316,7 @@ claude-conversation-memory-mcp get provider
236
316
 
237
317
  ## 🎯 Usage Examples
238
318
 
239
- ### First Time Setup
319
+ ### First Time Setup - Single Project
240
320
 
241
321
  ```
242
322
  You: "Index my conversation history for this project"
@@ -246,12 +326,37 @@ Claude: I'll index all conversations for this project...
246
326
  ✓ Semantic search enabled (embeddings generated)
247
327
  ```
248
328
 
249
- ### Search Past Conversations
329
+ ### First Time Setup - All Projects + Codex ✨ NEW
330
+
331
+ ```
332
+ You: "Index all my projects including Codex conversations"
333
+
334
+ Claude: I'll index all projects from both Claude Code and Codex...
335
+ ✓ Indexed 3 Claude Code projects (47 conversations)
336
+ ✓ Indexed Codex sessions (128 conversations)
337
+ ✓ Global index created at ~/.claude/.claude-global-index.db
338
+ ✓ Total: 175 conversations across 4 projects
339
+ ```
340
+
341
+ ### Search Across All Projects ✨ NEW
342
+
343
+ ```
344
+ You: "Search all my conversations about authentication"
345
+
346
+ Claude: Searching across 4 indexed projects...
347
+ Found 12 results:
348
+ • Project: my-api (claude-code) - 5 conversations
349
+ • Project: mobile-app (claude-code) - 3 conversations
350
+ • Project: Codex (codex) - 4 conversations
351
+ [Returns relevant messages with project context]
352
+ ```
353
+
354
+ ### Search Within Current Project
250
355
 
251
356
  ```
252
357
  You: "What did we discuss about the authentication system?"
253
358
 
254
- Claude: Let me search our conversation history...
359
+ Claude: Let me search our conversation history for this project...
255
360
  [Returns relevant messages with context and timestamps]
256
361
  ```
257
362
 
@@ -282,13 +387,17 @@ Claude: Let me search past mistakes...
282
387
  [Shows previous errors and how they were fixed]
283
388
  ```
284
389
 
285
- ### Find Related Work
390
+ ### Find Related Work Across Projects ✨ NEW
286
391
 
287
392
  ```
288
- You: "Have we worked on similar API endpoints before?"
393
+ You: "Search all projects for similar API endpoint implementations"
289
394
 
290
- Claude: Let me find similar sessions...
291
- [Returns past conversations about similar work]
395
+ Claude: Searching across all indexed projects...
396
+ Found similar work in:
397
+ • Project A: REST API design patterns
398
+ • Project B: GraphQL endpoint structure
399
+ • Codex: API versioning approach
400
+ [Returns relevant sessions from multiple projects]
292
401
  ```
293
402
 
294
403
  ### View File History
@@ -314,9 +423,40 @@ Claude: Let me recall the authentication implementation context...
314
423
  - "Remember the bug we fixed in parser.ts, check if similar issue exists in lexer.ts"
315
424
  - "Recall all decisions about database schema, now design the migration strategy"
316
425
  - "Find mistakes we made with async/await, avoid them in this new async function"
426
+ - "Search all my projects for how I handled error boundaries" ✨ NEW
317
427
 
318
428
  ## 🔧 Advanced Usage
319
429
 
430
+ ### Global Indexing Options ✨ NEW
431
+
432
+ #### Index All Projects
433
+
434
+ ```
435
+ You: "Index all my projects from Claude Code and Codex"
436
+
437
+ # With options:
438
+ You: "Index all projects, include Codex at /custom/path/.codex, exclude MCP conversations"
439
+ ```
440
+
441
+ Options:
442
+ - `include_codex` (default: true) - Index Codex sessions
443
+ - `include_claude_code` (default: true) - Index Claude Code projects
444
+ - `codex_path` - Custom Codex location (default: `~/.codex`)
445
+ - `claude_projects_path` - Custom Claude Code projects location (default: `~/.claude/projects`)
446
+
447
+ #### Filter Global Search by Source
448
+
449
+ ```
450
+ You: "Search only Claude Code projects for authentication"
451
+ # source_type: "claude-code"
452
+
453
+ You: "Search only Codex sessions for database design"
454
+ # source_type: "codex"
455
+
456
+ You: "Search all sources for error handling"
457
+ # source_type: "all" (default)
458
+ ```
459
+
320
460
  ### Index Specific Session
321
461
 
322
462
  ```
@@ -403,14 +543,26 @@ After indexing, you'll see:
403
543
  💾 Database: /path/to/.claude-conversations-memory.db
404
544
  ```
405
545
 
546
+ For global indexing:
547
+
548
+ ```
549
+ 🌐 Global index: ~/.claude/.claude-global-index.db
550
+ 📁 Indexed 4 projects:
551
+ • 2 Claude Code projects
552
+ • 1 Codex project
553
+ 💾 Total: 175 conversations, 8,432 messages
554
+ ```
555
+
406
556
  This shows:
407
557
  - **Indexed folders**: Which conversation folders were used (including legacy if it exists)
408
- - **Database location**: Where your indexed data is stored
558
+ - **Database locations**: Where your indexed data is stored (per-project + global)
559
+ - **Statistics**: Total counts across all sources
409
560
 
410
561
  ### Search with Date Filters
411
562
 
412
563
  ```
413
564
  You: "What were we working on last week?"
565
+ You: "Search all projects for discussions from January 2025"
414
566
  ```
415
567
 
416
568
  ### Generate Documentation
@@ -484,7 +636,7 @@ This shows what would be migrated without actually copying files.
484
636
 
485
637
  ### Merge Conversations from Different Projects
486
638
 
487
- **NEW in v0.4.0**: Combine conversation history from different projects into one folder using merge mode.
639
+ Combine conversation history from different projects into one folder using merge mode.
488
640
 
489
641
  **Use case**: You want to merge conversations from `/project-a/drafts/2025-01-05` into your current project `/project-b`.
490
642
 
@@ -593,12 +745,53 @@ Claude will use `forget_by_topic` with `confirm=true`:
593
745
  - "bug in parser" - Specific issues
594
746
  - "refactoring", "cleanup" - Development phases
595
747
 
748
+ ## 🏗️ Architecture
749
+
750
+ ### Hybrid Database Design
751
+
752
+ The MCP uses a **hybrid architecture** combining per-project isolation with global search capability:
753
+
754
+ ```
755
+ Per-Project Databases (Isolation & Speed)
756
+ ├── ~/.claude/projects/{project}/.claude-conversations-memory.db
757
+ ├── ~/.claude/projects/{another-project}/.claude-conversations-memory.db
758
+ └── ~/.codex/.codex-conversations-memory.db
759
+
760
+ Global Registry (Cross-Project Search)
761
+ └── ~/.claude/.claude-global-index.db
762
+ ├── Tracks all indexed projects
763
+ ├── Stores project metadata
764
+ └── Enables global search coordination
765
+ ```
766
+
767
+ **Benefits:**
768
+ - **Privacy**: Projects remain isolated unless you explicitly search globally
769
+ - **Performance**: Direct database access per project - no central bottleneck
770
+ - **Scalability**: Add unlimited projects without performance degradation
771
+ - **Flexibility**: Search single project OR all projects as needed
772
+
773
+ ### Database Schema
774
+
775
+ Each project database contains:
776
+ - **conversations**: Session metadata with source_type ('claude-code' or 'codex')
777
+ - **messages**: Chat messages with semantic embeddings
778
+ - **decisions**: Extracted architectural decisions
779
+ - **mistakes**: Tracked errors and corrections
780
+ - **git_commits**: Linked git history
781
+ - **file_edits**: File modification tracking
782
+ - **thinking_blocks**: Claude's reasoning (optional)
783
+
784
+ The global index contains:
785
+ - **project_metadata**: Registry of all indexed projects
786
+ - **source_type**: Distinguishes claude-code vs codex
787
+ - **aggregate stats**: Total conversations, messages, decisions, mistakes
788
+
596
789
  ## 📚 Learn More
597
790
 
598
- - **[Tool Examples](docs/TOOL-EXAMPLES.md)** - 50+ natural language examples for each tool
791
+ - **[Tool Examples](docs/TOOL-EXAMPLES.md)** - 50+ natural language examples for each tool (including new global search tools)
599
792
  - **[Quick Reference](docs/QUICK-REFERENCE.md)** - Common phrases cheat sheet
600
793
  - **[Embeddings FAQ](docs/EMBEDDINGS-FAQ.md)** - How semantic search works
601
-
794
+ - **[Functional Matrix](docs/FUNCTIONAL-MATRIX.md)** - Complete feature coverage
602
795
 
603
796
  ## 🐛 Troubleshooting
604
797
 
@@ -606,6 +799,8 @@ Claude will use `forget_by_topic` with `confirm=true`:
606
799
 
607
800
  Make sure you're running this in a directory where you've had Claude Code CLI conversations. Check `~/.claude/projects/` to verify conversation files exist.
608
801
 
802
+ For Codex: Check `~/.codex/sessions/` for session files.
803
+
609
804
  ### "Embeddings failed"
610
805
 
611
806
  The MCP falls back to full-text search if embeddings fail. Everything still works, just without semantic search.
@@ -614,6 +809,10 @@ The MCP falls back to full-text search if embeddings fail. Everything still work
614
809
 
615
810
  Restart Claude Code CLI to reload the MCP server.
616
811
 
812
+ ### "Global index not found"
813
+
814
+ Run `index_all_projects` first to create the global registry before using cross-project search.
815
+
617
816
  ## 📄 License
618
817
 
619
818
  MIT License - See [LICENSE](LICENSE) file for details.
@@ -624,4 +823,4 @@ Inspired by [code-graph-rag-mcp](https://github.com/er77/code-graph-rag-mcp).
624
823
 
625
824
  ---
626
825
 
627
- **Made with ❤️ for the Claude Code CLI community**
826
+ **Made with ❤️ for the Claude Code CLI and Codex communities**
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;GAEG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,QAAQ,CAAe;;IAqB/B;;OAEG;IACH,OAAO,CAAC,aAAa;IA2GrB;;OAEG;IACG,KAAK;CAUZ"}
1
+ {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;GAEG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,QAAQ,CAAe;;IAqB/B;;OAEG;IACH,OAAO,CAAC,aAAa;IA2HrB;;OAEG;IACG,KAAK;CAUZ"}
@@ -91,6 +91,18 @@ export class ConversationMemoryServer {
91
91
  case "forget_by_topic":
92
92
  result = await this.handlers.forgetByTopic(args);
93
93
  break;
94
+ case "index_all_projects":
95
+ result = await this.handlers.indexAllProjects(args);
96
+ break;
97
+ case "search_all_conversations":
98
+ result = await this.handlers.searchAllConversations(args);
99
+ break;
100
+ case "get_all_decisions":
101
+ result = await this.handlers.getAllDecisions(args);
102
+ break;
103
+ case "search_all_mistakes":
104
+ result = await this.handlers.searchAllMistakes(args);
105
+ break;
94
106
  default:
95
107
  throw new Error(`Unknown tool: ${name}`);
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AC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAE7C,OAAO,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACrE,OAAO,CAAC,KAAK,CAAC,mBAAmB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;QAEzE,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAErC,OAAO,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC3D,CAAC;CACF"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Codex Conversation Parser for MCP integration.
3
+ *
4
+ * This parser reads conversation history from Codex's storage location
5
+ * (~/.codex/sessions) and converts it to the same format as ConversationParser.
6
+ *
7
+ * Codex stores conversations in a date-hierarchical structure:
8
+ * ~/.codex/sessions/YYYY/MM/DD/rollout-{timestamp}-{uuid}.jsonl
9
+ *
10
+ * Each line in a Codex session file has the structure:
11
+ * {
12
+ * timestamp: string,
13
+ * type: "session_meta" | "response_item" | "event_msg" | "turn_context",
14
+ * payload: { ... }
15
+ * }
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * const parser = new CodexConversationParser();
20
+ * const result = parser.parseSessions('/Users/username/.codex');
21
+ * console.log(`Parsed ${result.conversations.length} Codex sessions`);
22
+ * ```
23
+ */
24
+ import type { ParseResult } from "./ConversationParser.js";
25
+ /**
26
+ * Parser for Codex conversation history.
27
+ *
28
+ * Converts Codex session files into the same format as ConversationParser
29
+ * so they can be stored in the same database and searched together.
30
+ */
31
+ export declare class CodexConversationParser {
32
+ /**
33
+ * Parse all Codex sessions.
34
+ *
35
+ * Recursively scans the sessions directory for JSONL files and parses them.
36
+ *
37
+ * @param codexPath - Path to Codex home directory (default: ~/.codex)
38
+ * @param sessionId - Optional specific session ID to parse
39
+ * @returns ParseResult with all extracted entities
40
+ */
41
+ parseSession(codexPath: string, sessionId?: string): ParseResult;
42
+ /**
43
+ * Recursively find all .jsonl session files.
44
+ */
45
+ private findSessionFiles;
46
+ /**
47
+ * Parse a single Codex session file.
48
+ */
49
+ private parseSessionFile;
50
+ }
51
+ //# sourceMappingURL=CodexConversationParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodexConversationParser.d.ts","sourceRoot":"","sources":["../../src/parsers/CodexConversationParser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,KAAK,EAOV,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAwCjC;;;;;GAKG;AACH,qBAAa,uBAAuB;IAClC;;;;;;;;OAQG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW;IAoEhE;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAuBxB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CA6KzB"}