@vheins/local-memory-mcp 0.4.2 → 0.4.6
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 +16 -7
- package/dist/dashboard/public/index.html +17 -6
- package/dist/prompts/registry.d.ts +92 -8
- package/dist/prompts/registry.d.ts.map +1 -1
- package/dist/prompts/registry.js +204 -41
- package/dist/prompts/registry.js.map +1 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +18 -3
- package/dist/router.js.map +1 -1
- package/dist/storage/sqlite.d.ts.map +1 -1
- package/dist/storage/sqlite.js +23 -6
- package/dist/storage/sqlite.js.map +1 -1
- package/dist/tasks.archive.test.d.ts +2 -0
- package/dist/tasks.archive.test.d.ts.map +1 -0
- package/dist/tasks.archive.test.js +75 -0
- package/dist/tasks.archive.test.js.map +1 -0
- package/dist/tools/schemas.d.ts +12 -18
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +10 -11
- package/dist/tools/schemas.js.map +1 -1
- package/dist/tools/task.bulk-manage.d.ts +2 -1
- package/dist/tools/task.bulk-manage.d.ts.map +1 -1
- package/dist/tools/task.bulk-manage.js +20 -2
- package/dist/tools/task.bulk-manage.js.map +1 -1
- package/dist/tools/task.manage.d.ts +3 -1
- package/dist/tools/task.manage.d.ts.map +1 -1
- package/dist/tools/task.manage.js +66 -3
- package/dist/tools/task.manage.js.map +1 -1
- package/dist/tools/tasks-transition.test.js +71 -11
- package/dist/tools/tasks-transition.test.js.map +1 -1
- package/dist/tools/tasks.pending-limit-refined.test.d.ts +2 -0
- package/dist/tools/tasks.pending-limit-refined.test.d.ts.map +1 -0
- package/dist/tools/tasks.pending-limit-refined.test.js +72 -0
- package/dist/tools/tasks.pending-limit-refined.test.js.map +1 -0
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/prompts/registry.js
CHANGED
|
@@ -118,7 +118,7 @@ Memory is a permanent record, categorize it properly with tags.`
|
|
|
118
118
|
|
|
119
119
|
2. Resource & Tool Usage:
|
|
120
120
|
- MANDATORY: Always call 'task-list' at the very start of a new session to understand current progress and avoid duplicating work.
|
|
121
|
-
- Resource: You can also read 'tasks://current
|
|
121
|
+
- Resource: You can also read 'tasks://current' for a filtered view of active tasks for the current repository.
|
|
122
122
|
- Coordinate: If a task is already 'in_progress', do not attempt to work on it unless specifically asked to collaborate.
|
|
123
123
|
|
|
124
124
|
3. Workflow Integration:
|
|
@@ -131,25 +131,19 @@ Memory is a permanent record, categorize it properly with tags.`
|
|
|
131
131
|
},
|
|
132
132
|
"import-github-issues": {
|
|
133
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
|
-
],
|
|
134
|
+
description: "Guide for importing GitHub Issues from the current repository as local tasks",
|
|
135
|
+
arguments: [],
|
|
142
136
|
messages: [
|
|
143
137
|
{
|
|
144
138
|
role: "user",
|
|
145
139
|
content: {
|
|
146
140
|
type: "text",
|
|
147
|
-
text: `You are tasked with importing GitHub Issues from the repository
|
|
141
|
+
text: `You are tasked with importing GitHub Issues from the current repository into our local task management system.
|
|
148
142
|
|
|
149
143
|
Please follow these steps:
|
|
150
144
|
|
|
151
|
-
1. **Access Issues**: Use available GitHub MCP tools to list open issues for the repository
|
|
152
|
-
2. **Review Existing Tasks**: Call 'task-list' for the current
|
|
145
|
+
1. **Access Issues**: Use available GitHub MCP tools to list open issues for the current repository.
|
|
146
|
+
2. **Review Existing Tasks**: Call 'task-list' for the current repository to identify tasks already imported.
|
|
153
147
|
3. **Map and Create**: For each relevant issue that hasn't been imported yet:
|
|
154
148
|
- Use 'task-manage' with action='create'.
|
|
155
149
|
- Set 'task_code' to 'GH-{{issue_number}}' (e.g., GH-123).
|
|
@@ -167,18 +161,16 @@ Please follow these steps:
|
|
|
167
161
|
"project-briefing": {
|
|
168
162
|
name: "project-briefing",
|
|
169
163
|
description: "Onboard the agent to the current repository state",
|
|
170
|
-
arguments: [
|
|
171
|
-
{ name: "repo", description: "The current repository name", required: true }
|
|
172
|
-
],
|
|
164
|
+
arguments: [],
|
|
173
165
|
messages: [
|
|
174
166
|
{
|
|
175
167
|
role: "user",
|
|
176
168
|
content: {
|
|
177
169
|
type: "text",
|
|
178
|
-
text: `I am starting a new session in repository
|
|
170
|
+
text: `I am starting a new session in the current repository.
|
|
179
171
|
|
|
180
172
|
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
|
|
173
|
+
1. **Recent Knowledge**: Call 'memory-recap' for the current repo to see the latest decisions, patterns, and mistakes recorded.
|
|
182
174
|
2. **Current Tasks**: Call 'task-list' to understand what is currently pending or in-progress.
|
|
183
175
|
3. **Context Check**: Summarize the top 3 most important architectural decisions you found.
|
|
184
176
|
4. **Readiness**: Tell me what you are ready to help with based on the current backlog.`
|
|
@@ -188,9 +180,8 @@ Please perform a briefing to catch up on the project:
|
|
|
188
180
|
},
|
|
189
181
|
"learning-retrospective": {
|
|
190
182
|
name: "learning-retrospective",
|
|
191
|
-
description: "Extract durable knowledge from recent work",
|
|
183
|
+
description: "Extract durable knowledge from recent work in the current repository",
|
|
192
184
|
arguments: [
|
|
193
|
-
{ name: "repo", description: "The current repository name", required: true },
|
|
194
185
|
{ name: "task_id", description: "Optional ID of the task just completed", required: false }
|
|
195
186
|
],
|
|
196
187
|
messages: [
|
|
@@ -198,7 +189,7 @@ Please perform a briefing to catch up on the project:
|
|
|
198
189
|
role: "user",
|
|
199
190
|
content: {
|
|
200
191
|
type: "text",
|
|
201
|
-
text: `We have just finished some work in
|
|
192
|
+
text: `We have just finished some work in the current repository related to task {{task_id}}.
|
|
202
193
|
|
|
203
194
|
Please reflect on the changes and identify knowledge worth keeping:
|
|
204
195
|
1. **Mistakes**: Did we encounter any bugs that were hard to find or caused by specific environment quirks? (Store as 'mistake')
|
|
@@ -212,20 +203,19 @@ Use 'memory-store' to record any high-value findings. Be concise and use appropr
|
|
|
212
203
|
},
|
|
213
204
|
"memory-guided-review": {
|
|
214
205
|
name: "memory-guided-review",
|
|
215
|
-
description: "Review code for compliance with stored project decisions",
|
|
206
|
+
description: "Review code for compliance with stored project decisions in the current repository",
|
|
216
207
|
arguments: [
|
|
217
|
-
{ name: "file_path", description: "Path to the file to review", required: true }
|
|
218
|
-
{ name: "repo", description: "The current repository name", required: true }
|
|
208
|
+
{ name: "file_path", description: "Path to the file to review", required: true }
|
|
219
209
|
],
|
|
220
210
|
messages: [
|
|
221
211
|
{
|
|
222
212
|
role: "user",
|
|
223
213
|
content: {
|
|
224
214
|
type: "text",
|
|
225
|
-
text: `Please review the code in '{{file_path}}'
|
|
215
|
+
text: `Please review the code in '{{file_path}}'.
|
|
226
216
|
|
|
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.
|
|
217
|
+
Your goal is to ensure compliance with our stored project knowledge for the current repository:
|
|
218
|
+
1. **Search Constraints**: Use 'memory-search' with current_file_path='{{file_path}}' and the current repo context to find relevant decisions and patterns.
|
|
229
219
|
2. **Evaluate Compliance**: Does the code follow established patterns? Does it repeat any known mistakes?
|
|
230
220
|
3. **Feedback**: Provide specific suggestions for improvement if you find violations of stored decisions.`
|
|
231
221
|
}
|
|
@@ -234,21 +224,20 @@ Your goal is to ensure compliance with our stored project knowledge:
|
|
|
234
224
|
},
|
|
235
225
|
"session-planner": {
|
|
236
226
|
name: "session-planner",
|
|
237
|
-
description: "Break down a complex objective into atomic tasks",
|
|
227
|
+
description: "Break down a complex objective into atomic tasks for the current repository",
|
|
238
228
|
arguments: [
|
|
239
|
-
{ name: "objective", description: "The high-level goal for this session", required: true }
|
|
240
|
-
{ name: "repo", description: "The current repository name", required: true }
|
|
229
|
+
{ name: "objective", description: "The high-level goal for this session", required: true }
|
|
241
230
|
],
|
|
242
231
|
messages: [
|
|
243
232
|
{
|
|
244
233
|
role: "user",
|
|
245
234
|
content: {
|
|
246
235
|
type: "text",
|
|
247
|
-
text: `Our objective for today in
|
|
236
|
+
text: `Our objective for today in the current repository is: '{{objective}}'.
|
|
248
237
|
|
|
249
238
|
Please act as a project manager and plan the execution:
|
|
250
239
|
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.
|
|
240
|
+
2. **Execute**: Use 'task-manage' with action='create' to add these to the local tracker for the current repo.
|
|
252
241
|
3. **Hierarchy**: Use 'parent_id' or 'depends_on' if there is a clear order of operations.
|
|
253
242
|
4. **Phases**: Group tasks into phases like 'research', 'implementation', and 'validation'.
|
|
254
243
|
|
|
@@ -259,17 +248,16 @@ Display the created plan to the user when done.`
|
|
|
259
248
|
},
|
|
260
249
|
"tech-affinity-scout": {
|
|
261
250
|
name: "tech-affinity-scout",
|
|
262
|
-
description: "Find relevant best practices from other projects with similar tech",
|
|
251
|
+
description: "Find relevant best practices from other projects with similar tech for the current repository",
|
|
263
252
|
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 }
|
|
253
|
+
{ name: "tags", description: "Comma-separated tech tags (e.g., 'react, tailwind')", required: true }
|
|
266
254
|
],
|
|
267
255
|
messages: [
|
|
268
256
|
{
|
|
269
257
|
role: "user",
|
|
270
258
|
content: {
|
|
271
259
|
type: "text",
|
|
272
|
-
text: `I am working on
|
|
260
|
+
text: `I am working on the current repository using [{{tags}}].
|
|
273
261
|
|
|
274
262
|
Please scout for relevant knowledge from other projects:
|
|
275
263
|
1. **Search**: Use 'memory-search' with current_tags=[{{tags}}] and include_archived=false.
|
|
@@ -281,20 +269,18 @@ Please scout for relevant knowledge from other projects:
|
|
|
281
269
|
},
|
|
282
270
|
"documentation-sync": {
|
|
283
271
|
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
|
-
],
|
|
272
|
+
description: "Reconcile memory decisions with local markdown files in the current repository",
|
|
273
|
+
arguments: [],
|
|
288
274
|
messages: [
|
|
289
275
|
{
|
|
290
276
|
role: "user",
|
|
291
277
|
content: {
|
|
292
278
|
type: "text",
|
|
293
|
-
text: `Please verify if our local documentation (README.md, docs/*.md) is in sync with our stored memories for
|
|
279
|
+
text: `Please verify if our local documentation (README.md, docs/*.md, .agents/documents/**/*.md, .kiro/**/*.md) is in sync with our stored memories for the current repository.
|
|
294
280
|
|
|
295
281
|
Steps:
|
|
296
282
|
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.
|
|
283
|
+
2. **Read Docs**: Read the primary project documentation files including those in .agents/documents and .kiro.
|
|
298
284
|
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
285
|
4. **Propose Updates**: Suggest specific changes to the documentation to reflect the current source of truth.`
|
|
300
286
|
}
|
|
@@ -330,6 +316,183 @@ If a task becomes blocked, update its status to 'blocked' with a **clear reason
|
|
|
330
316
|
}
|
|
331
317
|
}
|
|
332
318
|
]
|
|
319
|
+
},
|
|
320
|
+
"senior-code-review": {
|
|
321
|
+
name: "senior-code-review",
|
|
322
|
+
description: "Performs a comprehensive production-readiness evaluation for the current repository context",
|
|
323
|
+
arguments: [
|
|
324
|
+
{ name: "tech_stack", description: "Target tech stack (e.g., 'Node.js + Express')", required: true },
|
|
325
|
+
{ name: "context", description: "Production context (traffic, data sensitivity, SLA, conventions)", required: false }
|
|
326
|
+
],
|
|
327
|
+
messages: [
|
|
328
|
+
{
|
|
329
|
+
role: "user",
|
|
330
|
+
content: {
|
|
331
|
+
type: "text",
|
|
332
|
+
text: `Act as a principal software engineer performing a production-readiness review for the current repository.
|
|
333
|
+
|
|
334
|
+
Stack: {{tech_stack}}
|
|
335
|
+
Context: {{context}}
|
|
336
|
+
|
|
337
|
+
Please review the current code/changes against these 6 dimensions:
|
|
338
|
+
1. **Error Handling Completeness**
|
|
339
|
+
2. **Security** (Injection, Input validation, PII/Secrets)
|
|
340
|
+
3. **Performance** (Time/Memory complexity, DB queries)
|
|
341
|
+
4. **Observability** (Logging, Metrics, Tracing)
|
|
342
|
+
5. **Test Coverage**
|
|
343
|
+
6. **Documentation**
|
|
344
|
+
|
|
345
|
+
For each finding, provide:
|
|
346
|
+
- **Severity**: P0-P3
|
|
347
|
+
- **Dimension**: One of the above
|
|
348
|
+
- **Location**: Specific function/line
|
|
349
|
+
- **Problem**: What is wrong and why it matters
|
|
350
|
+
- **Fix**: Actionable recommendation
|
|
351
|
+
|
|
352
|
+
Produce a **Production Readiness Verdict**: READY | READY WITH MINOR FIXES | NOT READY`
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
]
|
|
356
|
+
},
|
|
357
|
+
"fix-suggestion": {
|
|
358
|
+
name: "fix-suggestion",
|
|
359
|
+
description: "Provide a targeted, minimal fix for an identified bug with before/after code and a test case",
|
|
360
|
+
arguments: [
|
|
361
|
+
{ name: "tech_stack", description: "Target technology stack", required: true },
|
|
362
|
+
{ name: "bug_description", description: "Description of the bug behavior", required: true },
|
|
363
|
+
{ name: "root_cause", description: "The identified root cause", required: true }
|
|
364
|
+
],
|
|
365
|
+
messages: [
|
|
366
|
+
{
|
|
367
|
+
role: "user",
|
|
368
|
+
content: {
|
|
369
|
+
type: "text",
|
|
370
|
+
text: `You are a senior software engineer generating a precise, minimal fix for a confirmed bug in the current repository.
|
|
371
|
+
|
|
372
|
+
Tech stack: {{tech_stack}}
|
|
373
|
+
Bug description: {{bug_description}}
|
|
374
|
+
Root cause: {{root_cause}}
|
|
375
|
+
|
|
376
|
+
Please provide:
|
|
377
|
+
1. **Fix Explanation**: Why the bug occurs and how the fix resolves it.
|
|
378
|
+
2. **Before Code**: Show original buggy code.
|
|
379
|
+
3. **After Code**: Show fixed code with explanatory comments.
|
|
380
|
+
4. **Fix Checklist**: Additional changes (config, migrations, etc.)
|
|
381
|
+
5. **Test Case**: A regression test case to verify the fix.`
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
]
|
|
385
|
+
},
|
|
386
|
+
"root-cause-analysis": {
|
|
387
|
+
name: "root-cause-analysis",
|
|
388
|
+
description: "Apply structured 5-Why analysis to trace bugs to their origin",
|
|
389
|
+
arguments: [
|
|
390
|
+
{ name: "tech_stack", description: "Target technology stack", required: true },
|
|
391
|
+
{ name: "bug_description", description: "Observable symptom or bug behavior", required: true },
|
|
392
|
+
{ name: "symptoms", description: "Additional errors, logs, metrics", required: false }
|
|
393
|
+
],
|
|
394
|
+
messages: [
|
|
395
|
+
{
|
|
396
|
+
role: "user",
|
|
397
|
+
content: {
|
|
398
|
+
type: "text",
|
|
399
|
+
text: `You are a senior software engineer conducting a root cause analysis for a bug in the current repository.
|
|
400
|
+
|
|
401
|
+
Tech stack: {{tech_stack}}
|
|
402
|
+
Bug description: {{bug_description}}
|
|
403
|
+
Symptoms: {{symptoms}}
|
|
404
|
+
|
|
405
|
+
Apply a full **5-Why analysis**:
|
|
406
|
+
1. **Symptom Statement**: Technically restate the problem.
|
|
407
|
+
2. **5-Why Causal Chain**: Trace from symptom to the core process/design/environmental failure.
|
|
408
|
+
3. **Root Cause Statement**: "The root cause is [X] because [Y], which allowed [Z] to occur."
|
|
409
|
+
4. **Fix Recommendation**: Address the root cause, not just the symptom.
|
|
410
|
+
5. **Recurrence Prevention**: Suggest a monitoring or testing measure.`
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
]
|
|
414
|
+
},
|
|
415
|
+
"technical-planning": {
|
|
416
|
+
name: "technical-planning",
|
|
417
|
+
description: "Define the technical blueprint for a new feature or product",
|
|
418
|
+
arguments: [
|
|
419
|
+
{ name: "objective", description: "The high-level goal for the plan", required: true }
|
|
420
|
+
],
|
|
421
|
+
messages: [
|
|
422
|
+
{
|
|
423
|
+
role: "user",
|
|
424
|
+
content: {
|
|
425
|
+
type: "text",
|
|
426
|
+
text: `You are tasked with creating a technical blueprint for the following objective in the current repository: '{{objective}}'.
|
|
427
|
+
|
|
428
|
+
Please cover:
|
|
429
|
+
1. **Tech Stack**: Confirm or select the stack.
|
|
430
|
+
2. **Architecture**: Component layout and data flow.
|
|
431
|
+
3. **Domain Model**: Entities, value objects, and events.
|
|
432
|
+
4. **Database Schema**: Normalized tables and relationships.
|
|
433
|
+
5. **API Contracts**: Endpoint definitions (request/response/errors).
|
|
434
|
+
6. **Roadmap & Sprints**: Phased delivery plan.
|
|
435
|
+
|
|
436
|
+
Present a cohesive technical design and obtain feedback before proceeding to implementation.`
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
]
|
|
440
|
+
},
|
|
441
|
+
"security-triage": {
|
|
442
|
+
name: "security-triage",
|
|
443
|
+
description: "Assess security vulnerability reports for exploitability and prioritize remediation",
|
|
444
|
+
arguments: [
|
|
445
|
+
{ name: "tech_stack", description: "Application stack", required: true },
|
|
446
|
+
{ name: "vulnerability_report", description: "Report details (CVE, SAST, etc.)", required: true },
|
|
447
|
+
{ name: "codebase_context", description: "Component usage context", required: false }
|
|
448
|
+
],
|
|
449
|
+
messages: [
|
|
450
|
+
{
|
|
451
|
+
role: "user",
|
|
452
|
+
content: {
|
|
453
|
+
type: "text",
|
|
454
|
+
text: `Act as a senior application security engineer triaging a vulnerability for the current repository.
|
|
455
|
+
|
|
456
|
+
Stack: {{tech_stack}}
|
|
457
|
+
Report: {{vulnerability_report}}
|
|
458
|
+
Codebase context: {{codebase_context}}
|
|
459
|
+
|
|
460
|
+
Please provide:
|
|
461
|
+
1. **Vulnerability Classification**: Type, CVE, CVSS, and attack vector.
|
|
462
|
+
2. **Exploitability Assessment**: Contextual reachability and realistic scenarios.
|
|
463
|
+
3. **Impact Assessment**: Impact on Confidentiality, Integrity, and Availability.
|
|
464
|
+
4. **Remediation Priority & Fix**: Concrete priority (P0-P3) and fix steps.
|
|
465
|
+
5. **Verification**: How to test and verify the fix.`
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
]
|
|
469
|
+
},
|
|
470
|
+
"architecture-design": {
|
|
471
|
+
name: "architecture-design",
|
|
472
|
+
description: "Plan system architecture, component layout, and data flow",
|
|
473
|
+
arguments: [
|
|
474
|
+
{ name: "tech_stack", description: "Technology stack", required: true },
|
|
475
|
+
{ name: "requirements", description: "Key functional and non-functional requirements", required: true }
|
|
476
|
+
],
|
|
477
|
+
messages: [
|
|
478
|
+
{
|
|
479
|
+
role: "user",
|
|
480
|
+
content: {
|
|
481
|
+
type: "text",
|
|
482
|
+
text: `Design the architecture for a system in the current repository.
|
|
483
|
+
|
|
484
|
+
Stack: {{tech_stack}}
|
|
485
|
+
Requirements: {{requirements}}
|
|
486
|
+
|
|
487
|
+
Produce a comprehensive architecture overview:
|
|
488
|
+
1. **Component Diagram**: Major blocks and their responsibilities.
|
|
489
|
+
2. **Data Flow**: How information moves through the system.
|
|
490
|
+
3. **Key Technical Decisions**: Rationale for chosen patterns.
|
|
491
|
+
4. **Scalability & Reliability**: How the design handles growth and failure.
|
|
492
|
+
5. **Security Considerations**: Identity, data protection, and boundaries.`
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
]
|
|
333
496
|
}
|
|
334
497
|
};
|
|
335
498
|
//# 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,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mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAYzC,wBAAgB,YAAY,CAC1B,EAAE,EAAE,WAAW,EACf,OAAO,EAAE,WAAW,GACnB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAYzC,wBAAgB,YAAY,CAC1B,EAAE,EAAE,WAAW,EACf,OAAO,EAAE,WAAW,GACnB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAyI/C"}
|
package/dist/router.js
CHANGED
|
@@ -33,7 +33,22 @@ export function createRouter(db, vectors) {
|
|
|
33
33
|
if (!prompt) {
|
|
34
34
|
throw new Error(`Unknown prompt: ${params?.name}`);
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
// Clone to avoid modifying the original registry
|
|
37
|
+
const result = JSON.parse(JSON.stringify(prompt));
|
|
38
|
+
const args = params?.arguments || {};
|
|
39
|
+
// Simple template substitution
|
|
40
|
+
result.messages = result.messages.map((msg) => {
|
|
41
|
+
if (msg.content && msg.content.type === "text") {
|
|
42
|
+
let text = msg.content.text;
|
|
43
|
+
for (const [key, value] of Object.entries(args)) {
|
|
44
|
+
const placeholder = new RegExp(`\\{\\{${key}\\}\\}`, "g");
|
|
45
|
+
text = text.replace(placeholder, String(value));
|
|
46
|
+
}
|
|
47
|
+
return { ...msg, content: { ...msg.content, text } };
|
|
48
|
+
}
|
|
49
|
+
return msg;
|
|
50
|
+
});
|
|
51
|
+
return result;
|
|
37
52
|
}
|
|
38
53
|
default:
|
|
39
54
|
throw new Error(`Unsupported method: ${method}`);
|
|
@@ -74,7 +89,7 @@ export function createRouter(db, vectors) {
|
|
|
74
89
|
result = await handleTaskCreate(args, db);
|
|
75
90
|
break;
|
|
76
91
|
case "task-update":
|
|
77
|
-
result = await handleTaskUpdate(args, db);
|
|
92
|
+
result = await handleTaskUpdate(args, db, vectors);
|
|
78
93
|
break;
|
|
79
94
|
case "task-delete":
|
|
80
95
|
result = await handleTaskDelete(args, db);
|
|
@@ -83,7 +98,7 @@ export function createRouter(db, vectors) {
|
|
|
83
98
|
result = await handleTaskList(args, db);
|
|
84
99
|
break;
|
|
85
100
|
case "task-bulk-manage":
|
|
86
|
-
result = await handleTaskBulkManage(args, db);
|
|
101
|
+
result = await handleTaskBulkManage(args, db, vectors);
|
|
87
102
|
break;
|
|
88
103
|
default:
|
|
89
104
|
throw new Error(`Unknown tool: ${name}`);
|
package/dist/router.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,iBAAiB,E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EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;aAC5G,CAAC;YAEF,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACvE,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/storage/sqlite.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/storage/sqlite.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAA4C,MAAM,aAAa,CAAC;AAwDpF,qBAAa,WAAW;IACtB,OAAO,CAAC,EAAE,CAAoB;gBAElB,MAAM,CAAC,EAAE,MAAM;IAepB,SAAS,IAAI,MAAM;IAI1B,OAAO,CAAC,OAAO;IAuMf,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAiChC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,IAAI;IAgCtC,OAAO,CAAC,0BAA0B;IAgElC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAKvC,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI;IAQxC,QAAQ,CAAC,GAAG,EA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,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE;IAQ9C,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,EAAE,eAAe,GAAE,OAAe,GAAG,WAAW,EAAE;IAYnH,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,UAAQ,GAAG,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;IAazD,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,GAAG,EAAE;IAkBlD,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,gBAAgB;IAsBxB,KAAK,IAAI,IAAI;CACd"}
|
package/dist/storage/sqlite.js
CHANGED
|
@@ -76,7 +76,8 @@ export class SQLiteStore {
|
|
|
76
76
|
'pattern',
|
|
77
77
|
'agent_handoff',
|
|
78
78
|
'agent_registered',
|
|
79
|
-
'file_claim'
|
|
79
|
+
'file_claim',
|
|
80
|
+
'task_archive'
|
|
80
81
|
)),
|
|
81
82
|
title TEXT,
|
|
82
83
|
content TEXT NOT NULL,
|
|
@@ -124,7 +125,7 @@ export class SQLiteStore {
|
|
|
124
125
|
phase TEXT,
|
|
125
126
|
title TEXT NOT NULL,
|
|
126
127
|
description TEXT,
|
|
127
|
-
status TEXT NOT NULL DEFAULT '
|
|
128
|
+
status TEXT NOT NULL DEFAULT 'backlog' CHECK (status IN ('backlog', 'pending', 'in_progress', 'completed', 'canceled', 'blocked')),
|
|
128
129
|
priority INTEGER NOT NULL DEFAULT 3,
|
|
129
130
|
agent TEXT NOT NULL DEFAULT 'unknown',
|
|
130
131
|
role TEXT NOT NULL DEFAULT 'unknown',
|
|
@@ -301,7 +302,7 @@ export class SQLiteStore {
|
|
|
301
302
|
const tableSql = this.db
|
|
302
303
|
.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'memories'")
|
|
303
304
|
.get();
|
|
304
|
-
if (!tableSql?.sql || tableSql.sql.includes("'
|
|
305
|
+
if (!tableSql?.sql || tableSql.sql.includes("'task_archive'")) {
|
|
305
306
|
return;
|
|
306
307
|
}
|
|
307
308
|
this.db.exec(`
|
|
@@ -317,7 +318,8 @@ export class SQLiteStore {
|
|
|
317
318
|
'pattern',
|
|
318
319
|
'agent_handoff',
|
|
319
320
|
'agent_registered',
|
|
320
|
-
'file_claim'
|
|
321
|
+
'file_claim',
|
|
322
|
+
'task_archive'
|
|
321
323
|
)),
|
|
322
324
|
title TEXT,
|
|
323
325
|
content TEXT NOT NULL,
|
|
@@ -515,6 +517,7 @@ export class SQLiteStore {
|
|
|
515
517
|
const rows = this.db.prepare(query).all(...params);
|
|
516
518
|
const stats = {
|
|
517
519
|
total: 0,
|
|
520
|
+
backlog: 0,
|
|
518
521
|
todo: 0,
|
|
519
522
|
inProgress: 0,
|
|
520
523
|
completed: 0,
|
|
@@ -523,7 +526,9 @@ export class SQLiteStore {
|
|
|
523
526
|
};
|
|
524
527
|
for (const row of rows) {
|
|
525
528
|
stats.total += row.count;
|
|
526
|
-
if (row.status === "
|
|
529
|
+
if (row.status === "backlog")
|
|
530
|
+
stats.backlog = row.count;
|
|
531
|
+
else if (row.status === "pending")
|
|
527
532
|
stats.todo = row.count;
|
|
528
533
|
else if (row.status === "in_progress")
|
|
529
534
|
stats.inProgress = row.count;
|
|
@@ -766,7 +771,12 @@ export class SQLiteStore {
|
|
|
766
771
|
query += ` ORDER BY
|
|
767
772
|
CASE WHEN t.status = 'completed' THEN 1 ELSE 0 END ASC,
|
|
768
773
|
CASE WHEN t.status = 'completed' THEN t.updated_at ELSE NULL END DESC,
|
|
769
|
-
t.status
|
|
774
|
+
CASE WHEN t.status = 'in_progress' THEN 0
|
|
775
|
+
WHEN t.status = 'pending' THEN 1
|
|
776
|
+
WHEN t.status = 'backlog' THEN 2
|
|
777
|
+
WHEN t.status = 'blocked' THEN 3
|
|
778
|
+
WHEN t.status = 'canceled' THEN 4
|
|
779
|
+
ELSE 5 END ASC,
|
|
770
780
|
t.priority DESC,
|
|
771
781
|
t.created_at ASC`;
|
|
772
782
|
if (limit !== undefined) {
|
|
@@ -796,7 +806,14 @@ export class SQLiteStore {
|
|
|
796
806
|
params.push(searchPattern, searchPattern, searchPattern);
|
|
797
807
|
}
|
|
798
808
|
query += ` ORDER BY
|
|
809
|
+
CASE WHEN t.status = 'completed' THEN 1 ELSE 0 END ASC,
|
|
799
810
|
CASE WHEN t.status = 'completed' THEN t.updated_at ELSE NULL END DESC,
|
|
811
|
+
CASE WHEN t.status = 'in_progress' THEN 0
|
|
812
|
+
WHEN t.status = 'pending' THEN 1
|
|
813
|
+
WHEN t.status = 'backlog' THEN 2
|
|
814
|
+
WHEN t.status = 'blocked' THEN 3
|
|
815
|
+
WHEN t.status = 'canceled' THEN 4
|
|
816
|
+
ELSE 5 END ASC,
|
|
800
817
|
t.priority DESC,
|
|
801
818
|
t.created_at ASC`;
|
|
802
819
|
if (limit !== undefined) {
|