@prmichaelsen/remember-mcp 2.3.4 → 2.5.1

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.
Files changed (34) hide show
  1. package/AGENT.md +2 -2
  2. package/CHANGELOG.md +63 -0
  3. package/README.md +50 -5
  4. package/agent/commands/git.commit.md +511 -0
  5. package/agent/commands/git.init.md +513 -0
  6. package/agent/milestones/milestone-11-unified-public-collection.md +205 -0
  7. package/agent/scripts/install.sh +31 -16
  8. package/agent/scripts/update.sh +32 -17
  9. package/agent/tasks/task-45-fix-publish-false-success-bug.md +114 -181
  10. package/agent/tasks/task-46-update-spacememory-types.md +94 -0
  11. package/agent/tasks/task-47-update-space-schema.md +102 -0
  12. package/agent/tasks/task-48-create-memory-public-collection.md +96 -0
  13. package/agent/tasks/task-49-update-remember-publish.md +153 -0
  14. package/agent/tasks/task-50-update-remember-confirm.md +111 -0
  15. package/agent/tasks/task-51-update-remember-search-space.md +154 -0
  16. package/agent/tasks/task-52-update-remember-query-space.md +142 -0
  17. package/agent/tasks/task-53-add-multispace-tests.md +193 -0
  18. package/agent/tasks/task-54-update-documentation-multispace.md +191 -0
  19. package/dist/server-factory.js +203 -107
  20. package/dist/server.js +203 -107
  21. package/dist/tools/publish.d.ts +1 -1
  22. package/dist/tools/query-space.d.ts +1 -1
  23. package/dist/tools/search-space.d.ts +1 -1
  24. package/dist/types/space-memory.d.ts +5 -3
  25. package/dist/weaviate/space-schema.d.ts +16 -0
  26. package/package.json +1 -1
  27. package/src/services/confirmation-token.service.ts +74 -30
  28. package/src/tools/confirm.ts +15 -16
  29. package/src/tools/publish.ts +42 -20
  30. package/src/tools/query-space.ts +38 -24
  31. package/src/tools/search-space.ts +51 -28
  32. package/src/types/space-memory.ts +5 -3
  33. package/src/weaviate/space-schema.spec.ts +55 -0
  34. package/src/weaviate/space-schema.ts +45 -6
