@mneme-ai/mcp 1.1.1 → 1.3.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 (68) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +75 -343
  3. package/dist/index.js.map +1 -1
  4. package/dist/tools/_capabilities.d.ts +14 -0
  5. package/dist/tools/_capabilities.d.ts.map +1 -0
  6. package/dist/tools/_capabilities.js +90 -0
  7. package/dist/tools/_capabilities.js.map +1 -0
  8. package/dist/tools/_lifecycle.d.ts +51 -0
  9. package/dist/tools/_lifecycle.d.ts.map +1 -0
  10. package/dist/tools/_lifecycle.js +124 -0
  11. package/dist/tools/_lifecycle.js.map +1 -0
  12. package/dist/tools/_molecules.d.ts +22 -0
  13. package/dist/tools/_molecules.d.ts.map +1 -0
  14. package/dist/tools/_molecules.js +142 -0
  15. package/dist/tools/_molecules.js.map +1 -0
  16. package/dist/tools/_registry.d.ts +16 -0
  17. package/dist/tools/_registry.d.ts.map +1 -0
  18. package/dist/tools/_registry.js +57 -0
  19. package/dist/tools/_registry.js.map +1 -0
  20. package/dist/tools/_runtime.d.ts +32 -0
  21. package/dist/tools/_runtime.d.ts.map +1 -0
  22. package/dist/tools/_runtime.js +78 -0
  23. package/dist/tools/_runtime.js.map +1 -0
  24. package/dist/tools/_smart_do.d.ts +14 -0
  25. package/dist/tools/_smart_do.d.ts.map +1 -0
  26. package/dist/tools/_smart_do.js +49 -0
  27. package/dist/tools/_smart_do.js.map +1 -0
  28. package/dist/tools/_types.d.ts +118 -0
  29. package/dist/tools/_types.d.ts.map +1 -0
  30. package/dist/tools/_types.js +34 -0
  31. package/dist/tools/_types.js.map +1 -0
  32. package/dist/tools/audit.d.ts +9 -0
  33. package/dist/tools/audit.d.ts.map +1 -0
  34. package/dist/tools/audit.js +233 -0
  35. package/dist/tools/audit.js.map +1 -0
  36. package/dist/tools/forensics.d.ts +7 -0
  37. package/dist/tools/forensics.d.ts.map +1 -0
  38. package/dist/tools/forensics.js +189 -0
  39. package/dist/tools/forensics.js.map +1 -0
  40. package/dist/tools/insights.d.ts +7 -0
  41. package/dist/tools/insights.d.ts.map +1 -0
  42. package/dist/tools/insights.js +40 -0
  43. package/dist/tools/insights.js.map +1 -0
  44. package/dist/tools/lab.d.ts +7 -0
  45. package/dist/tools/lab.d.ts.map +1 -0
  46. package/dist/tools/lab.js +93 -0
  47. package/dist/tools/lab.js.map +1 -0
  48. package/dist/tools/memory.d.ts +10 -0
  49. package/dist/tools/memory.d.ts.map +1 -0
  50. package/dist/tools/memory.js +463 -0
  51. package/dist/tools/memory.js.map +1 -0
  52. package/dist/tools/meta.d.ts +7 -0
  53. package/dist/tools/meta.d.ts.map +1 -0
  54. package/dist/tools/meta.js +20 -0
  55. package/dist/tools/meta.js.map +1 -0
  56. package/dist/tools/people.d.ts +10 -0
  57. package/dist/tools/people.d.ts.map +1 -0
  58. package/dist/tools/people.js +73 -0
  59. package/dist/tools/people.js.map +1 -0
  60. package/dist/tools/quality.d.ts +6 -0
  61. package/dist/tools/quality.d.ts.map +1 -0
  62. package/dist/tools/quality.js +57 -0
  63. package/dist/tools/quality.js.map +1 -0
  64. package/dist/tools/quant.d.ts +7 -0
  65. package/dist/tools/quant.d.ts.map +1 -0
  66. package/dist/tools/quant.js +26 -0
  67. package/dist/tools/quant.js.map +1 -0
  68. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;CACb;AAwGD,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA2MpE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;CACb;AAsDD,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCpE"}
