@prmichaelsen/remember-mcp 2.2.1 → 2.3.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 (69) hide show
  1. package/AGENT.md +98 -5
  2. package/CHANGELOG.md +45 -0
  3. package/README.md +43 -3
  4. package/agent/commands/acp.init.md +376 -0
  5. package/agent/commands/acp.package-install.md +347 -0
  6. package/agent/commands/acp.proceed.md +311 -0
  7. package/agent/commands/acp.report.md +392 -0
  8. package/agent/commands/acp.status.md +280 -0
  9. package/agent/commands/acp.sync.md +323 -0
  10. package/agent/commands/acp.update.md +301 -0
  11. package/agent/commands/acp.validate.md +385 -0
  12. package/agent/commands/acp.version-check-for-updates.md +275 -0
  13. package/agent/commands/acp.version-check.md +190 -0
  14. package/agent/commands/acp.version-update.md +288 -0
  15. package/agent/commands/command.template.md +273 -0
  16. package/agent/design/core-memory-user-profile.md +1253 -0
  17. package/agent/design/ghost-profiles-pseudonymous-identity.md +194 -0
  18. package/agent/design/publish-tools-confirmation-flow.md +922 -0
  19. package/agent/milestones/milestone-10-shared-spaces.md +169 -0
  20. package/agent/progress.yaml +90 -4
  21. package/agent/scripts/install.sh +118 -0
  22. package/agent/scripts/update.sh +22 -10
  23. package/agent/scripts/version.sh +35 -0
  24. package/agent/tasks/task-27-implement-llm-provider-interface.md +51 -0
  25. package/agent/tasks/task-28-implement-llm-provider-factory.md +64 -0
  26. package/agent/tasks/task-29-update-config-for-llm.md +71 -0
  27. package/agent/tasks/task-30-implement-bedrock-provider.md +147 -0
  28. package/agent/tasks/task-31-implement-background-job-service.md +120 -0
  29. package/agent/tasks/task-32-test-llm-provider-integration.md +152 -0
  30. package/agent/tasks/task-34-create-confirmation-token-service.md +191 -0
  31. package/agent/tasks/task-35-create-space-memory-types-schema.md +183 -0
  32. package/agent/tasks/task-36-implement-remember-publish.md +227 -0
  33. package/agent/tasks/task-37-implement-remember-confirm.md +225 -0
  34. package/agent/tasks/task-38-implement-remember-deny.md +161 -0
  35. package/agent/tasks/task-39-implement-remember-search-space.md +188 -0
  36. package/agent/tasks/task-40-implement-remember-query-space.md +193 -0
  37. package/agent/tasks/task-41-configure-firestore-ttl.md +188 -0
  38. package/agent/tasks/task-42-create-tests-shared-spaces.md +216 -0
  39. package/agent/tasks/task-43-update-documentation.md +255 -0
  40. package/agent/tasks/task-44-implement-remember-retract.md +263 -0
  41. package/agent/tasks/task-45-fix-publish-false-success-bug.md +230 -0
  42. package/dist/llm/types.d.ts +1 -0
  43. package/dist/server-factory.js +1000 -1
  44. package/dist/server.js +1002 -3
  45. package/dist/services/confirmation-token.service.d.ts +99 -0
  46. package/dist/services/confirmation-token.service.spec.d.ts +5 -0
  47. package/dist/tools/confirm.d.ts +20 -0
  48. package/dist/tools/deny.d.ts +19 -0
  49. package/dist/tools/publish.d.ts +22 -0
  50. package/dist/tools/query-space.d.ts +28 -0
  51. package/dist/tools/search-space.d.ts +29 -0
  52. package/dist/types/space-memory.d.ts +80 -0
  53. package/dist/weaviate/space-schema.d.ts +59 -0
  54. package/dist/weaviate/space-schema.spec.d.ts +5 -0
  55. package/package.json +1 -1
  56. package/src/llm/types.ts +0 -0
  57. package/src/server-factory.ts +33 -0
  58. package/src/server.ts +33 -0
  59. package/src/services/confirmation-token.service.spec.ts +254 -0
  60. package/src/services/confirmation-token.service.ts +265 -0
  61. package/src/tools/confirm.ts +219 -0
  62. package/src/tools/create-memory.ts +7 -0
  63. package/src/tools/deny.ts +70 -0
  64. package/src/tools/publish.ts +190 -0
  65. package/src/tools/query-space.ts +197 -0
  66. package/src/tools/search-space.ts +189 -0
  67. package/src/types/space-memory.ts +94 -0
  68. package/src/weaviate/space-schema.spec.ts +131 -0
  69. package/src/weaviate/space-schema.ts +275 -0
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Confirmation Token Service
3
+ *
4
+ * Manages confirmation tokens for sensitive operations like publishing memories.
5
+ * Tokens are one-time use with 5-minute expiry.
6
+ */
7
+ /**
8
+ * Confirmation request stored in Firestore
9
+ */
10
+ export interface ConfirmationRequest {
11
+ user_id: string;
12
+ token: string;
13
+ action: string;
14
+ target_collection?: string;
15
+ payload: any;
16
+ created_at: string;
17
+ expires_at: string;
18
+ status: 'pending' | 'confirmed' | 'denied' | 'expired' | 'retracted';
19
+ confirmed_at?: string;
20
+ }
21
+ /**
22
+ * Service for managing confirmation tokens
23
+ */
24
+ export declare class ConfirmationTokenService {
25
+ private readonly EXPIRY_MINUTES;
26
+ /**
27
+ * Create a new confirmation request
28
+ *
29
+ * @param userId - User ID who initiated the request
30
+ * @param action - Action type (e.g., 'publish_memory')
31
+ * @param payload - Data to store with the request
32
+ * @param targetCollection - Optional target collection (e.g., 'the_void')
33
+ * @returns Request ID and token
34
+ */
35
+ createRequest(userId: string, action: string, payload: any, targetCollection?: string): Promise<{
36
+ requestId: string;
37
+ token: string;
38
+ }>;
39
+ /**
40
+ * Validate and retrieve a confirmation request
41
+ *
42
+ * @param userId - User ID
43
+ * @param token - Confirmation token
44
+ * @returns Request with request_id if valid, null otherwise
45
+ */
46
+ validateToken(userId: string, token: string): Promise<(ConfirmationRequest & {
47
+ request_id: string;
48
+ }) | null>;
49
+ /**
50
+ * Confirm a request
51
+ *
52
+ * @param userId - User ID
53
+ * @param token - Confirmation token
54
+ * @returns Confirmed request if valid, null otherwise
55
+ */
56
+ confirmRequest(userId: string, token: string): Promise<(ConfirmationRequest & {
57
+ request_id: string;
58
+ }) | null>;
59
+ /**
60
+ * Deny a request
61
+ *
62
+ * @param userId - User ID
63
+ * @param token - Confirmation token
64
+ * @returns True if denied successfully, false otherwise
65
+ */
66
+ denyRequest(userId: string, token: string): Promise<boolean>;
67
+ /**
68
+ * Retract a request
69
+ *
70
+ * @param userId - User ID
71
+ * @param token - Confirmation token
72
+ * @returns True if retracted successfully, false otherwise
73
+ */
74
+ retractRequest(userId: string, token: string): Promise<boolean>;
75
+ /**
76
+ * Update request status
77
+ *
78
+ * @param userId - User ID
79
+ * @param requestId - Request document ID
80
+ * @param status - New status
81
+ */
82
+ private updateStatus;
83
+ /**
84
+ * Clean up expired requests (optional - Firestore TTL handles deletion)
85
+ *
86
+ * Note: Configure Firestore TTL policy on 'requests' collection group
87
+ * with 'expires_at' field for automatic deletion within 24 hours.
88
+ *
89
+ * This method is optional for immediate cleanup if needed.
90
+ *
91
+ * @returns Count of deleted requests
92
+ */
93
+ cleanupExpired(): Promise<number>;
94
+ }
95
+ /**
96
+ * Singleton instance of the confirmation token service
97
+ */
98
+ export declare const confirmationTokenService: ConfirmationTokenService;
99
+ //# sourceMappingURL=confirmation-token.service.d.ts.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Unit tests for Confirmation Token Service
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=confirmation-token.service.spec.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * remember_confirm tool
3
+ *
4
+ * Generic confirmation tool that executes any pending action.
5
+ * This is the second phase of the confirmation workflow.
6
+ */
7
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
8
+ /**
9
+ * Tool definition for remember_confirm
10
+ */
11
+ export declare const confirmTool: Tool;
12
+ interface ConfirmArgs {
13
+ token: string;
14
+ }
15
+ /**
16
+ * Handle remember_confirm tool execution
17
+ */
18
+ export declare function handleConfirm(args: ConfirmArgs, userId: string): Promise<string>;
19
+ export {};
20
+ //# sourceMappingURL=confirm.d.ts.map
@@ -0,0 +1,19 @@
1
+ /**
2
+ * remember_deny tool
3
+ *
4
+ * Generic denial tool for any pending action.
5
+ */
6
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
7
+ /**
8
+ * Tool definition for remember_deny
9
+ */
10
+ export declare const denyTool: Tool;
11
+ interface DenyArgs {
12
+ token: string;
13
+ }
14
+ /**
15
+ * Handle remember_deny tool execution
16
+ */
17
+ export declare function handleDeny(args: DenyArgs, userId: string): Promise<string>;
18
+ export {};
19
+ //# sourceMappingURL=deny.d.ts.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * remember_publish tool
3
+ *
4
+ * Generates a confirmation token for publishing a memory to a shared space.
5
+ * This is the first phase of the two-phase publish workflow.
6
+ */
7
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
8
+ /**
9
+ * Tool definition for remember_publish
10
+ */
11
+ export declare const publishTool: Tool;
12
+ interface PublishArgs {
13
+ memory_id: string;
14
+ target: string;
15
+ additional_tags?: string[];
16
+ }
17
+ /**
18
+ * Handle remember_publish tool execution
19
+ */
20
+ export declare function handlePublish(args: PublishArgs, userId: string): Promise<string>;
21
+ export {};
22
+ //# sourceMappingURL=publish.d.ts.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * remember_query_space tool
3
+ *
4
+ * RAG-optimized natural language queries for shared spaces.
5
+ * Similar to remember_query_memory but queries space collections.
6
+ */
7
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
8
+ /**
9
+ * Tool definition for remember_query_space
10
+ */
11
+ export declare const querySpaceTool: Tool;
12
+ interface QuerySpaceArgs {
13
+ question: string;
14
+ space: string;
15
+ content_type?: string;
16
+ tags?: string[];
17
+ min_weight?: number;
18
+ date_from?: string;
19
+ date_to?: string;
20
+ limit?: number;
21
+ format?: 'detailed' | 'compact';
22
+ }
23
+ /**
24
+ * Handle remember_query_space tool execution
25
+ */
26
+ export declare function handleQuerySpace(args: QuerySpaceArgs, userId: string): Promise<string>;
27
+ export {};
28
+ //# sourceMappingURL=query-space.d.ts.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * remember_search_space tool
3
+ *
4
+ * Search shared spaces to discover memories from other users.
5
+ * Similar to remember_search_memory but searches space collections.
6
+ */
7
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
8
+ /**
9
+ * Tool definition for remember_search_space
10
+ */
11
+ export declare const searchSpaceTool: Tool;
12
+ interface SearchSpaceArgs {
13
+ query: string;
14
+ space: string;
15
+ content_type?: string;
16
+ tags?: string[];
17
+ min_weight?: number;
18
+ max_weight?: number;
19
+ date_from?: string;
20
+ date_to?: string;
21
+ limit?: number;
22
+ offset?: number;
23
+ }
24
+ /**
25
+ * Handle remember_search_space tool execution
26
+ */
27
+ export declare function handleSearchSpace(args: SearchSpaceArgs, userId: string): Promise<string>;
28
+ export {};
29
+ //# sourceMappingURL=search-space.d.ts.map
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Space Memory type definitions for remember-mcp
3
+ *
4
+ * Space memories are memories published to shared collections
5
+ * where they can be discovered by other users.
6
+ */
7
+ import type { Memory, SearchOptions, SearchResult } from './memory.js';
8
+ /**
9
+ * Space memory - a memory published to a shared space
10
+ *
11
+ * Extends Memory with additional fields for attribution and discovery
12
+ */
13
+ export interface SpaceMemory extends Omit<Memory, 'user_id' | 'doc_type'> {
14
+ /**
15
+ * Space identifier (snake_case)
16
+ * Examples: 'the_void', 'public_space'
17
+ */
18
+ space_id: string;
19
+ /**
20
+ * Original author's user_id (for permissions)
21
+ * This is private and not shown publicly
22
+ */
23
+ author_id: string;
24
+ /**
25
+ * Optional ghost profile ID for pseudonymous publishing
26
+ * If present, memory is attributed to ghost instead of user
27
+ */
28
+ ghost_id?: string;
29
+ /**
30
+ * When the memory was published to the space
31
+ */
32
+ published_at: string;
33
+ /**
34
+ * How many times this memory has been discovered/viewed
35
+ */
36
+ discovery_count: number;
37
+ /**
38
+ * Attribution type
39
+ * - 'user': Published as the user (shows author_id)
40
+ * - 'ghost': Published as a ghost (shows ghost_id)
41
+ */
42
+ attribution: 'user' | 'ghost';
43
+ /**
44
+ * Document type discriminator
45
+ * Always 'space_memory' for space memories
46
+ */
47
+ doc_type: 'space_memory';
48
+ }
49
+ /**
50
+ * Search options for space memories
51
+ * Same as SearchOptions but for space collections
52
+ */
53
+ export interface SpaceSearchOptions extends Omit<SearchOptions, 'include_relationships'> {
54
+ /**
55
+ * Space to search
56
+ */
57
+ space: string;
58
+ }
59
+ /**
60
+ * Search result for space memories
61
+ */
62
+ export interface SpaceSearchResult extends Omit<SearchResult, 'memories' | 'relationships'> {
63
+ /**
64
+ * Found space memories
65
+ */
66
+ space_memories: SpaceMemory[];
67
+ }
68
+ /**
69
+ * Supported space IDs
70
+ */
71
+ export type SpaceId = 'the_void';
72
+ /**
73
+ * Space display names mapped to IDs
74
+ */
75
+ export declare const SPACE_DISPLAY_NAMES: Record<SpaceId, string>;
76
+ /**
77
+ * Supported spaces constant
78
+ */
79
+ export declare const SUPPORTED_SPACES: SpaceId[];
80
+ //# sourceMappingURL=space-memory.d.ts.map
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Weaviate space collection schema and utilities
3
+ *
4
+ * Manages shared space collections where users can publish memories
5
+ * for discovery by other users.
6
+ */
7
+ import { type WeaviateClient, type Collection } from 'weaviate-client';
8
+ /**
9
+ * Get collection name for a space
10
+ *
11
+ * @param spaceId - Space identifier (snake_case)
12
+ * @returns Collection name in format Memory_{space_id}
13
+ *
14
+ * @example
15
+ * getSpaceCollectionName('the_void') // Returns 'Memory_the_void'
16
+ */
17
+ export declare function getSpaceCollectionName(spaceId: string): string;
18
+ /**
19
+ * Sanitize display name to space ID
20
+ *
21
+ * Converts display names like "The Void" to snake_case IDs like "the_void"
22
+ *
23
+ * @param displayName - Display name with spaces and mixed case
24
+ * @returns snake_case space ID
25
+ *
26
+ * @example
27
+ * sanitizeSpaceId('The Void') // Returns 'the_void'
28
+ * sanitizeSpaceId('Public Space') // Returns 'public_space'
29
+ */
30
+ export declare function sanitizeSpaceId(displayName: string): string;
31
+ /**
32
+ * Get display name for a space ID
33
+ *
34
+ * @param spaceId - Space identifier
35
+ * @returns Display name or the space ID if not found
36
+ *
37
+ * @example
38
+ * getSpaceDisplayName('the_void') // Returns 'The Void'
39
+ */
40
+ export declare function getSpaceDisplayName(spaceId: string): string;
41
+ /**
42
+ * Validate space ID
43
+ *
44
+ * @param spaceId - Space identifier to validate
45
+ * @returns True if valid, false otherwise
46
+ */
47
+ export declare function isValidSpaceId(spaceId: string): boolean;
48
+ /**
49
+ * Ensure a space collection exists, creating it if needed
50
+ *
51
+ * @param client - Weaviate client
52
+ * @param spaceId - Space identifier
53
+ * @returns Collection reference
54
+ *
55
+ * @example
56
+ * const collection = await ensureSpaceCollection(client, 'the_void');
57
+ */
58
+ export declare function ensureSpaceCollection(client: WeaviateClient, spaceId: string): Promise<Collection<any>>;
59
+ //# sourceMappingURL=space-schema.d.ts.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Unit tests for Space Schema utilities
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=space-schema.spec.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prmichaelsen/remember-mcp",
3
- "version": "2.2.1",
3
+ "version": "2.3.1",
4
4
  "description": "Multi-tenant memory system MCP server with vector search and relationships",
