@prmichaelsen/remember-mcp 3.13.0 → 3.14.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/agent/milestones/milestone-17-remember-core-migration.md +140 -0
- package/agent/progress.yaml +123 -6
- package/agent/tasks/milestone-17-remember-core-migration/task-193-foundation-setup.md +58 -0
- package/agent/tasks/milestone-17-remember-core-migration/task-194-migrate-relationship-tools.md +47 -0
- package/agent/tasks/milestone-17-remember-core-migration/task-195-migrate-preference-tools.md +34 -0
- package/agent/tasks/milestone-17-remember-core-migration/task-196-migrate-memory-tools.md +46 -0
- package/agent/tasks/milestone-17-remember-core-migration/task-197-migrate-space-confirmation-tools.md +49 -0
- package/agent/tasks/milestone-17-remember-core-migration/task-198-migrate-space-search-moderate.md +46 -0
- package/agent/tasks/milestone-17-remember-core-migration/task-199-migrate-delete-memory.md +43 -0
- package/agent/tasks/milestone-17-remember-core-migration/task-200-code-cleanup-verification.md +52 -0
- package/dist/core-services.d.ts +25 -0
- package/dist/server-factory.js +3578 -4485
- package/dist/server.js +3070 -3973
- package/dist/tools/confirm-publish-moderation.spec.d.ts +3 -2
- package/dist/tools/create-memory.d.ts +1 -1
- package/dist/tools/query-space.d.ts +1 -1
- package/dist/tools/search-space.d.ts +10 -14
- package/jest.config.js +11 -0
- package/package.json +2 -1
- package/src/core-services.ts +50 -0
- package/src/tools/confirm-publish-moderation.spec.ts +120 -176
- package/src/tools/confirm.ts +70 -1035
- package/src/tools/create-memory.ts +16 -67
- package/src/tools/create-relationship.ts +13 -181
- package/src/tools/delete-memory.ts +7 -72
- package/src/tools/delete-relationship.ts +7 -91
- package/src/tools/deny.ts +4 -14
- package/src/tools/find-similar.ts +16 -110
- package/src/tools/get-preferences.ts +3 -8
- package/src/tools/moderate.spec.ts +65 -81
- package/src/tools/moderate.ts +18 -121
- package/src/tools/publish.ts +7 -204
- package/src/tools/query-space.ts +28 -140
- package/src/tools/retract.ts +7 -185
- package/src/tools/revise.ts +4 -136
- package/src/tools/search-relationship.ts +17 -116
- package/src/tools/search-space.ts +58 -304
- package/src/tools/set-preference.ts +3 -8
- package/src/tools/update-memory.ts +22 -190
- package/src/tools/update-relationship.ts +16 -90
- package/src/v2-smoke.e2e.ts +3 -2
- package/dist/collections/composite-ids.d.ts +0 -106
- package/dist/collections/core-infrastructure.spec.d.ts +0 -11
- package/dist/collections/dot-notation.d.ts +0 -106
- package/dist/collections/tracking-arrays.d.ts +0 -176
- package/dist/constants/content-types.d.ts +0 -61
- package/dist/services/confirmation-token.service.d.ts +0 -99
- package/dist/services/confirmation-token.service.spec.d.ts +0 -5
- package/dist/services/preferences-database.service.d.ts +0 -22
- package/dist/services/space-config.service.d.ts +0 -23
- package/dist/services/space-config.service.spec.d.ts +0 -2
- package/src/collections/composite-ids.ts +0 -193
- package/src/collections/core-infrastructure.spec.ts +0 -353
- package/src/collections/dot-notation.ts +0 -212
- package/src/collections/tracking-arrays.ts +0 -298
- package/src/constants/content-types.ts +0 -490
- package/src/services/confirmation-token.service.spec.ts +0 -254
- package/src/services/confirmation-token.service.ts +0 -328
- package/src/services/preferences-database.service.ts +0 -120
- package/src/services/space-config.service.spec.ts +0 -102
- package/src/services/space-config.service.ts +0 -79
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tracking Array Management
|
|
3
|
-
*
|
|
4
|
-
* Provides utilities for managing space_ids and group_ids tracking arrays
|
|
5
|
-
* in Memory Collection Pattern v2. These arrays track where memories have
|
|
6
|
-
* been published.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Memory with tracking arrays
|
|
11
|
-
*/
|
|
12
|
-
export interface MemoryWithTracking {
|
|
13
|
-
space_ids: string[];
|
|
14
|
-
group_ids: string[];
|
|
15
|
-
[key: string]: any; // Allow other properties
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Published locations summary
|
|
20
|
-
*/
|
|
21
|
-
export interface PublishedLocations {
|
|
22
|
-
spaces: string[]
|
|
23
|
-
groups: string[]
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Add a space ID to the space_ids array (immutable)
|
|
28
|
-
*
|
|
29
|
-
* @param memory - Memory object with tracking arrays
|
|
30
|
-
* @param spaceId - Space ID to add
|
|
31
|
-
* @returns New memory object with updated space_ids
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* const memory = { space_ids: ['cooking'], group_ids: [] }
|
|
35
|
-
* addToSpaceIds(memory, 'recipes')
|
|
36
|
-
* // Returns: { space_ids: ['cooking', 'recipes'], group_ids: [] }
|
|
37
|
-
*/
|
|
38
|
-
export function addToSpaceIds<T extends MemoryWithTracking>(
|
|
39
|
-
memory: T,
|
|
40
|
-
spaceId: string
|
|
41
|
-
): T {
|
|
42
|
-
// Don't add if already present
|
|
43
|
-
if (memory.space_ids.includes(spaceId)) {
|
|
44
|
-
return memory
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return {
|
|
48
|
-
...memory,
|
|
49
|
-
space_ids: [...memory.space_ids, spaceId],
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Remove a space ID from the space_ids array (immutable)
|
|
55
|
-
*
|
|
56
|
-
* @param memory - Memory object with tracking arrays
|
|
57
|
-
* @param spaceId - Space ID to remove
|
|
58
|
-
* @returns New memory object with updated space_ids
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* const memory = { space_ids: ['cooking', 'recipes'], group_ids: [] }
|
|
62
|
-
* removeFromSpaceIds(memory, 'cooking')
|
|
63
|
-
* // Returns: { space_ids: ['recipes'], group_ids: [] }
|
|
64
|
-
*/
|
|
65
|
-
export function removeFromSpaceIds<T extends MemoryWithTracking>(
|
|
66
|
-
memory: T,
|
|
67
|
-
spaceId: string
|
|
68
|
-
): T {
|
|
69
|
-
return {
|
|
70
|
-
...memory,
|
|
71
|
-
space_ids: memory.space_ids.filter(id => id !== spaceId),
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Add a group ID to the group_ids array (immutable)
|
|
77
|
-
*
|
|
78
|
-
* @param memory - Memory object with tracking arrays
|
|
79
|
-
* @param groupId - Group ID to add
|
|
80
|
-
* @returns New memory object with updated group_ids
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* const memory = { space_ids: [], group_ids: ['family'] }
|
|
84
|
-
* addToGroupIds(memory, 'friends')
|
|
85
|
-
* // Returns: { space_ids: [], group_ids: ['family', 'friends'] }
|
|
86
|
-
*/
|
|
87
|
-
export function addToGroupIds<T extends MemoryWithTracking>(
|
|
88
|
-
memory: T,
|
|
89
|
-
groupId: string
|
|
90
|
-
): T {
|
|
91
|
-
// Don't add if already present
|
|
92
|
-
if (memory.group_ids.includes(groupId)) {
|
|
93
|
-
return memory
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return {
|
|
97
|
-
...memory,
|
|
98
|
-
group_ids: [...memory.group_ids, groupId],
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Remove a group ID from the group_ids array (immutable)
|
|
104
|
-
*
|
|
105
|
-
* @param memory - Memory object with tracking arrays
|
|
106
|
-
* @param groupId - Group ID to remove
|
|
107
|
-
* @returns New memory object with updated group_ids
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
* const memory = { space_ids: [], group_ids: ['family', 'friends'] }
|
|
111
|
-
* removeFromGroupIds(memory, 'family')
|
|
112
|
-
* // Returns: { space_ids: [], group_ids: ['friends'] }
|
|
113
|
-
*/
|
|
114
|
-
export function removeFromGroupIds<T extends MemoryWithTracking>(
|
|
115
|
-
memory: T,
|
|
116
|
-
groupId: string
|
|
117
|
-
): T {
|
|
118
|
-
return {
|
|
119
|
-
...memory,
|
|
120
|
-
group_ids: memory.group_ids.filter(id => id !== groupId),
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Check if memory is published to a specific space
|
|
126
|
-
*
|
|
127
|
-
* @param memory - Memory object with tracking arrays
|
|
128
|
-
* @param spaceId - Space ID to check
|
|
129
|
-
* @returns true if published to space, false otherwise
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* const memory = { space_ids: ['cooking'], group_ids: [] }
|
|
133
|
-
* isPublishedToSpace(memory, 'cooking') // true
|
|
134
|
-
* isPublishedToSpace(memory, 'recipes') // false
|
|
135
|
-
*/
|
|
136
|
-
export function isPublishedToSpace(
|
|
137
|
-
memory: MemoryWithTracking,
|
|
138
|
-
spaceId: string
|
|
139
|
-
): boolean {
|
|
140
|
-
return memory.space_ids.includes(spaceId)
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Check if memory is published to a specific group
|
|
145
|
-
*
|
|
146
|
-
* @param memory - Memory object with tracking arrays
|
|
147
|
-
* @param groupId - Group ID to check
|
|
148
|
-
* @returns true if published to group, false otherwise
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* const memory = { space_ids: [], group_ids: ['family'] }
|
|
152
|
-
* isPublishedToGroup(memory, 'family') // true
|
|
153
|
-
* isPublishedToGroup(memory, 'friends') // false
|
|
154
|
-
*/
|
|
155
|
-
export function isPublishedToGroup(
|
|
156
|
-
memory: MemoryWithTracking,
|
|
157
|
-
groupId: string
|
|
158
|
-
): boolean {
|
|
159
|
-
return memory.group_ids.includes(groupId)
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Get all published locations for a memory
|
|
164
|
-
*
|
|
165
|
-
* @param memory - Memory object with tracking arrays
|
|
166
|
-
* @returns Object with spaces and groups arrays
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* const memory = { space_ids: ['cooking', 'recipes'], group_ids: ['family'] }
|
|
170
|
-
* getPublishedLocations(memory)
|
|
171
|
-
* // Returns: { spaces: ['cooking', 'recipes'], groups: ['family'] }
|
|
172
|
-
*/
|
|
173
|
-
export function getPublishedLocations(
|
|
174
|
-
memory: MemoryWithTracking
|
|
175
|
-
): PublishedLocations {
|
|
176
|
-
return {
|
|
177
|
-
spaces: [...memory.space_ids],
|
|
178
|
-
groups: [...memory.group_ids],
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Check if memory is published anywhere
|
|
184
|
-
*
|
|
185
|
-
* @param memory - Memory object with tracking arrays
|
|
186
|
-
* @returns true if published to any space or group, false otherwise
|
|
187
|
-
*
|
|
188
|
-
* @example
|
|
189
|
-
* const memory = { space_ids: ['cooking'], group_ids: [] }
|
|
190
|
-
* isPublished(memory) // true
|
|
191
|
-
*
|
|
192
|
-
* const unpublished = { space_ids: [], group_ids: [] }
|
|
193
|
-
* isPublished(unpublished) // false
|
|
194
|
-
*/
|
|
195
|
-
export function isPublished(memory: MemoryWithTracking): boolean {
|
|
196
|
-
return memory.space_ids.length > 0 || memory.group_ids.length > 0
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Get count of published locations
|
|
201
|
-
*
|
|
202
|
-
* @param memory - Memory object with tracking arrays
|
|
203
|
-
* @returns Total number of spaces and groups memory is published to
|
|
204
|
-
*
|
|
205
|
-
* @example
|
|
206
|
-
* const memory = { space_ids: ['cooking', 'recipes'], group_ids: ['family'] }
|
|
207
|
-
* getPublishedCount(memory) // 3
|
|
208
|
-
*/
|
|
209
|
-
export function getPublishedCount(memory: MemoryWithTracking): number {
|
|
210
|
-
return memory.space_ids.length + memory.group_ids.length
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Initialize tracking arrays on a memory object (immutable)
|
|
215
|
-
*
|
|
216
|
-
* @param memory - Memory object (may not have tracking arrays)
|
|
217
|
-
* @returns New memory object with initialized tracking arrays
|
|
218
|
-
*
|
|
219
|
-
* @example
|
|
220
|
-
* const memory = { id: '123', content: 'test' }
|
|
221
|
-
* initializeTracking(memory)
|
|
222
|
-
* // Returns: { id: '123', content: 'test', space_ids: [], group_ids: [] }
|
|
223
|
-
*/
|
|
224
|
-
export function initializeTracking<T extends Record<string, any>>(
|
|
225
|
-
memory: T
|
|
226
|
-
): T & MemoryWithTracking {
|
|
227
|
-
return {
|
|
228
|
-
...memory,
|
|
229
|
-
space_ids: (memory as any).space_ids || [],
|
|
230
|
-
group_ids: (memory as any).group_ids || [],
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Add multiple space IDs at once (immutable)
|
|
236
|
-
*
|
|
237
|
-
* @param memory - Memory object with tracking arrays
|
|
238
|
-
* @param spaceIds - Array of space IDs to add
|
|
239
|
-
* @returns New memory object with updated space_ids
|
|
240
|
-
*
|
|
241
|
-
* @example
|
|
242
|
-
* const memory = { space_ids: ['cooking'], group_ids: [] }
|
|
243
|
-
* addMultipleSpaceIds(memory, ['recipes', 'baking'])
|
|
244
|
-
* // Returns: { space_ids: ['cooking', 'recipes', 'baking'], group_ids: [] }
|
|
245
|
-
*/
|
|
246
|
-
export function addMultipleSpaceIds<T extends MemoryWithTracking>(
|
|
247
|
-
memory: T,
|
|
248
|
-
spaceIds: string[]
|
|
249
|
-
): T {
|
|
250
|
-
// Use Set for O(n+m) deduplication instead of O(n*m) includes() loop
|
|
251
|
-
const existing = new Set(memory.space_ids)
|
|
252
|
-
const merged = [...memory.space_ids]
|
|
253
|
-
|
|
254
|
-
for (const spaceId of spaceIds) {
|
|
255
|
-
if (!existing.has(spaceId)) {
|
|
256
|
-
existing.add(spaceId)
|
|
257
|
-
merged.push(spaceId)
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return {
|
|
262
|
-
...memory,
|
|
263
|
-
space_ids: merged,
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Add multiple group IDs at once (immutable)
|
|
269
|
-
*
|
|
270
|
-
* @param memory - Memory object with tracking arrays
|
|
271
|
-
* @param groupIds - Array of group IDs to add
|
|
272
|
-
* @returns New memory object with updated group_ids
|
|
273
|
-
*
|
|
274
|
-
* @example
|
|
275
|
-
* const memory = { space_ids: [], group_ids: ['family'] }
|
|
276
|
-
* addMultipleGroupIds(memory, ['friends', 'coworkers'])
|
|
277
|
-
* // Returns: { space_ids: [], group_ids: ['family', 'friends', 'coworkers'] }
|
|
278
|
-
*/
|
|
279
|
-
export function addMultipleGroupIds<T extends MemoryWithTracking>(
|
|
280
|
-
memory: T,
|
|
281
|
-
groupIds: string[]
|
|
282
|
-
): T {
|
|
283
|
-
// Use Set for O(n+m) deduplication instead of O(n*m) includes() loop
|
|
284
|
-
const existing = new Set(memory.group_ids)
|
|
285
|
-
const merged = [...memory.group_ids]
|
|
286
|
-
|
|
287
|
-
for (const groupId of groupIds) {
|
|
288
|
-
if (!existing.has(groupId)) {
|
|
289
|
-
existing.add(groupId)
|
|
290
|
-
merged.push(groupId)
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return {
|
|
295
|
-
...memory,
|
|
296
|
-
group_ids: merged,
|
|
297
|
-
}
|
|
298
|
-
}
|