package/dist/index.js CHANGED
@@ -1,17 +1,34 @@
1
- import { existsSync, mkdirSync, readFileSync } from "node:fs";
2
- import { join, dirname } from "node:path";
1
+ /**
2
+ * Mneme MCP Server entrypoint.
3
+ *
4
+ * Architecture (since v1.2.0):
5
+ * tools/_types.ts — MnemeTool + ToolResponse + wisdom envelope
6
+ * tools/_runtime.ts — buildRuntime() + passthroughHandler() + runCliJson()
7
+ * tools/_registry.ts — buildAllTools() merges every category file
8
+ * tools/_capabilities.ts — syllabus tool (the curriculum AI calls first)
9
+ * tools/_smart_do.ts — fallback NL dispatcher
10
+ * tools/<category>.ts — memory · people · audit · forensics · insights ·
11
+ * quality · quant · lab · meta
12
+ *
13
+ * Positioning: Mneme is the TEACHER, AI is the STUDENT. Every tool returns a
14
+ * `{data, wisdom, followUp, confidence}` envelope so AI clients get the data
15
+ * + an interpretive wisdom string + cross-references in one shot. The AI
16
+ * doesn't need to interpret raw JSON; Mneme pre-digests every finding.
17
+ */
18
+ import { readFileSync } from "node:fs";
19
+ import { dirname, join } from "node:path";
3
20
  import { fileURLToPath } from "node:url";
4
21
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
5
22
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
23
  import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
7
- import { git, retrieve, store, htc } from "@mneme-ai/core";
8
- import { resolveEmbedder } from "@mneme-ai/embeddings";
9
- /** Resolve the published package version from package.json — single source of truth.
10
- * Never hardcode versions in source: they drift silently across releases. */
24
+ import { buildRuntime } from "./tools/_runtime.js";
25
+ import { buildAllTools, buildToolMap } from "./tools/_registry.js";
26
+ import { toCallResult, toErrorResult } from "./tools/_types.js";
27
+ import { moleculesContaining } from "./tools/_molecules.js";
28
+ import { recordInvocation } from "./tools/_lifecycle.js";
11
29
  function resolveVersion() {
12
30
  try {
13
31
  const here = dirname(fileURLToPath(import.meta.url));
14
- // dist/index.js → ../package.json (sits beside dist/)
15
32
  const pkg = JSON.parse(readFileSync(join(here, "..", "package.json"), "utf8"));
16
33
  return pkg.version ?? "0.0.0";
17
34
  }
@@ -19,353 +36,68 @@ function resolveVersion() {
19
36
  return "0.0.0";
20
37
  }
21
38
  }