5
5
  "main": "dist/server.js",
6
6
  "type": "module",
File without changes
@@ -32,6 +32,13 @@ import { deleteRelationshipTool, handleDeleteRelationship } from './tools/delete
32
32
  import { setPreferenceTool, handleSetPreference } from './tools/set-preference.js';
33
33
  import { getPreferencesTool, handleGetPreferences } from './tools/get-preferences.js';
34
34
 
35
+ // Import space tools
36
+ import { publishTool, handlePublish } from './tools/publish.js';
37
+ import { confirmTool, handleConfirm } from './tools/confirm.js';
38
+ import { denyTool, handleDeny } from './tools/deny.js';
39
+ import { searchSpaceTool, handleSearchSpace } from './tools/search-space.js';
40
+ import { querySpaceTool, handleQuerySpace } from './tools/query-space.js';
41
+
35
42
  export interface ServerOptions {
36
43
  name?: string;
37
44
  version?: string;
@@ -173,6 +180,12 @@ function registerHandlers(server: Server, userId: string, accessToken: string):
173
180
  // Preference tools
174
181
  setPreferenceTool,
175
182
  getPreferencesTool,
183
+ // Space tools
184
+ publishTool,
185
+ confirmTool,
186
+ denyTool,
187
+ searchSpaceTool,
188
+ querySpaceTool,
176
189
  ],
