lemma-mcp 0.7.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 +474 -0
- package/README.tr.md +384 -0
- package/dist/guides/core.d.ts +33 -0
- package/dist/guides/core.d.ts.map +1 -0
- package/dist/guides/core.js +424 -0
- package/dist/guides/core.js.map +1 -0
- package/dist/guides/index.d.ts +2 -0
- package/dist/guides/index.d.ts.map +1 -0
- package/dist/guides/index.js +2 -0
- package/dist/guides/index.js.map +1 -0
- package/dist/guides/task-map.d.ts +3 -0
- package/dist/guides/task-map.d.ts.map +1 -0
- package/dist/guides/task-map.js +107 -0
- package/dist/guides/task-map.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/config.d.ts +6 -0
- package/dist/memory/config.d.ts.map +1 -0
- package/dist/memory/config.js +69 -0
- package/dist/memory/config.js.map +1 -0
- package/dist/memory/core.d.ts +27 -0
- package/dist/memory/core.d.ts.map +1 -0
- package/dist/memory/core.js +415 -0
- package/dist/memory/core.js.map +1 -0
- package/dist/memory/index.d.ts +2 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +2 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/server/handlers.d.ts +131 -0
- package/dist/server/handlers.d.ts.map +1 -0
- package/dist/server/handlers.js +694 -0
- package/dist/server/handlers.js.map +1 -0
- package/dist/server/hooks.d.ts +16 -0
- package/dist/server/hooks.d.ts.map +1 -0
- package/dist/server/hooks.js +77 -0
- package/dist/server/hooks.js.map +1 -0
- package/dist/server/index.d.ts +5 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +322 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/system-prompt.d.ts +5 -0
- package/dist/server/system-prompt.d.ts.map +1 -0
- package/dist/server/system-prompt.js +143 -0
- package/dist/server/system-prompt.js.map +1 -0
- package/dist/server/tools.d.ts +22 -0
- package/dist/server/tools.d.ts.map +1 -0
- package/dist/server/tools.js +443 -0
- package/dist/server/tools.js.map +1 -0
- package/dist/sessions/core.d.ts +17 -0
- package/dist/sessions/core.d.ts.map +1 -0
- package/dist/sessions/core.js +162 -0
- package/dist/sessions/core.js.map +1 -0
- package/dist/sessions/index.d.ts +2 -0
- package/dist/sessions/index.d.ts.map +1 -0
- package/dist/sessions/index.js +2 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/sessions/virtual.d.ts +23 -0
- package/dist/sessions/virtual.d.ts.map +1 -0
- package/dist/sessions/virtual.js +157 -0
- package/dist/sessions/virtual.js.map +1 -0
- package/dist/types.d.ts +143 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import * as core from "../memory/index.js";
|
|
2
|
+
import { applyPromptModifiers } from "./hooks.js";
|
|
3
|
+
const BASE_SYSTEM_PROMPT = `<system_prompt>
|
|
4
|
+
<identity>
|
|
5
|
+
# Lemma — Persistent Memory for LLMs
|
|
6
|
+
</identity>
|
|
7
|
+
|
|
8
|
+
<critical_rules>
|
|
9
|
+
## MANDATORY BEHAVIOR — NO EXCEPTIONS
|
|
10
|
+
|
|
11
|
+
1. **ALWAYS call \`memory_read\` FIRST** before reading files, searching code, or answering questions about a project. Your memory may already contain the answer.
|
|
12
|
+
2. **ALWAYS call \`memory_add\`** after learning something new about the project, solving a bug, discovering a pattern, or making a decision. If you skip this, the knowledge is lost forever — you will NOT remember it next session.
|
|
13
|
+
3. **NEVER say "I'll remember this next time"** — you won't. The ONLY way to persist knowledge is through \`memory_add\` or \`guide_practice\`. Execute the tool immediately, do not just promise to remember.
|
|
14
|
+
4. **NEVER re-discover what you already know.** Check memory before exploring filesystem. If a memory fragment answers your question, use it.
|
|
15
|
+
</critical_rules>
|
|
16
|
+
|
|
17
|
+
<workflow>
|
|
18
|
+
## Operational Loop
|
|
19
|
+
1. **Recall (FIRST):** \`memory_read\` → \`guide_get\` — check what you already know. DO THIS BEFORE ANYTHING ELSE.
|
|
20
|
+
2. **Act:** Read files, search code, implement changes — but only if memory didn't already have the answer.
|
|
21
|
+
3. **Persist (LAST):** \`memory_add\` or \`guide_practice\` — save new findings BEFORE responding to the user.
|
|
22
|
+
</workflow>
|
|
23
|
+
|
|
24
|
+
<memory_strategy>
|
|
25
|
+
## Retrieval Strategy
|
|
26
|
+
1. **Global:** Check general conventions and preferences first.
|
|
27
|
+
2. **Project:** Look for project-specific patterns and tech stack details.
|
|
28
|
+
3. **Methodology:** Use \`guide_get\` for established workflows.
|
|
29
|
+
</memory_strategy>
|
|
30
|
+
|
|
31
|
+
<scope_rules>
|
|
32
|
+
## Scope Rules
|
|
33
|
+
| Scope | Use For | Example |
|
|
34
|
+
|-------|---------|---------|
|
|
35
|
+
| project: null | Global preferences | "User prefers dark mode" |
|
|
36
|
+
| project: "Name" | Project-specific | "Lemma uses Node.js 18+" |
|
|
37
|
+
</scope_rules>
|
|
38
|
+
|
|
39
|
+
<distillation_examples>
|
|
40
|
+
## Distillation Examples
|
|
41
|
+
- **Raw:** "Apollo Client with custom cache, 5min invalidation" → **Distilled:** "Apollo Cache: Custom policy, 5min auto-invalidation."
|
|
42
|
+
- **Raw:** "I hate Tailwind, use CSS modules" → **Distilled:** "Styling: CSS Modules only (No Tailwind)."
|
|
43
|
+
- **Raw:** "Prisma with PostgreSQL on Supabase" → **Distilled:** "Prisma + PostgreSQL (Supabase)."
|
|
44
|
+
- **Raw:** "Always write tests first in __tests__/" → **Distilled:** "TDD: Tests first, located in __tests__/."
|
|
45
|
+
</distillation_examples>
|
|
46
|
+
|
|
47
|
+
<guide_tracking>
|
|
48
|
+
## Guide System
|
|
49
|
+
- **Memory** = WHAT you know — static facts ("TypeScript strict mode", "API at /api/v1")
|
|
50
|
+
- **Guide** = HOW you work — accumulated experience ("React 45x, learned: prefer composition")
|
|
51
|
+
|
|
52
|
+
**Tools:** \`guide_create\` (methodology), \`guide_practice\` (track usage), \`guide_distill\` (memory→guide), \`guide_merge\` (consolidate)
|
|
53
|
+
</guide_tracking>
|
|
54
|
+
|
|
55
|
+
<tool_focus_rule>
|
|
56
|
+
When you see tool names: EXECUTE the tool, don't discuss it. Lemma is your memory — use it.
|
|
57
|
+
</tool_focus_rule>
|
|
58
|
+
</system_prompt>`;
|
|
59
|
+
function formatProjectContext(fragments, projectName) {
|
|
60
|
+
if (!fragments || fragments.length === 0) {
|
|
61
|
+
return "";
|
|
62
|
+
}
|
|
63
|
+
const lines = fragments.map(frag => {
|
|
64
|
+
const barCount = Math.round(frag.confidence / 0.2);
|
|
65
|
+
const confidenceBar = "█".repeat(barCount) + "░".repeat(5 - barCount);
|
|
66
|
+
const sourceIcon = frag.source === "ai" ? "🤖" : "👤";
|
|
67
|
+
const summary = frag.description || frag.title;
|
|
68
|
+
return `[${frag.id}] ${confidenceBar} (${sourceIcon}) ${frag.title}\n ${summary}`;
|
|
69
|
+
});
|
|
70
|
+
return `<project_context>
|
|
71
|
+
## Project Context: ${projectName}
|
|
72
|
+
|
|
73
|
+
You have ${fragments.length} saved memory fragment(s) for this project.
|
|
74
|
+
Use \`memory_read\` to load full details or \`memory_read id="<id>"\` for specific fragment.
|
|
75
|
+
|
|
76
|
+
${lines.join("\n")}
|
|
77
|
+
</project_context>`;
|
|
78
|
+
}
|
|
79
|
+
function formatGlobalContext(fragments) {
|
|
80
|
+
if (!fragments || fragments.length === 0) {
|
|
81
|
+
return "";
|
|
82
|
+
}
|
|
83
|
+
const lines = fragments.map(frag => {
|
|
84
|
+
return `- **${frag.title}**: ${frag.description || frag.fragment.slice(0, 100)}`;
|
|
85
|
+
});
|
|
86
|
+
return `<global_knowledge>
|
|
87
|
+
## Global Knowledge
|
|
88
|
+
|
|
89
|
+
Cross-project learnings and preferences that apply everywhere:
|
|
90
|
+
|
|
91
|
+
${lines.join("\n")}
|
|
92
|
+
</global_knowledge>`;
|
|
93
|
+
}
|
|
94
|
+
function processFragments(fragments, limit) {
|
|
95
|
+
if (!fragments || fragments.length === 0)
|
|
96
|
+
return [];
|
|
97
|
+
const decayed = core.decayConfidence(fragments);
|
|
98
|
+
return [...decayed]
|
|
99
|
+
.sort((a, b) => b.confidence - a.confidence)
|
|
100
|
+
.slice(0, limit);
|
|
101
|
+
}
|
|
102
|
+
export async function getDynamicSystemPrompt(projectName) {
|
|
103
|
+
let prompt = BASE_SYSTEM_PROMPT;
|
|
104
|
+
let memory = [];
|
|
105
|
+
try {
|
|
106
|
+
memory = core.loadMemory();
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
console.error(`[Lemma] Critical: Failed to load memory for system prompt: ${error.message}`);
|
|
110
|
+
return prompt;
|
|
111
|
+
}
|
|
112
|
+
const context = {
|
|
113
|
+
project: projectName,
|
|
114
|
+
fragments: [],
|
|
115
|
+
globalFragments: [],
|
|
116
|
+
};
|
|
117
|
+
const globalFragmentsRaw = core.filterByProject(memory, null);
|
|
118
|
+
if (globalFragmentsRaw.length > 0) {
|
|
119
|
+
const sortedGlobal = processFragments(globalFragmentsRaw, 10);
|
|
120
|
+
context.globalFragments = sortedGlobal;
|
|
121
|
+
const globalContext = formatGlobalContext(sortedGlobal);
|
|
122
|
+
prompt = prompt.replace("</system_prompt>", `\n${globalContext}\n</system_prompt>`);
|
|
123
|
+
}
|
|
124
|
+
if (projectName) {
|
|
125
|
+
const projectFragmentsRaw = core.filterByProject(memory, projectName);
|
|
126
|
+
if (projectFragmentsRaw.length > 0) {
|
|
127
|
+
const sortedProject = processFragments(projectFragmentsRaw, 20);
|
|
128
|
+
context.fragments = sortedProject;
|
|
129
|
+
const projectContext = formatProjectContext(sortedProject, projectName);
|
|
130
|
+
prompt = prompt.replace("</system_prompt>", `\n${projectContext}\n</system_prompt>`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
prompt = await applyPromptModifiers(prompt, context);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
console.error(`[Lemma] Prompt modifiers failed: ${error.message}`);
|
|
138
|
+
}
|
|
139
|
+
return prompt;
|
|
140
|
+
}
|
|
141
|
+
export { BASE_SYSTEM_PROMPT };
|
|
142
|
+
export const SYSTEM_PROMPT = BASE_SYSTEM_PROMPT;
|
|
143
|
+
//# sourceMappingURL=system-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/server/system-prompt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuDV,CAAC;AAElB,SAAS,oBAAoB,CAAC,SAA2B,EAAE,WAAmB;IAC5E,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC;QACnD,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;QACtE,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAEtD,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC;QAE/C,OAAO,IAAI,IAAI,CAAC,EAAE,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,OAA6C,CAAC,CAAC;IAC7F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface ToolProperty {
|
|
2
|
+
type: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
items?: {
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
enum?: string[];
|
|
8
|
+
default?: unknown;
|
|
9
|
+
}
|
|
10
|
+
interface ToolInputSchema {
|
|
11
|
+
type: string;
|
|
12
|
+
properties: Record<string, ToolProperty>;
|
|
13
|
+
required?: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface ToolDefinition {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
inputSchema: ToolInputSchema;
|
|
19
|
+
}
|
|
20
|
+
export declare const TOOLS: ToolDefinition[];
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/server/tools.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,eAAe,CAAC;CAC9B;AAED,eAAO,MAAM,KAAK,EAAE,cAAc,EAybjC,CAAC"}
|
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
export const TOOLS = [
|
|
2
|
+
{
|
|
3
|
+
name: "session_start",
|
|
4
|
+
description: "Start a traced work session. Records task metadata and returns relevant guides and memories for the task.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
task_type: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "Type of task: 'debugging', 'implementation', 'refactoring', 'testing', 'research', 'documentation', 'optimization', or 'other'",
|
|
11
|
+
},
|
|
12
|
+
technologies: {
|
|
13
|
+
type: "array",
|
|
14
|
+
items: { type: "string" },
|
|
15
|
+
description: "Technologies involved (e.g., ['react', 'typescript']). Optional.",
|
|
16
|
+
},
|
|
17
|
+
initial_approach: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Your initial plan or approach for this task. Optional.",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
required: ["task_type"],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "session_end",
|
|
27
|
+
description: "End the current traced session. Records outcome, updates guide success/failure tracking, and generates improvement suggestions if patterns are detected.",
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
outcome: {
|
|
32
|
+
type: "string",
|
|
33
|
+
enum: ["success", "partial", "failure", "abandoned"],
|
|
34
|
+
description: "How the task turned out",
|
|
35
|
+
},
|
|
36
|
+
final_approach: {
|
|
37
|
+
type: "string",
|
|
38
|
+
description: "What approach actually worked (or didn't). Optional.",
|
|
39
|
+
},
|
|
40
|
+
lessons: {
|
|
41
|
+
type: "array",
|
|
42
|
+
items: { type: "string" },
|
|
43
|
+
description: "What was learned during this session. Optional.",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
required: ["outcome"],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "memory_read",
|
|
51
|
+
description: "Read memory fragments. SUMMARY MODE: Shows title + description only (not full content). Use id parameter to get full detail of a specific fragment. Use all=true to see fragments from all projects.",
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: "object",
|
|
54
|
+
properties: {
|
|
55
|
+
project: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "Project name to filter (optional, defaults to detected project)",
|
|
58
|
+
},
|
|
59
|
+
query: {
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "Optional semantic search keyword. Supply only if you are looking for specific context.",
|
|
62
|
+
},
|
|
63
|
+
id: {
|
|
64
|
+
type: "string",
|
|
65
|
+
description: "Get FULL DETAIL for a specific fragment ID. Use this after seeing the summary to read the complete content.",
|
|
66
|
+
},
|
|
67
|
+
context: {
|
|
68
|
+
type: "string",
|
|
69
|
+
description: "Optional context tag for this access (e.g., 'debugging', 'refactoring'). Boosts confidence and tags the fragment for future recall.",
|
|
70
|
+
},
|
|
71
|
+
all: {
|
|
72
|
+
type: "boolean",
|
|
73
|
+
description: "If true, show fragments from all projects. Default: false (current project + global only)",
|
|
74
|
+
},
|
|
75
|
+
ids: {
|
|
76
|
+
type: "array",
|
|
77
|
+
items: { type: "string" },
|
|
78
|
+
description: "Get full details for multiple fragment IDs at once. Optional.",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "memory_add",
|
|
85
|
+
description: "MANDATORY: Call this AFTER completing analysis/research to save findings. Synthesize information into short, reusable fragments.",
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {
|
|
89
|
+
fragment: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "The memory fragment text to store",
|
|
92
|
+
},
|
|
93
|
+
title: {
|
|
94
|
+
type: "string",
|
|
95
|
+
description: "Short title for the memory (auto-generated if not provided)",
|
|
96
|
+
},
|
|
97
|
+
description: {
|
|
98
|
+
type: "string",
|
|
99
|
+
description: "Short description/summary (auto-generated if not provided)",
|
|
100
|
+
},
|
|
101
|
+
project: {
|
|
102
|
+
type: "string",
|
|
103
|
+
description: "Project scope (null = global, string = project-specific). Use current project name for project-specific info.",
|
|
104
|
+
default: null,
|
|
105
|
+
},
|
|
106
|
+
source: {
|
|
107
|
+
type: "string",
|
|
108
|
+
description: "Source of the memory (default: 'ai')",
|
|
109
|
+
default: "ai",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
required: ["fragment"],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "memory_update",
|
|
117
|
+
description: "Update an existing memory fragment by ID. Can update title, fragment text, confidence, or all.",
|
|
118
|
+
inputSchema: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: {
|
|
121
|
+
id: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "The ID of the fragment to update",
|
|
124
|
+
},
|
|
125
|
+
title: {
|
|
126
|
+
type: "string",
|
|
127
|
+
description: "New title text (optional)",
|
|
128
|
+
},
|
|
129
|
+
fragment: {
|
|
130
|
+
type: "string",
|
|
131
|
+
description: "New fragment text (optional)",
|
|
132
|
+
},
|
|
133
|
+
confidence: {
|
|
134
|
+
type: "number",
|
|
135
|
+
description: "New confidence value 0-1 (optional)",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
required: ["id"],
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "memory_forget",
|
|
143
|
+
description: "Remove a memory fragment by ID.",
|
|
144
|
+
inputSchema: {
|
|
145
|
+
type: "object",
|
|
146
|
+
properties: {
|
|
147
|
+
id: {
|
|
148
|
+
type: "string",
|
|
149
|
+
description: "The ID of the fragment to remove",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
required: ["id"],
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "memory_feedback",
|
|
157
|
+
description: "Provide feedback on a memory fragment after use. positive = the memory was useful (boosts confidence), negative = it was not helpful (reduces confidence by -0.1).",
|
|
158
|
+
inputSchema: {
|
|
159
|
+
type: "object",
|
|
160
|
+
properties: {
|
|
161
|
+
id: {
|
|
162
|
+
type: "string",
|
|
163
|
+
description: "The ID of the fragment to give feedback on",
|
|
164
|
+
},
|
|
165
|
+
useful: {
|
|
166
|
+
type: "boolean",
|
|
167
|
+
description: "true if the memory was helpful, false if it was not relevant or incorrect",
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
required: ["id", "useful"],
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "memory_merge",
|
|
175
|
+
description: "Merge multiple memory fragments into one. You decide the merged content, this tool just executes the merge. Use when you find related/overlapping fragments that should be consolidated.",
|
|
176
|
+
inputSchema: {
|
|
177
|
+
type: "object",
|
|
178
|
+
properties: {
|
|
179
|
+
ids: {
|
|
180
|
+
type: "array",
|
|
181
|
+
items: { type: "string" },
|
|
182
|
+
description: "Array of fragment IDs to merge (will be deleted after merge)",
|
|
183
|
+
},
|
|
184
|
+
title: {
|
|
185
|
+
type: "string",
|
|
186
|
+
description: "Title for the merged fragment",
|
|
187
|
+
},
|
|
188
|
+
fragment: {
|
|
189
|
+
type: "string",
|
|
190
|
+
description: "The merged content you prepared",
|
|
191
|
+
},
|
|
192
|
+
project: {
|
|
193
|
+
type: "string",
|
|
194
|
+
description: "Project scope (null = global, string = project-specific). Optional.",
|
|
195
|
+
default: null,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
required: ["ids", "title", "fragment"],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "memory_stats",
|
|
203
|
+
description: "Get memory store statistics: fragment counts, average confidence, project breakdown, and health metrics.",
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: "object",
|
|
206
|
+
properties: {
|
|
207
|
+
project: {
|
|
208
|
+
type: "string",
|
|
209
|
+
description: "Project name to filter stats (optional, defaults to all projects)",
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: "memory_audit",
|
|
216
|
+
description: "Audit memory store for integrity issues: orphan references, duplicate IDs, confidence anomalies.",
|
|
217
|
+
inputSchema: {
|
|
218
|
+
type: "object",
|
|
219
|
+
properties: {},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "guide_get",
|
|
224
|
+
description: "Get guides with usage statistics. Returns guides sorted by usage count (most used first). Use task parameter to get suggestions based on a task description.",
|
|
225
|
+
inputSchema: {
|
|
226
|
+
type: "object",
|
|
227
|
+
properties: {
|
|
228
|
+
category: {
|
|
229
|
+
type: "string",
|
|
230
|
+
description: "Filter by category (web-frontend, web-backend, dev-tool, etc.). Optional.",
|
|
231
|
+
},
|
|
232
|
+
guide: {
|
|
233
|
+
type: "string",
|
|
234
|
+
description: "Get detail for a specific guide name. Optional.",
|
|
235
|
+
},
|
|
236
|
+
task: {
|
|
237
|
+
type: "string",
|
|
238
|
+
description: "Task description to get relevant guide suggestions (e.g., 'react component with hooks', 'nodejs api'). Optional.",
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "guide_practice",
|
|
245
|
+
description: "MANDATORY: Record guide usage - increments usage count, updates last_used date, and adds contexts/learnings. Call this when you use a guide during work. Both contexts and learnings are REQUIRED.",
|
|
246
|
+
inputSchema: {
|
|
247
|
+
type: "object",
|
|
248
|
+
properties: {
|
|
249
|
+
guide: {
|
|
250
|
+
type: "string",
|
|
251
|
+
description: "Guide name (e.g., 'react', 'python', 'git')",
|
|
252
|
+
},
|
|
253
|
+
category: {
|
|
254
|
+
type: "string",
|
|
255
|
+
description: "Category: web-frontend, web-backend, dev-tool, programming-language, data-storage, etc.",
|
|
256
|
+
},
|
|
257
|
+
description: {
|
|
258
|
+
type: "string",
|
|
259
|
+
description: "Detailed description, manual, or protocols for the guide. Optional.",
|
|
260
|
+
},
|
|
261
|
+
contexts: {
|
|
262
|
+
type: "array",
|
|
263
|
+
items: { type: "string" },
|
|
264
|
+
description: "REQUIRED: Contexts where this guide was used (e.g., ['hooks', 'state']). Provide at least one context or empty array [].",
|
|
265
|
+
},
|
|
266
|
+
learnings: {
|
|
267
|
+
type: "array",
|
|
268
|
+
items: { type: "string" },
|
|
269
|
+
description: "REQUIRED: New learnings discovered during use (e.g., ['useCallback prevents re-renders']). Provide at least one learning or empty array [].",
|
|
270
|
+
},
|
|
271
|
+
outcome: {
|
|
272
|
+
type: "string",
|
|
273
|
+
enum: ["success", "failure"],
|
|
274
|
+
description: "Optional outcome when using this guide. Tracks success rate.",
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
required: ["guide", "category", "contexts", "learnings"],
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
name: "guide_create",
|
|
282
|
+
description: "Definition mode: Create a new guide with a detailed manual, mission, and protocols. Use this to establish a reusable framework for a specific technology or methodology.",
|
|
283
|
+
inputSchema: {
|
|
284
|
+
type: "object",
|
|
285
|
+
properties: {
|
|
286
|
+
guide: {
|
|
287
|
+
type: "string",
|
|
288
|
+
description: "Guide name (e.g., 'X Viral Growth Engine', 'TDD Workflow')",
|
|
289
|
+
},
|
|
290
|
+
category: {
|
|
291
|
+
type: "string",
|
|
292
|
+
description: "Category: web-frontend, web-backend, dev-tool, programming-language, data-storage, etc.",
|
|
293
|
+
},
|
|
294
|
+
description: {
|
|
295
|
+
type: "string",
|
|
296
|
+
description: "The full manual, protocols, mission, and templates for this guide.",
|
|
297
|
+
},
|
|
298
|
+
contexts: {
|
|
299
|
+
type: "array",
|
|
300
|
+
items: { type: "string" },
|
|
301
|
+
description: "Initial contexts (optional).",
|
|
302
|
+
},
|
|
303
|
+
learnings: {
|
|
304
|
+
type: "array",
|
|
305
|
+
items: { type: "string" },
|
|
306
|
+
description: "Initial learnings (optional).",
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
required: ["guide", "category", "description"],
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: "guide_distill",
|
|
314
|
+
description: "Transform a memory fragment (static fact) into a guide's learning (procedural knowledge). Use this when a learned piece of information should become part of a permanent capability.",
|
|
315
|
+
inputSchema: {
|
|
316
|
+
type: "object",
|
|
317
|
+
properties: {
|
|
318
|
+
memory_id: {
|
|
319
|
+
type: "string",
|
|
320
|
+
description: "ID of the memory fragment to distill",
|
|
321
|
+
},
|
|
322
|
+
guide: {
|
|
323
|
+
type: "string",
|
|
324
|
+
description: "Target guide name (e.g., 'react', 'git'). If it doesn't exist, it will be created.",
|
|
325
|
+
},
|
|
326
|
+
category: {
|
|
327
|
+
type: "string",
|
|
328
|
+
description: "Category for the guide (required only if creating a new guide).",
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
required: ["memory_id", "guide"],
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
name: "guide_update",
|
|
336
|
+
description: "Update an existing guide's basic properties (name, category, description).",
|
|
337
|
+
inputSchema: {
|
|
338
|
+
type: "object",
|
|
339
|
+
properties: {
|
|
340
|
+
guide: {
|
|
341
|
+
type: "string",
|
|
342
|
+
description: "Current name of the guide to update",
|
|
343
|
+
},
|
|
344
|
+
new_name: {
|
|
345
|
+
type: "string",
|
|
346
|
+
description: "New name for the guide (optional)",
|
|
347
|
+
},
|
|
348
|
+
category: {
|
|
349
|
+
type: "string",
|
|
350
|
+
description: "New category for the guide (optional)",
|
|
351
|
+
},
|
|
352
|
+
description: {
|
|
353
|
+
type: "string",
|
|
354
|
+
description: "New description/manual for the guide (optional)",
|
|
355
|
+
},
|
|
356
|
+
add_anti_patterns: {
|
|
357
|
+
type: "array",
|
|
358
|
+
items: { type: "string" },
|
|
359
|
+
description: "Add anti-patterns to this guide. Optional.",
|
|
360
|
+
},
|
|
361
|
+
add_pitfalls: {
|
|
362
|
+
type: "array",
|
|
363
|
+
items: { type: "string" },
|
|
364
|
+
description: "Add known pitfalls to this guide. Optional.",
|
|
365
|
+
},
|
|
366
|
+
superseded_by: {
|
|
367
|
+
type: "string",
|
|
368
|
+
description: "Mark this guide as superseded by another guide name. Optional.",
|
|
369
|
+
},
|
|
370
|
+
deprecated: {
|
|
371
|
+
type: "boolean",
|
|
372
|
+
description: "Mark this guide as deprecated. Optional.",
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
required: ["guide"],
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
name: "guide_forget",
|
|
380
|
+
description: "Remove a guide from the persistent database.",
|
|
381
|
+
inputSchema: {
|
|
382
|
+
type: "object",
|
|
383
|
+
properties: {
|
|
384
|
+
guide: {
|
|
385
|
+
type: "string",
|
|
386
|
+
description: "Name of the guide to remove",
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
required: ["guide"],
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
name: "guide_merge",
|
|
394
|
+
description: "Merge multiple guides into one. You decide the merged content (description, contexts, learnings). Usage counts are summed. Use when you find overlapping guides that should be consolidated.",
|
|
395
|
+
inputSchema: {
|
|
396
|
+
type: "object",
|
|
397
|
+
properties: {
|
|
398
|
+
guides: {
|
|
399
|
+
type: "array",
|
|
400
|
+
items: { type: "string" },
|
|
401
|
+
description: "Array of guide names to merge (will be deleted after merge)",
|
|
402
|
+
},
|
|
403
|
+
guide: {
|
|
404
|
+
type: "string",
|
|
405
|
+
description: "Name for the merged guide",
|
|
406
|
+
},
|
|
407
|
+
category: {
|
|
408
|
+
type: "string",
|
|
409
|
+
description: "Category for the merged guide",
|
|
410
|
+
},
|
|
411
|
+
description: {
|
|
412
|
+
type: "string",
|
|
413
|
+
description: "Merged description/manual (optional, can be empty)",
|
|
414
|
+
},
|
|
415
|
+
contexts: {
|
|
416
|
+
type: "array",
|
|
417
|
+
items: { type: "string" },
|
|
418
|
+
description: "Merged contexts (optional, will auto-merge from source guides if not provided)",
|
|
419
|
+
},
|
|
420
|
+
learnings: {
|
|
421
|
+
type: "array",
|
|
422
|
+
items: { type: "string" },
|
|
423
|
+
description: "Merged learnings (optional, will auto-merge from source guides if not provided)",
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
required: ["guides", "guide", "category"],
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
name: "session_stats",
|
|
431
|
+
description: "Get virtual session statistics: recent tool usage patterns, technologies encountered, and memory activity.",
|
|
432
|
+
inputSchema: {
|
|
433
|
+
type: "object",
|
|
434
|
+
properties: {
|
|
435
|
+
count: {
|
|
436
|
+
type: "number",
|
|
437
|
+
description: "Number of recent sessions to analyze (default 10)",
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
];
|
|
443
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/server/tools.ts"],"names":[],"mappings":"AAoBA,MAAM,CAAC,MAAM,KAAK,GAAqB;IACrC;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,2GAA2G;QACxH,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,gIAAgI;iBAC9I;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,E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d,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,6DAA6D;iBAC3E;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2BAA2B;iBACzC;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,+BAA+B;iBAC7C;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,oDAAoD;iBAClE;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,gFAAgF;iBAC9F;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,iFAAiF;iBAC/F;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC;SAC1C;KACF;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,4GAA4G;QACzH,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,mDAAmD;iBACjE;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Session } from "../types.js";
|
|
2
|
+
export declare function setSessionsDir(dir: string): void;
|
|
3
|
+
export declare function generateSessionId(): string;
|
|
4
|
+
export declare function generateTraceId(): string;
|
|
5
|
+
export declare function loadSessions(): Session[];
|
|
6
|
+
export declare function saveSessions(sessions: Session[], options?: {
|
|
7
|
+
force?: boolean;
|
|
8
|
+
}): void;
|
|
9
|
+
export declare function createSession(taskType: string, technologies?: string[]): Session;
|
|
10
|
+
export declare function findSession(sessions: Session[], sessionId: string): Session | null;
|
|
11
|
+
export declare function findActiveSession(sessions: Session[]): Session | null;
|
|
12
|
+
export declare function endSession(session: Session, outcome: string, finalApproach?: string | null, lessons?: string[]): Session;
|
|
13
|
+
export declare function getRecentSessions(sessions: Session[], limit?: number): Session[];
|
|
14
|
+
export declare function getSessionsByTechnology(sessions: Session[], technology: string): Session[];
|
|
15
|
+
export declare function calculateSuccessRate(sessions: Session[]): number | null;
|
|
16
|
+
export declare function formatSessionDetail(session: Session | null): string;
|
|
17
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/sessions/core.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAK3C,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAGhD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,wBAAgB,YAAY,IAAI,OAAO,EAAE,CAiBxC;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,IAAI,CAqCzF;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,GAAE,MAAM,EAAO,GAAG,OAAO,CAoBpF;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAElF;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,GAAG,IAAI,CAErE;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAE,MAAM,GA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