22
- const TOOLS = [
23
- {
24
- name: "mneme_ask",
25
- description: "Ask the codebase memory a question about WHY something exists. Returns the most relevant commits and PRs with citations.",
26
- inputSchema: {
27
- type: "object",
28
- properties: {
29
- question: { type: "string", description: "Natural language question" },
30
- topK: { type: "number", description: "Max results (default 8)" },
31
- },
32
- required: ["question"],
33
- },
34
- },
35
- {
36
- name: "mneme_why",
37
- description: "Explain why a specific file (or line range) exists by combining git blame with related commits.",
38
- inputSchema: {
39
- type: "object",
40
- properties: {
41
- file: { type: "string", description: "Path relative to repo root" },
42
- startLine: { type: "number" },
43
- endLine: { type: "number" },
44
- },
45
- required: ["file"],
46
- },
47
- },
48
- {
49
- name: "mneme_search_commits",
50
- description: "Hybrid (lexical + semantic) search over indexed commits and PRs.",
51
- inputSchema: {
52
- type: "object",
53
- properties: {
54
- query: { type: "string" },
55
- topK: { type: "number" },
56
- },
57
- required: ["query"],
58
- },
59
- },
60
- {
61
- name: "mneme_status",
62
- description: "Report what's indexed, the embedder, and DB stats.",
63
- inputSchema: { type: "object", properties: {} },
64
- },
65
- {
66
- name: "mneme_list_entities",
67
- description: "List indexed source-code entities (functions, classes, types, exported variables) with optional filtering by language/kind/path-prefix.",
68
- inputSchema: {
69
- type: "object",
70
- properties: {
71
- kind: { type: "string", description: "function | class | type | variable | module" },
72
- language: { type: "string", description: "typescript | tsx | javascript | jsx" },
73
- pathPrefix: { type: "string", description: "Only entities under this path" },
74
- limit: { type: "number", description: "Max rows (default 100)" },
75
- },
76
- },
77
- },
78
- {
79
- name: "mneme_find_similar",
80
- description: "Given an entity id (from mneme_list_entities) OR a code snippet, return the top-K most semantically similar entities in the repo.",
81
- inputSchema: {
82
- type: "object",
83
- properties: {
84
- entityId: { type: "string", description: "Existing entity id" },
85
- snippet: { type: "string", description: "Or a code snippet to compare against" },
86
- topK: { type: "number" },
87
- },
88
- },
89
- },
90
- {
91
- name: "mneme_blast",
92
- description: "Predict the blast radius of shipping a commit: which past incidents share its file footprint, plus a base-rate verdict (LOW/MED/HIGH).",
93
- inputSchema: {
94
- type: "object",
95
- properties: {
96
- commit: { type: "string", description: "Commit hash, short hash, or HEAD-relative ref" },
97
- windowHours: { type: "number" },
98
- },
99
- required: ["commit"],
39
+ /** Convert MnemeTool[] to MCP's Tool[] shape (drops handler + triggers, keeps the
40
+ * rich description so AI tool-selection has full WHEN-to-use guidance). */
41
+ function toMcpTools(all) {
42
+ return all.map((t) => ({
43
+ name: t.name,
44
+ description: t.description,
45
+ inputSchema: t.inputSchema,
46
+ }));
47
+ }
48
+ /** Auto-enrich a tool response with Second Brain layer:
49
+ * - compose: which molecules this atom participates in
50
+ * - lifecycle: is this a new combination? should we suggest saving?
51
+ *
52
+ * If the handler already populated `secondBrain`, we MERGE — handler's
53
+ * presentation hint wins, and we add compose/lifecycle if missing. */
54
+ function enrichWithSecondBrain(response, toolName, repoRoot) {
55
+ const compose = moleculesContaining(toolName);
56
+ let lifecycle;
57
+ try {
58
+ lifecycle = recordInvocation(repoRoot, toolName);
59
+ }
60
+ catch {
61
+ // Lifecycle is best-effort — never fail a tool call because of it.
62
+ lifecycle = undefined;
63
+ }
64
+ const existing = response.secondBrain;
65
+ return {
66
+ ...response,
67
+ secondBrain: {
68
+ presentation: existing?.presentation,
69
+ compose: existing?.compose && existing.compose.length > 0 ? existing.compose : compose,
70
+ lifecycle: existing?.lifecycle ?? lifecycle,
100
71
  },
101
- },
102
- ];
72
+ };
73
+ }
103
74
  export async function startMcpServer(opts) {
104
- if (!(await git.isGitRepo(opts.cwd))) {
105
- throw new Error(`Mneme MCP: not in a git repo (${opts.cwd}).`);
106
- }
107
- const meta = await git.getRepoMeta(opts.cwd);
108
- const dbDir = join(meta.rootPath, ".mneme");
109
- if (!existsSync(dbDir))
110
- mkdirSync(dbDir, { recursive: true });
111
- const dbPath = join(dbDir, "mneme.db");
112
- const s = new store.MnemeStore(dbPath);
113
- const embedder = await resolveEmbedder({ provider: "auto" });
75
+ const runtime = await buildRuntime(opts.cwd);
76
+ const allTools = buildAllTools();
77
+ const toolMap = buildToolMap();
114
78
  const server = new Server({ name: "mneme", version: resolveVersion() }, { capabilities: { tools: {} } });
115
- server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
79
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
80
+ tools: toMcpTools(allTools),
81
+ }));
116
82
  server.setRequestHandler(CallToolRequestSchema, async (req) => {
117
- const args = (req.params.arguments ?? {});
118
- // v0.24 HTC: default to compressed responses when Layer-1 abstracts exist.
119
- // Caller opts out with `compress=false` to get raw bodies.
120
- const compressOptOut = args["compress"] === false;
121
- function htcCompressedFor(results) {
122
- if (compressOptOut)
123
- return undefined;
124
- try {
125
- const cached = htc.getAllAbstracts(s);
126
- if (cached.size === 0)
127
- return undefined;
128
- const out = new Map();
129
- for (const r of results) {
130
- const hit = cached.get(r.commit.hash);
131
- if (hit)
132
- out.set(r.commit.hash, hit.abstract);
133
- }
134
- return out.size > 0 ? out : undefined;
135
- }
136
- catch {
137
- return undefined;
138
- }
83
+ const tool = toolMap.get(req.params.name);
84
+ if (!tool) {
85
+ return toErrorResult(`unknown tool: ${req.params.name}. Call mneme.capabilities to list available tools.`);
139
86
  }
140
87
  try {
141
- switch (req.params.name) {
142
- case "mneme_ask": {
143
- const result = await retrieve.ask(String(args["question"] ?? ""), {
144
- store: s,
145
- embedder,
146
- repo: meta,
147
- topK: typeof args["topK"] === "number" ? args["topK"] : 8,
148
- });
149
- return jsonResult(toAskPayload(result, htcCompressedFor(result.searchResults)));
150
- }
151
- case "mneme_search_commits": {
152
- const results = await retrieve.search(String(args["query"] ?? ""), {
153
- store: s,
154
- embedder,
155
- repo: meta,
156
- topK: typeof args["topK"] === "number" ? args["topK"] : 8,
157
- });
158
- const compressed = htcCompressedFor(results);
159
- return jsonResult(results.map((sr) => toSearchPayload(sr, compressed)));
160
- }
161
- case "mneme_why": {
162
- const file = String(args["file"] ?? "");
163
- const sl = typeof args["startLine"] === "number" ? args["startLine"] : undefined;
164
- const el = typeof args["endLine"] === "number" ? args["endLine"] : undefined;
165
- const blamed = await git.blame(meta.rootPath, file, sl, el);
166
- const tally = new Map();
167
- for (const b of blamed)
168
- tally.set(b.commitHash, (tally.get(b.commitHash) ?? 0) + 1);
169
- const top = Array.from(tally.entries())
170
- .sort((a, b) => b[1] - a[1])
171
- .slice(0, 8)
172
- .map(([h, count]) => ({
173
- commit: s.getCommit(h) ?? null,
174
- hash: h,
175
- lineCount: count,
176
- }));
177
- return jsonResult({ file, startLine: sl, endLine: el, originating: top });
178
- }
179
- case "mneme_status": {
180
- return jsonResult({
181
- commits: s.countCommits(),
182
- chunks: s.countChunks(),
183
- embedded: s.countChunksWithEmbedding(),
184
- entities: s.countEntities(),
185
- entitiesEmbedded: s.countEntitiesWithEmbedding(),
186
- synthesizedNotes: s.countSynthesizedNotes(),
187
- embedder: s.getMeta("embedder"),
188
- repoRoot: meta.rootPath,
189
- host: meta.host,
190
- owner: meta.owner,
191
- repo: meta.repo,
192
- });
193
- }
194
- case "mneme_list_entities": {
195
- const where = [];
196
- const params = [];
197
- if (args["kind"]) {
198
- where.push("kind = ?");
199
- params.push(String(args["kind"]));
200
- }
201
- if (args["language"]) {
202
- where.push("language = ?");
203
- params.push(String(args["language"]));
204
- }
205
- if (args["pathPrefix"]) {
206
- where.push("file_path LIKE ?");
207
- params.push(`${String(args["pathPrefix"])}%`);
208
- }
209
- const limit = typeof args["limit"] === "number" ? Math.min(500, args["limit"]) : 100;
210
- const sql = "SELECT id, kind, name, file_path, start_line, end_line, signature, language FROM entities" +
211
- (where.length ? " WHERE " + where.join(" AND ") : "") +
212
- " ORDER BY file_path, start_line LIMIT ?";
213
- const rows = s.db.prepare(sql).all(...params, limit);
214
- return jsonResult({ entities: rows, count: rows.length });
215
- }
216
- case "mneme_find_similar": {
217
- const topK = typeof args["topK"] === "number" ? args["topK"] : 5;
218
- const entityId = args["entityId"] ? String(args["entityId"]) : undefined;
219
- const snippet = args["snippet"] ? String(args["snippet"]) : undefined;
220
- let queryVec = null;
221
- if (entityId) {
222
- // Use the stored embedding directly. node:sqlite returns BLOBs as
223
- // Uint8Array; better-sqlite3 used to return Buffer. Both expose
224
- // the same .buffer / .byteOffset / .byteLength shape, so the
225
- // copy-out works identically.
226
- const row = s.db
227
- .prepare("SELECT embedding FROM entities WHERE id = ?")
228
- .get(entityId);
229
- if (!row?.embedding) {
230
- return errorResult(`No embedding for entity ${entityId}. Run \`mneme entities\` first.`);
231
- }
232
- const blob = row.embedding;
233
- const copy = new Uint8Array(blob.byteLength);
234
- copy.set(blob);
235
- queryVec = new Float32Array(copy.buffer, 0, copy.byteLength / 4);
236
- }
237
- else if (snippet) {
238
- const [v] = await embedder.embed([snippet]);
239
- queryVec = v ?? null;
240
- }
241
- else {
242
- return errorResult("mneme_find_similar requires either entityId or snippet.");
243
- }
244
- if (!queryVec)
245
- return jsonResult({ matches: [] });
246
- const candidates = [];
247
- for (const e of s.iterEmbeddedEntities()) {
248
- if (!e.embedding)
249
- continue;
250
- if (entityId && e.id === entityId)
251
- continue;
252
- if (e.embedding.length !== queryVec.length)
253
- continue;
254
- let dot = 0;
255
- let na = 0;
256
- let nb = 0;
257
- for (let i = 0; i < queryVec.length; i++) {
258
- const av = queryVec[i];
259
- const bv = e.embedding[i];
260
- dot += av * bv;
261
- na += av * av;
262
- nb += bv * bv;
263
- }
264
- const denom = Math.sqrt(na) * Math.sqrt(nb);
265
- const sim = denom === 0 ? 0 : dot / denom;
266
- candidates.push({ entity: { ...e, embedding: undefined }, score: sim });
267
- }
268
- candidates.sort((a, b) => b.score - a.score);
269
- return jsonResult({ matches: candidates.slice(0, topK) });
270
- }
271
- case "mneme_blast": {
272
- const ref = String(args["commit"] ?? "");
273
- if (!ref)
274
- return errorResult("mneme_blast requires `commit`.");
275
- const r = await git.execGit(["rev-parse", ref], { cwd: meta.rootPath });
276
- if (r.code !== 0)
277
- return errorResult(`Cannot resolve commit "${ref}".`);
278
- const hash = r.stdout.trim();
279
- const c = s.getCommit(hash);
280
- if (!c)
281
- return errorResult(`Commit ${hash.slice(0, 8)} not indexed.`);
282
- const incidents = s.db
283
- .prepare("SELECT * FROM incidents")
284
- .all();
285
- const cFiles = new Set(c.files.map((p) => p.replace(/\\/g, "/").toLowerCase()));
286
- const matches = incidents
287
- .map((i) => {
288
- const inc = {
289
- id: String(i.id),
290
- title: String(i.title),
291
- affected: i.affected_files
292
- ? JSON.parse(String(i.affected_files))
293
- : [],
294
- };
295
- const overlap = inc.affected.filter((f) => cFiles.has(f.replace(/\\/g, "/").toLowerCase()));
296
- return overlap.length > 0 ? { incident: inc, overlap } : null;
297
- })
298
- .filter((x) => x !== null);
299
- return jsonResult({ commit: c.shortHash, fileCount: c.files.length, matches });
300
- }
301
- default:
302
- return errorResult(`unknown tool: ${req.params.name}`);
303
- }
88
+ const args = (req.params.arguments ?? {});
89
+ const response = await tool.handler(runtime, args);
90
+ // Second Brain auto-enrich every response with composition hints
91
+ // + lifecycle tracking. The chain reaction starts here.
92
+ const enriched = enrichWithSecondBrain(response, tool.name, runtime.meta.rootPath);
93
+ return toCallResult(enriched);
304
94
  }
305
95
  catch (err) {
306
- return errorResult(err.message);
96
+ return toErrorResult(`${req.params.name} failed: ${err.message}. ` +
97
+ `If this tool requires the index, ask the user to run \`mneme index\`.`);
307
98
  }
308
99
  });
309
100
  const transport = new StdioServerTransport();
310
101
  await server.connect(transport);
311
102
  }