177
190
  };
178
191
  });
@@ -233,6 +246,26 @@ function registerHandlers(server: Server, userId: string, accessToken: string):
233
246
  result = await handleGetPreferences(args as any, userId);
234
247
  break;
235
248
 
249
+ case 'remember_publish':
250
+ result = await handlePublish(args as any, userId);
251
+ break;
252
+
253
+ case 'remember_confirm':
254
+ result = await handleConfirm(args as any, userId);
255
+ break;
256
+
257
+ case 'remember_deny':
258
+ result = await handleDeny(args as any, userId);
259
+ break;
260
+
261
+ case 'remember_search_space':
262
+ result = await handleSearchSpace(args as any, userId);
263
+ break;
264
+
265
+ case 'remember_query_space':
266
+ result = await handleQuerySpace(args as any, userId);
267
+ break;
268
+
236
269
  default:
237
270
  throw new McpError(
238
271
  ErrorCode.MethodNotFound,
package/src/server.ts CHANGED
@@ -31,6 +31,13 @@ import { deleteRelationshipTool, handleDeleteRelationship } from './tools/delete
31
31
  import { setPreferenceTool, handleSetPreference } from './tools/set-preference.js';
32
32
  import { getPreferencesTool, handleGetPreferences } from './tools/get-preferences.js';
33
33
 
34
+ // Import space tools
35
+ import { publishTool, handlePublish } from './tools/publish.js';
36
+ import { confirmTool, handleConfirm } from './tools/confirm.js';
37
+ import { denyTool, handleDeny } from './tools/deny.js';
38
+ import { searchSpaceTool, handleSearchSpace } from './tools/search-space.js';
39
+ import { querySpaceTool, handleQuerySpace } from './tools/query-space.js';
40
+
34
41
  /**
35
42
  * Initialize remember-mcp server
36
43
  */
@@ -98,6 +105,12 @@ function registerHandlers(server: Server): void {
98
105
  // Preference tools
99
106
  setPreferenceTool,
100
107
  getPreferencesTool,
108
+ // Space tools
109
+ publishTool,
110
+ confirmTool,
111
+ denyTool,
112
+ searchSpaceTool,
113
+ querySpaceTool,
101
114
  ],
102
115
  };
103
116
  });
@@ -162,6 +175,26 @@ function registerHandlers(server: Server): void {
162
175
  result = await handleGetPreferences(args as any, userId);
163
176
  break;
164
177
 
178
+ case 'remember_publish':
179
+ result = await handlePublish(args as any, userId);
180
+ break;
181
+
182
+ case 'remember_confirm':
183
+ result = await handleConfirm(args as any, userId);
184
+ break;
185
+
186
+ case 'remember_deny':
187
+ result = await handleDeny(args as any, userId);
188
+ break;
189
+
190
+ case 'remember_search_space':
191
+ result = await handleSearchSpace(args as any, userId);
192
+ break;
193
+
194
+ case 'remember_query_space':
195
+ result = await handleQuerySpace(args as any, userId);
196
+ break;
197
+
165
198
  default:
166
199
  throw new McpError(
167
200
  ErrorCode.MethodNotFound,