cccmemory 1.8.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 (216) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +349 -0
  3. package/dist/ConversationMemory.d.ts +231 -0
  4. package/dist/ConversationMemory.d.ts.map +1 -0
  5. package/dist/ConversationMemory.js +357 -0
  6. package/dist/ConversationMemory.js.map +1 -0
  7. package/dist/cache/QueryCache.d.ts +215 -0
  8. package/dist/cache/QueryCache.d.ts.map +1 -0
  9. package/dist/cache/QueryCache.js +294 -0
  10. package/dist/cache/QueryCache.js.map +1 -0
  11. package/dist/cli/commands.d.ts +9 -0
  12. package/dist/cli/commands.d.ts.map +1 -0
  13. package/dist/cli/commands.js +954 -0
  14. package/dist/cli/commands.js.map +1 -0
  15. package/dist/cli/help.d.ts +16 -0
  16. package/dist/cli/help.d.ts.map +1 -0
  17. package/dist/cli/help.js +361 -0
  18. package/dist/cli/help.js.map +1 -0
  19. package/dist/cli/index.d.ts +30 -0
  20. package/dist/cli/index.d.ts.map +1 -0
  21. package/dist/cli/index.js +111 -0
  22. package/dist/cli/index.js.map +1 -0
  23. package/dist/context/ContextInjector.d.ts +38 -0
  24. package/dist/context/ContextInjector.d.ts.map +1 -0
  25. package/dist/context/ContextInjector.js +235 -0
  26. package/dist/context/ContextInjector.js.map +1 -0
  27. package/dist/documentation/CodeAnalyzer.d.ts +29 -0
  28. package/dist/documentation/CodeAnalyzer.d.ts.map +1 -0
  29. package/dist/documentation/CodeAnalyzer.js +122 -0
  30. package/dist/documentation/CodeAnalyzer.js.map +1 -0
  31. package/dist/documentation/ConversationAnalyzer.d.ts +19 -0
  32. package/dist/documentation/ConversationAnalyzer.d.ts.map +1 -0
  33. package/dist/documentation/ConversationAnalyzer.js +157 -0
  34. package/dist/documentation/ConversationAnalyzer.js.map +1 -0
  35. package/dist/documentation/CrossReferencer.d.ts +67 -0
  36. package/dist/documentation/CrossReferencer.d.ts.map +1 -0
  37. package/dist/documentation/CrossReferencer.js +247 -0
  38. package/dist/documentation/CrossReferencer.js.map +1 -0
  39. package/dist/documentation/DocumentationGenerator.d.ts +22 -0
  40. package/dist/documentation/DocumentationGenerator.d.ts.map +1 -0
  41. package/dist/documentation/DocumentationGenerator.js +57 -0
  42. package/dist/documentation/DocumentationGenerator.js.map +1 -0
  43. package/dist/documentation/MarkdownFormatter.d.ts +26 -0
  44. package/dist/documentation/MarkdownFormatter.d.ts.map +1 -0
  45. package/dist/documentation/MarkdownFormatter.js +301 -0
  46. package/dist/documentation/MarkdownFormatter.js.map +1 -0
  47. package/dist/documentation/types.d.ts +176 -0
  48. package/dist/documentation/types.d.ts.map +1 -0
  49. package/dist/documentation/types.js +5 -0
  50. package/dist/documentation/types.js.map +1 -0
  51. package/dist/embeddings/ConfigManager.d.ts +46 -0
  52. package/dist/embeddings/ConfigManager.d.ts.map +1 -0
  53. package/dist/embeddings/ConfigManager.js +177 -0
  54. package/dist/embeddings/ConfigManager.js.map +1 -0
  55. package/dist/embeddings/EmbeddingConfig.d.ts +39 -0
  56. package/dist/embeddings/EmbeddingConfig.d.ts.map +1 -0
  57. package/dist/embeddings/EmbeddingConfig.js +132 -0
  58. package/dist/embeddings/EmbeddingConfig.js.map +1 -0
  59. package/dist/embeddings/EmbeddingGenerator.d.ts +51 -0
  60. package/dist/embeddings/EmbeddingGenerator.d.ts.map +1 -0
  61. package/dist/embeddings/EmbeddingGenerator.js +157 -0
  62. package/dist/embeddings/EmbeddingGenerator.js.map +1 -0
  63. package/dist/embeddings/EmbeddingProvider.d.ts +34 -0
  64. package/dist/embeddings/EmbeddingProvider.d.ts.map +1 -0
  65. package/dist/embeddings/EmbeddingProvider.js +6 -0
  66. package/dist/embeddings/EmbeddingProvider.js.map +1 -0
  67. package/dist/embeddings/ModelRegistry.d.ts +48 -0
  68. package/dist/embeddings/ModelRegistry.d.ts.map +1 -0
  69. package/dist/embeddings/ModelRegistry.js +170 -0
  70. package/dist/embeddings/ModelRegistry.js.map +1 -0
  71. package/dist/embeddings/VectorStore.d.ts +114 -0
  72. package/dist/embeddings/VectorStore.d.ts.map +1 -0
  73. package/dist/embeddings/VectorStore.js +393 -0
  74. package/dist/embeddings/VectorStore.js.map +1 -0
  75. package/dist/embeddings/providers/OllamaEmbeddings.d.ts +38 -0
  76. package/dist/embeddings/providers/OllamaEmbeddings.d.ts.map +1 -0
  77. package/dist/embeddings/providers/OllamaEmbeddings.js +125 -0
  78. package/dist/embeddings/providers/OllamaEmbeddings.js.map +1 -0
  79. package/dist/embeddings/providers/OpenAIEmbeddings.d.ts +40 -0
  80. package/dist/embeddings/providers/OpenAIEmbeddings.d.ts.map +1 -0
  81. package/dist/embeddings/providers/OpenAIEmbeddings.js +129 -0
  82. package/dist/embeddings/providers/OpenAIEmbeddings.js.map +1 -0
  83. package/dist/embeddings/providers/TransformersEmbeddings.d.ts +38 -0
  84. package/dist/embeddings/providers/TransformersEmbeddings.d.ts.map +1 -0
  85. package/dist/embeddings/providers/TransformersEmbeddings.js +115 -0
  86. package/dist/embeddings/providers/TransformersEmbeddings.js.map +1 -0
  87. package/dist/handoff/SessionHandoffStore.d.ts +80 -0
  88. package/dist/handoff/SessionHandoffStore.d.ts.map +1 -0
  89. package/dist/handoff/SessionHandoffStore.js +314 -0
  90. package/dist/handoff/SessionHandoffStore.js.map +1 -0
  91. package/dist/index.d.ts +7 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/index.js +115 -0
  94. package/dist/index.js.map +1 -0
  95. package/dist/mcp-server.d.ts +27 -0
  96. package/dist/mcp-server.d.ts.map +1 -0
  97. package/dist/mcp-server.js +157 -0
  98. package/dist/mcp-server.js.map +1 -0
  99. package/dist/memory/WorkingMemoryStore.d.ts +83 -0
  100. package/dist/memory/WorkingMemoryStore.d.ts.map +1 -0
  101. package/dist/memory/WorkingMemoryStore.js +318 -0
  102. package/dist/memory/WorkingMemoryStore.js.map +1 -0
  103. package/dist/memory/types.d.ts +192 -0
  104. package/dist/memory/types.d.ts.map +1 -0
  105. package/dist/memory/types.js +8 -0
  106. package/dist/memory/types.js.map +1 -0
  107. package/dist/parsers/CodexConversationParser.d.ts +51 -0
  108. package/dist/parsers/CodexConversationParser.d.ts.map +1 -0
  109. package/dist/parsers/CodexConversationParser.js +301 -0
  110. package/dist/parsers/CodexConversationParser.js.map +1 -0
  111. package/dist/parsers/ConversationParser.d.ts +286 -0
  112. package/dist/parsers/ConversationParser.d.ts.map +1 -0
  113. package/dist/parsers/ConversationParser.js +795 -0
  114. package/dist/parsers/ConversationParser.js.map +1 -0
  115. package/dist/parsers/DecisionExtractor.d.ts +144 -0
  116. package/dist/parsers/DecisionExtractor.d.ts.map +1 -0
  117. package/dist/parsers/DecisionExtractor.js +434 -0
  118. package/dist/parsers/DecisionExtractor.js.map +1 -0
  119. package/dist/parsers/GitIntegrator.d.ts +156 -0
  120. package/dist/parsers/GitIntegrator.d.ts.map +1 -0
  121. package/dist/parsers/GitIntegrator.js +348 -0
  122. package/dist/parsers/GitIntegrator.js.map +1 -0
  123. package/dist/parsers/MistakeExtractor.d.ts +151 -0
  124. package/dist/parsers/MistakeExtractor.d.ts.map +1 -0
  125. package/dist/parsers/MistakeExtractor.js +460 -0
  126. package/dist/parsers/MistakeExtractor.js.map +1 -0
  127. package/dist/parsers/RequirementsExtractor.d.ts +166 -0
  128. package/dist/parsers/RequirementsExtractor.d.ts.map +1 -0
  129. package/dist/parsers/RequirementsExtractor.js +338 -0
  130. package/dist/parsers/RequirementsExtractor.js.map +1 -0
  131. package/dist/realtime/ConversationWatcher.d.ts +87 -0
  132. package/dist/realtime/ConversationWatcher.d.ts.map +1 -0
  133. package/dist/realtime/ConversationWatcher.js +204 -0
  134. package/dist/realtime/ConversationWatcher.js.map +1 -0
  135. package/dist/realtime/IncrementalParser.d.ts +83 -0
  136. package/dist/realtime/IncrementalParser.d.ts.map +1 -0
  137. package/dist/realtime/IncrementalParser.js +232 -0
  138. package/dist/realtime/IncrementalParser.js.map +1 -0
  139. package/dist/realtime/LiveExtractor.d.ts +72 -0
  140. package/dist/realtime/LiveExtractor.d.ts.map +1 -0
  141. package/dist/realtime/LiveExtractor.js +288 -0
  142. package/dist/realtime/LiveExtractor.js.map +1 -0
  143. package/dist/search/SemanticSearch.d.ts +121 -0
  144. package/dist/search/SemanticSearch.d.ts.map +1 -0
  145. package/dist/search/SemanticSearch.js +823 -0
  146. package/dist/search/SemanticSearch.js.map +1 -0
  147. package/dist/storage/BackupManager.d.ts +58 -0
  148. package/dist/storage/BackupManager.d.ts.map +1 -0
  149. package/dist/storage/BackupManager.js +223 -0
  150. package/dist/storage/BackupManager.js.map +1 -0
  151. package/dist/storage/ConversationStorage.d.ts +341 -0
  152. package/dist/storage/ConversationStorage.d.ts.map +1 -0
  153. package/dist/storage/ConversationStorage.js +792 -0
  154. package/dist/storage/ConversationStorage.js.map +1 -0
  155. package/dist/storage/DeletionService.d.ts +70 -0
  156. package/dist/storage/DeletionService.d.ts.map +1 -0
  157. package/dist/storage/DeletionService.js +253 -0
  158. package/dist/storage/DeletionService.js.map +1 -0
  159. package/dist/storage/GlobalIndex.d.ts +133 -0
  160. package/dist/storage/GlobalIndex.d.ts.map +1 -0
  161. package/dist/storage/GlobalIndex.js +310 -0
  162. package/dist/storage/GlobalIndex.js.map +1 -0
  163. package/dist/storage/SQLiteManager.d.ts +114 -0
  164. package/dist/storage/SQLiteManager.d.ts.map +1 -0
  165. package/dist/storage/SQLiteManager.js +636 -0
  166. package/dist/storage/SQLiteManager.js.map +1 -0
  167. package/dist/storage/migrations.d.ts +54 -0
  168. package/dist/storage/migrations.d.ts.map +1 -0
  169. package/dist/storage/migrations.js +285 -0
  170. package/dist/storage/migrations.js.map +1 -0
  171. package/dist/storage/schema.sql +436 -0
  172. package/dist/tools/ToolDefinitions.d.ts +946 -0
  173. package/dist/tools/ToolDefinitions.d.ts.map +1 -0
  174. package/dist/tools/ToolDefinitions.js +937 -0
  175. package/dist/tools/ToolDefinitions.js.map +1 -0
  176. package/dist/tools/ToolHandlers.d.ts +791 -0
  177. package/dist/tools/ToolHandlers.d.ts.map +1 -0
  178. package/dist/tools/ToolHandlers.js +3262 -0
  179. package/dist/tools/ToolHandlers.js.map +1 -0
  180. package/dist/types/ToolTypes.d.ts +824 -0
  181. package/dist/types/ToolTypes.d.ts.map +1 -0
  182. package/dist/types/ToolTypes.js +6 -0
  183. package/dist/types/ToolTypes.js.map +1 -0
  184. package/dist/utils/Logger.d.ts +70 -0
  185. package/dist/utils/Logger.d.ts.map +1 -0
  186. package/dist/utils/Logger.js +131 -0
  187. package/dist/utils/Logger.js.map +1 -0
  188. package/dist/utils/McpConfig.d.ts +54 -0
  189. package/dist/utils/McpConfig.d.ts.map +1 -0
  190. package/dist/utils/McpConfig.js +136 -0
  191. package/dist/utils/McpConfig.js.map +1 -0
  192. package/dist/utils/ProjectMigration.d.ts +82 -0
  193. package/dist/utils/ProjectMigration.d.ts.map +1 -0
  194. package/dist/utils/ProjectMigration.js +416 -0
  195. package/dist/utils/ProjectMigration.js.map +1 -0
  196. package/dist/utils/constants.d.ts +75 -0
  197. package/dist/utils/constants.d.ts.map +1 -0
  198. package/dist/utils/constants.js +105 -0
  199. package/dist/utils/constants.js.map +1 -0
  200. package/dist/utils/safeJson.d.ts +37 -0
  201. package/dist/utils/safeJson.d.ts.map +1 -0
  202. package/dist/utils/safeJson.js +48 -0
  203. package/dist/utils/safeJson.js.map +1 -0
  204. package/dist/utils/sanitization.d.ts +45 -0
  205. package/dist/utils/sanitization.d.ts.map +1 -0
  206. package/dist/utils/sanitization.js +153 -0
  207. package/dist/utils/sanitization.js.map +1 -0
  208. package/dist/utils/worktree.d.ts +15 -0
  209. package/dist/utils/worktree.d.ts.map +1 -0
  210. package/dist/utils/worktree.js +86 -0
  211. package/dist/utils/worktree.js.map +1 -0
  212. package/package.json +98 -0
  213. package/scripts/changelog-check.sh +62 -0
  214. package/scripts/check-node.js +17 -0
  215. package/scripts/dev-config.js +56 -0
  216. package/scripts/postinstall.js +117 -0
