@maximalabs/dev-mcp-suite 0.0.0-stage → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +69 -0
- package/CHANGELOG.md +281 -0
- package/CODEX_DEV_MCP_GUIDE.md +297 -0
- package/LICENSE +21 -0
- package/README.md +193 -2
- package/armada/package.json +14 -0
- package/armada/server.js +329 -0
- package/backfill-sessions-v2.mjs +288 -0
- package/bin/_meta.mjs +73 -0
- package/bin/armada-mcp.mjs +12 -0
- package/bin/checkpoint.mjs +9 -0
- package/bin/context-pack.mjs +9 -0
- package/bin/devjournal.mjs +9 -0
- package/bin/init.mjs +25 -0
- package/bin/project-memory.mjs +10 -0
- package/bin/provider-smoke.mjs +278 -0
- package/bin/prune.mjs +158 -0
- package/bin/stats.mjs +101 -0
- package/bin/ui.mjs +5 -0
- package/checkpoint/package.json +14 -0
- package/checkpoint/server.js +318 -0
- package/context-pack/package.json +14 -0
- package/context-pack/server.js +747 -0
- package/devjournal/compress.js +75 -0
- package/devjournal/env.js +3 -0
- package/devjournal/package.json +14 -0
- package/devjournal/provider-chain.js +109 -0
- package/devjournal/rerank.js +120 -0
- package/devjournal/server.js +415 -0
- package/docs/ROADMAP.md +77 -0
- package/docs/clients/antigravity.md +52 -0
- package/docs/clients/claude-code.md +46 -0
- package/docs/clients/codex.md +39 -0
- package/docs/clients/generic-mcp.md +45 -0
- package/docs/clients/hermes.md +48 -0
- package/docs/configuration.md +123 -0
- package/docs/privacy.md +39 -0
- package/docs/providers.md +13 -0
- package/docs/superpowers/plans/2026-06-15-hardening-v1-2-implementation.md +60 -0
- package/docs/superpowers/plans/2026-06-15-provider-chain-v1-1-implementation.md +65 -0
- package/docs/superpowers/plans/2026-06-15-provider-client-agnostic-config.md +41 -0
- package/docs/superpowers/plans/2026-06-15-trust-release-implementation.md +62 -0
- package/docs/superpowers/plans/2026-06-18-v1-5-0-knowledge-graph.md +792 -0
- package/docs/superpowers/specs/2026-06-15-provider-chain-v1-1-design.md +89 -0
- package/docs/superpowers/specs/2026-06-15-trust-release-design.md +164 -0
- package/docs/superpowers/specs/2026-06-18-dev-mcp-suite-v1-5-0-knowledge-graph-design.md +386 -0
- package/docs/superpowers/specs/2026-07-22-v2-0-0-peak-intelligence.md +50 -0
- package/docs/superpowers/specs/2026-07-22-v3-0-0-god-tier.md +32 -0
- package/lib/init-wizard.js +120 -0
- package/lib/provider-smoke.js +234 -0
- package/lib/prune.js +114 -0
- package/lib/stats.js +269 -0
- package/lib/ui-server.js +151 -0
- package/lib/update-check.js +125 -0
- package/package.json +71 -4
- package/project-memory/auto-indexer.js +152 -0
- package/project-memory/dedup.js +49 -0
- package/project-memory/embedding.js +174 -0
- package/project-memory/env.js +3 -0
- package/project-memory/global-index.js +46 -0
- package/project-memory/graph.js +93 -0
- package/project-memory/local-embed.js +92 -0
- package/project-memory/package.json +14 -0
- package/project-memory/provider-chain.js +109 -0
- package/project-memory/rerank.js +120 -0
- package/project-memory/server.js +931 -0
- package/project-memory/swarm.js +56 -0
- package/run-tests.mjs +54 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checkpoint MCP Server for Codex
|
|
5
|
+
*
|
|
6
|
+
* Local, git-independent file snapshots so a solo dev / vibecoder can
|
|
7
|
+
* experiment freely and roll back instantly. Snapshots are stored outside
|
|
8
|
+
* the project (default ~/.codex/memories/checkpoints/<project-slug>/).
|
|
9
|
+
*
|
|
10
|
+
* Tools: checkpoint_create, checkpoint_list, checkpoint_restore,
|
|
11
|
+
* checkpoint_diff, checkpoint_delete
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
15
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
16
|
+
import {
|
|
17
|
+
CallToolRequestSchema,
|
|
18
|
+
ListToolsRequestSchema,
|
|
19
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
20
|
+
import fs from "fs/promises";
|
|
21
|
+
import path from "path";
|
|
22
|
+
import os from "os";
|
|
23
|
+
import crypto from "crypto";
|
|
24
|
+
import { execSync } from "child_process";
|
|
25
|
+
|
|
26
|
+
const ROOT =
|
|
27
|
+
process.env.CHECKPOINT_DIR ||
|
|
28
|
+
path.join(os.homedir(), ".ai-shared-memory", "checkpoints");
|
|
29
|
+
|
|
30
|
+
const DEFAULT_IGNORE = new Set([
|
|
31
|
+
"node_modules", ".git", ".next", "dist", "build", "target", ".venv",
|
|
32
|
+
"venv", "__pycache__", ".cache", ".turbo", "coverage", ".DS_Store",
|
|
33
|
+
".codex", "vendor", ".idea", ".gradle",
|
|
34
|
+
]);
|
|
35
|
+
const MAX_FILE_BYTES = 2_000_000;
|
|
36
|
+
const MAX_FILES = 4000;
|
|
37
|
+
|
|
38
|
+
function slug(dir) {
|
|
39
|
+
const resolved = path.resolve(dir || process.cwd());
|
|
40
|
+
const base = path.basename(resolved) || "root";
|
|
41
|
+
const hash = crypto.createHash("sha1").update(resolved).digest("hex").slice(0, 8);
|
|
42
|
+
return `${base.replace(/[^a-zA-Z0-9._-]/g, "-").slice(0, 40)}-${hash}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function nowIso() { return new Date().toISOString(); }
|
|
46
|
+
function cpId() {
|
|
47
|
+
return new Date().toISOString().replace(/[:.]/g, "").slice(0, 15) + "-" + crypto.randomBytes(2).toString("hex");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function walk(base, rel = "", out = []) {
|
|
51
|
+
const abs = path.join(base, rel);
|
|
52
|
+
let entries;
|
|
53
|
+
try { entries = await fs.readdir(abs, { withFileTypes: true }); } catch { return out; }
|
|
54
|
+
for (const e of entries) {
|
|
55
|
+
if (DEFAULT_IGNORE.has(e.name)) continue;
|
|
56
|
+
const childRel = path.join(rel, e.name);
|
|
57
|
+
if (e.isDirectory()) {
|
|
58
|
+
await walk(base, childRel, out);
|
|
59
|
+
} else if (e.isFile()) {
|
|
60
|
+
if (out.length >= MAX_FILES) break;
|
|
61
|
+
out.push(childRel);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function hashContent(buf) {
|
|
68
|
+
return crypto.createHash("sha1").update(buf).digest("hex");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
class CheckpointServer {
|
|
72
|
+
constructor() {
|
|
73
|
+
this.server = new Server(
|
|
74
|
+
{ name: "checkpoint", version: "1.0.0" },
|
|
75
|
+
{ capabilities: { tools: {} } }
|
|
76
|
+
);
|
|
77
|
+
this.setup();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
paths(dir) {
|
|
81
|
+
const s = slug(dir);
|
|
82
|
+
const projectDir = path.join(ROOT, s);
|
|
83
|
+
return {
|
|
84
|
+
slug: s,
|
|
85
|
+
root: path.resolve(dir || process.cwd()),
|
|
86
|
+
projectDir,
|
|
87
|
+
manifest: path.join(projectDir, "manifest.json"),
|
|
88
|
+
snaps: path.join(projectDir, "snapshots"),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async loadManifest(p) {
|
|
93
|
+
try { return JSON.parse(await fs.readFile(p.manifest, "utf8")); }
|
|
94
|
+
catch { return { project: p.slug, root: p.root, checkpoints: {} }; }
|
|
95
|
+
}
|
|
96
|
+
async saveManifest(p, m) {
|
|
97
|
+
await fs.mkdir(p.projectDir, { recursive: true });
|
|
98
|
+
await fs.writeFile(p.manifest, JSON.stringify(m, null, 2));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
setup() {
|
|
102
|
+
this.server.setRequestHandler(ListToolsRequestSchema, () => ({
|
|
103
|
+
tools: [
|
|
104
|
+
{
|
|
105
|
+
name: "checkpoint_create",
|
|
106
|
+
description: "Snapshot all text files in a project directory (git-independent). Use before risky/experimental changes so you can roll back.",
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: "object",
|
|
109
|
+
properties: {
|
|
110
|
+
dir: { type: "string", description: "Project directory (defaults to CWD)" },
|
|
111
|
+
label: { type: "string", description: "Short label for this checkpoint" },
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "checkpoint_list",
|
|
117
|
+
description: "List checkpoints for a project (newest first).",
|
|
118
|
+
inputSchema: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: { dir: { type: "string", description: "Project directory (defaults to CWD)" } },
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "checkpoint_restore",
|
|
125
|
+
description: "Restore project files to a checkpoint. By default only restores changed/deleted files; pass clean=true to also remove files added since the checkpoint.",
|
|
126
|
+
inputSchema: {
|
|
127
|
+
type: "object",
|
|
128
|
+
properties: {
|
|
129
|
+
id: { type: "string", description: "Checkpoint id" },
|
|
130
|
+
dir: { type: "string", description: "Project directory (defaults to CWD)" },
|
|
131
|
+
clean: { type: "boolean", description: "Delete files created after the checkpoint", default: false },
|
|
132
|
+
},
|
|
133
|
+
required: ["id"],
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "checkpoint_diff",
|
|
138
|
+
description: "Summarize what changed between a checkpoint and current files. Pass detailed=true to get actual unified diffs of modified files.",
|
|
139
|
+
inputSchema: {
|
|
140
|
+
type: "object",
|
|
141
|
+
properties: {
|
|
142
|
+
id: { type: "string", description: "Checkpoint id" },
|
|
143
|
+
dir: { type: "string", description: "Project directory (defaults to CWD)" },
|
|
144
|
+
detailed: { type: "boolean", description: "If true, returns unified diff content of modified files." }
|
|
145
|
+
},
|
|
146
|
+
required: ["id"],
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "checkpoint_delete",
|
|
151
|
+
description: "Delete a checkpoint by id.",
|
|
152
|
+
inputSchema: {
|
|
153
|
+
type: "object",
|
|
154
|
+
properties: {
|
|
155
|
+
id: { type: "string", description: "Checkpoint id" },
|
|
156
|
+
dir: { type: "string", description: "Project directory (defaults to CWD)" },
|
|
157
|
+
},
|
|
158
|
+
required: ["id"],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
}));
|
|
163
|
+
|
|
164
|
+
this.server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
165
|
+
const { name, arguments: args } = req.params;
|
|
166
|
+
try {
|
|
167
|
+
switch (name) {
|
|
168
|
+
case "checkpoint_create": return await this.create(args || {});
|
|
169
|
+
case "checkpoint_list": return await this.list(args || {});
|
|
170
|
+
case "checkpoint_restore": return await this.restore(args || {});
|
|
171
|
+
case "checkpoint_diff": return await this.diff(args || {});
|
|
172
|
+
case "checkpoint_delete": return await this.del(args || {});
|
|
173
|
+
default: throw new Error(`Unknown tool: ${name}`);
|
|
174
|
+
}
|
|
175
|
+
} catch (e) {
|
|
176
|
+
return { content: [{ type: "text", text: `Error: ${e.message}` }], isError: true };
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
async create({ dir, label }) {
|
|
182
|
+
const p = this.paths(dir);
|
|
183
|
+
const files = await walk(p.root);
|
|
184
|
+
const id = cpId();
|
|
185
|
+
const snapDir = path.join(p.snaps, id);
|
|
186
|
+
await fs.mkdir(snapDir, { recursive: true });
|
|
187
|
+
|
|
188
|
+
const records = {};
|
|
189
|
+
let skipped = 0, stored = 0;
|
|
190
|
+
for (const rel of files) {
|
|
191
|
+
const abs = path.join(p.root, rel);
|
|
192
|
+
let stat;
|
|
193
|
+
try { stat = await fs.stat(abs); } catch { continue; }
|
|
194
|
+
if (stat.size > MAX_FILE_BYTES) { skipped++; continue; }
|
|
195
|
+
const buf = await fs.readFile(abs);
|
|
196
|
+
if (buf.includes(0)) { skipped++; continue; } // skip binary
|
|
197
|
+
const h = hashContent(buf);
|
|
198
|
+
const dest = path.join(snapDir, h);
|
|
199
|
+
await fs.writeFile(dest, buf).catch(() => {});
|
|
200
|
+
records[rel] = { hash: h, size: stat.size };
|
|
201
|
+
stored++;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const manifest = await this.loadManifest(p);
|
|
205
|
+
manifest.checkpoints[id] = { id, label: label || "", created: nowIso(), files: records, stored, skipped };
|
|
206
|
+
await this.saveManifest(p, manifest);
|
|
207
|
+
return { content: [{ type: "text", text: `Checkpoint ${id} created for ${p.slug}\nLabel: ${label || "(none)"}\nFiles stored: ${stored}${skipped ? `, skipped(binary/large): ${skipped}` : ""}` }] };
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
async list({ dir }) {
|
|
211
|
+
const p = this.paths(dir);
|
|
212
|
+
const m = await this.loadManifest(p);
|
|
213
|
+
const cps = Object.values(m.checkpoints || {}).sort((a, b) => (a.created < b.created ? 1 : -1));
|
|
214
|
+
if (!cps.length) return { content: [{ type: "text", text: `No checkpoints for ${p.slug} yet.` }] };
|
|
215
|
+
const lines = cps.map((c) => `- ${c.id} ${c.label ? `"${c.label}" ` : ""}(${c.stored} files) — ${c.created}`);
|
|
216
|
+
return { content: [{ type: "text", text: `Checkpoints in ${p.slug} (${cps.length}):\n${lines.join("\n")}` }] };
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
async computeDiff(p, cp) {
|
|
220
|
+
const current = await walk(p.root);
|
|
221
|
+
const currentSet = new Set(current);
|
|
222
|
+
const added = [], modified = [], deleted = [];
|
|
223
|
+
for (const rel of current) {
|
|
224
|
+
if (!cp.files[rel]) { added.push(rel); continue; }
|
|
225
|
+
const abs = path.join(p.root, rel);
|
|
226
|
+
try {
|
|
227
|
+
const buf = await fs.readFile(abs);
|
|
228
|
+
if (hashContent(buf) !== cp.files[rel].hash) modified.push(rel);
|
|
229
|
+
} catch { /* ignore */ }
|
|
230
|
+
}
|
|
231
|
+
for (const rel of Object.keys(cp.files)) {
|
|
232
|
+
if (!currentSet.has(rel)) deleted.push(rel);
|
|
233
|
+
}
|
|
234
|
+
return { added, modified, deleted };
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async diff({ id, dir, detailed = false }) {
|
|
238
|
+
const p = this.paths(dir);
|
|
239
|
+
const m = await this.loadManifest(p);
|
|
240
|
+
const cp = m.checkpoints?.[id];
|
|
241
|
+
if (!cp) throw new Error(`Checkpoint ${id} not found in ${p.slug}`);
|
|
242
|
+
const d = await this.computeDiff(p, cp);
|
|
243
|
+
|
|
244
|
+
let text = `Diff vs ${id} (${cp.created}) in ${p.slug}:\n`;
|
|
245
|
+
const fmt = (arr) => arr.length ? arr.slice(0, 100).map((x) => ` ${x}`).join("\n") : " (none)";
|
|
246
|
+
|
|
247
|
+
text += `Added (${d.added.length}):\n${fmt(d.added)}\n`;
|
|
248
|
+
text += `Deleted (${d.deleted.length}):\n${fmt(d.deleted)}\n`;
|
|
249
|
+
text += `Modified (${d.modified.length}):\n`;
|
|
250
|
+
|
|
251
|
+
if (!detailed) {
|
|
252
|
+
text += fmt(d.modified) + "\n\n(Pass detailed=true for unified diff)";
|
|
253
|
+
} else {
|
|
254
|
+
const snapDir = path.join(p.snaps, id);
|
|
255
|
+
for (let i = 0; i < Math.min(d.modified.length, 20); i++) {
|
|
256
|
+
const rel = d.modified[i];
|
|
257
|
+
const oldPath = path.join(snapDir, cp.files[rel].hash);
|
|
258
|
+
const newPath = path.join(p.root, rel);
|
|
259
|
+
try {
|
|
260
|
+
const diffOut = execSync(`diff -u "${oldPath}" "${newPath}" || true`).toString();
|
|
261
|
+
// Remove the absolute paths from diff header to keep it clean
|
|
262
|
+
const cleanDiff = diffOut.split("\n").map(l => l.replace(oldPath, `[CHECKPOINT]/${rel}`).replace(newPath, `[CURRENT]/${rel}`)).join("\n");
|
|
263
|
+
text += `\n--- ${rel} ---\n${cleanDiff}`;
|
|
264
|
+
} catch (e) {
|
|
265
|
+
text += `\n--- ${rel} ---\n(Binary or failed diff)\n`;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (d.modified.length > 20) text += `\n... and ${d.modified.length - 20} more files.`;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return { content: [{ type: "text", text }] };
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
async restore({ id, dir, clean = false }) {
|
|
275
|
+
const p = this.paths(dir);
|
|
276
|
+
const m = await this.loadManifest(p);
|
|
277
|
+
const cp = m.checkpoints?.[id];
|
|
278
|
+
if (!cp) throw new Error(`Checkpoint ${id} not found in ${p.slug}`);
|
|
279
|
+
const snapDir = path.join(p.snaps, id);
|
|
280
|
+
let restored = 0, removed = 0;
|
|
281
|
+
for (const [rel, rec] of Object.entries(cp.files)) {
|
|
282
|
+
const src = path.join(snapDir, rec.hash);
|
|
283
|
+
const dest = path.join(p.root, rel);
|
|
284
|
+
try {
|
|
285
|
+
const buf = await fs.readFile(src);
|
|
286
|
+
await fs.mkdir(path.dirname(dest), { recursive: true });
|
|
287
|
+
await fs.writeFile(dest, buf);
|
|
288
|
+
restored++;
|
|
289
|
+
} catch { /* ignore */ }
|
|
290
|
+
}
|
|
291
|
+
if (clean) {
|
|
292
|
+
const d = await this.computeDiff(p, cp);
|
|
293
|
+
for (const rel of d.added) {
|
|
294
|
+
await fs.unlink(path.join(p.root, rel)).catch(() => {});
|
|
295
|
+
removed++;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return { content: [{ type: "text", text: `Restored ${restored} files from ${id}${clean ? `, removed ${removed} newer files` : ""} in ${p.slug}` }] };
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
async del({ id, dir }) {
|
|
302
|
+
const p = this.paths(dir);
|
|
303
|
+
const m = await this.loadManifest(p);
|
|
304
|
+
if (!m.checkpoints?.[id]) throw new Error(`Checkpoint ${id} not found in ${p.slug}`);
|
|
305
|
+
await fs.rm(path.join(p.snaps, id), { recursive: true, force: true }).catch(() => {});
|
|
306
|
+
delete m.checkpoints[id];
|
|
307
|
+
await this.saveManifest(p, m);
|
|
308
|
+
return { content: [{ type: "text", text: `Deleted checkpoint ${id} from ${p.slug}` }] };
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
async run() {
|
|
312
|
+
const t = new StdioServerTransport();
|
|
313
|
+
await this.server.connect(t);
|
|
314
|
+
console.error(`Checkpoint MCP server running on stdio (store: ${ROOT})`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
new CheckpointServer().run().catch(console.error);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "context-pack-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Token-efficient project digest builder (tree, stack, key files, symbols)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "server.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "node server.js",
|
|
9
|
+
"test": "node test.mjs"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
13
|
+
}
|
|
14
|
+
}
|