repomemory 0.1.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.
- package/LICENSE +21 -0
- package/README.md +227 -0
- package/dist/commands/analyze.d.ts +7 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +360 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +86 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/serve.d.ts +4 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +13 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/setup.d.ts +4 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +134 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/sync.d.ts +5 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +77 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/ai-provider.d.ts +18 -0
- package/dist/lib/ai-provider.d.ts.map +1 -0
- package/dist/lib/ai-provider.js +164 -0
- package/dist/lib/ai-provider.js.map +1 -0
- package/dist/lib/config.d.ts +29 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +103 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/context-store.d.ts +31 -0
- package/dist/lib/context-store.d.ts.map +1 -0
- package/dist/lib/context-store.js +150 -0
- package/dist/lib/context-store.js.map +1 -0
- package/dist/lib/git.d.ts +29 -0
- package/dist/lib/git.d.ts.map +1 -0
- package/dist/lib/git.js +139 -0
- package/dist/lib/git.js.map +1 -0
- package/dist/lib/repo-scanner.d.ts +26 -0
- package/dist/lib/repo-scanner.d.ts.map +1 -0
- package/dist/lib/repo-scanner.js +213 -0
- package/dist/lib/repo-scanner.js.map +1 -0
- package/dist/lib/search.d.ts +21 -0
- package/dist/lib/search.d.ts.map +1 -0
- package/dist/lib/search.js +147 -0
- package/dist/lib/search.js.map +1 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +324 -0
- package/dist/mcp/server.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
+
import { ContextStore } from "../lib/context-store.js";
|
|
5
|
+
import { SearchIndex } from "../lib/search.js";
|
|
6
|
+
export async function startMcpServer(repoRoot, config) {
|
|
7
|
+
const store = new ContextStore(repoRoot, config);
|
|
8
|
+
let searchIndex = null;
|
|
9
|
+
// Initialize search index if .context exists
|
|
10
|
+
if (store.exists()) {
|
|
11
|
+
try {
|
|
12
|
+
searchIndex = new SearchIndex(store.path, store);
|
|
13
|
+
searchIndex.rebuild();
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
console.error("Warning: Could not initialize search index:", e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const server = new Server({
|
|
20
|
+
name: "repomemory",
|
|
21
|
+
version: "0.1.0",
|
|
22
|
+
}, {
|
|
23
|
+
capabilities: {
|
|
24
|
+
tools: {},
|
|
25
|
+
resources: {},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
// --- Tools ---
|
|
29
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
30
|
+
return {
|
|
31
|
+
tools: [
|
|
32
|
+
{
|
|
33
|
+
name: "context_search",
|
|
34
|
+
description: "Search the repository's persistent knowledge base. Returns relevant facts, decisions, regressions, and session notes. Use this at the start of a task to find relevant context, or when you need to understand why something is the way it is.",
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
query: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Natural language search query. Examples: 'authentication flow', 'why we chose Drizzle', 'database schema', 'known issues with deployment'",
|
|
41
|
+
},
|
|
42
|
+
category: {
|
|
43
|
+
type: "string",
|
|
44
|
+
enum: ["facts", "decisions", "regressions", "sessions", "changelog"],
|
|
45
|
+
description: "Optional: filter results to a specific category. Omit to search all.",
|
|
46
|
+
},
|
|
47
|
+
limit: {
|
|
48
|
+
type: "number",
|
|
49
|
+
description: "Max results to return (default: 5)",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
required: ["query"],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "context_write",
|
|
57
|
+
description: "Write a new piece of knowledge to the repository's persistent memory. Use this to record: discoveries you made during this session, architectural decisions, bug patterns, or any insight that would help a future AI session. This persists across sessions — write anything you'd want a future version of yourself to know.",
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: "object",
|
|
60
|
+
properties: {
|
|
61
|
+
category: {
|
|
62
|
+
type: "string",
|
|
63
|
+
enum: ["facts", "decisions", "regressions", "sessions", "changelog"],
|
|
64
|
+
description: `Category for the knowledge:
|
|
65
|
+
- facts: Architecture, patterns, how things work
|
|
66
|
+
- decisions: Why something was chosen (include alternatives considered)
|
|
67
|
+
- regressions: Bug patterns, things that broke, gotchas
|
|
68
|
+
- sessions: What you worked on and discovered this session
|
|
69
|
+
- changelog: Notable changes`,
|
|
70
|
+
},
|
|
71
|
+
filename: {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: "Descriptive filename (without .md extension). Use kebab-case. Examples: 'auth-flow', 'why-drizzle-orm', 'token-refresh-race-condition'",
|
|
74
|
+
},
|
|
75
|
+
content: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: "Markdown content to write. Be specific: include file paths, function names, commands. Every line should inform a decision.",
|
|
78
|
+
},
|
|
79
|
+
append: {
|
|
80
|
+
type: "boolean",
|
|
81
|
+
description: "If true, append to existing file instead of overwriting. Useful for session logs.",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
required: ["category", "filename", "content"],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "context_list",
|
|
89
|
+
description: "List all knowledge entries in the repository context, optionally filtered by category. Returns filenames and titles for browsing.",
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: "object",
|
|
92
|
+
properties: {
|
|
93
|
+
category: {
|
|
94
|
+
type: "string",
|
|
95
|
+
enum: ["facts", "decisions", "regressions", "sessions", "changelog"],
|
|
96
|
+
description: "Optional: filter to a specific category.",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "context_read",
|
|
103
|
+
description: "Read the full content of a specific context file. Use after context_search or context_list to get complete details.",
|
|
104
|
+
inputSchema: {
|
|
105
|
+
type: "object",
|
|
106
|
+
properties: {
|
|
107
|
+
category: {
|
|
108
|
+
type: "string",
|
|
109
|
+
description: "The category (facts, decisions, regressions, sessions, changelog)",
|
|
110
|
+
},
|
|
111
|
+
filename: {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "The filename to read (with or without .md extension)",
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
required: ["category", "filename"],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
123
|
+
const { name, arguments: args } = request.params;
|
|
124
|
+
switch (name) {
|
|
125
|
+
case "context_search": {
|
|
126
|
+
const { query, category, limit = 5 } = args;
|
|
127
|
+
if (!store.exists()) {
|
|
128
|
+
return {
|
|
129
|
+
content: [
|
|
130
|
+
{
|
|
131
|
+
type: "text",
|
|
132
|
+
text: "No .context/ directory found. Run `repomemory init && repomemory analyze` to set up.",
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
// Rebuild index if needed
|
|
138
|
+
if (!searchIndex) {
|
|
139
|
+
searchIndex = new SearchIndex(store.path, store);
|
|
140
|
+
searchIndex.rebuild();
|
|
141
|
+
}
|
|
142
|
+
const results = searchIndex.search(query, category, limit);
|
|
143
|
+
if (results.length === 0) {
|
|
144
|
+
// Fallback to simple text search
|
|
145
|
+
const entries = store.listEntries(category);
|
|
146
|
+
const queryLower = query.toLowerCase();
|
|
147
|
+
const matched = entries
|
|
148
|
+
.filter((e) => e.content.toLowerCase().includes(queryLower) ||
|
|
149
|
+
e.title.toLowerCase().includes(queryLower))
|
|
150
|
+
.slice(0, limit);
|
|
151
|
+
if (matched.length === 0) {
|
|
152
|
+
return {
|
|
153
|
+
content: [
|
|
154
|
+
{
|
|
155
|
+
type: "text",
|
|
156
|
+
text: `No results found for "${query}"${category ? ` in ${category}` : ""}. Try a different query or browse with context_list.`,
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
const text = matched
|
|
162
|
+
.map((e) => `## ${e.category}/${e.filename}\n**${e.title}**\n\n${e.content.slice(0, 800)}\n`)
|
|
163
|
+
.join("\n---\n\n");
|
|
164
|
+
return { content: [{ type: "text", text }] };
|
|
165
|
+
}
|
|
166
|
+
const text = results
|
|
167
|
+
.map((r) => `## ${r.category}/${r.filename} (relevance: ${r.score.toFixed(2)})\n**${r.title}**\n\n${r.snippet}\n`)
|
|
168
|
+
.join("\n---\n\n");
|
|
169
|
+
return { content: [{ type: "text", text }] };
|
|
170
|
+
}
|
|
171
|
+
case "context_write": {
|
|
172
|
+
const { category, filename, content, append = false } = args;
|
|
173
|
+
if (!store.exists()) {
|
|
174
|
+
store.scaffold();
|
|
175
|
+
}
|
|
176
|
+
let relativePath;
|
|
177
|
+
if (append) {
|
|
178
|
+
relativePath = store.appendEntry(category, filename, content);
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
relativePath = store.writeEntry(category, filename, content);
|
|
182
|
+
}
|
|
183
|
+
// Update search index
|
|
184
|
+
if (searchIndex) {
|
|
185
|
+
searchIndex.rebuild();
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
content: [
|
|
189
|
+
{
|
|
190
|
+
type: "text",
|
|
191
|
+
text: `✓ Written to ${relativePath}${append ? " (appended)" : ""}. This knowledge will persist across sessions.`,
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
case "context_list": {
|
|
197
|
+
const { category } = (args || {});
|
|
198
|
+
if (!store.exists()) {
|
|
199
|
+
return {
|
|
200
|
+
content: [
|
|
201
|
+
{
|
|
202
|
+
type: "text",
|
|
203
|
+
text: "No .context/ directory found. Run `repomemory init` first.",
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const entries = store.listEntries(category);
|
|
209
|
+
if (entries.length === 0) {
|
|
210
|
+
return {
|
|
211
|
+
content: [
|
|
212
|
+
{
|
|
213
|
+
type: "text",
|
|
214
|
+
text: `No entries found${category ? ` in ${category}` : ""}. Run \`repomemory analyze\` to populate, or use context_write to add entries.`,
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
const grouped = {};
|
|
220
|
+
for (const entry of entries) {
|
|
221
|
+
if (!grouped[entry.category])
|
|
222
|
+
grouped[entry.category] = [];
|
|
223
|
+
grouped[entry.category].push(entry);
|
|
224
|
+
}
|
|
225
|
+
let text = "# Repository Context\n\n";
|
|
226
|
+
for (const [cat, catEntries] of Object.entries(grouped)) {
|
|
227
|
+
text += `## ${cat}/\n`;
|
|
228
|
+
for (const entry of catEntries) {
|
|
229
|
+
const sizeKb = (entry.sizeBytes / 1024).toFixed(1);
|
|
230
|
+
const age = getRelativeTime(entry.lastModified);
|
|
231
|
+
text += `- **${entry.filename}** — ${entry.title} (${sizeKb}KB, ${age})\n`;
|
|
232
|
+
}
|
|
233
|
+
text += "\n";
|
|
234
|
+
}
|
|
235
|
+
return { content: [{ type: "text", text }] };
|
|
236
|
+
}
|
|
237
|
+
case "context_read": {
|
|
238
|
+
const { category, filename } = args;
|
|
239
|
+
const fname = filename.endsWith(".md") ? filename : filename + ".md";
|
|
240
|
+
const content = store.readEntry(category, fname);
|
|
241
|
+
if (!content) {
|
|
242
|
+
return {
|
|
243
|
+
content: [
|
|
244
|
+
{
|
|
245
|
+
type: "text",
|
|
246
|
+
text: `File not found: ${category}/${fname}. Use context_list to see available files.`,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
content: [
|
|
253
|
+
{
|
|
254
|
+
type: "text",
|
|
255
|
+
text: `# ${category}/${fname}\n\n${content}`,
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
default:
|
|
261
|
+
return {
|
|
262
|
+
content: [
|
|
263
|
+
{
|
|
264
|
+
type: "text",
|
|
265
|
+
text: `Unknown tool: ${name}`,
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
isError: true,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
// --- Resources (expose .context/ files as MCP resources) ---
|
|
273
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
274
|
+
if (!store.exists()) {
|
|
275
|
+
return { resources: [] };
|
|
276
|
+
}
|
|
277
|
+
const entries = store.listEntries();
|
|
278
|
+
return {
|
|
279
|
+
resources: entries.map((entry) => ({
|
|
280
|
+
uri: `repomemory://${entry.category}/${entry.filename}`,
|
|
281
|
+
name: `${entry.category}/${entry.filename}`,
|
|
282
|
+
description: entry.title,
|
|
283
|
+
mimeType: "text/markdown",
|
|
284
|
+
})),
|
|
285
|
+
};
|
|
286
|
+
});
|
|
287
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
288
|
+
const uri = request.params.uri;
|
|
289
|
+
const match = uri.match(/^repomemory:\/\/([^/]+)\/(.+)$/);
|
|
290
|
+
if (!match) {
|
|
291
|
+
throw new Error(`Invalid URI: ${uri}`);
|
|
292
|
+
}
|
|
293
|
+
const [, category, filename] = match;
|
|
294
|
+
const content = store.readEntry(category, filename);
|
|
295
|
+
if (!content) {
|
|
296
|
+
throw new Error(`Resource not found: ${uri}`);
|
|
297
|
+
}
|
|
298
|
+
return {
|
|
299
|
+
contents: [
|
|
300
|
+
{
|
|
301
|
+
uri,
|
|
302
|
+
mimeType: "text/markdown",
|
|
303
|
+
text: content,
|
|
304
|
+
},
|
|
305
|
+
],
|
|
306
|
+
};
|
|
307
|
+
});
|
|
308
|
+
// Connect via stdio
|
|
309
|
+
const transport = new StdioServerTransport();
|
|
310
|
+
await server.connect(transport);
|
|
311
|
+
}
|
|
312
|
+
function getRelativeTime(date) {
|
|
313
|
+
const seconds = Math.floor((Date.now() - date.getTime()) / 1000);
|
|
314
|
+
if (seconds < 60)
|
|
315
|
+
return "just now";
|
|
316
|
+
if (seconds < 3600)
|
|
317
|
+
return `${Math.floor(seconds / 60)}m ago`;
|
|
318
|
+
if (seconds < 86400)
|
|
319
|
+
return `${Math.floor(seconds / 3600)}h ago`;
|
|
320
|
+
if (seconds < 2592000)
|
|
321
|
+
return `${Math.floor(seconds / 86400)}d ago`;
|
|
322
|
+
return `${Math.floor(seconds / 2592000)}mo ago`;
|
|
323
|
+
}
|
|
324
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,o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,IAAU;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;IACjE,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,UAAU,CAAC;IACpC,IAAI,OAAO,GAAG,IAAI;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC;IAC9D,IAAI,OAAO,GAAG,KAAK;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IACjE,IAAI,OAAO,GAAG,OAAO;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACpE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;AAClD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "repomemory",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Your repo remembers what every AI session learned. Persistent, structured memory for AI coding agents.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"repomemory": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "node scripts/build.js",
|
|
11
|
+
"dev": "tsx src/index.ts",
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/DanielGuru/repomemory.git"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/DanielGuru/repomemory#readme",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/DanielGuru/repomemory/issues"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"ai",
|
|
25
|
+
"memory",
|
|
26
|
+
"context",
|
|
27
|
+
"coding-agent",
|
|
28
|
+
"claude",
|
|
29
|
+
"claude-code",
|
|
30
|
+
"cursor",
|
|
31
|
+
"copilot",
|
|
32
|
+
"mcp",
|
|
33
|
+
"openclaw",
|
|
34
|
+
"repository",
|
|
35
|
+
"knowledge-base",
|
|
36
|
+
"gemini",
|
|
37
|
+
"grok",
|
|
38
|
+
"context-engineering"
|
|
39
|
+
],
|
|
40
|
+
"author": "DanielGuru",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@anthropic-ai/sdk": "^0.74.0",
|
|
44
|
+
"@google/generative-ai": "^0.24.1",
|
|
45
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
46
|
+
"better-sqlite3": "^12.6.2",
|
|
47
|
+
"chalk": "^5.6.2",
|
|
48
|
+
"commander": "^14.0.3",
|
|
49
|
+
"glob": "^13.0.5",
|
|
50
|
+
"openai": "^6.22.0",
|
|
51
|
+
"zod": "^4.3.6"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
55
|
+
"@types/node": "^25.2.3",
|
|
56
|
+
"tsx": "^4.21.0",
|
|
57
|
+
"typescript": "^5.9.3"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=18.0.0"
|
|
61
|
+
},
|
|
62
|
+
"files": [
|
|
63
|
+
"dist",
|
|
64
|
+
"README.md",
|
|
65
|
+
"LICENSE"
|
|
66
|
+
]
|
|
67
|
+
}
|