@@ -0,0 +1,937 @@
1
+ /**
2
+ * MCP Tool Definitions
3
+ */
4
+ export const TOOLS = {
5
+ index_conversations: {
6
+ name: "index_conversations",
7
+ description: "Index conversation history for the current project. This parses conversation files, extracts decisions, mistakes, and links to git commits. Can index all sessions or a specific session.",
8
+ inputSchema: {
9
+ type: "object",
10
+ properties: {
11
+ project_path: {
12
+ type: "string",
13
+ description: "Path to the project (defaults to current working directory)",
14
+ },
15
+ session_id: {
16
+ type: "string",
17
+ description: "Optional: specific session ID to index (e.g., 'a1172af3-ca62-41be-9b90-701cef39daae'). If not provided, indexes all sessions in the project.",
18
+ },
19
+ include_thinking: {
20
+ type: "boolean",
21
+ description: "Include thinking blocks in indexing (default: false, can be large)",
22
+ default: false,
23
+ },
24
+ enable_git: {
25
+ type: "boolean",
26
+ description: "Enable git integration to link commits to conversations (default: true)",
27
+ default: true,
28
+ },
29
+ exclude_mcp_conversations: {
30
+ type: ["boolean", "string"],
31
+ description: "Exclude MCP tool conversations from indexing. Options: 'self-only' (exclude only cccmemory MCP to prevent self-referential loops, DEFAULT), false (index all MCP conversations), 'all-mcp' or true (exclude all MCP tool conversations)",
32
+ default: "self-only",
33
+ },
34
+ exclude_mcp_servers: {
35
+ type: "array",
36
+ description: "List of specific MCP server names to exclude (e.g., ['cccmemory', 'code-graph-rag']). More granular than exclude_mcp_conversations.",
37
+ items: { type: "string" },
38
+ },
39
+ },
40
+ },
41
+ },
42
+ search_conversations: {
43
+ name: "search_conversations",
44
+ description: "Search conversation history using natural language queries. Returns relevant messages with context. Supports pagination and scope filtering (current session, all sessions in project, or global across projects).",
45
+ inputSchema: {
46
+ type: "object",
47
+ properties: {
48
+ query: {
49
+ type: "string",
50
+ description: "Natural language search query",
51
+ },
52
+ limit: {
53
+ type: "number",
54
+ description: "Maximum number of results (default: 10)",
55
+ default: 10,
56
+ },
57
+ offset: {
58
+ type: "number",
59
+ description: "Skip N results for pagination (default: 0). Use with limit to fetch subsequent pages.",
60
+ default: 0,
61
+ },
62
+ date_range: {
63
+ type: "array",
64
+ description: "Optional date range filter [start_timestamp, end_timestamp]",
65
+ items: { type: "number" },
66
+ },
67
+ scope: {
68
+ type: "string",
69
+ enum: ["current", "all", "global"],
70
+ description: "Search scope: 'current' (current session only), 'all' (all sessions in current project), 'global' (all indexed projects including Codex). Default: 'all'",
71
+ default: "all",
72
+ },
73
+ conversation_id: {
74
+ type: "string",
75
+ description: "Required when scope='current': the conversation/session ID to search within",
76
+ },
77
+ },
78
+ required: ["query"],
79
+ },
80
+ },
81
+ get_decisions: {
82
+ name: "get_decisions",
83
+ description: "Find decisions made about a specific topic, file, or component. Shows rationale, alternatives considered, and rejected approaches. Supports pagination and scope filtering.",
84
+ inputSchema: {
85
+ type: "object",
86
+ properties: {
87
+ query: {
88
+ type: "string",
89
+ description: "Topic or keyword to search for (e.g., 'authentication', 'database')",
90
+ },
91
+ file_path: {
92
+ type: "string",
93
+ description: "Optional: filter decisions related to a specific file",
94
+ },
95
+ limit: {
96
+ type: "number",
97
+ description: "Maximum number of decisions to return (default: 10)",
98
+ default: 10,
99
+ },
100
+ offset: {
101
+ type: "number",
102
+ description: "Skip N results for pagination (default: 0). Use with limit to fetch subsequent pages.",
103
+ default: 0,
104
+ },
105
+ scope: {
106
+ type: "string",
107
+ enum: ["current", "all", "global"],
108
+ description: "Search scope: 'current' (current session only), 'all' (all sessions in current project), 'global' (all indexed projects including Codex). Default: 'all'",
109
+ default: "all",
110
+ },
111
+ conversation_id: {
112
+ type: "string",
113
+ description: "Required when scope='current': the conversation/session ID to search within",
114
+ },
115
+ },
116
+ required: ["query"],
117
+ },
118
+ },
119
+ check_before_modify: {
120
+ name: "check_before_modify",
121
+ description: "Check important context before modifying a file. Shows recent changes, related decisions, commits, and past mistakes to avoid.",
122
+ inputSchema: {
123
+ type: "object",
124
+ properties: {
125
+ file_path: {
126
+ type: "string",
127
+ description: "Path to the file you want to modify",
128
+ },
129
+ },
130
+ required: ["file_path"],
131
+ },
132
+ },
133
+ get_file_evolution: {
134
+ name: "get_file_evolution",
135
+ description: "Show complete timeline of changes to a file across conversations and commits. Supports pagination for files with long history.",
136
+ inputSchema: {
137
+ type: "object",
138
+ properties: {
139
+ file_path: {
140
+ type: "string",
141
+ description: "Path to the file",
142
+ },
143
+ include_decisions: {
144
+ type: "boolean",
145
+ description: "Include related decisions (default: true)",
146
+ default: true,
147
+ },
148
+ include_commits: {
149
+ type: "boolean",
150
+ description: "Include git commits (default: true)",
151
+ default: true,
152
+ },
153
+ limit: {
154
+ type: "number",
155
+ description: "Maximum number of timeline events to return (default: 50)",
156
+ default: 50,
157
+ },
158
+ offset: {
159
+ type: "number",
160
+ description: "Skip N events for pagination (default: 0). Use with limit to fetch subsequent pages.",
161
+ default: 0,
162
+ },
163
+ },
164
+ required: ["file_path"],
165
+ },
166
+ },
167
+ link_commits_to_conversations: {
168
+ name: "link_commits_to_conversations",
169
+ description: "Link git commits to the conversation sessions where they were made or discussed. Creates associations between code changes and their conversation context, enabling you to see WHY changes were made. Supports pagination and scope filtering.",
170
+ inputSchema: {
171
+ type: "object",
172
+ properties: {
173
+ query: {
174
+ type: "string",
175
+ description: "Search query for commits",
176
+ },
177
+ conversation_id: {
178
+ type: "string",
179
+ description: "Optional: filter by specific conversation ID",
180
+ },
181
+ limit: {
182
+ type: "number",
183
+ description: "Maximum number of commits (default: 20)",
184
+ default: 20,
185
+ },
186
+ offset: {
187
+ type: "number",
188
+ description: "Skip N results for pagination (default: 0). Use with limit to fetch subsequent pages.",
189
+ default: 0,
190
+ },
191
+ scope: {
192
+ type: "string",
193
+ enum: ["current", "all", "global"],
194
+ description: "Search scope: 'current' (current session only), 'all' (all sessions in current project), 'global' (all indexed projects including Codex). Default: 'all'",
195
+ default: "all",
196
+ },
197
+ },
198
+ },
199
+ },
200
+ search_mistakes: {
201
+ name: "search_mistakes",
202
+ description: "Find past mistakes to avoid repeating them. Shows what went wrong and how it was corrected. Supports pagination and scope filtering.",
203
+ inputSchema: {
204
+ type: "object",
205
+ properties: {
206
+ query: {
207
+ type: "string",
208
+ description: "Search query for mistakes",
209
+ },
210
+ mistake_type: {
211
+ type: "string",
212
+ description: "Optional: filter by type (logic_error, wrong_approach, misunderstanding, tool_error, syntax_error)",
213
+ enum: ["logic_error", "wrong_approach", "misunderstanding", "tool_error", "syntax_error"],
214
+ },
215
+ limit: {
216
+ type: "number",
217
+ description: "Maximum number of results (default: 10)",
218
+ default: 10,
219
+ },
220
+ offset: {
221
+ type: "number",
222
+ description: "Skip N results for pagination (default: 0). Use with limit to fetch subsequent pages.",
223
+ default: 0,
224
+ },
225
+ scope: {
226
+ type: "string",
227
+ enum: ["current", "all", "global"],
228
+ description: "Search scope: 'current' (current session only), 'all' (all sessions in current project), 'global' (all indexed projects including Codex). Default: 'all'",
229
+ default: "all",
230
+ },
231
+ conversation_id: {
232
+ type: "string",
233
+ description: "Required when scope='current': the conversation/session ID to search within",
234
+ },
235
+ },
236
+ required: ["query"],
237
+ },
238
+ },
239
+ get_requirements: {
240
+ name: "get_requirements",
241
+ description: "Look up requirements and constraints for a component or feature.",
242
+ inputSchema: {
243
+ type: "object",
244
+ properties: {
245
+ component: {
246
+ type: "string",
247
+ description: "Component or feature name",
248
+ },
249
+ type: {
250
+ type: "string",
251
+ description: "Optional: filter by requirement type",
252
+ enum: ["dependency", "performance", "compatibility", "business"],
253
+ },
254
+ },
255
+ required: ["component"],
256
+ },
257
+ },
258
+ get_tool_history: {
259
+ name: "get_tool_history",
260
+ description: "Query history of tool uses (bash commands, file edits, reads, etc.) with pagination, filtering, and content control. Returns metadata about tool uses with optional content truncation to stay within token limits. Use include_content=false for quick overview of many tools, or enable with max_content_length to control response size.",
261
+ inputSchema: {
262
+ type: "object",
263
+ properties: {
264
+ tool_name: {
265
+ type: "string",
266
+ description: "Optional: filter by tool name (Bash, Edit, Write, Read)",
267
+ },
268
+ file_path: {
269
+ type: "string",
270
+ description: "Optional: filter by file path (searches in tool parameters)",
271
+ },
272
+ limit: {
273
+ type: "number",
274
+ description: "Maximum number of results per page (default: 20)",
275
+ default: 20,
276
+ },
277
+ offset: {
278
+ type: "number",
279
+ description: "Skip N results for pagination (default: 0). Use with limit to fetch subsequent pages.",
280
+ default: 0,
281
+ },
282
+ include_content: {
283
+ type: "boolean",
284
+ description: "Include tool result content, stdout, stderr (default: false for security). Set true to include content (tool names, timestamps, success/failure status).",
285
+ default: false,
286
+ },
287
+ max_content_length: {
288
+ type: "number",
289
+ description: "Maximum characters per content field before truncation (default: 500). Truncated fields are marked with content_truncated flag.",
290
+ default: 500,
291
+ },
292
+ date_range: {
293
+ type: "array",
294
+ description: "Optional: filter by timestamp range [start_timestamp, end_timestamp]. Use Date.now() for current time.",
295
+ items: {
296
+ type: "number",
297
+ },
298
+ minItems: 2,
299
+ maxItems: 2,
300
+ },
301
+ conversation_id: {
302
+ type: "string",
303
+ description: "Optional: filter by specific conversation session ID",
304
+ },
305
+ errors_only: {
306
+ type: "boolean",
307
+ description: "Optional: show only tool uses that resulted in errors (default: false)",
308
+ default: false,
309
+ },
310
+ },
311
+ },
312
+ },
313
+ find_similar_sessions: {
314
+ name: "find_similar_sessions",
315
+ description: "Find conversations that dealt with similar topics or problems. Supports pagination and scope filtering.",
316
+ inputSchema: {
317
+ type: "object",
318
+ properties: {
319
+ query: {
320
+ type: "string",
321
+ description: "Description of the topic or problem",
322
+ },
323
+ limit: {
324
+ type: "number",
325
+ description: "Maximum number of sessions (default: 5)",
326
+ default: 5,
327
+ },
328
+ offset: {
329
+ type: "number",
330
+ description: "Skip N results for pagination (default: 0). Use with limit to fetch subsequent pages.",
331
+ default: 0,
332
+ },
333
+ scope: {
334
+ type: "string",
335
+ enum: ["current", "all", "global"],
336
+ description: "Search scope: 'current' (current session only), 'all' (all sessions in current project), 'global' (all indexed projects including Codex). Default: 'all'",
337
+ default: "all",
338
+ },
339
+ conversation_id: {
340
+ type: "string",
341
+ description: "Required when scope='current': the conversation/session ID to search within",
342
+ },
343
+ },
344
+ required: ["query"],
345
+ },
346
+ },
347
+ recall_and_apply: {
348
+ name: "recall_and_apply",
349
+ description: "Recall relevant past context (conversations, decisions, mistakes, file changes) and format it for applying to current work. Use this when you need to 'remember when we did X' and 'now do Y based on that'. Returns structured context optimized for context transfer workflows. Supports pagination and scope filtering.",
350
+ inputSchema: {
351
+ type: "object",
352
+ properties: {
353
+ query: {
354
+ type: "string",
355
+ description: "What to recall (e.g., 'how we implemented authentication', 'the bug we fixed in parser', 'decisions about database schema')",
356
+ },
357
+ context_types: {
358
+ type: "array",
359
+ description: "Types of context to include: 'conversations', 'decisions', 'mistakes', 'file_changes', 'commits'. Default: all types",
360
+ items: {
361
+ type: "string",
362
+ enum: ["conversations", "decisions", "mistakes", "file_changes", "commits"]
363
+ },
364
+ default: ["conversations", "decisions", "mistakes", "file_changes", "commits"],
365
+ },
366
+ file_path: {
367
+ type: "string",
368
+ description: "Optional: focus on a specific file",
369
+ },
370
+ date_range: {
371
+ type: "array",
372
+ description: "Optional: limit to time range [start_timestamp, end_timestamp]",
373
+ items: { type: "number" },
374
+ },
375
+ limit: {
376
+ type: "number",
377
+ description: "Maximum results per context type (default: 5)",
378
+ default: 5,
379
+ },
380
+ offset: {
381
+ type: "number",
382
+ description: "Skip N results for pagination (default: 0). Use with limit to fetch subsequent pages.",
383
+ default: 0,
384
+ },
385
+ scope: {
386
+ type: "string",
387
+ enum: ["current", "all", "global"],
388
+ description: "Search scope: 'current' (current session only), 'all' (all sessions in current project), 'global' (all indexed projects including Codex). Default: 'all'",
389
+ default: "all",
390
+ },
391
+ conversation_id: {
392
+ type: "string",
393
+ description: "Required when scope='current': the conversation/session ID to search within",
394
+ },
395
+ },
396
+ required: ["query"],
397
+ },
398
+ },
399
+ generate_documentation: {
400
+ name: "generate_documentation",
401
+ description: "Generate comprehensive project documentation by combining codebase analysis (CODE-GRAPH-RAG-MCP) with conversation history. Shows WHAT exists in code and WHY it was built that way.",
402
+ inputSchema: {
403
+ type: "object",
404
+ properties: {
405
+ project_path: {
406
+ type: "string",
407
+ description: "Path to the project (defaults to current working directory)",
408
+ },
409
+ session_id: {
410
+ type: "string",
411
+ description: "Optional: specific session ID to include. If not provided, includes all sessions.",
412
+ },
413
+ scope: {
414
+ type: "string",
415
+ enum: ["full", "architecture", "decisions", "quality"],
416
+ description: "Documentation scope: full (everything), architecture (modules), decisions (decision log), quality (code quality insights)",
417
+ default: "full",
418
+ },
419
+ module_filter: {
420
+ type: "string",
421
+ description: "Optional: filter to specific module path (e.g., 'src/auth')",
422
+ },
423
+ },
424
+ },
425
+ },
426
+ discover_old_conversations: {
427
+ name: "discover_old_conversations",
428
+ description: "Discover old conversation folders when project directories are renamed or moved. Scans ~/.claude/projects to find folders that match the current project based on database contents and folder similarity.",
429
+ inputSchema: {
430
+ type: "object",
431
+ properties: {
432
+ current_project_path: {
433
+ type: "string",
434
+ description: "Current project path (defaults to current working directory). Used to find matching old folders.",
435
+ },
436
+ },
437
+ },
438
+ },
439
+ migrate_project: {
440
+ name: "migrate_project",
441
+ description: "Migrate or merge conversation history from different project folders. Use 'migrate' mode (default) to replace target folder when renaming projects. Use 'merge' mode to combine conversations from different projects into one folder. Creates backups automatically.",
442
+ inputSchema: {
443
+ type: "object",
444
+ properties: {
445
+ source_folder: {
446
+ type: "string",
447
+ description: "Path to the source conversation folder (e.g., /Users/name/.claude/projects/-old-project)",
448
+ },
449
+ old_project_path: {
450
+ type: "string",
451
+ description: "Old project path stored in database (e.g., /Users/name/old-project)",
452
+ },
453
+ new_project_path: {
454
+ type: "string",
455
+ description: "New project path to update to (e.g., /Users/name/new-project)",
456
+ },
457
+ dry_run: {
458
+ type: "boolean",
459
+ description: "If true, shows what would be migrated without making changes (default: false)",
460
+ default: false,
461
+ },
462
+ mode: {
463
+ type: "string",
464
+ enum: ["migrate", "merge"],
465
+ description: "Operation mode: 'migrate' (default) replaces target folder, 'merge' combines conversations from source into existing target. In merge mode, duplicate conversation IDs are skipped (target kept). Use 'merge' to combine history from different projects.",
466
+ default: "migrate",
467
+ },
468
+ },
469
+ required: ["source_folder", "old_project_path", "new_project_path"],
470
+ },
471
+ },
472
+ forget_by_topic: {
473
+ name: "forget_by_topic",
474
+ description: "Forget conversations about specific topics or keywords. Searches for matching conversations and optionally deletes them with automatic backup. Use confirm=false to preview what would be deleted, then set confirm=true to actually delete.",
475
+ inputSchema: {
476
+ type: "object",
477
+ properties: {
478
+ keywords: {
479
+ type: "array",
480
+ description: "Topics or keywords to search for (e.g., ['authentication', 'redesign'])",
481
+ items: { type: "string" },
482
+ minItems: 1,
483
+ },
484
+ project_path: {
485
+ type: "string",
486
+ description: "Path to the project (defaults to current working directory)",
487
+ },
488
+ confirm: {
489
+ type: "boolean",
490
+ description: "Set to true to actually delete conversations. If false (default), only shows preview of what would be deleted",
491
+ default: false,
492
+ },
493
+ },
494
+ required: ["keywords"],
495
+ },
496
+ },
497
+ // ==================== High-Value Utility Tools ====================
498
+ search_by_file: {
499
+ name: "search_by_file",
500
+ description: "Find all conversation context related to a specific file: discussions, decisions, mistakes, and changes. Essential for understanding file history before modifications.",
501
+ inputSchema: {
502
+ type: "object",
503
+ properties: {
504
+ file_path: {
505
+ type: "string",
506
+ description: "Path to the file (can be relative or absolute)",
507
+ },
508
+ limit: {
509
+ type: "number",
510
+ description: "Maximum results per category (default: 5)",
511
+ default: 5,
512
+ },
513
+ },
514
+ required: ["file_path"],
515
+ },
516
+ },
517
+ list_recent_sessions: {
518
+ name: "list_recent_sessions",
519
+ description: "List recent conversation sessions with summary info (date, message count, topics). Useful for understanding conversation history at a glance.",
520
+ inputSchema: {
521
+ type: "object",
522
+ properties: {
523
+ limit: {
524
+ type: "number",
525
+ description: "Maximum sessions to return (default: 10)",
526
+ default: 10,
527
+ },
528
+ offset: {
529
+ type: "number",
530
+ description: "Skip N sessions for pagination (default: 0)",
531
+ default: 0,
532
+ },
533
+ project_path: {
534
+ type: "string",
535
+ description: "Optional: filter to specific project path",
536
+ },
537
+ },
538
+ },
539
+ },
540
+ // ==================== Global Cross-Project Tools ====================
541
+ index_all_projects: {
542
+ name: "index_all_projects",
543
+ description: "Index all projects from both Claude Code and Codex. Discovers and indexes conversations from all sources, registering them in a global index for cross-project search. This enables searching across all your work globally.",
544
+ inputSchema: {
545
+ type: "object",
546
+ properties: {
547
+ include_codex: {
548
+ type: "boolean",
549
+ description: "Include Codex conversations (default: true)",
550
+ default: true,
551
+ },
552
+ include_claude_code: {
553
+ type: "boolean",
554
+ description: "Include Claude Code conversations (default: true)",
555
+ default: true,
556
+ },
557
+ codex_path: {
558
+ type: "string",
559
+ description: "Path to Codex home directory (default: ~/.codex)",
560
+ },
561
+ claude_projects_path: {
562
+ type: "string",
563
+ description: "Path to Claude Code projects directory (default: ~/.claude/projects)",
564
+ },
565
+ incremental: {
566
+ type: "boolean",
567
+ description: "Perform incremental indexing - only index files modified since last indexing (default: true). Set to false for full re-indexing.",
568
+ default: true,
569
+ },
570
+ },
571
+ },
572
+ },
573
+ search_all_conversations: {
574
+ name: "search_all_conversations",
575
+ description: "Search conversations across all indexed projects (Claude Code + Codex). Returns results from all projects with source type and project path for context. Supports full pagination.",
576
+ inputSchema: {
577
+ type: "object",
578
+ properties: {
579
+ query: {
580
+ type: "string",
581
+ description: "Natural language search query",
582
+ },
583
+ limit: {
584
+ type: "number",
585
+ description: "Maximum number of results (default: 20)",
586
+ default: 20,
587
+ },
588
+ offset: {
589
+ type: "number",
590
+ description: "Skip N results for pagination (default: 0). Use with limit to fetch subsequent pages.",
591
+ default: 0,
592
+ },
593
+ date_range: {
594
+ type: "array",
595
+ description: "Optional date range filter [start_timestamp, end_timestamp]",
596
+ items: { type: "number" },
597
+ },
598
+ source_type: {
599
+ type: "string",
600
+ description: "Filter by source: 'claude-code', 'codex', or 'all' (default: 'all')",
601
+ enum: ["claude-code", "codex", "all"],
602
+ default: "all",
603
+ },
604
+ },
605
+ required: ["query"],
606
+ },
607
+ },
608
+ get_all_decisions: {
609
+ name: "get_all_decisions",
610
+ description: "Find decisions made across all indexed projects. Shows rationale, alternatives, and rejected approaches from all your work globally. Supports full pagination.",
611
+ inputSchema: {
612
+ type: "object",
613
+ properties: {
614
+ query: {
615
+ type: "string",
616
+ description: "Topic or keyword to search for (e.g., 'authentication', 'database')",
617
+ },
618
+ file_path: {
619
+ type: "string",
620
+ description: "Optional: filter decisions related to a specific file",
621
+ },
622
+ limit: {
623
+ type: "number",
624
+ description: "Maximum number of decisions to return (default: 20)",
625
+ default: 20,
626
+ },
627
+ offset: {
628
+ type: "number",
629
+ description: "Skip N results for pagination (default: 0). Use with limit to fetch subsequent pages.",
630
+ default: 0,
631
+ },
632
+ source_type: {
633
+ type: "string",
634
+ description: "Filter by source: 'claude-code', 'codex', or 'all' (default: 'all')",
635
+ enum: ["claude-code", "codex", "all"],
636
+ default: "all",
637
+ },
638
+ },
639
+ required: ["query"],
640
+ },
641
+ },
642
+ search_all_mistakes: {
643
+ name: "search_all_mistakes",
644
+ description: "Find past mistakes across all indexed projects to avoid repeating them. Shows what went wrong and how it was corrected across all your work. Supports full pagination.",
645
+ inputSchema: {
646
+ type: "object",
647
+ properties: {
648
+ query: {
649
+ type: "string",
650
+ description: "Search query for mistakes",
651
+ },
652
+ mistake_type: {
653
+ type: "string",
654
+ description: "Optional: filter by type (logic_error, wrong_approach, misunderstanding, tool_error, syntax_error)",
655
+ },
656
+ limit: {
657
+ type: "number",
658
+ description: "Maximum number of results (default: 20)",
659
+ default: 20,
660
+ },
661
+ offset: {
662
+ type: "number",
663
+ description: "Skip N results for pagination (default: 0). Use with limit to fetch subsequent pages.",
664
+ default: 0,
665
+ },
666
+ source_type: {
667
+ type: "string",
668
+ description: "Filter by source: 'claude-code', 'codex', or 'all' (default: 'all')",
669
+ enum: ["claude-code", "codex", "all"],
670
+ default: "all",
671
+ },
672
+ },
673
+ required: ["query"],
674
+ },
675
+ },
676
+ // ==================== Live Context Layer Tools ====================
677
+ remember: {
678
+ name: "remember",
679
+ description: "Store a fact, decision, or piece of context in working memory. Use this to remember important information that should persist across conversation boundaries. Items are stored per-project and can be recalled by key or searched semantically.",
680
+ inputSchema: {
681
+ type: "object",
682
+ properties: {
683
+ key: {
684
+ type: "string",
685
+ description: "A unique key to identify this memory (e.g., 'storage_decision', 'auth_approach', 'current_task')",
686
+ },
687
+ value: {
688
+ type: "string",
689
+ description: "The value to remember (e.g., 'Using SQLite for simplicity and portability')",
690
+ },
691
+ context: {
692
+ type: "string",
693
+ description: "Optional additional context or rationale for this memory",
694
+ },
695
+ tags: {
696
+ type: "array",
697
+ items: { type: "string" },
698
+ description: "Optional tags for categorization (e.g., ['architecture', 'decision'])",
699
+ },
700
+ ttl: {
701
+ type: "number",
702
+ description: "Optional time-to-live in seconds. Memory will auto-expire after this time.",
703
+ },
704
+ project_path: {
705
+ type: "string",
706
+ description: "Project path (defaults to current working directory)",
707
+ },
708
+ },
709
+ required: ["key", "value"],
710
+ },
711
+ },
712
+ recall: {
713
+ name: "recall",
714
+ description: "Retrieve a specific memory item by its key. Use this when you need to recall a specific fact or decision that was previously stored.",
715
+ inputSchema: {
716
+ type: "object",
717
+ properties: {
718
+ key: {
719
+ type: "string",
720
+ description: "The key of the memory to recall",
721
+ },
722
+ project_path: {
723
+ type: "string",
724
+ description: "Project path (defaults to current working directory)",
725
+ },
726
+ },
727
+ required: ["key"],
728
+ },
729
+ },
730
+ recall_relevant: {
731
+ name: "recall_relevant",
732
+ description: "Search working memory semantically to find relevant memories based on a query. Use this when you need to find memories related to a topic but don't know the exact key.",
733
+ inputSchema: {
734
+ type: "object",
735
+ properties: {
736
+ query: {
737
+ type: "string",
738
+ description: "Natural language query to search for (e.g., 'database decisions', 'authentication setup')",
739
+ },
740
+ limit: {
741
+ type: "number",
742
+ description: "Maximum number of results (default: 10)",
743
+ default: 10,
744
+ },
745
+ project_path: {
746
+ type: "string",
747
+ description: "Project path (defaults to current working directory)",
748
+ },
749
+ },
750
+ required: ["query"],
751
+ },
752
+ },
753
+ list_memory: {
754
+ name: "list_memory",
755
+ description: "List all items in working memory for the current project. Optionally filter by tags.",
756
+ inputSchema: {
757
+ type: "object",
758
+ properties: {
759
+ tags: {
760
+ type: "array",
761
+ items: { type: "string" },
762
+ description: "Optional: filter by tags (returns items matching any tag)",
763
+ },
764
+ limit: {
765
+ type: "number",
766
+ description: "Maximum number of items to return (default: 100)",
767
+ default: 100,
768
+ },
769
+ offset: {
770
+ type: "number",
771
+ description: "Skip N items for pagination (default: 0)",
772
+ default: 0,
773
+ },
774
+ project_path: {
775
+ type: "string",
776
+ description: "Project path (defaults to current working directory)",
777
+ },
778
+ },
779
+ },
780
+ },
781
+ forget: {
782
+ name: "forget",
783
+ description: "Remove a memory item by its key. Use this to clean up memories that are no longer relevant.",
784
+ inputSchema: {
785
+ type: "object",
786
+ properties: {
787
+ key: {
788
+ type: "string",
789
+ description: "The key of the memory to forget",
790
+ },
791
+ project_path: {
792
+ type: "string",
793
+ description: "Project path (defaults to current working directory)",
794
+ },
795
+ },
796
+ required: ["key"],
797
+ },
798
+ },
799
+ // ==================== Session Handoff Tools ====================
800
+ prepare_handoff: {
801
+ name: "prepare_handoff",
802
+ description: "Prepare a handoff document for transitioning to a new conversation. Extracts key decisions, active files, pending tasks, and working memory to enable seamless continuation in a new session.",
803
+ inputSchema: {
804
+ type: "object",
805
+ properties: {
806
+ session_id: {
807
+ type: "string",
808
+ description: "Session ID to prepare handoff for (defaults to most recent session)",
809
+ },
810
+ include: {
811
+ type: "array",
812
+ items: {
813
+ type: "string",
814
+ enum: ["decisions", "files", "tasks", "memory"],
815
+ },
816
+ description: "What to include in handoff (default: all). Options: decisions, files, tasks, memory",
817
+ },
818
+ context_summary: {
819
+ type: "string",
820
+ description: "Optional summary of current context/task to include in handoff",
821
+ },
822
+ project_path: {
823
+ type: "string",
824
+ description: "Project path (defaults to current working directory)",
825
+ },
826
+ },
827
+ },
828
+ },
829
+ resume_from_handoff: {
830
+ name: "resume_from_handoff",
831
+ description: "Resume work from a previous handoff document. Loads the context from the handoff and provides a summary of what was being worked on.",
832
+ inputSchema: {
833
+ type: "object",
834
+ properties: {
835
+ handoff_id: {
836
+ type: "string",
837
+ description: "ID of the handoff to resume from (defaults to most recent)",
838
+ },
839
+ inject_context: {
840
+ type: "boolean",
841
+ description: "Whether to inject the handoff context into the response (default: true)",
842
+ default: true,
843
+ },
844
+ project_path: {
845
+ type: "string",
846
+ description: "Project path (defaults to current working directory)",
847
+ },
848
+ },
849
+ },
850
+ },
851
+ list_handoffs: {
852
+ name: "list_handoffs",
853
+ description: "List available handoff documents for the current project. Shows when each was created and whether it has been resumed.",
854
+ inputSchema: {
855
+ type: "object",
856
+ properties: {
857
+ limit: {
858
+ type: "number",
859
+ description: "Maximum number of handoffs to return (default: 10)",
860
+ default: 10,
861
+ },
862
+ include_resumed: {
863
+ type: "boolean",
864
+ description: "Include handoffs that have already been resumed (default: true)",
865
+ default: true,
866
+ },
867
+ project_path: {
868
+ type: "string",
869
+ description: "Project path (defaults to current working directory)",
870
+ },
871
+ },
872
+ },
873
+ },
874
+ // ==================== Context Injection Tools ====================
875
+ get_startup_context: {
876
+ name: "get_startup_context",
877
+ description: "Get relevant context to inject at the start of a new conversation. Combines recent handoffs, decisions, working memory, and file history based on the query or task description.",
878
+ inputSchema: {
879
+ type: "object",
880
+ properties: {
881
+ query: {
882
+ type: "string",
883
+ description: "Description of what you're about to work on (e.g., 'authentication system', 'database optimization')",
884
+ },
885
+ max_tokens: {
886
+ type: "number",
887
+ description: "Maximum tokens for context response (default: 2000). Helps stay within context limits.",
888
+ default: 2000,
889
+ },
890
+ sources: {
891
+ type: "array",
892
+ items: {
893
+ type: "string",
894
+ enum: ["history", "decisions", "memory", "handoffs"],
895
+ },
896
+ description: "Which sources to include (default: all). Options: history, decisions, memory, handoffs",
897
+ },
898
+ project_path: {
899
+ type: "string",
900
+ description: "Project path (defaults to current working directory)",
901
+ },
902
+ },
903
+ },
904
+ },
905
+ inject_relevant_context: {
906
+ name: "inject_relevant_context",
907
+ description: "Analyze a message and automatically inject relevant historical context. Use at the start of a conversation to bring in context from past sessions.",
908
+ inputSchema: {
909
+ type: "object",
910
+ properties: {
911
+ message: {
912
+ type: "string",
913
+ description: "The user's first message or task description to analyze for context injection",
914
+ },
915
+ max_tokens: {
916
+ type: "number",
917
+ description: "Maximum tokens for injected context (default: 1500)",
918
+ default: 1500,
919
+ },
920
+ sources: {
921
+ type: "array",
922
+ items: {
923
+ type: "string",
924
+ enum: ["history", "decisions", "memory", "handoffs"],
925
+ },
926
+ description: "Which sources to search (default: all)",
927
+ },
928
+ project_path: {
929
+ type: "string",
930
+ description: "Project path (defaults to current working directory)",
931
+ },
932
+ },
933
+ required: ["message"],
934
+ },
935
+ },
936
+ };
937
+ //# sourceMappingURL=ToolDefinitions.js.map