312
- function toAskPayload(r, compressedAbstracts) {
313
- return {
314
- question: r.question,
315
- summary: r.summary,
316
- citations: r.citations,
317
- results: r.searchResults.map((s) => toSearchPayload(s, compressedAbstracts)),
318
- };
319
- }
320
- /**
321
- * v0.24 HTC: when an abstracts map is provided, emit the compressed payload
322
- * (abstract, hash, subject only — drops raw body + full file list). MCP
323
- * clients (Claude Code, Cursor, Codex) consume ~10× fewer tokens.
324
- *
325
- * Caller can opt back into raw with `compress=false` in tool args.
326
- */
327
- function toSearchPayload(s, compressedAbstracts) {
328
- if (compressedAbstracts && compressedAbstracts.has(s.commit.hash)) {
329
- return {
330
- score: s.score,
331
- commit: {
332
- hash: s.commit.hash,
333
- shortHash: s.commit.shortHash,
334
- date: s.commit.authorDate.slice(0, 10),
335
- author: s.commit.authorName,
336
- // Compressed abstract takes the place of subject + body
337
- abstract: compressedAbstracts.get(s.commit.hash),
338
- // Keep prNumber as a lightweight cross-ref
339
- prNumber: s.commit.prNumber,
340
- },
341
- compressed: true,
342
- matchedKinds: Array.from(new Set(s.matchedChunks.map((c) => c.kind))),
343
- };
344
- }
345
- return {
346
- score: s.score,
347
- commit: {
348
- hash: s.commit.hash,
349
- shortHash: s.commit.shortHash,
350
- author: s.commit.authorName,
351
- date: s.commit.authorDate,
352
- subject: s.commit.subject,
353
- body: s.commit.body,
354
- files: s.commit.files,
355
- prNumber: s.commit.prNumber,
356
- },
357
- matchedKinds: Array.from(new Set(s.matchedChunks.map((c) => c.kind))),
358
- };
359
- }
360
- function jsonResult(value) {
361
- return {
362
- content: [{ type: "text", text: JSON.stringify(value, null, 2) }],
363
- };
364
- }
365
- function errorResult(message) {
366
- return {
367
- isError: true,
368
- content: [{ type: "text", text: message }],
369
- };
370
- }
371
103
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,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C,SAAS,IAAI,EAAE,CAA4B,CAAC;YACrE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACnD,mEAAmE;YACnE,wDAAwD;YACxD,MAAM,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACnF,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,aAAa,CAClB,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,YAAa,GAAa,CAAC,OAAO,IAAI;gBACtD,uEAAuE,CAC1E,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * mneme.capabilities — the SYLLABUS tool.
3
+ *
4
+ * AI students should call this FIRST when they connect to Mneme. It returns
5
+ * a categorized index of every tool with WHEN-to-use guidance, so the AI
6
+ * builds a mental model of the catalog before picking individual tools.
7
+ *
8
+ * This tool embodies the Mneme positioning: "Mneme is the teacher. AI is the
9
+ * student." A good teacher hands the student a syllabus on day one — not a
10
+ * pile of unrelated lessons.
11
+ */
12
+ import type { MnemeTool } from "./_types.js";
13
+ export declare const capabilitiesTool: MnemeTool;
14
+ //# sourceMappingURL=_capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_capabilities.d.ts","sourceRoot":"","sources":["../../src/tools/_capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,aAAa,CAAC;AAqB3D,eAAO,MAAM,gBAAgB,EAAE,SA0E9B,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * mneme.capabilities — the SYLLABUS tool.
3
+ *
4
+ * AI students should call this FIRST when they connect to Mneme. It returns
5
+ * a categorized index of every tool with WHEN-to-use guidance, so the AI
6
+ * builds a mental model of the catalog before picking individual tools.
7
+ *
8
+ * This tool embodies the Mneme positioning: "Mneme is the teacher. AI is the
9
+ * student." A good teacher hands the student a syllabus on day one — not a
10
+ * pile of unrelated lessons.
11
+ */
12
+ import { groupByCategory } from "./_registry.js";
13
+ const CATEGORY_DESCRIPTIONS = {
14
+ memory: "Q&A, semantic search, citations. Pick from here when the user asks WHY code exists, when something was added, or wants to find related commits.",
15
+ people: "Contributors, knowledge atrophy, telepathic teammates, cultural alphas, semantic ownership. Pick from here when the user asks about PEOPLE.",
16
+ audit: "AI Session Audit — trust certificate for every AI commit. Vendor-neutral. Pick from here when the user asks 'is this AI commit safe?'.",
17
+ forensics: "Security: vuln-hunt, anomaly detection, authorship attribution. Pick from here when the user asks about security or suspicious commits.",
18
+ insights: "Storytelling, regret-mining, prediction. Pick from here for 'tell me the story', 'what should we worry about', 'what could break'.",
19
+ quality: "Code/repo health, palimpsest causal chains, twin rewriting, cognitive fingerprints. Pick from here for quality + voice + history.",
20
+ quant: "Wall-Street-inspired metrics: drawdown, alpha, Greeks, moneyball, black-swan. Pick when user wants quantitative analysis of engineering data.",
21
+ lab: "Periodic Table + Second Brain + Wisdom Mutant. Compose new workflows, save recipes, recalibrate. Pick when user wants to build/run custom plans.",
22
+ meta: "Doctor, manifesto, wisdom, advanced help — informational only.",
23
+ };
24
+ export const capabilitiesTool = {
25
+ name: "mneme.capabilities",
26
+ category: "meta",
27
+ description: "Return Mneme's full tool catalog organized by category, with WHEN-to-use guidance for each. " +
28
+ "**AI clients should call this FIRST when they connect** — it's the syllabus that teaches you what kind of question " +
29
+ "goes to which group of tools. Mneme is the teacher; this tool hands you the curriculum.",
30
+ triggers: [
31
+ "what can mneme do?",
32
+ "list mneme tools",
33
+ "mneme capabilities",
34
+ ],
35
+ inputSchema: {
36
+ type: "object",
37
+ properties: {
38
+ category: {
39
+ type: "string",
40
+ description: "Optional: filter to one category (memory | people | audit | forensics | insights | quality | quant | lab | meta).",
41
+ },
42
+ },
43
+ },
44
+ handler: async (_rt, args) => {
45
+ const grouped = groupByCategory();
46
+ const filter = args["category"] ? String(args["category"]) : undefined;
47
+ const data = {};
48
+ for (const [category, tools] of grouped) {
49
+ if (filter && filter !== category)
50
+ continue;
51
+ data[category] = {
52
+ purpose: CATEGORY_DESCRIPTIONS[category],
53
+ tools: tools.map((t) => ({
54
+ name: t.name,
55
+ description: t.description,
56
+ triggers: t.triggers,
57
+ })),
58
+ };
59
+ }
60
+ const total = Object.values(data).reduce((s, c) => s + (c.tools?.length ?? 0), 0);
61
+ return {
62
+ data: {
63
+ positioning: "Mneme is the NUCLEAR CORE you bolt into your AI coding tool — Claude Code / Cursor / Codex / Gemini / " +
64
+ "Continue / Aider — to trigger a chain reaction of wisdom about the user's repo. Mneme is the teacher of " +
65
+ "AI in the domain of git / source control specifically.",
66
+ totalTools: total,
67
+ catalog: data,
68
+ secondBrainContract: "Every tool response carries a `secondBrain` field with: (1) `presentation` — how to render the result for " +
69
+ "the user; (2) `compose` — list of MOLECULES this atom participates in (firing the chain reaction); " +
70
+ "(3) `lifecycle` — tracking new combinations + auto-promotion to compounds. As the AI student, read these " +
71
+ "fields on EVERY response and let them shape your next move.",
72
+ chainReaction: "When you call an atom, check secondBrain.compose for natural molecules. If a molecule fits the user's " +
73
+ "intent, fire its other atoms in parallel and synthesize the combined output. If lifecycle.suggestSaveAs " +
74
+ "is non-null, ask the user whether to save the combination as a permanent compound.",
75
+ },
76
+ wisdom: `Mneme exposes ${total} tools across 9 categories. As you receive user queries: (1) match intent to a ` +
77
+ `specific tool (preferred), or call mneme.smart_do for ambiguous cases. (2) Read secondBrain.compose on ` +
78
+ `every response and fire molecule combinations when they fit. (3) Quote the wisdom field directly to the ` +
79
+ `user; cite data fields when they want details.`,
80
+ followUp: ["mneme.memory.status"],
81
+ confidence: { level: "high" },
82
+ secondBrain: {
83
+ presentation: "If the user asks 'what can mneme do?' — render the catalog as 9 sections (one per category), each listing " +
84
+ "3-5 example tool names with their one-line use case. Don't dump the whole JSON. Mention that every " +
85
+ "response carries a secondBrain layer that triggers compositional chain reactions.",
86
+ },
87
+ };
88
+ },
89
+ };
90
+ //# sourceMappingURL=_capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_capabilities.js","sourceRoot":"","sources":["../../src/tools/_capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,MAAM,qBAAqB,GAAiC;IAC1D,MAAM,EACJ,iJAAiJ;IACnJ,MAAM,EACJ,6IAA6I;IAC/I,KAAK,EACH,wIAAwI;IAC1I,SAAS,EACP,yIAAyI;IAC3I,QAAQ,EACN,oIAAoI;IACtI,OAAO,EACL,mIAAmI;IACrI,KAAK,EACH,+IAA+I;IACjJ,GAAG,EAAE,kJAAkJ;IACvJ,IAAI,EAAE,gEAAgE;CACvE,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAc;IACzC,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,MAAM;IAChB,WAAW,EACT,8FAA8F;QAC9F,qHAAqH;QACrH,yFAAyF;IAC3F,QAAQ,EAAE;QACR,oBAAoB;QACpB,kBAAkB;QAClB,oBAAoB;KACrB;IACD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,mHAAmH;aACtH;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,MAAM,OAAO,GAAG,eAAe,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MA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