@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.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +75 -343
- package/dist/index.js.map +1 -1
- package/dist/tools/_capabilities.d.ts +14 -0
- package/dist/tools/_capabilities.d.ts.map +1 -0
- package/dist/tools/_capabilities.js +90 -0
- package/dist/tools/_capabilities.js.map +1 -0
- package/dist/tools/_lifecycle.d.ts +51 -0
- package/dist/tools/_lifecycle.d.ts.map +1 -0
- package/dist/tools/_lifecycle.js +124 -0
- package/dist/tools/_lifecycle.js.map +1 -0
- package/dist/tools/_molecules.d.ts +22 -0
- package/dist/tools/_molecules.d.ts.map +1 -0
- package/dist/tools/_molecules.js +142 -0
- package/dist/tools/_molecules.js.map +1 -0
- package/dist/tools/_registry.d.ts +16 -0
- package/dist/tools/_registry.d.ts.map +1 -0
- package/dist/tools/_registry.js +57 -0
- package/dist/tools/_registry.js.map +1 -0
- package/dist/tools/_runtime.d.ts +32 -0
- package/dist/tools/_runtime.d.ts.map +1 -0
- package/dist/tools/_runtime.js +78 -0
- package/dist/tools/_runtime.js.map +1 -0
- package/dist/tools/_smart_do.d.ts +14 -0
- package/dist/tools/_smart_do.d.ts.map +1 -0
- package/dist/tools/_smart_do.js +49 -0
- package/dist/tools/_smart_do.js.map +1 -0
- package/dist/tools/_types.d.ts +118 -0
- package/dist/tools/_types.d.ts.map +1 -0
- package/dist/tools/_types.js +34 -0
- package/dist/tools/_types.js.map +1 -0
- package/dist/tools/audit.d.ts +9 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +233 -0
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/forensics.d.ts +7 -0
- package/dist/tools/forensics.d.ts.map +1 -0
- package/dist/tools/forensics.js +189 -0
- package/dist/tools/forensics.js.map +1 -0
- package/dist/tools/insights.d.ts +7 -0
- package/dist/tools/insights.d.ts.map +1 -0
- package/dist/tools/insights.js +40 -0
- package/dist/tools/insights.js.map +1 -0
- package/dist/tools/lab.d.ts +7 -0
- package/dist/tools/lab.d.ts.map +1 -0
- package/dist/tools/lab.js +93 -0
- package/dist/tools/lab.js.map +1 -0
- package/dist/tools/memory.d.ts +10 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +463 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/meta.d.ts +7 -0
- package/dist/tools/meta.d.ts.map +1 -0
- package/dist/tools/meta.js +20 -0
- package/dist/tools/meta.js.map +1 -0
- package/dist/tools/people.d.ts +10 -0
- package/dist/tools/people.d.ts.map +1 -0
- package/dist/tools/people.js +73 -0
- package/dist/tools/people.js.map +1 -0
- package/dist/tools/quality.d.ts +6 -0
- package/dist/tools/quality.d.ts.map +1 -0
- package/dist/tools/quality.js +57 -0
- package/dist/tools/quality.js.map +1 -0
- package/dist/tools/quant.d.ts +7 -0
- package/dist/tools/quant.d.ts.map +1 -0
- package/dist/tools/quant.js +26 -0
- package/dist/tools/quant.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insights.d.ts","sourceRoot":"","sources":["../../src/tools/insights.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoB7C,eAAO,MAAM,aAAa,EAAE,SAAS,EAkNpC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Insights — applied storytelling, regret-mining, and prediction over git history.
|
|
3
|
+
* 24 tools that surface narrative, friction, and risk patterns the user can act on.
|
|
4
|
+
*/
|
|
5
|
+
import { passthroughHandler } from "./_runtime.js";
|
|
6
|
+
const passthrough = (name, description, triggers, cli, argMap = () => [], inputSchema = { type: "object", properties: {} }, followUp = [], wisdom = () => "Result returned — summarize key fields for the user.") => ({
|
|
7
|
+
name,
|
|
8
|
+
category: "insights",
|
|
9
|
+
description,
|
|
10
|
+
triggers,
|
|
11
|
+
inputSchema,
|
|
12
|
+
handler: passthroughHandler(cli, argMap, { wisdom, followUp, confidence: "medium" }),
|
|
13
|
+
});
|
|
14
|
+
export const insightsTools = [
|
|
15
|
+
passthrough("mneme.insights.ghost", "Half-finished features and stale TODOs haunting the repo — files born and forgotten. Use WHEN user asks: 'what is haunting my repo?', 'ghost code', 'half-finished features'.", ["ghost code", "half-finished features", "stale TODOs"], "ghost", (a) => (a["topN"] ? ["--top", String(a["topN"])] : []), { type: "object", properties: { topN: { type: "number" } } }, ["mneme.insights.runaway", "mneme.insights.fossil"], (d) => `Found ${d?.ghosts?.length ?? 0} ghost files. Each is born + forgotten — review for deletion.`),
|
|
16
|
+
passthrough("mneme.insights.regret", "Commits that were shipped and immediately fixed/reverted — instant-regret detector. Use WHEN user asks: 'what did we ship and regret?', 'recent reverts/hotfixes'.", ["shipped and regretted", "recent reverts"], "regret", (a) => (a["windowDays"] ? ["--window-days", String(a["windowDays"])] : []), { type: "object", properties: { windowDays: { type: "number" } } }, ["mneme.insights.premortem", "mneme.audit.conscience"], (d) => `${d?.regrets?.length ?? 0} regrets found. Use to identify recurring failure patterns.`),
|
|
17
|
+
passthrough("mneme.insights.paradox", "Architectural flip-flops — A→B→A decisions over time. Use WHEN user asks: 'have we changed our minds repeatedly?', 'architectural paradoxes'.", ["architectural flip-flops", "decisions reversed"], "paradox", () => [], { type: "object", properties: {} }, ["mneme.insights.decisions"]),
|
|
18
|
+
passthrough("mneme.insights.oracle", "Predict next-window co-edits + author collisions on the same file. Use WHEN user asks: 'who will edit X next?', 'predict collisions'.", ["predict next edits", "author collisions"], "oracle", () => [], { type: "object", properties: {} }),
|
|
19
|
+
passthrough("mneme.insights.premortem", "Predict regret risk for a proposed change, grounded in similar past attempts. Use WHEN user asks: 'will this be regretted?', 'risk of doing X', 'pre-mortem'.", ["pre-mortem of this change", "predict regret"], "premortem", (a) => (a["intent"] ? [String(a["intent"])] : []), { type: "object", properties: { intent: { type: "string", description: "Proposed change in plain English" } }, required: ["intent"] }, ["mneme.audit.conscience", "mneme.memory.blast"], (d) => `Pre-mortem verdict in data.risk. Top historical analogues in data.precedents.`),
|
|
20
|
+
passthrough("mneme.insights.time_machine", "Tell a file's life as eras: birth → rewrite → firefight → plateau → evolution. Use WHEN user asks: 'tell me the story of this file', 'evolution of src/auth.ts'.", ["story of this file", "file evolution"], "time-machine", (a) => [String(a["file"])], { type: "object", properties: { file: { type: "string" } }, required: ["file"] }, ["mneme.insights.story", "mneme.people.lineage"]),
|
|
21
|
+
passthrough("mneme.insights.story", "Narrate the evolution of a topic across acts (with optional LLM polish). Use WHEN user asks: 'how did X evolve?', 'history of payments'.", ["how did X evolve", "story of feature"], "story", (a) => [String(a["topic"])], { type: "object", properties: { topic: { type: "string" } }, required: ["topic"] }, ["mneme.insights.chronicle"]),
|
|
22
|
+
passthrough("mneme.insights.decisions", "Auto-extract architectural decisions (ADRs) from commit history. Use WHEN user asks: 'list our ADRs', 'architectural decisions'.", ["ADR list", "architectural decisions"], "decisions", () => [], { type: "object", properties: {} }, ["mneme.insights.story", "mneme.insights.paradox"]),
|
|
23
|
+
passthrough("mneme.insights.mirror", "Onboarding dossier on a topic: 5 PRs, 3 people, 2 incidents. Use WHEN user asks: 'onboard me on payments', 'mirror for new hire on X'.", ["onboarding on payments", "mirror dossier"], "mirror", (a) => [String(a["topic"])], { type: "object", properties: { topic: { type: "string" } }, required: ["topic"] }, ["mneme.people.who_knows", "mneme.insights.story"]),
|
|
24
|
+
passthrough("mneme.insights.rumor", "Tribal phrases mentioned in commits/PRs but never documented. Use WHEN user asks: 'what slang does our team use?', 'undocumented terms'.", ["tribal slang", "undocumented terms"], "rumor", () => [], { type: "object", properties: {} }),
|
|
25
|
+
passthrough("mneme.insights.fossil", "Files deleted from HEAD but still alive in git history. Use WHEN user asks: 'show deleted files', 'ghost code from history'.", ["deleted files in history", "fossils"], "fossil", () => [], { type: "object", properties: {} }, ["mneme.insights.ghost"]),
|
|
26
|
+
passthrough("mneme.insights.runaway", "Files growing silently across many commits — leak indicator. Use WHEN user asks: 'files growing silently', 'scope creep'.", ["files growing silently", "scope creep"], "runaway", () => [], { type: "object", properties: {} }, ["mneme.insights.ghost"]),
|
|
27
|
+
passthrough("mneme.insights.drift", "Topical drift — features → refactors → firefights → polish over time. Use WHEN user asks: 'what's our work pattern?', 'topical drift'.", ["topical drift", "work pattern over time"], "drift", () => [], { type: "object", properties: {} }),
|
|
28
|
+
passthrough("mneme.insights.chronicle", "Auto-generate a chaptered narrative documentary of the whole repo. Use WHEN user asks: 'documentary of our repo', 'chronicle'.", ["documentary of repo", "chronicle"], "chronicle", () => [], { type: "object", properties: {} }, ["mneme.insights.story"]),
|
|
29
|
+
passthrough("mneme.insights.constellation", "Graph view: files as stars, authors as orbitals, commits as edges. Use WHEN user asks: 'visualize our repo', 'star map'.", ["constellation view", "visual repo map"], "constellation", () => [], { type: "object", properties: {} }),
|
|
30
|
+
passthrough("mneme.insights.cluster", "Find topic islands — semantic clustering of commit messages. Use WHEN user asks: 'group commits by topic', 'topic clusters'.", ["topic clusters", "group commits"], "cluster", () => [], { type: "object", properties: {} }),
|
|
31
|
+
passthrough("mneme.insights.network", "Author network — who collaborates with whom (co-edit + co-time + co-topic). Use WHEN user asks: 'collaboration graph', 'who works with whom'.", ["collaboration graph", "author network"], "network", () => [], { type: "object", properties: {} }, ["mneme.people.telepathy", "mneme.people.nemesis"]),
|
|
32
|
+
passthrough("mneme.insights.manage", "Engineering management dashboard — health, succession, skill matrix, trajectory. Use WHEN user asks: 'manager dashboard', 'team health for VP'.", ["manager dashboard", "team health summary"], "manage", () => [], { type: "object", properties: {} }, ["mneme.people.nervous_system"]),
|
|
33
|
+
passthrough("mneme.insights.export_bundle", "One bundle: DNA + drift + chronicle + oracle + constellation + clusters + network + manage + ghost. Use WHEN user asks: 'export everything', 'full repo bundle'.", ["export full bundle", "everything in one file"], "export-bundle", () => [], { type: "object", properties: {} }),
|
|
34
|
+
passthrough("mneme.insights.dream", "Speculative ideas grounded in the codebase's own patterns. Use WHEN user asks: 'what should we build next?', 'speculative ideas'.", ["speculative ideas", "what should we build next"], "dream", () => [], { type: "object", properties: {} }),
|
|
35
|
+
passthrough("mneme.insights.echo", "Find past incidents resembling the current one. Use WHEN user asks: 'has this happened before?', 'similar past incidents'.", ["has this happened before", "similar past incidents"], "echo", (a) => (a["query"] ? ["--query", String(a["query"])] : []), { type: "object", properties: { query: { type: "string" } } }),
|
|
36
|
+
passthrough("mneme.insights.stack_trace", "Paste a stack trace, get historical context per frame. Use WHEN user asks: 'explain this stack trace', 'historical context for error'.", ["explain stack trace", "historical context per frame"], "stack-trace", () => [], { type: "object", properties: { from: { type: "string", description: "Path to error log" } } }),
|
|
37
|
+
passthrough("mneme.insights.commit_coach", "Pre-commit AI partner — message, reviewers, scope, past warnings. Use WHEN user asks: 'review my staged commit', 'commit coach'.", ["pre-commit review", "commit coach"], "commit-coach", () => [], { type: "object", properties: {} }),
|
|
38
|
+
passthrough("mneme.insights.crystal_ball", "Predict CI / follow-up failure probability before pushing. Use WHEN user asks: 'will CI fail?', 'crystal ball'.", ["will CI fail?", "predict push outcome"], "crystal-ball", () => [], { type: "object", properties: {} }, ["mneme.audit.certify"]),
|
|
39
|
+
];
|
|
40
|
+
//# sourceMappingURL=insights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insights.js","sourceRoot":"","sources":["../../src/tools/insights.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,MAAM,WAAW,GAAG,CAClB,IAAY,EACZ,WAAmB,EACnB,QAAkB,EAClB,GAAW,EACX,SAAmD,GAAG,EAAE,CAAC,EAAE,EAC3D,cAAwC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,EAC1E,WAAqB,EAAE,EACvB,SAAiC,GAAG,EAA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,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC9D;IACD,WAAW,CACT,4BAA4B,EAC5B,wIAAwI,EACxI,CAAC,qBAAqB,EAAE,8BAA8B,CAAC,EACvD,aAAa,EACb,GAAG,EAAE,CAAC,EAAE,EACR,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE,EAAE,EAAE,CAC/F;IACD,WAAW,CACT,6BAA6B,EAC7B,kIAAkI,EAClI,CAAC,mBAAmB,EAAE,cAAc,CAAC,EACrC,cAAc,EACd,GAAG,EAAE,CAAC,EAAE,EACR,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,CACnC;IACD,WAAW,CACT,6BAA6B,EAC7B,iHAAiH,EACjH,CAAC,eAAe,EAAE,sBAAsB,CAAC,EACzC,cAAc,EACd,GAAG,EAAE,CAAC,EAAE,EACR,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,EAClC,CAAC,qBAAqB,CAAC,CACxB;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lab.d.ts","sourceRoot":"","sources":["../../src/tools/lab.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoB7C,eAAO,MAAM,QAAQ,EAAE,SAAS,EAuH/B,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lab — the Periodic Table + Second Brain + Wisdom Mutant engine.
|
|
3
|
+
* Compose, library, run, calibrate, adapt, feedback.
|
|
4
|
+
*/
|
|
5
|
+
import { passthroughHandler } from "./_runtime.js";
|
|
6
|
+
const lab = (name, description, triggers, cli, argMap = () => [], inputSchema = { type: "object", properties: {} }, followUp = [], wisdom = () => "Result returned — summarize key fields for the user.") => ({
|
|
7
|
+
name,
|
|
8
|
+
category: "lab",
|
|
9
|
+
description,
|
|
10
|
+
triggers,
|
|
11
|
+
inputSchema,
|
|
12
|
+
handler: passthroughHandler(cli, argMap, { wisdom, followUp, confidence: "medium" }),
|
|
13
|
+
});
|
|
14
|
+
export const labTools = [
|
|
15
|
+
lab("mneme.lab.periodic_table", "Browse Mneme's compositional layers — elements (primitives), atoms (parameterized), molecules (commands), compounds. Use WHEN user asks: 'what primitives does Mneme have?', 'show the periodic table', 'compose new tools'.", ["show periodic table", "what primitives are available"], "periodic-table", (a) => {
|
|
16
|
+
const out = [];
|
|
17
|
+
if (a["id"])
|
|
18
|
+
out.push(String(a["id"]));
|
|
19
|
+
if (a["kind"])
|
|
20
|
+
out.push("--kind", String(a["kind"]));
|
|
21
|
+
if (a["tag"])
|
|
22
|
+
out.push("--tag", String(a["tag"]));
|
|
23
|
+
return out;
|
|
24
|
+
}, {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
id: { type: "string", description: "Optional primitive id to focus" },
|
|
28
|
+
kind: { type: "string", description: "element | atom | molecule | compound" },
|
|
29
|
+
tag: { type: "string" },
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
lab("mneme.lab.compose", "Translate natural-language intent into a runnable molecule plan from the periodic table. Use WHEN user asks: 'compose a workflow for X', 'plan steps to do Y'.", ["compose a workflow", "plan steps for goal"], "compose", (a) => {
|
|
33
|
+
const out = [String(a["intent"] ?? "")];
|
|
34
|
+
if (a["execute"])
|
|
35
|
+
out.push("--execute");
|
|
36
|
+
return out;
|
|
37
|
+
}, {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {
|
|
40
|
+
intent: { type: "string", description: "Natural-language goal" },
|
|
41
|
+
execute: { type: "boolean", description: "Run the plan after composing" },
|
|
42
|
+
},
|
|
43
|
+
required: ["intent"],
|
|
44
|
+
}, ["mneme.lab.run", "mneme.lab.library"]),
|
|
45
|
+
lab("mneme.lab.run", "Run a saved molecule plan by alias or id. Use WHEN user asks: 'run X recipe', 'execute saved plan'.", ["run saved recipe", "execute molecule plan"], "run", (a) => {
|
|
46
|
+
const out = [String(a["needle"] ?? "")];
|
|
47
|
+
if (a["execute"])
|
|
48
|
+
out.push("--execute");
|
|
49
|
+
return out;
|
|
50
|
+
}, {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
needle: { type: "string", description: "Alias or id of the recipe" },
|
|
54
|
+
execute: { type: "boolean", description: "Actually run (default dry-run)" },
|
|
55
|
+
},
|
|
56
|
+
required: ["needle"],
|
|
57
|
+
}),
|
|
58
|
+
lab("mneme.lab.library", "List/manage saved molecule recipes. Use WHEN user asks: 'show saved recipes', 'promote a recipe', 'forget recipe'.", ["show saved recipes", "library of plans"], "library", (a) => {
|
|
59
|
+
const out = [];
|
|
60
|
+
if (a["promote"])
|
|
61
|
+
out.push("--promote", String(a["promote"]));
|
|
62
|
+
if (a["alias"])
|
|
63
|
+
out.push("--alias", String(a["alias"]));
|
|
64
|
+
if (a["eligible"])
|
|
65
|
+
out.push("--eligible");
|
|
66
|
+
if (a["archived"])
|
|
67
|
+
out.push("--archived");
|
|
68
|
+
if (a["forget"])
|
|
69
|
+
out.push("--forget", String(a["forget"]));
|
|
70
|
+
return out;
|
|
71
|
+
}, {
|
|
72
|
+
type: "object",
|
|
73
|
+
properties: {
|
|
74
|
+
promote: { type: "string" },
|
|
75
|
+
alias: { type: "string" },
|
|
76
|
+
eligible: { type: "boolean" },
|
|
77
|
+
archived: { type: "boolean" },
|
|
78
|
+
forget: { type: "string" },
|
|
79
|
+
},
|
|
80
|
+
}),
|
|
81
|
+
lab("mneme.lab.adapt", "Mneme inspects this repo and recommends 1-3 next commands. Use WHEN user asks: 'what should I run next?', 'recommend commands for me'.", ["what should I run next", "recommend commands"], "adapt"),
|
|
82
|
+
lab("mneme.lab.feedback", "Tell Mneme an answer was helpful (up) or wrong (down) — feeds the Wisdom Mutant calibrator. Use WHEN user gives feedback on a previous answer.", ["this answer was good/bad", "feedback on previous result"], "feedback", (a) => [String(a["id"] ?? ""), String(a["vote"] ?? "")], {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
id: { type: "string", description: "Answer id from a previous call" },
|
|
86
|
+
vote: { type: "string", description: "up | down" },
|
|
87
|
+
},
|
|
88
|
+
required: ["id", "vote"],
|
|
89
|
+
}),
|
|
90
|
+
lab("mneme.lab.calibrate", "Re-tune search knobs against accumulated feedback. Use WHEN user asks: 'recalibrate Mneme', 're-tune search'.", ["recalibrate Mneme", "retune"], "calibrate"),
|
|
91
|
+
lab("mneme.lab.htc_stats", "Coverage + compression ratio of HTC (hierarchical compressed memory) — how much of the repo is summarised. Use WHEN user asks: 'HTC coverage', 'compression stats'.", ["HTC coverage", "compression stats"], "htc-stats"),
|
|
92
|
+
];
|
|
93
|
+
//# sourceMappingURL=lab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lab.js","sourceRoot":"","sources":["../../src/tools/lab.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,MAAM,GAAG,GAAG,CACV,IAAY,EACZ,WAAmB,EACnB,QAAkB,EAClB,GAAW,EACX,SAAmD,GAAG,EAAE,CAAC,EAAE,EAC3D,cAAwC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,EAC1E,WAAqB,EAAE,EACvB,SAAiC,GAAG,EAAE,CAAC,sDAAsD,EAClF,EAAE,CAAC,CAAC;IACf,IAAI;IACJ,QAAQ,EAAE,KAAK;IACf,WAAW;IACX,QAAQ;IACR,WAAW;IACX,OAAO,EAAE,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;CACrF,CAAC,CAAC;AAEH,MAAM,CAAC,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,EAAE;SACnD;QACD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;KACzB,CACF;IACD,GAAG,CACD,qBAAqB,EACrB,+GAA+G,EAC/G,CAAC,mBAAmB,EAAE,QAAQ,CAAC,EAC/B,WAAW,CACZ;IACD,GAAG,CACD,qBAAqB,EACrB,qKAAqK,EACrK,CAAC,cAAc,EAAE,mBAAmB,CAAC,EACrC,WAAW,CACZ;CACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory tools — Q&A, semantic search, citations, blast-radius.
|
|
3
|
+
*
|
|
4
|
+
* These are the "ask the codebase a question" verbs. The AI student should
|
|
5
|
+
* pick from this category whenever the user wants to know WHY code exists,
|
|
6
|
+
* what changed, or what a commit might affect.
|
|
7
|
+
*/
|
|
8
|
+
import type { MnemeTool } from "./_types.js";
|
|
9
|
+
export declare const memoryTools: MnemeTool[];
|
|
10
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/tools/memory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,WAAW,EAAE,SAAS,EA0ZlC,CAAC"}
|