@prmichaelsen/remember-mcp 2.7.11 → 3.0.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/.env.example +6 -0
- package/AGENT.md +224 -21
- package/CHANGELOG.md +155 -915
- package/README.md +130 -1
- package/agent/commands/acp.command-create.md +372 -0
- package/agent/commands/acp.design-create.md +224 -0
- package/agent/commands/acp.init.md +39 -5
- package/agent/commands/acp.package-create.md +894 -0
- package/agent/commands/acp.package-info.md +211 -0
- package/agent/commands/acp.package-install.md +206 -33
- package/agent/commands/acp.package-list.md +279 -0
- package/agent/commands/acp.package-publish.md +540 -0
- package/agent/commands/acp.package-remove.md +292 -0
- package/agent/commands/acp.package-search.md +306 -0
- package/agent/commands/acp.package-update.md +360 -0
- package/agent/commands/acp.package-validate.md +539 -0
- package/agent/commands/acp.pattern-create.md +326 -0
- package/agent/commands/acp.plan.md +552 -0
- package/agent/commands/acp.proceed.md +111 -86
- package/agent/commands/acp.project-create.md +672 -0
- package/agent/commands/acp.project-list.md +224 -0
- package/agent/commands/acp.project-set.md +226 -0
- package/agent/commands/acp.report.md +2 -0
- package/agent/commands/acp.resume.md +237 -0
- package/agent/commands/acp.sync.md +55 -15
- package/agent/commands/acp.task-create.md +390 -0
- package/agent/commands/acp.validate.md +61 -10
- package/agent/commands/acp.version-check-for-updates.md +5 -5
- package/agent/commands/acp.version-check.md +6 -6
- package/agent/commands/acp.version-update.md +6 -6
- package/agent/commands/command.template.md +43 -0
- package/agent/commands/git.commit.md +5 -3
- package/agent/design/soft-delete-system.md +291 -0
- package/agent/manifest.template.yaml +13 -0
- package/agent/milestones/milestone-13-soft-delete-system.md +306 -0
- package/agent/package.template.yaml +36 -0
- package/agent/progress.template.yaml +3 -0
- package/agent/progress.yaml +238 -6
- package/agent/scripts/acp.common.sh +1536 -0
- package/agent/scripts/{install.sh → acp.install.sh} +82 -26
- package/agent/scripts/acp.package-create.sh +925 -0
- package/agent/scripts/acp.package-info.sh +270 -0
- package/agent/scripts/acp.package-install.sh +596 -0
- package/agent/scripts/acp.package-list.sh +263 -0
- package/agent/scripts/acp.package-publish.sh +420 -0
- package/agent/scripts/acp.package-remove.sh +272 -0
- package/agent/scripts/acp.package-search.sh +156 -0
- package/agent/scripts/acp.package-update.sh +438 -0
- package/agent/scripts/acp.package-validate.sh +855 -0
- package/agent/scripts/acp.project-list.sh +121 -0
- package/agent/scripts/acp.project-set.sh +138 -0
- package/agent/scripts/{uninstall.sh → acp.uninstall.sh} +25 -15
- package/agent/scripts/{check-for-updates.sh → acp.version-check-for-updates.sh} +24 -14
- package/agent/scripts/{version.sh → acp.version-check.sh} +20 -8
- package/agent/scripts/{update.sh → acp.version-update.sh} +44 -25
- package/agent/scripts/acp.yaml-parser.sh +853 -0
- package/agent/scripts/acp.yaml-validate.sh +205 -0
- package/agent/tasks/task-68-fix-missing-space-properties.md +192 -0
- package/agent/tasks/task-69-add-comprehensive-tool-debugging.md +454 -0
- package/agent/tasks/task-70-add-soft-delete-schema-fields.md +165 -0
- package/agent/tasks/task-71-implement-delete-confirmation-flow.md +257 -0
- package/agent/tasks/task-72-add-deleted-filter-to-search-tools.md +18 -0
- package/agent/tasks/task-73-update-relationship-handling.md +18 -0
- package/agent/tasks/task-74-add-unit-tests-soft-delete.md +18 -0
- package/agent/tasks/task-75-update-documentation-changelog.md +26 -0
- package/dist/config.d.ts +18 -0
- package/dist/server-factory.js +788 -355
- package/dist/server.js +788 -355
- package/dist/tools/delete-memory.d.ts +5 -30
- package/dist/tools/find-similar.d.ts +8 -1
- package/dist/tools/query-memory.d.ts +8 -1
- package/dist/tools/search-memory.d.ts +6 -0
- package/dist/tools/search-relationship.d.ts +8 -1
- package/dist/types/memory.d.ts +8 -0
- package/dist/types/space-memory.d.ts +3 -0
- package/dist/utils/debug.d.ts +52 -0
- package/dist/utils/debug.spec.d.ts +5 -0
- package/dist/utils/weaviate-filters.d.ts +19 -0
- package/dist/weaviate/client.d.ts +1 -1
- package/package.json +1 -1
- package/src/config.ts +33 -0
- package/src/tools/confirm.ts +113 -8
- package/src/tools/create-relationship.ts +14 -1
- package/src/tools/delete-memory.ts +91 -63
- package/src/tools/find-similar.ts +30 -5
- package/src/tools/publish.ts +19 -1
- package/src/tools/query-memory.ts +18 -5
- package/src/tools/query-space.ts +36 -3
- package/src/tools/search-memory.ts +18 -5
- package/src/tools/search-relationship.ts +19 -5
- package/src/tools/search-space.ts +36 -3
- package/src/tools/update-memory.ts +8 -0
- package/src/types/memory.ts +11 -0
- package/src/types/space-memory.ts +5 -0
- package/src/utils/debug.spec.ts +257 -0
- package/src/utils/debug.ts +138 -0
- package/src/utils/weaviate-filters.ts +28 -1
- package/src/weaviate/client.ts +47 -3
- package/src/weaviate/schema.ts +17 -0
- package/src/weaviate/space-schema.spec.ts +5 -2
- package/src/weaviate/space-schema.ts +17 -5
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# Task 71: Implement Delete Confirmation Flow
|
|
2
|
+
|
|
3
|
+
**Milestone**: M13 (Soft Delete System)
|
|
4
|
+
**Estimated Time**: 4-5 hours
|
|
5
|
+
**Dependencies**: Task 70 (Schema fields must exist)
|
|
6
|
+
**Status**: Not Started
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
|
|
12
|
+
Modify `remember_delete_memory` to create a confirmation token instead of immediately deleting the memory, and enhance `remember_confirm` to handle the `delete_memory` action. Include a preview of what will be deleted (content, relationship count, orphaned relationships).
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
|
|
18
|
+
### 1. Update Delete Memory Tool ([`src/tools/delete-memory.ts`](../../src/tools/delete-memory.ts))
|
|
19
|
+
|
|
20
|
+
**Current Behavior**: Immediately deletes memory from Weaviate
|
|
21
|
+
|
|
22
|
+
**New Behavior**: Creates confirmation token and returns preview
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { ConfirmationTokenService } from '../services/confirmation-token.service.js';
|
|
26
|
+
|
|
27
|
+
export const deleteMemoryTool: Tool = {
|
|
28
|
+
name: 'remember_delete_memory',
|
|
29
|
+
description: `Request to delete a memory. Requires confirmation via remember_confirm.
|
|
30
|
+
|
|
31
|
+
⚠️ **IMPORTANT**: This is a two-step process:
|
|
32
|
+
1. Call remember_delete_memory to request deletion (returns token)
|
|
33
|
+
2. User must confirm via remember_confirm with the token
|
|
34
|
+
|
|
35
|
+
The memory will be soft-deleted (marked as deleted but not removed from database).`,
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
properties: {
|
|
39
|
+
memory_id: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'ID of memory to delete',
|
|
42
|
+
},
|
|
43
|
+
reason: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Optional reason for deletion',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
required: ['memory_id'],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export async function handleDeleteMemory(
|
|
53
|
+
args: { memory_id: string; reason?: string },
|
|
54
|
+
userId: string
|
|
55
|
+
): Promise<any> {
|
|
56
|
+
try {
|
|
57
|
+
const { memory_id, reason } = args;
|
|
58
|
+
const client = getWeaviateClient();
|
|
59
|
+
const collectionName = `Memory_${sanitizeUserId(userId)}`;
|
|
60
|
+
|
|
61
|
+
// Fetch memory to verify ownership and get preview
|
|
62
|
+
const memory = await client.collections
|
|
63
|
+
.get(collectionName)
|
|
64
|
+
.query.fetchObjectById(memory_id, {
|
|
65
|
+
includeVector: false,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
if (!memory) {
|
|
69
|
+
throw new McpError(
|
|
70
|
+
ErrorCode.InvalidRequest,
|
|
71
|
+
`Memory not found: ${memory_id}`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Verify ownership
|
|
76
|
+
if (memory.properties.user_id !== userId) {
|
|
77
|
+
throw new McpError(
|
|
78
|
+
ErrorCode.InvalidRequest,
|
|
79
|
+
`Cannot delete memory: not owned by user ${userId}`
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Check if already deleted
|
|
84
|
+
if (memory.properties.deleted_at) {
|
|
85
|
+
throw new McpError(
|
|
86
|
+
ErrorCode.InvalidRequest,
|
|
87
|
+
`Memory ${memory_id} is already deleted`
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Find relationships that will be orphaned
|
|
92
|
+
const relationships = await client.collections
|
|
93
|
+
.get(collectionName)
|
|
94
|
+
.query.fetchObjects({
|
|
95
|
+
filters: Filters.and(
|
|
96
|
+
collection.filter.byProperty('doc_type').equal('relationship'),
|
|
97
|
+
collection.filter.byProperty('memory_ids').containsAny([memory_id])
|
|
98
|
+
),
|
|
99
|
+
limit: 100,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const orphanedRelationships = relationships.objects.map(r => r.uuid);
|
|
103
|
+
|
|
104
|
+
// Create confirmation token
|
|
105
|
+
const tokenService = new ConfirmationTokenService();
|
|
106
|
+
const { token, expiresAt } = await tokenService.createRequest(
|
|
107
|
+
userId,
|
|
108
|
+
'delete_memory',
|
|
109
|
+
{
|
|
110
|
+
memory_id,
|
|
111
|
+
reason,
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
content: [
|
|
117
|
+
{
|
|
118
|
+
type: 'text',
|
|
119
|
+
text: JSON.stringify({
|
|
120
|
+
success: true,
|
|
121
|
+
token,
|
|
122
|
+
expires_at: expiresAt.toISOString(),
|
|
123
|
+
preview: {
|
|
124
|
+
memory_id,
|
|
125
|
+
content: memory.properties.content?.substring(0, 200) + '...',
|
|
126
|
+
type: memory.properties.type,
|
|
127
|
+
relationships_count: orphanedRelationships.length,
|
|
128
|
+
will_orphan: orphanedRelationships,
|
|
129
|
+
},
|
|
130
|
+
message: `Deletion requested. Use remember_confirm with token to complete deletion. Token expires in 5 minutes.`,
|
|
131
|
+
}, null, 2),
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
};
|
|
135
|
+
} catch (error) {
|
|
136
|
+
return handleToolError('remember_delete_memory', error, { userId, memory_id: args.memory_id });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 2. Enhance Confirm Tool ([`src/tools/confirm.ts`](../../src/tools/confirm.ts))
|
|
142
|
+
|
|
143
|
+
Add handling for `delete_memory` action:
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
// In handleConfirm function, add new case
|
|
147
|
+
|
|
148
|
+
if (request.action === 'delete_memory') {
|
|
149
|
+
const { memory_id, reason } = request.payload;
|
|
150
|
+
|
|
151
|
+
// Soft delete the memory
|
|
152
|
+
const client = getWeaviateClient();
|
|
153
|
+
const collectionName = `Memory_${sanitizeUserId(userId)}`;
|
|
154
|
+
|
|
155
|
+
await client.collections
|
|
156
|
+
.get(collectionName)
|
|
157
|
+
.data.update({
|
|
158
|
+
id: memory_id,
|
|
159
|
+
properties: {
|
|
160
|
+
deleted_at: new Date().toISOString(),
|
|
161
|
+
deleted_by: userId,
|
|
162
|
+
deletion_reason: reason || null,
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// Mark request as confirmed
|
|
167
|
+
await tokenService.confirmRequest(userId, token);
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
content: [
|
|
171
|
+
{
|
|
172
|
+
type: 'text',
|
|
173
|
+
text: JSON.stringify({
|
|
174
|
+
success: true,
|
|
175
|
+
memory_id,
|
|
176
|
+
message: 'Memory deleted successfully',
|
|
177
|
+
}, null, 2),
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 3. Update Confirmation Token Service Types
|
|
185
|
+
|
|
186
|
+
Ensure `delete_memory` is a valid action type in [`src/services/confirmation-token.service.ts`](../../src/services/confirmation-token.service.ts):
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
type ConfirmationAction = 'publish_memory' | 'delete_memory';
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 4. Build and Test
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npm run build
|
|
196
|
+
npm test
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Expected**:
|
|
200
|
+
- TypeScript compiles without errors
|
|
201
|
+
- All existing tests pass
|
|
202
|
+
- Build successful
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Verification
|
|
207
|
+
|
|
208
|
+
- [ ] `remember_delete_memory` creates confirmation token (not immediate delete)
|
|
209
|
+
- [ ] Token includes preview with content, type, relationship count
|
|
210
|
+
- [ ] Preview shows which relationships will be orphaned
|
|
211
|
+
- [ ] `remember_confirm` handles `delete_memory` action
|
|
212
|
+
- [ ] Confirmation sets `deleted_at`, `deleted_by`, `deletion_reason`
|
|
213
|
+
- [ ] Cannot delete already-deleted memory (returns error)
|
|
214
|
+
- [ ] Cannot delete memory owned by another user (returns error)
|
|
215
|
+
- [ ] Token expires after 5 minutes
|
|
216
|
+
- [ ] TypeScript compiles without errors
|
|
217
|
+
- [ ] Build successful
|
|
218
|
+
- [ ] All existing tests still passing
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Files Modified
|
|
223
|
+
|
|
224
|
+
- [`src/tools/delete-memory.ts`](../../src/tools/delete-memory.ts) - Change to confirmation flow
|
|
225
|
+
- [`src/tools/confirm.ts`](../../src/tools/confirm.ts) - Add delete_memory action handling
|
|
226
|
+
- [`src/services/confirmation-token.service.ts`](../../src/services/confirmation-token.service.ts) - Add delete_memory to action types
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Files Created
|
|
231
|
+
|
|
232
|
+
None
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Testing Notes
|
|
237
|
+
|
|
238
|
+
**Manual Testing**:
|
|
239
|
+
```typescript
|
|
240
|
+
// 1. Request deletion
|
|
241
|
+
remember_delete_memory({ memory_id: "abc123", reason: "No longer needed" })
|
|
242
|
+
// Returns: { token: "xyz789", preview: {...} }
|
|
243
|
+
|
|
244
|
+
// 2. Confirm deletion
|
|
245
|
+
remember_confirm({ token: "xyz789" })
|
|
246
|
+
// Returns: { success: true, memory_id: "abc123" }
|
|
247
|
+
|
|
248
|
+
// 3. Verify memory is soft-deleted
|
|
249
|
+
remember_search_memory({ query: "test", deleted_filter: "only" })
|
|
250
|
+
// Should find the deleted memory
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Next Task
|
|
256
|
+
|
|
257
|
+
Task 72: Add deleted_filter to Search Tools
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Task 72: Add deleted_filter to Search Tools
|
|
2
|
+
|
|
3
|
+
**Milestone**: M13 (Soft Delete System)
|
|
4
|
+
**Estimated Time**: 4-5 hours
|
|
5
|
+
**Dependencies**: Task 70 (Schema fields must exist)
|
|
6
|
+
**Status**: Not Started
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
|
|
12
|
+
Add \`deleted_filter\` parameter to all search tools to control whether deleted memories are included in search results. Default behavior excludes deleted memories.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Next Task
|
|
17
|
+
|
|
18
|
+
Task 73: Update Relationship Handling for Deleted Memories
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Task 73: Update Relationship Handling for Deleted Memories
|
|
2
|
+
|
|
3
|
+
**Milestone**: M13 (Soft Delete System)
|
|
4
|
+
**Estimated Time**: 3-4 hours
|
|
5
|
+
**Dependencies**: Task 70, Task 72
|
|
6
|
+
**Status**: Not Started
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
|
|
12
|
+
Prevent creating relationships with deleted memories and return clear error messages when attempting to update deleted memories.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Next Task
|
|
17
|
+
|
|
18
|
+
Task 74: Add Unit Tests for Soft Delete
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Task 74: Add Unit Tests for Soft Delete
|
|
2
|
+
|
|
3
|
+
**Milestone**: M13 (Soft Delete System)
|
|
4
|
+
**Estimated Time**: 4-5 hours
|
|
5
|
+
**Dependencies**: Tasks 70-73
|
|
6
|
+
**Status**: Not Started
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
|
|
12
|
+
Create comprehensive unit tests for soft delete functionality.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Next Task
|
|
17
|
+
|
|
18
|
+
Task 75: Update Documentation and CHANGELOG
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Task 75: Update Documentation and CHANGELOG
|
|
2
|
+
|
|
3
|
+
**Milestone**: M13 (Soft Delete System)
|
|
4
|
+
**Estimated Time**: 2-3 hours
|
|
5
|
+
**Dependencies**: Tasks 70-74
|
|
6
|
+
**Status**: Not Started
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Objective
|
|
11
|
+
|
|
12
|
+
Update README.md with new deletion workflow, document breaking changes in CHANGELOG.md (v3.0.0), and update all tool descriptions.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Files to Update
|
|
17
|
+
|
|
18
|
+
- README.md - Add deletion workflow examples
|
|
19
|
+
- CHANGELOG.md - Document v3.0.0 breaking changes
|
|
20
|
+
- Tool descriptions - Update all affected tools
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Next Milestone
|
|
25
|
+
|
|
26
|
+
M5: Template System (deferred until M13 complete)
|
package/dist/config.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug levels for tool logging
|
|
3
|
+
*/
|
|
4
|
+
export declare enum DebugLevel {
|
|
5
|
+
NONE = 0,// No debug output (production default)
|
|
6
|
+
ERROR = 1,// Only errors
|
|
7
|
+
WARN = 2,// Warnings and errors
|
|
8
|
+
INFO = 3,// Info, warnings, and errors
|
|
9
|
+
DEBUG = 4,// Debug, info, warnings, and errors
|
|
10
|
+
TRACE = 5
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Debug configuration
|
|
14
|
+
*/
|
|
15
|
+
export declare const debugConfig: {
|
|
16
|
+
level: DebugLevel;
|
|
17
|
+
enabled: (level: DebugLevel) => boolean;
|
|
18
|
+
};
|
|
1
19
|
export declare const config: {
|
|
2
20
|
readonly weaviate: {
|
|
3
21
|
readonly url: string;
|