@@ -0,0 +1,142 @@
1
+ # Task 52: Update remember_query_space for Multi-Space
2
+
3
+ **Milestone**: M11 - Unified Public Collection
4
+ **Estimated Time**: 2 hours
5
+ **Dependencies**: Task 51
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Objective
11
+
12
+ Update the `remember_query_space` tool to accept a `spaces` array parameter, enabling RAG queries across multiple spaces simultaneously.
13
+
14
+ ---
15
+
16
+ ## Steps
17
+
18
+ ### 1. Update Tool Input Schema
19
+
20
+ **File**: `src/tools/query-space.ts`
21
+
22
+ **Change**:
23
+ ```typescript
24
+ // Before
25
+ space: {
26
+ type: 'string',
27
+ enum: SUPPORTED_SPACES,
28
+ default: 'the_void'
29
+ }
30
+
31
+ // After
32
+ spaces: {
33
+ type: 'array',
34
+ items: {
35
+ type: 'string',
36
+ enum: SUPPORTED_SPACES
37
+ },
38
+ description: 'Spaces to query (e.g., ["the_void", "dogs"])',
39
+ minItems: 1,
40
+ default: ['the_void']
41
+ }
42
+ ```
43
+
44
+ ### 2. Update handleQuerySpace Function
45
+
46
+ **File**: `src/tools/query-space.ts`
47
+
48
+ **Key Changes**:
49
+ ```typescript
50
+ interface QuerySpaceArgs {
51
+ question: string;
52
+ spaces: string[]; // ✅ Changed from space: string
53
+ content_type?: string;
54
+ tags?: string[];
55
+ // ... other filters
56
+ }
57
+
58
+ export async function handleQuerySpace(
59
+ args: QuerySpaceArgs,
60
+ userId: string
61
+ ): Promise<string> {
62
+ // Validate all spaces
63
+ const invalidSpaces = args.spaces.filter(s => !isValidSpaceId(s));
64
+ if (invalidSpaces.length > 0) {
65
+ return JSON.stringify({
66
+ success: false,
67
+ error: 'Invalid space IDs'
68
+ }, null, 2);
69
+ }
70
+
71
+ // Use unified public collection
72
+ const publicCollection = await ensurePublicCollection(weaviateClient);
73
+
74
+ // Build filter for spaces array
75
+ const spacesFilter = publicCollection.filter
76
+ .byProperty('spaces')
77
+ .containsAny(args.spaces); // ✅ Query multiple spaces!
78
+
79
+ // ... rest of RAG query logic
80
+ }
81
+ ```
82
+
83
+ ### 3. Update Response Format
84
+
85
+ **File**: `src/tools/query-space.ts`
86
+
87
+ Include which spaces were queried:
88
+ ```typescript
89
+ return JSON.stringify({
90
+ success: true,
91
+ spaces_queried: args.spaces, // ✅ Show what was queried
92
+ question: args.question,
93
+ results: formattedResults,
94
+ total: results.length
95
+ }, null, 2);
96
+ ```
97
+
98
+ ### 4. Add Backward Compatibility (Optional)
99
+
100
+ Support both `space` and `spaces` during migration:
101
+ ```typescript
102
+ const spaces = args.spaces || (args.space ? [args.space] : ['the_void']);
103
+ ```
104
+
105
+ ### 5. Update Tests
106
+
107
+ **File**: `tests/unit/query-space.test.ts` (create if doesn't exist)
108
+
109
+ **Add tests**:
110
+ - Query single space
111
+ - Query multiple spaces
112
+ - Results from all spaces returned
113
+ - Invalid space validation
114
+ - RAG query works across spaces
115
+
116
+ ---
117
+
118
+ ## Verification
119
+
120
+ - [ ] Tool accepts `spaces` array parameter
121
+ - [ ] Can query single space: `spaces: ["the_void"]`
122
+ - [ ] Can query multiple spaces: `spaces: ["the_void", "dogs"]`
123
+ - [ ] Uses `containsAny` filter for spaces array
124
+ - [ ] RAG results include memories from all requested spaces
125
+ - [ ] Invalid spaces rejected
126
+ - [ ] Tests passing
127
+ - [ ] TypeScript compiles without errors
128
+ - [ ] Build successful
129
+
130
+ ---
131
+
132
+ ## Files Modified
133
+
134
+ - `src/tools/query-space.ts` - Update for multi-space query
135
+
136
+ ## Files Created
137
+
138
+ - `tests/unit/query-space.test.ts` - Add multi-space tests (if doesn't exist)
139
+
140
+ ---
141
+
142
+ **Next Task**: Task 53 - Add Multi-Space Unit Tests
@@ -0,0 +1,193 @@
1
+ # Task 53: Add Multi-Space Unit Tests
2
+
3
+ **Milestone**: M11 - Unified Public Collection
4
+ **Estimated Time**: 3 hours
5
+ **Dependencies**: Task 52
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Objective
11
+
12
+ Create comprehensive unit tests for the multi-space architecture, covering all scenarios including single-space, multi-space, edge cases, and error conditions.
13
+
14
+ ---
15
+
16
+ ## Steps
17
+
18
+ ### 1. Test Space Schema
19
+
20
+ **File**: `src/weaviate/space-schema.spec.ts`
21
+
22
+ **Add tests**:
23
+ ```typescript
24
+ describe('Unified Public Collection', () => {
25
+ it('should create Memory_public collection', async () => {
26
+ // Test ensurePublicCollection()
27
+ });
28
+
29
+ it('should have spaces array field in schema', () => {
30
+ // Verify schema includes spaces: text[]
31
+ });
32
+
33
+ it('should support backward compatibility', () => {
34
+ // Test old getSpaceCollectionName() still works
35
+ });
36
+ });
37
+ ```
38
+
39
+ ### 2. Test remember_publish
40
+
41
+ **File**: `tests/unit/publish.test.ts`
42
+
43
+ **Add tests**:
44
+ ```typescript
45
+ describe('remember_publish multi-space', () => {
46
+ it('should accept single space', async () => {
47
+ const result = await handlePublish({
48
+ memory_id: 'mem123',
49
+ spaces: ['the_void']
50
+ }, 'user123');
51
+ // Verify token generated
52
+ });
53
+
54
+ it('should accept multiple spaces', async () => {
55
+ const result = await handlePublish({
56
+ memory_id: 'mem123',
57
+ spaces: ['the_void', 'dogs', 'cats']
58
+ }, 'user123');
59
+ // Verify token generated with spaces array
60
+ });
61
+
62
+ it('should reject invalid spaces', async () => {
63
+ const result = await handlePublish({
64
+ memory_id: 'mem123',
65
+ spaces: ['invalid_space']
66
+ }, 'user123');
67
+ // Verify error returned
68
+ });
69
+
70
+ it('should reject empty spaces array', async () => {
71
+ const result = await handlePublish({
72
+ memory_id: 'mem123',
73
+ spaces: []
74
+ }, 'user123');
75
+ // Verify error returned
76
+ });
77
+ });
78
+ ```
79
+
80
+ ### 3. Test remember_confirm
81
+
82
+ **File**: `tests/unit/confirm.test.ts`
83
+
84
+ **Add tests**:
85
+ ```typescript
86
+ describe('remember_confirm multi-space', () => {
87
+ it('should publish to single space', async () => {
88
+ // Mock token with spaces: ['the_void']
89
+ // Verify memory inserted into Memory_public
90
+ // Verify spaces field is ['the_void']
91
+ });
92
+
93
+ it('should publish to multiple spaces', async () => {
94
+ // Mock token with spaces: ['the_void', 'dogs']
95
+ // Verify memory inserted once
96
+ // Verify spaces field is ['the_void', 'dogs']
97
+ });
98
+
99
+ it('should include all spaces in response', async () => {
100
+ // Verify response includes spaces array
101
+ });
102
+ });
103
+ ```
104
+
105
+ ### 4. Test remember_search_space
106
+
107
+ **File**: `tests/unit/search-space.test.ts`
108
+
109
+ **Add tests**:
110
+ ```typescript
111
+ describe('remember_search_space multi-space', () => {
112
+ it('should search single space', async () => {
113
+ // Search spaces: ['the_void']
114
+ // Verify containsAny filter used
115
+ });
116
+
117
+ it('should search multiple spaces', async () => {
118
+ // Search spaces: ['the_void', 'dogs']
119
+ // Verify results from both spaces
120
+ });
121
+
122
+ it('should find memories published to multiple spaces', async () => {
123
+ // Memory with spaces: ['the_void', 'dogs']
124
+ // Search spaces: ['the_void']
125
+ // Verify memory found
126
+ });
127
+
128
+ it('should not find memories from other spaces', async () => {
129
+ // Memory with spaces: ['cats']
130
+ // Search spaces: ['dogs']
131
+ // Verify memory not found
132
+ });
133
+ });
134
+ ```
135
+
136
+ ### 5. Test remember_query_space
137
+
138
+ **File**: `tests/unit/query-space.test.ts`
139
+
140
+ **Add tests**:
141
+ ```typescript
142
+ describe('remember_query_space multi-space', () => {
143
+ it('should query single space', async () => {
144
+ // Query spaces: ['the_void']
145
+ });
146
+
147
+ it('should query multiple spaces', async () => {
148
+ // Query spaces: ['the_void', 'dogs']
149
+ // Verify RAG results from both spaces
150
+ });
151
+ });
152
+ ```
153
+
154
+ ### 6. Test Edge Cases
155
+
156
+ **Add tests for**:
157
+ - Duplicate spaces in array: `['the_void', 'the_void']`
158
+ - Case sensitivity: `['The_Void']` vs `['the_void']`
159
+ - Special characters in space names
160
+ - Very long spaces array (100+ spaces)
161
+ - Spaces array with null/undefined values
162
+
163
+ ---
164
+
165
+ ## Verification
166
+
167
+ - [ ] All space schema tests passing
168
+ - [ ] All publish tests passing (single + multi-space)
169
+ - [ ] All confirm tests passing (single + multi-space)
170
+ - [ ] All search tests passing (single + multi-space)
171
+ - [ ] All query tests passing (single + multi-space)
172
+ - [ ] Edge cases covered
173
+ - [ ] Test coverage increased
174
+ - [ ] All tests passing
175
+ - [ ] TypeScript compiles without errors
176
+ - [ ] Build successful
177
+
178
+ ---
179
+
180
+ ## Files Modified
181
+
182
+ - `src/weaviate/space-schema.spec.ts` - Add unified collection tests
183
+
184
+ ## Files Created
185
+
186
+ - `tests/unit/publish.test.ts` - Multi-space publish tests (if doesn't exist)
187
+ - `tests/unit/confirm.test.ts` - Multi-space confirm tests (if doesn't exist)
188
+ - `tests/unit/search-space.test.ts` - Multi-space search tests (if doesn't exist)
189
+ - `tests/unit/query-space.test.ts` - Multi-space query tests (if doesn't exist)
190
+
191
+ ---
192
+
193
+ **Next Task**: Task 54 - Update Documentation for Multi-Space
@@ -0,0 +1,191 @@
1
+ # Task 54: Update Documentation for Multi-Space
2
+
3
+ **Milestone**: M11 - Unified Public Collection
4
+ **Estimated Time**: 2 hours
5
+ **Dependencies**: Task 53
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Objective
11
+
12
+ Update all documentation to reflect the new multi-space architecture, including README, CHANGELOG, and API examples.
13
+
14
+ ---
15
+
16
+ ## Steps
17
+
18
+ ### 1. Update README.md
19
+
20
+ **File**: `README.md`
21
+
22
+ **Update Shared Spaces section**:
23
+ ```markdown
24
+ ### Publishing Workflow
25
+
26
+ 1. **Request Publication**: Generate confirmation token
27
+ \`\`\`typescript
28
+ remember_publish({
29
+ memory_id: "abc123",
30
+ spaces: ["the_void", "dogs"] // ✅ Multiple spaces!
31
+ })
32
+ // Returns: { success: true, token: "xyz789" }
33
+ \`\`\`
34
+
35
+ 2. **User Confirms**: Execute the publication
36
+ \`\`\`typescript
37
+ remember_confirm({ token: "xyz789" })
38
+ // Returns: {
39
+ // success: true,
40
+ // space_memory_id: "new-id",
41
+ // spaces: ["the_void", "dogs"]
42
+ // }
43
+ \`\`\`
44
+
45
+ 3. **Discover**: Search multiple spaces
46
+ \`\`\`typescript
47
+ remember_search_space({
48
+ spaces: ["the_void", "dogs"], // ✅ Search both at once!
49
+ query: "cute dog pictures"
50
+ })
51
+ \`\`\`
52
+ ```
53
+
54
+ ### 2. Update CHANGELOG.md
55
+
56
+ **File**: `CHANGELOG.md`
57
+
58
+ **Add v2.4.0 entry**:
59
+ ```markdown
60
+ ## [2.4.0] - YYYY-MM-DD
61
+
62
+ ### ✨ Added
63
+
64
+ - **Multi-Space Support**: Publish and search across multiple spaces simultaneously
65
+ - `spaces` array parameter in `remember_publish`
66
+ - `spaces` array parameter in `remember_search_space`
67
+ - `spaces` array parameter in `remember_query_space`
68
+ - Single memory can belong to multiple spaces
69
+ - No duplication - one memory, multiple spaces
70
+
71
+ - **Unified Public Collection**: `Memory_public` replaces per-space collections
72
+ - All public memories in single collection
73
+ - Efficient storage (N× reduction)
74
+ - Simpler architecture
75
+
76
+ ### 🔧 Changed
77
+
78
+ - `remember_publish`: `target` parameter → `spaces` array
79
+ - `remember_search_space`: `space` parameter → `spaces` array
80
+ - `remember_query_space`: `space` parameter → `spaces` array
81
+ - SpaceMemory type: `space_id` field → `spaces` array
82
+ - Collection strategy: Per-space → Unified public
83
+
84
+ ### 🔄 Migration
85
+
86
+ **Backward Compatibility**: v2.4.0 supports both old and new formats
87
+ - Old: `target: "the_void"` → New: `spaces: ["the_void"]`
88
+ - Old: `space: "the_void"` → New: `spaces: ["the_void"]`
89
+
90
+ **Breaking Changes in v3.0.0**:
91
+ - Old format will be removed
92
+ - Must use `spaces` array
93
+ ```
94
+
95
+ ### 3. Update Tool Documentation
96
+
97
+ **Files**: `src/tools/publish.ts`, `src/tools/search-space.ts`, `src/tools/query-space.ts`
98
+
99
+ Update JSDoc comments:
100
+ ```typescript
101
+ /**
102
+ * remember_publish tool
103
+ *
104
+ * Publish a memory to one or more shared spaces.
105
+ *
106
+ * @example
107
+ * // Publish to single space
108
+ * remember_publish({ memory_id: "abc", spaces: ["the_void"] })
109
+ *
110
+ * @example
111
+ * // Publish to multiple spaces
112
+ * remember_publish({ memory_id: "abc", spaces: ["the_void", "dogs", "cats"] })
113
+ */
114
+ ```
115
+
116
+ ### 4. Add Architecture Documentation
117
+
118
+ **File**: `README.md` or create `docs/ARCHITECTURE.md`
119
+
120
+ **Add section**:
121
+ ```markdown
122
+ ## Architecture: Unified Public Collection
123
+
124
+ ### Collection Strategy
125
+
126
+ **Before v2.4.0** (Per-Space Collections):
127
+ - `Memory_the_void` - Only "The Void" memories
128
+ - `Memory_dogs` - Only "Dogs" memories
129
+ - Problem: Can't search multiple spaces, memory duplication
130
+
131
+ **After v2.4.0** (Unified Collection):
132
+ - `Memory_public` - ALL public memories
133
+ - `spaces: ["the_void", "dogs"]` - Memory in multiple spaces
134
+ - Benefit: Multi-space search, no duplication, efficient storage
135
+
136
+ ### Multi-Space Search
137
+
138
+ \`\`\`typescript
139
+ // Search across multiple spaces in one query
140
+ remember_search_space({
141
+ spaces: ["the_void", "dogs", "cats"],
142
+ query: "interesting ideas"
143
+ })
144
+
145
+ // Weaviate filter: spaces containsAny ["the_void", "dogs", "cats"]
146
+ \`\`\`
147
+ ```
148
+
149
+ ### 5. Update Examples
150
+
151
+ **File**: `README.md`
152
+
153
+ Add multi-space examples to use cases:
154
+ ```markdown
155
+ ### Multi-Space Discovery
156
+
157
+ - "Search the void and dogs for cute dog pictures"
158
+ - "Find recipes in cooking and healthy-eating spaces"
159
+ - "Discover tech content across programming and ai spaces"
160
+ ```
161
+
162
+ ---
163
+
164
+ ## Verification
165
+
166
+ - [ ] README updated with multi-space examples
167
+ - [ ] CHANGELOG.md has v2.4.0 entry
168
+ - [ ] Tool JSDoc comments updated
169
+ - [ ] Architecture section added
170
+ - [ ] Migration guide included
171
+ - [ ] Examples show multi-space usage
172
+ - [ ] All documentation accurate
173
+ - [ ] Links work correctly
174
+
175
+ ---
176
+
177
+ ## Files Modified
178
+
179
+ - `README.md` - Add multi-space examples and architecture
180
+ - `CHANGELOG.md` - Add v2.4.0 release notes
181
+ - `src/tools/publish.ts` - Update JSDoc
182
+ - `src/tools/search-space.ts` - Update JSDoc
183
+ - `src/tools/query-space.ts` - Update JSDoc
184
+
185
+ ## Files Created
186
+
187
+ - `docs/ARCHITECTURE.md` - Detailed architecture docs (optional)
188
+
189
+ ---
190
+
191
+ **Next Task**: None - M11 Complete!