@vheins/local-memory-mcp 0.2.1 → 0.3.12
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/dashboard/public/app.js +358 -31
- package/dist/dashboard/public/index.html +131 -7
- package/dist/dashboard/server.js +109 -5
- package/dist/dashboard/server.js.map +1 -1
- package/dist/prompts/registry.d.ts +112 -0
- package/dist/prompts/registry.d.ts.map +1 -1
- package/dist/prompts/registry.js +172 -0
- package/dist/prompts/registry.js.map +1 -1
- package/dist/resources/index.test.js +2 -0
- package/dist/resources/index.test.js.map +1 -1
- package/dist/storage/sqlite.d.ts +6 -1
- package/dist/storage/sqlite.d.ts.map +1 -1
- package/dist/storage/sqlite.js +91 -13
- package/dist/storage/sqlite.js.map +1 -1
- package/dist/storage/sqlite.test.js +2 -0
- package/dist/storage/sqlite.test.js.map +1 -1
- package/dist/tools/memory.store.d.ts.map +1 -1
- package/dist/tools/memory.store.js +2 -0
- package/dist/tools/memory.store.js.map +1 -1
- package/dist/tools/memory.update.d.ts.map +1 -1
- package/dist/tools/memory.update.js +6 -0
- package/dist/tools/memory.update.js.map +1 -1
- package/dist/tools/schemas.d.ts +35 -1
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +21 -2
- package/dist/tools/schemas.js.map +1 -1
- package/dist/tools/task.manage.d.ts.map +1 -1
- package/dist/tools/task.manage.js +15 -2
- package/dist/tools/task.manage.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/logger.test.js +19 -27
- package/dist/utils/logger.test.js.map +1 -1
- package/dist/v2-features.test.js +2 -0
- package/dist/v2-features.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -47,5 +47,117 @@ export declare const PROMPTS: {
|
|
|
47
47
|
};
|
|
48
48
|
}[];
|
|
49
49
|
};
|
|
50
|
+
"import-github-issues": {
|
|
51
|
+
name: string;
|
|
52
|
+
description: string;
|
|
53
|
+
arguments: {
|
|
54
|
+
name: string;
|
|
55
|
+
description: string;
|
|
56
|
+
required: boolean;
|
|
57
|
+
}[];
|
|
58
|
+
messages: {
|
|
59
|
+
role: string;
|
|
60
|
+
content: {
|
|
61
|
+
type: string;
|
|
62
|
+
text: string;
|
|
63
|
+
};
|
|
64
|
+
}[];
|
|
65
|
+
};
|
|
66
|
+
"project-briefing": {
|
|
67
|
+
name: string;
|
|
68
|
+
description: string;
|
|
69
|
+
arguments: {
|
|
70
|
+
name: string;
|
|
71
|
+
description: string;
|
|
72
|
+
required: boolean;
|
|
73
|
+
}[];
|
|
74
|
+
messages: {
|
|
75
|
+
role: string;
|
|
76
|
+
content: {
|
|
77
|
+
type: string;
|
|
78
|
+
text: string;
|
|
79
|
+
};
|
|
80
|
+
}[];
|
|
81
|
+
};
|
|
82
|
+
"learning-retrospective": {
|
|
83
|
+
name: string;
|
|
84
|
+
description: string;
|
|
85
|
+
arguments: {
|
|
86
|
+
name: string;
|
|
87
|
+
description: string;
|
|
88
|
+
required: boolean;
|
|
89
|
+
}[];
|
|
90
|
+
messages: {
|
|
91
|
+
role: string;
|
|
92
|
+
content: {
|
|
93
|
+
type: string;
|
|
94
|
+
text: string;
|
|
95
|
+
};
|
|
96
|
+
}[];
|
|
97
|
+
};
|
|
98
|
+
"memory-guided-review": {
|
|
99
|
+
name: string;
|
|
100
|
+
description: string;
|
|
101
|
+
arguments: {
|
|
102
|
+
name: string;
|
|
103
|
+
description: string;
|
|
104
|
+
required: boolean;
|
|
105
|
+
}[];
|
|
106
|
+
messages: {
|
|
107
|
+
role: string;
|
|
108
|
+
content: {
|
|
109
|
+
type: string;
|
|
110
|
+
text: string;
|
|
111
|
+
};
|
|
112
|
+
}[];
|
|
113
|
+
};
|
|
114
|
+
"session-planner": {
|
|
115
|
+
name: string;
|
|
116
|
+
description: string;
|
|
117
|
+
arguments: {
|
|
118
|
+
name: string;
|
|
119
|
+
description: string;
|
|
120
|
+
required: boolean;
|
|
121
|
+
}[];
|
|
122
|
+
messages: {
|
|
123
|
+
role: string;
|
|
124
|
+
content: {
|
|
125
|
+
type: string;
|
|
126
|
+
text: string;
|
|
127
|
+
};
|
|
128
|
+
}[];
|
|
129
|
+
};
|
|
130
|
+
"tech-affinity-scout": {
|
|
131
|
+
name: string;
|
|
132
|
+
description: string;
|
|
133
|
+
arguments: {
|
|
134
|
+
name: string;
|
|
135
|
+
description: string;
|
|
136
|
+
required: boolean;
|
|
137
|
+
}[];
|
|
138
|
+
messages: {
|
|
139
|
+
role: string;
|
|
140
|
+
content: {
|
|
141
|
+
type: string;
|
|
142
|
+
text: string;
|
|
143
|
+
};
|
|
144
|
+
}[];
|
|
145
|
+
};
|
|
146
|
+
"documentation-sync": {
|
|
147
|
+
name: string;
|
|
148
|
+
description: string;
|
|
149
|
+
arguments: {
|
|
150
|
+
name: string;
|
|
151
|
+
description: string;
|
|
152
|
+
required: boolean;
|
|
153
|
+
}[];
|
|
154
|
+
messages: {
|
|
155
|
+
role: string;
|
|
156
|
+
content: {
|
|
157
|
+
type: string;
|
|
158
|
+
text: string;
|
|
159
|
+
};
|
|
160
|
+
}[];
|
|
161
|
+
};
|
|
50
162
|
};
|
|
51
163
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/prompts/registry.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/prompts/registry.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+SnB,CAAC"}
|
package/dist/prompts/registry.js
CHANGED
|
@@ -128,6 +128,178 @@ Memory is a permanent record, categorize it properly with tags.`
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
]
|
|
131
|
+
},
|
|
132
|
+
"import-github-issues": {
|
|
133
|
+
name: "import-github-issues",
|
|
134
|
+
description: "Guide for importing GitHub Issues as local tasks",
|
|
135
|
+
arguments: [
|
|
136
|
+
{
|
|
137
|
+
name: "repo",
|
|
138
|
+
description: "GitHub repository in 'owner/repo' format",
|
|
139
|
+
required: true
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
messages: [
|
|
143
|
+
{
|
|
144
|
+
role: "user",
|
|
145
|
+
content: {
|
|
146
|
+
type: "text",
|
|
147
|
+
text: `You are tasked with importing GitHub Issues from the repository {{repo}} into our local task management system.
|
|
148
|
+
|
|
149
|
+
Please follow these steps:
|
|
150
|
+
|
|
151
|
+
1. **Access Issues**: Use available GitHub MCP tools to list open issues for the repository {{repo}}.
|
|
152
|
+
2. **Review Existing Tasks**: Call 'task-list' for the current local repository to identify tasks already imported.
|
|
153
|
+
3. **Map and Create**: For each relevant issue that hasn't been imported yet:
|
|
154
|
+
- Use 'task-manage' with action='create'.
|
|
155
|
+
- Set 'task_code' to 'GH-{{issue_number}}' (e.g., GH-123).
|
|
156
|
+
- Set 'title' to the issue title.
|
|
157
|
+
- Set 'description' to the issue body (abbreviate if extremely long).
|
|
158
|
+
- Map GitHub labels to 'tags' if applicable.
|
|
159
|
+
- Default 'phase' to 'backlog' or 'triage'.
|
|
160
|
+
- Set 'metadata' to include the original GitHub URL.
|
|
161
|
+
4. **Avoid Duplicates**: Do not import issues that already have a corresponding 'GH-{{number}}' task code in our system.
|
|
162
|
+
5. **Confirmation**: Provide a summary of how many tasks were successfully created.`
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
"project-briefing": {
|
|
168
|
+
name: "project-briefing",
|
|
169
|
+
description: "Onboard the agent to the current repository state",
|
|
170
|
+
arguments: [
|
|
171
|
+
{ name: "repo", description: "The current repository name", required: true }
|
|
172
|
+
],
|
|
173
|
+
messages: [
|
|
174
|
+
{
|
|
175
|
+
role: "user",
|
|
176
|
+
content: {
|
|
177
|
+
type: "text",
|
|
178
|
+
text: `I am starting a new session in repository: {{repo}}.
|
|
179
|
+
|
|
180
|
+
Please perform a briefing to catch up on the project:
|
|
181
|
+
1. **Recent Knowledge**: Call 'memory-recap' to see the latest decisions, patterns, and mistakes recorded for this repo.
|
|
182
|
+
2. **Current Tasks**: Call 'task-list' to understand what is currently pending or in-progress.
|
|
183
|
+
3. **Context Check**: Summarize the top 3 most important architectural decisions you found.
|
|
184
|
+
4. **Readiness**: Tell me what you are ready to help with based on the current backlog.`
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
"learning-retrospective": {
|
|
190
|
+
name: "learning-retrospective",
|
|
191
|
+
description: "Extract durable knowledge from recent work",
|
|
192
|
+
arguments: [
|
|
193
|
+
{ name: "repo", description: "The current repository name", required: true },
|
|
194
|
+
{ name: "task_id", description: "Optional ID of the task just completed", required: false }
|
|
195
|
+
],
|
|
196
|
+
messages: [
|
|
197
|
+
{
|
|
198
|
+
role: "user",
|
|
199
|
+
content: {
|
|
200
|
+
type: "text",
|
|
201
|
+
text: `We have just finished some work in {{repo}} related to task {{task_id}}.
|
|
202
|
+
|
|
203
|
+
Please reflect on the changes and identify knowledge worth keeping:
|
|
204
|
+
1. **Mistakes**: Did we encounter any bugs that were hard to find or caused by specific environment quirks? (Store as 'mistake')
|
|
205
|
+
2. **Decisions**: Did we make a choice between multiple options (e.g., library choice, UI pattern)? (Store as 'decision')
|
|
206
|
+
3. **Patterns**: Did we establish a repeatable way of doing things in this codebase? (Store as 'pattern')
|
|
207
|
+
|
|
208
|
+
Use 'memory-store' to record any high-value findings. Be concise and use appropriate technology tags.`
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
"memory-guided-review": {
|
|
214
|
+
name: "memory-guided-review",
|
|
215
|
+
description: "Review code for compliance with stored project decisions",
|
|
216
|
+
arguments: [
|
|
217
|
+
{ name: "file_path", description: "Path to the file to review", required: true },
|
|
218
|
+
{ name: "repo", description: "The current repository name", required: true }
|
|
219
|
+
],
|
|
220
|
+
messages: [
|
|
221
|
+
{
|
|
222
|
+
role: "user",
|
|
223
|
+
content: {
|
|
224
|
+
type: "text",
|
|
225
|
+
text: `Please review the code in '{{file_path}}' for repository '{{repo}}'.
|
|
226
|
+
|
|
227
|
+
Your goal is to ensure compliance with our stored project knowledge:
|
|
228
|
+
1. **Search Constraints**: Use 'memory-search' with current_file_path='{{file_path}}' to find relevant decisions and patterns.
|
|
229
|
+
2. **Evaluate Compliance**: Does the code follow established patterns? Does it repeat any known mistakes?
|
|
230
|
+
3. **Feedback**: Provide specific suggestions for improvement if you find violations of stored decisions.`
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
"session-planner": {
|
|
236
|
+
name: "session-planner",
|
|
237
|
+
description: "Break down a complex objective into atomic tasks",
|
|
238
|
+
arguments: [
|
|
239
|
+
{ name: "objective", description: "The high-level goal for this session", required: true },
|
|
240
|
+
{ name: "repo", description: "The current repository name", required: true }
|
|
241
|
+
],
|
|
242
|
+
messages: [
|
|
243
|
+
{
|
|
244
|
+
role: "user",
|
|
245
|
+
content: {
|
|
246
|
+
type: "text",
|
|
247
|
+
text: `Our objective for today in {{repo}} is: '{{objective}}'.
|
|
248
|
+
|
|
249
|
+
Please act as a project manager and plan the execution:
|
|
250
|
+
1. **Analyze**: Break this objective down into 3-7 small, atomic, and verifiable tasks.
|
|
251
|
+
2. **Execute**: Use 'task-manage' with action='create' to add these to the local tracker.
|
|
252
|
+
3. **Hierarchy**: Use 'parent_id' or 'depends_on' if there is a clear order of operations.
|
|
253
|
+
4. **Phases**: Group tasks into phases like 'research', 'implementation', and 'validation'.
|
|
254
|
+
|
|
255
|
+
Display the created plan to the user when done.`
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
},
|
|
260
|
+
"tech-affinity-scout": {
|
|
261
|
+
name: "tech-affinity-scout",
|
|
262
|
+
description: "Find relevant best practices from other projects with similar tech",
|
|
263
|
+
arguments: [
|
|
264
|
+
{ name: "tags", description: "Comma-separated tech tags (e.g., 'react, tailwind')", required: true },
|
|
265
|
+
{ name: "repo", description: "The current repository name", required: true }
|
|
266
|
+
],
|
|
267
|
+
messages: [
|
|
268
|
+
{
|
|
269
|
+
role: "user",
|
|
270
|
+
content: {
|
|
271
|
+
type: "text",
|
|
272
|
+
text: `I am working on {{repo}} using [{{tags}}].
|
|
273
|
+
|
|
274
|
+
Please scout for relevant knowledge from other projects:
|
|
275
|
+
1. **Search**: Use 'memory-search' with current_tags=[{{tags}}] and include_archived=false.
|
|
276
|
+
2. **Filter**: Look for 'patterns' or 'decisions' from other repositories that might apply here.
|
|
277
|
+
3. **Translate**: Explain how these external best practices can be adapted to our current project context.`
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
]
|
|
281
|
+
},
|
|
282
|
+
"documentation-sync": {
|
|
283
|
+
name: "documentation-sync",
|
|
284
|
+
description: "Reconcile memory decisions with local markdown files",
|
|
285
|
+
arguments: [
|
|
286
|
+
{ name: "repo", description: "The current repository name", required: true }
|
|
287
|
+
],
|
|
288
|
+
messages: [
|
|
289
|
+
{
|
|
290
|
+
role: "user",
|
|
291
|
+
content: {
|
|
292
|
+
type: "text",
|
|
293
|
+
text: `Please verify if our local documentation (README.md, docs/*.md) is in sync with our stored memories for {{repo}}.
|
|
294
|
+
|
|
295
|
+
Steps:
|
|
296
|
+
1. **Fetch Decisions**: Use 'memory-search' to find all 'decision' type memories for this repo.
|
|
297
|
+
2. **Read Docs**: Read the primary project documentation files.
|
|
298
|
+
3. **Identify Gaps**: Is there any durable knowledge in the memory that is MISSING from the docs? Is there any documentation that is OUTDATED based on recent decisions?
|
|
299
|
+
4. **Propose Updates**: Suggest specific changes to the documentation to reflect the current source of truth.`
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
]
|
|
131
303
|
}
|
|
132
304
|
};
|
|
133
305
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/prompts/registry.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,mBAAmB,EAAE;QACnB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,kDAAkD;QAC/D,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+IAgC+H;iBACtI;aACF;SACF;KACF;IACD,qBAAqB,EAAE;QACrB,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,kCAAkC;QAC/C,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;gEAUgD;iBACvD;aACF;SACF;KACF;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE,8CAA8C;QAC3D,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;+DAe+C;iBACtD;aACF;SACF;KACF;IACD,4BAA4B,EAAE;QAC5B,IAAI,EAAE,4BAA4B;QAClC,WAAW,EAAE,0DAA0D;QACvE,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAA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D;QACnE,SAAS,EAAE;YACT,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,6BAA6B,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC7E;QACD,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;8GAM8F;iBACrG;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -11,10 +11,12 @@ function makeEntry(id, repo) {
|
|
|
11
11
|
content: `Content for memory ${id} in repo ${repo}`,
|
|
12
12
|
importance: 3,
|
|
13
13
|
agent: "test-agent",
|
|
14
|
+
role: "unknown",
|
|
14
15
|
model: "test-model",
|
|
15
16
|
scope: { repo },
|
|
16
17
|
created_at: new Date().toISOString(),
|
|
17
18
|
updated_at: new Date().toISOString(),
|
|
19
|
+
completed_at: null,
|
|
18
20
|
hit_count: 0,
|
|
19
21
|
recall_count: 0,
|
|
20
22
|
last_used_at: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/resources/index.test.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,SAAS,SAAS,CAAC,EAAU,EAAE,IAAY;IACzC,OAAO;QACL,EAAE;QACF,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,UAAU,EAAE,EAAE;QACrB,OAAO,EAAE,sBAAsB,EAAE,YAAY,IAAI,EAAE;QACnD,UAAU,EAAE,CAAC;QACb,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,EAAE,IAAI,EAAE;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ACX,OAAO,QAAQ,CAAC;QAClB,CAAC,CACF,EACD,EAAE,OAAO,EAAE,GAAG,EAAE,CACjB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,EAAE,CAAC,MAAM,CACP,EAAE,CAAC,QAAQ,CACT,EAAE,CAAC,WAAW,CACZ,EAAE,CAAC,cAAc,CAAC,uBAAuB,CAAC,EAC1C,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAC/B,EACD,CAAC,KAAe,EAAE,EAAE;YAClB,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;YAEvC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;YAC3C,CAAC;YAED,MAAM,MAAM,GAAG,YAAY,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;YAClD,MAAM,OAAO,GACX,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAEtC,0EAA0E;YAC1E,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YAE1C,EAAE,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAC;QACd,CAAC,CACF,EACD,EAAE,OAAO,EAAE,GAAG,EAAE,CACjB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/storage/sqlite.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export declare class SQLiteStore {
|
|
|
8
8
|
update(id: string, updates: any): void;
|
|
9
9
|
getById(id: string): MemoryEntry | null;
|
|
10
10
|
getByIdWithStats(id: string): any | null;
|
|
11
|
+
getByIds(ids: string[], filters?: {
|
|
12
|
+
type?: string;
|
|
13
|
+
status?: string;
|
|
14
|
+
}): MemoryEntry[];
|
|
11
15
|
searchByRepo(repo: string, options?: any): MemoryEntry[];
|
|
12
16
|
searchBySimilarity(query: string, repo: string, limit?: number, includeArchived?: boolean, currentTags?: string[]): any[];
|
|
13
17
|
archiveExpiredMemories(force?: boolean): number;
|
|
@@ -40,7 +44,8 @@ export declare class SQLiteStore {
|
|
|
40
44
|
incrementRecallCount(id: string): void;
|
|
41
45
|
insertTask(task: any): void;
|
|
42
46
|
updateTask(id: string, updates: any): void;
|
|
43
|
-
getTasksByRepo(repo: string, status?: string): any[];
|
|
47
|
+
getTasksByRepo(repo: string, status?: string, limit?: number, offset?: number): any[];
|
|
48
|
+
getTasksByMultipleStatuses(repo: string, statuses: string[], limit?: number, offset?: number): any[];
|
|
44
49
|
deleteTask(id: string): void;
|
|
45
50
|
private rowToTask;
|
|
46
51
|
getRecentMemories(repo: string, limit: number, offset?: number, includeArchived?: boolean): MemoryEntry[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/storage/sqlite.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAe,MAAM,aAAa,CAAC;AAwDvD,qBAAa,WAAW;IACtB,OAAO,CAAC,EAAE,CAAoB;gBAElB,MAAM,CAAC,EAAE,MAAM;IAepB,SAAS,IAAI,MAAM;IAI1B,OAAO,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/storage/sqlite.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAe,MAAM,aAAa,CAAC;AAwDvD,qBAAa,WAAW;IACtB,OAAO,CAAC,EAAE,CAAoB;gBAElB,MAAM,CAAC,EAAE,MAAM;IAepB,SAAS,IAAI,MAAM;IAI1B,OAAO,CAAC,OAAO;IAwKf,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAgChC,MAAM,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MAAM;IAM5D,mBAAmB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,GAAG,EAAE;IAQtD,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;IAOtD,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,SAAO,GAAG,OAAO,CAAC,GAAG,CAAC;IAqB/G,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,GAAQ;IAMzD,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,GAAG,EAAE;IAkBlD,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,gBAAgB;IAoBxB,KAAK,IAAI,IAAI;CACd"}
|
package/dist/storage/sqlite.js
CHANGED
|
@@ -86,7 +86,9 @@ export class SQLiteStore {
|
|
|
86
86
|
recall_count INTEGER NOT NULL DEFAULT 0,
|
|
87
87
|
last_used_at TEXT,
|
|
88
88
|
agent TEXT NOT NULL DEFAULT 'unknown',
|
|
89
|
-
|
|
89
|
+
role TEXT NOT NULL DEFAULT 'unknown',
|
|
90
|
+
model TEXT NOT NULL DEFAULT 'unknown',
|
|
91
|
+
completed_at TEXT
|
|
90
92
|
);
|
|
91
93
|
|
|
92
94
|
CREATE INDEX IF NOT EXISTS idx_memories_repo ON memories(repo);
|
|
@@ -121,6 +123,9 @@ export class SQLiteStore {
|
|
|
121
123
|
description TEXT,
|
|
122
124
|
status TEXT NOT NULL DEFAULT 'pending' CHECK (status IN ('pending', 'in_progress', 'completed', 'canceled', 'blocked')),
|
|
123
125
|
priority INTEGER NOT NULL DEFAULT 3,
|
|
126
|
+
agent TEXT NOT NULL DEFAULT 'unknown',
|
|
127
|
+
role TEXT NOT NULL DEFAULT 'unknown',
|
|
128
|
+
doc_path TEXT,
|
|
124
129
|
created_at TEXT NOT NULL,
|
|
125
130
|
updated_at TEXT NOT NULL,
|
|
126
131
|
finished_at TEXT,
|
|
@@ -156,7 +161,9 @@ export class SQLiteStore {
|
|
|
156
161
|
expires_at TEXT,
|
|
157
162
|
archived_at TEXT NOT NULL,
|
|
158
163
|
agent TEXT NOT NULL DEFAULT 'unknown',
|
|
159
|
-
|
|
164
|
+
role TEXT NOT NULL DEFAULT 'unknown',
|
|
165
|
+
model TEXT NOT NULL DEFAULT 'unknown',
|
|
166
|
+
completed_at TEXT
|
|
160
167
|
);
|
|
161
168
|
|
|
162
169
|
CREATE TABLE IF NOT EXISTS action_log (
|
|
@@ -189,7 +196,12 @@ export class SQLiteStore {
|
|
|
189
196
|
{ name: "task_code", table: "tasks", definition: "ALTER TABLE tasks ADD COLUMN task_code TEXT" },
|
|
190
197
|
{ name: "task_id", table: "action_log", definition: "ALTER TABLE action_log ADD COLUMN task_id TEXT" },
|
|
191
198
|
{ name: "agent", table: "memories", definition: "ALTER TABLE memories ADD COLUMN agent TEXT NOT NULL DEFAULT 'unknown'" },
|
|
199
|
+
{ name: "role", table: "memories", definition: "ALTER TABLE memories ADD COLUMN role TEXT NOT NULL DEFAULT 'unknown'" },
|
|
192
200
|
{ name: "model", table: "memories", definition: "ALTER TABLE memories ADD COLUMN model TEXT NOT NULL DEFAULT 'unknown'" },
|
|
201
|
+
{ name: "completed_at", table: "memories", definition: "ALTER TABLE memories ADD COLUMN completed_at TEXT" },
|
|
202
|
+
{ name: "agent", table: "tasks", definition: "ALTER TABLE tasks ADD COLUMN agent TEXT NOT NULL DEFAULT 'unknown'" },
|
|
203
|
+
{ name: "role", table: "tasks", definition: "ALTER TABLE tasks ADD COLUMN role TEXT NOT NULL DEFAULT 'unknown'" },
|
|
204
|
+
{ name: "doc_path", table: "tasks", definition: "ALTER TABLE tasks ADD COLUMN doc_path TEXT" },
|
|
193
205
|
];
|
|
194
206
|
for (const col of columnsToAdd) {
|
|
195
207
|
try {
|
|
@@ -220,10 +232,10 @@ export class SQLiteStore {
|
|
|
220
232
|
INSERT INTO memories (
|
|
221
233
|
id, repo, type, title, content, importance, folder, language,
|
|
222
234
|
created_at, updated_at, hit_count, recall_count, last_used_at, expires_at,
|
|
223
|
-
supersedes, status, is_global, tags, agent, model
|
|
224
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, 0, NULL, ?, ?, ?, ?, ?, ?, ?)
|
|
235
|
+
supersedes, status, is_global, tags, agent, role, model, completed_at
|
|
236
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, 0, NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
225
237
|
`);
|
|
226
|
-
stmt.run(entry.id, entry.scope.repo, entry.type, entry.title || null, entry.content, entry.importance, entry.scope.folder || null, entry.scope.language || null, entry.created_at, entry.updated_at, entry.expires_at ?? null, entry.supersedes ?? null, entry.status || "active", entry.is_global ? 1 : 0, entry.tags ? JSON.stringify(entry.tags) : null, entry.agent || 'unknown', entry.model || 'unknown');
|
|
238
|
+
stmt.run(entry.id, entry.scope.repo, entry.type, entry.title || null, entry.content, entry.importance, entry.scope.folder || null, entry.scope.language || null, entry.created_at, entry.updated_at, entry.expires_at ?? null, entry.supersedes ?? null, entry.status || "active", entry.is_global ? 1 : 0, entry.tags ? JSON.stringify(entry.tags) : null, entry.agent || 'unknown', entry.role || 'unknown', entry.model || 'unknown', entry.completed_at || null);
|
|
227
239
|
}
|
|
228
240
|
update(id, updates) {
|
|
229
241
|
const fields = [];
|
|
@@ -263,6 +275,22 @@ export class SQLiteStore {
|
|
|
263
275
|
`).get(id);
|
|
264
276
|
return row ? { ...this.rowToMemoryEntry(row), recall_rate: row.recall_rate ?? 0 } : null;
|
|
265
277
|
}
|
|
278
|
+
getByIds(ids, filters) {
|
|
279
|
+
if (ids.length === 0)
|
|
280
|
+
return [];
|
|
281
|
+
let query = "SELECT * FROM memories WHERE id IN (" + ids.map(() => "?").join(",") + ")";
|
|
282
|
+
const params = [...ids];
|
|
283
|
+
if (filters?.type) {
|
|
284
|
+
query += " AND type = ?";
|
|
285
|
+
params.push(filters.type);
|
|
286
|
+
}
|
|
287
|
+
if (filters?.status) {
|
|
288
|
+
query += " AND status = ?";
|
|
289
|
+
params.push(filters.status);
|
|
290
|
+
}
|
|
291
|
+
const rows = this.db.prepare(query).all(...params);
|
|
292
|
+
return rows.map(r => this.rowToMemoryEntry(r));
|
|
293
|
+
}
|
|
266
294
|
searchByRepo(repo, options = {}) {
|
|
267
295
|
let where = ["(repo = ? OR is_global = 1)"];
|
|
268
296
|
const params = [repo];
|
|
@@ -452,10 +480,17 @@ export class SQLiteStore {
|
|
|
452
480
|
}
|
|
453
481
|
const countStmt = this.db.prepare(`SELECT COUNT(*) as count FROM memories WHERE ${where.join(" AND ")}`);
|
|
454
482
|
const total = countStmt.get(...params).count;
|
|
483
|
+
let orderBy = "";
|
|
484
|
+
if (sortBy && sortOrder) {
|
|
485
|
+
orderBy = `ORDER BY ${sortBy} ${sortOrder}`;
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
orderBy = `ORDER BY importance DESC, created_at ASC`;
|
|
489
|
+
}
|
|
455
490
|
const dataStmt = this.db.prepare(`
|
|
456
491
|
SELECT *, CASE WHEN hit_count > 0 THEN CAST(recall_count AS REAL) / hit_count ELSE 0 END AS recall_rate
|
|
457
492
|
FROM memories WHERE ${where.join(" AND ")}
|
|
458
|
-
|
|
493
|
+
${orderBy} LIMIT ? OFFSET ?
|
|
459
494
|
`);
|
|
460
495
|
const rows = dataStmt.all(...params, limit, offset);
|
|
461
496
|
const items = rows.map(row => ({
|
|
@@ -489,10 +524,10 @@ export class SQLiteStore {
|
|
|
489
524
|
const stmt = this.db.prepare(`
|
|
490
525
|
INSERT INTO tasks (
|
|
491
526
|
id, repo, task_code, phase, title, description, status, priority,
|
|
492
|
-
created_at, updated_at, finished_at, canceled_at, tags, metadata, parent_id, depends_on
|
|
493
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
527
|
+
agent, role, doc_path, created_at, updated_at, finished_at, canceled_at, tags, metadata, parent_id, depends_on
|
|
528
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
494
529
|
`);
|
|
495
|
-
stmt.run(task.id, task.repo, task.task_code, task.phase || null, task.title, task.description || null, task.status || "pending", task.priority || 3, task.created_at, task.updated_at, task.finished_at || null, task.canceled_at || null, task.tags ? JSON.stringify(task.tags) : null, task.metadata ? JSON.stringify(task.metadata) : null, task.parent_id || null, task.depends_on || null);
|
|
530
|
+
stmt.run(task.id, task.repo, task.task_code, task.phase || null, task.title, task.description || null, task.status || "pending", task.priority || 3, task.agent || 'unknown', task.role || 'unknown', task.doc_path || null, task.created_at, task.updated_at, task.finished_at || null, task.canceled_at || null, task.tags ? JSON.stringify(task.tags) : null, task.metadata ? JSON.stringify(task.metadata) : null, task.parent_id || null, task.depends_on || null);
|
|
496
531
|
}
|
|
497
532
|
updateTask(id, updates) {
|
|
498
533
|
const fields = [];
|
|
@@ -517,14 +552,43 @@ export class SQLiteStore {
|
|
|
517
552
|
const stmt = this.db.prepare(`UPDATE tasks SET ${fields.join(", ")} WHERE id = ?`);
|
|
518
553
|
stmt.run(...values);
|
|
519
554
|
}
|
|
520
|
-
getTasksByRepo(repo, status) {
|
|
555
|
+
getTasksByRepo(repo, status, limit, offset) {
|
|
521
556
|
let query = "SELECT * FROM tasks WHERE repo = ?";
|
|
522
557
|
const params = [repo];
|
|
523
558
|
if (status) {
|
|
524
559
|
query += " AND status = ?";
|
|
525
560
|
params.push(status);
|
|
526
561
|
}
|
|
562
|
+
// Default sorting logic for the unified list:
|
|
563
|
+
// 1. Completed tasks at the bottom (or top if specified)
|
|
564
|
+
// 2. Priority for others
|
|
565
|
+
// 3. Created date
|
|
566
|
+
query += " ORDER BY status DESC, priority DESC, created_at ASC";
|
|
567
|
+
if (limit !== undefined) {
|
|
568
|
+
query += " LIMIT ?";
|
|
569
|
+
params.push(limit);
|
|
570
|
+
if (offset !== undefined) {
|
|
571
|
+
query += " OFFSET ?";
|
|
572
|
+
params.push(offset);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
const rows = this.db.prepare(query).all(...params);
|
|
576
|
+
return rows.map(r => this.rowToTask(r));
|
|
577
|
+
}
|
|
578
|
+
getTasksByMultipleStatuses(repo, statuses, limit, offset) {
|
|
579
|
+
if (!statuses.length)
|
|
580
|
+
return this.getTasksByRepo(repo, undefined, limit, offset);
|
|
581
|
+
let query = `SELECT * FROM tasks WHERE repo = ? AND status IN (${statuses.map(() => '?').join(',')})`;
|
|
582
|
+
const params = [repo, ...statuses];
|
|
527
583
|
query += " ORDER BY priority DESC, created_at ASC";
|
|
584
|
+
if (limit !== undefined) {
|
|
585
|
+
query += " LIMIT ?";
|
|
586
|
+
params.push(limit);
|
|
587
|
+
if (offset !== undefined) {
|
|
588
|
+
query += " OFFSET ?";
|
|
589
|
+
params.push(offset);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
528
592
|
const rows = this.db.prepare(query).all(...params);
|
|
529
593
|
return rows.map(r => this.rowToTask(r));
|
|
530
594
|
}
|
|
@@ -543,6 +607,9 @@ export class SQLiteStore {
|
|
|
543
607
|
catch (e) { }
|
|
544
608
|
return {
|
|
545
609
|
...row,
|
|
610
|
+
agent: row.agent || 'unknown',
|
|
611
|
+
role: row.role || 'unknown',
|
|
612
|
+
doc_path: row.doc_path || null,
|
|
546
613
|
tags,
|
|
547
614
|
metadata
|
|
548
615
|
};
|
|
@@ -582,10 +649,18 @@ export class SQLiteStore {
|
|
|
582
649
|
}
|
|
583
650
|
async checkConflicts(content, repo, type, vectors, threshold = 0.55) {
|
|
584
651
|
const vectorResults = await vectors.search(content, 10, repo);
|
|
652
|
+
const candidateIds = vectorResults
|
|
653
|
+
.filter((vr) => vr.score > threshold)
|
|
654
|
+
.map((vr) => vr.id);
|
|
655
|
+
if (candidateIds.length === 0)
|
|
656
|
+
return null;
|
|
657
|
+
const memories = this.getByIds(candidateIds, { type, status: "active" });
|
|
658
|
+
const memoryMap = new Map(memories.map(m => [m.id, m]));
|
|
659
|
+
// Iterate through original vector results to maintain score priority
|
|
585
660
|
for (const vr of vectorResults) {
|
|
586
661
|
if (vr.score > threshold) {
|
|
587
|
-
const memory =
|
|
588
|
-
if (memory
|
|
662
|
+
const memory = memoryMap.get(vr.id);
|
|
663
|
+
if (memory)
|
|
589
664
|
return memory;
|
|
590
665
|
}
|
|
591
666
|
}
|
|
@@ -644,9 +719,12 @@ export class SQLiteStore {
|
|
|
644
719
|
return {
|
|
645
720
|
id: row.id, type: row.type, title: row.title || "Untitled", content: row.content, importance: row.importance,
|
|
646
721
|
agent: row.agent || 'unknown',
|
|
722
|
+
role: row.role || 'unknown',
|
|
647
723
|
model: row.model || 'unknown',
|
|
648
724
|
scope: { repo: row.repo, folder: row.folder || undefined, language: row.language || undefined },
|
|
649
|
-
created_at: row.created_at, updated_at: row.updated_at,
|
|
725
|
+
created_at: row.created_at, updated_at: row.updated_at,
|
|
726
|
+
completed_at: row.completed_at || null,
|
|
727
|
+
hit_count: row.hit_count ?? 0, recall_count: row.recall_count ?? 0,
|
|
650
728
|
last_used_at: row.last_used_at ?? null, expires_at: row.expires_at ?? null, supersedes: row.supersedes ?? null, status: row.status || "active",
|
|
651
729
|
is_global: row.is_global === 1, tags
|
|
652
730
|
};
|