@prmichaelsen/remember-mcp 0.2.5 → 0.2.7
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/progress.yaml +141 -30
- package/agent/tasks/task-20-fix-weaviate-v3-filters.md +450 -0
- package/dist/server-factory.js +582 -113
- package/dist/server.js +579 -113
- package/dist/services/preferences-database.service.d.ts +22 -0
- package/dist/tools/get-preferences.d.ts +41 -0
- package/dist/tools/search-memory.d.ts +1 -1
- package/dist/tools/set-preference.d.ts +185 -0
- package/dist/types/preferences.d.ts +284 -0
- package/dist/utils/weaviate-filters.d.ts +37 -0
- package/dist/utils/weaviate-filters.spec.d.ts +5 -0
- package/package.json +1 -1
- package/src/server-factory.ts +15 -0
- package/src/server.ts +15 -0
- package/src/services/preferences-database.service.ts +120 -0
- package/src/tools/create-memory.ts +1 -0
- package/src/tools/get-preferences.ts +111 -0
- package/src/tools/query-memory.ts +5 -57
- package/src/tools/search-memory.ts +52 -83
- package/src/tools/set-preference.ts +145 -0
- package/src/types/preferences.ts +280 -0
- package/src/utils/weaviate-filters.spec.ts +515 -0
- package/src/utils/weaviate-filters.ts +207 -0
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preferences Database Service
|
|
3
|
+
* Handles all Firestore operations for user preferences
|
|
4
|
+
*/
|
|
5
|
+
import { UserPreferences } from '../types/preferences.js';
|
|
6
|
+
export declare class PreferencesDatabaseService {
|
|
7
|
+
/**
|
|
8
|
+
* Get user preferences
|
|
9
|
+
* Returns defaults if preferences don't exist
|
|
10
|
+
*/
|
|
11
|
+
static getPreferences(userId: string): Promise<UserPreferences>;
|
|
12
|
+
/**
|
|
13
|
+
* Update user preferences (partial update with merge)
|
|
14
|
+
* Creates with defaults if preferences don't exist
|
|
15
|
+
*/
|
|
16
|
+
static updatePreferences(userId: string, updates: Partial<Omit<UserPreferences, 'user_id' | 'created_at'>>): Promise<UserPreferences>;
|
|
17
|
+
/**
|
|
18
|
+
* Create preferences with defaults
|
|
19
|
+
*/
|
|
20
|
+
static createPreferences(userId: string): Promise<UserPreferences>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=preferences-database.service.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* remember_get_preferences tool
|
|
3
|
+
* Retrieve user preferences with defaults
|
|
4
|
+
*/
|
|
5
|
+
import { UserPreferences, PreferenceCategory } from '../types/preferences.js';
|
|
6
|
+
/**
|
|
7
|
+
* Tool definition for remember_get_preferences
|
|
8
|
+
*/
|
|
9
|
+
export declare const getPreferencesTool: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: string;
|
|
14
|
+
properties: {
|
|
15
|
+
category: {
|
|
16
|
+
type: string;
|
|
17
|
+
enum: string[];
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Get preferences arguments
|
|
25
|
+
*/
|
|
26
|
+
export interface GetPreferencesArgs {
|
|
27
|
+
category?: PreferenceCategory;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get preferences result
|
|
31
|
+
*/
|
|
32
|
+
export interface GetPreferencesResult {
|
|
33
|
+
preferences: UserPreferences | Partial<UserPreferences>;
|
|
34
|
+
is_default: boolean;
|
|
35
|
+
message: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Handle remember_get_preferences tool
|
|
39
|
+
*/
|
|
40
|
+
export declare function handleGetPreferences(args: GetPreferencesArgs, userId: string): Promise<string>;
|
|
41
|
+
//# sourceMappingURL=get-preferences.d.ts.map
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* remember_set_preference tool
|
|
3
|
+
* Update user preferences through natural conversation
|
|
4
|
+
*/
|
|
5
|
+
import { UserPreferences } from '../types/preferences.js';
|
|
6
|
+
/**
|
|
7
|
+
* Tool definition for remember_set_preference
|
|
8
|
+
*/
|
|
9
|
+
export declare const setPreferenceTool: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: string;
|
|
14
|
+
properties: {
|
|
15
|
+
preferences: {
|
|
16
|
+
description: string;
|
|
17
|
+
type: string;
|
|
18
|
+
properties: {
|
|
19
|
+
templates: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
properties: {
|
|
23
|
+
auto_suggest: {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
suggestion_threshold: {
|
|
27
|
+
type: string;
|
|
28
|
+
minimum: number;
|
|
29
|
+
maximum: number;
|
|
30
|
+
};
|
|
31
|
+
max_suggestions: {
|
|
32
|
+
type: string;
|
|
33
|
+
minimum: number;
|
|
34
|
+
maximum: number;
|
|
35
|
+
};
|
|
36
|
+
show_preview: {
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
remember_choice: {
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
suppressed_categories: {
|
|
43
|
+
type: string;
|
|
44
|
+
items: {
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
suppressed_templates: {
|
|
49
|
+
type: string;
|
|
50
|
+
items: {
|
|
51
|
+
type: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
always_suggest: {
|
|
55
|
+
type: string;
|
|
56
|
+
items: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
search: {
|
|
63
|
+
type: string;
|
|
64
|
+
description: string;
|
|
65
|
+
properties: {
|
|
66
|
+
default_limit: {
|
|
67
|
+
type: string;
|
|
68
|
+
minimum: number;
|
|
69
|
+
maximum: number;
|
|
70
|
+
};
|
|
71
|
+
include_low_trust: {
|
|
72
|
+
type: string;
|
|
73
|
+
};
|
|
74
|
+
weight_by_access: {
|
|
75
|
+
type: string;
|
|
76
|
+
};
|
|
77
|
+
weight_by_recency: {
|
|
78
|
+
type: string;
|
|
79
|
+
};
|
|
80
|
+
default_alpha: {
|
|
81
|
+
type: string;
|
|
82
|
+
minimum: number;
|
|
83
|
+
maximum: number;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
location: {
|
|
88
|
+
type: string;
|
|
89
|
+
description: string;
|
|
90
|
+
properties: {
|
|
91
|
+
auto_capture: {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
94
|
+
precision: {
|
|
95
|
+
type: string;
|
|
96
|
+
enum: string[];
|
|
97
|
+
};
|
|
98
|
+
share_with_memories: {
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
privacy: {
|
|
104
|
+
type: string;
|
|
105
|
+
description: string;
|
|
106
|
+
properties: {
|
|
107
|
+
default_trust_level: {
|
|
108
|
+
type: string;
|
|
109
|
+
minimum: number;
|
|
110
|
+
maximum: number;
|
|
111
|
+
};
|
|
112
|
+
allow_cross_user_access: {
|
|
113
|
+
type: string;
|
|
114
|
+
};
|
|
115
|
+
auto_approve_requests: {
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
118
|
+
audit_logging: {
|
|
119
|
+
type: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
notifications: {
|
|
124
|
+
type: string;
|
|
125
|
+
description: string;
|
|
126
|
+
properties: {
|
|
127
|
+
trust_violations: {
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
access_requests: {
|
|
131
|
+
type: string;
|
|
132
|
+
};
|
|
133
|
+
memory_reminders: {
|
|
134
|
+
type: string;
|
|
135
|
+
};
|
|
136
|
+
relationship_suggestions: {
|
|
137
|
+
type: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
display: {
|
|
142
|
+
type: string;
|
|
143
|
+
description: string;
|
|
144
|
+
properties: {
|
|
145
|
+
date_format: {
|
|
146
|
+
type: string;
|
|
147
|
+
};
|
|
148
|
+
time_format: {
|
|
149
|
+
type: string;
|
|
150
|
+
enum: string[];
|
|
151
|
+
};
|
|
152
|
+
timezone: {
|
|
153
|
+
type: string;
|
|
154
|
+
};
|
|
155
|
+
language: {
|
|
156
|
+
type: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
required: string[];
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Set preference arguments
|
|
168
|
+
*/
|
|
169
|
+
export interface SetPreferenceArgs {
|
|
170
|
+
preferences: Partial<Omit<UserPreferences, 'user_id' | 'created_at' | 'updated_at'>>;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Set preference result
|
|
174
|
+
*/
|
|
175
|
+
export interface SetPreferenceResult {
|
|
176
|
+
success: boolean;
|
|
177
|
+
updated_preferences: UserPreferences;
|
|
178
|
+
message: string;
|
|
179
|
+
error?: string;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Handle remember_set_preference tool
|
|
183
|
+
*/
|
|
184
|
+
export declare function handleSetPreference(args: SetPreferenceArgs, userId: string): Promise<string>;
|
|
185
|
+
//# sourceMappingURL=set-preference.d.ts.map
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User preferences types
|
|
3
|
+
* Stored in Firestore at users/{userId}/preferences
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Template preferences
|
|
7
|
+
*/
|
|
8
|
+
export interface TemplatePreferences {
|
|
9
|
+
auto_suggest: boolean;
|
|
10
|
+
suggestion_threshold: number;
|
|
11
|
+
max_suggestions: number;
|
|
12
|
+
show_preview: boolean;
|
|
13
|
+
remember_choice: boolean;
|
|
14
|
+
suppressed_categories?: string[];
|
|
15
|
+
suppressed_templates?: string[];
|
|
16
|
+
always_suggest?: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Search preferences
|
|
20
|
+
*/
|
|
21
|
+
export interface SearchPreferences {
|
|
22
|
+
default_limit: number;
|
|
23
|
+
include_low_trust: boolean;
|
|
24
|
+
weight_by_access: boolean;
|
|
25
|
+
weight_by_recency: boolean;
|
|
26
|
+
default_alpha: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Location preferences
|
|
30
|
+
*/
|
|
31
|
+
export interface LocationPreferences {
|
|
32
|
+
auto_capture: boolean;
|
|
33
|
+
precision: 'exact' | 'approximate' | 'city' | 'none';
|
|
34
|
+
share_with_memories: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Privacy preferences
|
|
38
|
+
*/
|
|
39
|
+
export interface PrivacyPreferences {
|
|
40
|
+
default_trust_level: number;
|
|
41
|
+
allow_cross_user_access: boolean;
|
|
42
|
+
auto_approve_requests: boolean;
|
|
43
|
+
audit_logging: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Notification preferences
|
|
47
|
+
*/
|
|
48
|
+
export interface NotificationPreferences {
|
|
49
|
+
trust_violations: boolean;
|
|
50
|
+
access_requests: boolean;
|
|
51
|
+
memory_reminders: boolean;
|
|
52
|
+
relationship_suggestions: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Display preferences
|
|
56
|
+
*/
|
|
57
|
+
export interface DisplayPreferences {
|
|
58
|
+
date_format: string;
|
|
59
|
+
time_format: string;
|
|
60
|
+
timezone: string;
|
|
61
|
+
language: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Complete user preferences
|
|
65
|
+
*/
|
|
66
|
+
export interface UserPreferences {
|
|
67
|
+
user_id: string;
|
|
68
|
+
templates: TemplatePreferences;
|
|
69
|
+
search: SearchPreferences;
|
|
70
|
+
location: LocationPreferences;
|
|
71
|
+
privacy: PrivacyPreferences;
|
|
72
|
+
notifications: NotificationPreferences;
|
|
73
|
+
display: DisplayPreferences;
|
|
74
|
+
created_at: string;
|
|
75
|
+
updated_at: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Default preferences
|
|
79
|
+
*/
|
|
80
|
+
export declare const DEFAULT_PREFERENCES: Omit<UserPreferences, 'user_id' | 'created_at' | 'updated_at'>;
|
|
81
|
+
/**
|
|
82
|
+
* Valid preference categories
|
|
83
|
+
*/
|
|
84
|
+
export declare const PREFERENCE_CATEGORIES: readonly ["templates", "search", "location", "privacy", "notifications", "display"];
|
|
85
|
+
export type PreferenceCategory = typeof PREFERENCE_CATEGORIES[number];
|
|
86
|
+
/**
|
|
87
|
+
* Preference field descriptions for dynamic tool schema generation
|
|
88
|
+
*/
|
|
89
|
+
export declare const PREFERENCE_DESCRIPTIONS: {
|
|
90
|
+
readonly templates: {
|
|
91
|
+
readonly auto_suggest: "Automatically suggest templates when creating memories (default: true)";
|
|
92
|
+
readonly suggestion_threshold: "Minimum confidence to show template suggestion, 0-1 (default: 0.6)";
|
|
93
|
+
readonly max_suggestions: "Maximum number of templates to suggest, 1-5 (default: 3)";
|
|
94
|
+
readonly show_preview: "Show template preview in suggestion (default: true)";
|
|
95
|
+
readonly remember_choice: "Remember \"don't suggest for this type\" choices (default: true)";
|
|
96
|
+
readonly suppressed_categories: "Categories to never suggest templates for (default: [])";
|
|
97
|
+
readonly suppressed_templates: "Specific templates to never suggest (default: [])";
|
|
98
|
+
readonly always_suggest: "Templates to always suggest regardless of confidence (default: [])";
|
|
99
|
+
};
|
|
100
|
+
readonly search: {
|
|
101
|
+
readonly default_limit: "Default number of search results to return, 1-100 (default: 10)";
|
|
102
|
+
readonly include_low_trust: "Include low-trust memories in search results (default: false)";
|
|
103
|
+
readonly weight_by_access: "Use access count in search ranking (default: true)";
|
|
104
|
+
readonly weight_by_recency: "Use recency in search ranking (default: true)";
|
|
105
|
+
readonly default_alpha: "Default hybrid search alpha (0=keyword, 1=semantic, default: 0.7)";
|
|
106
|
+
};
|
|
107
|
+
readonly location: {
|
|
108
|
+
readonly auto_capture: "Automatically capture location for memories (default: true)";
|
|
109
|
+
readonly precision: "Location precision level: exact, approximate, city, none (default: approximate)";
|
|
110
|
+
readonly share_with_memories: "Include location data in memories (default: true)";
|
|
111
|
+
};
|
|
112
|
+
readonly privacy: {
|
|
113
|
+
readonly default_trust_level: "Default trust level for new memories, 0-1 (default: 0.5)";
|
|
114
|
+
readonly allow_cross_user_access: "Allow other users to request access to memories (default: false)";
|
|
115
|
+
readonly auto_approve_requests: "Automatically approve access requests (default: false)";
|
|
116
|
+
readonly audit_logging: "Enable audit logging for preference changes (default: true)";
|
|
117
|
+
};
|
|
118
|
+
readonly notifications: {
|
|
119
|
+
readonly trust_violations: "Notify on trust violations (default: true)";
|
|
120
|
+
readonly access_requests: "Notify on access requests from other users (default: true)";
|
|
121
|
+
readonly memory_reminders: "Send reminders about important memories (default: false)";
|
|
122
|
+
readonly relationship_suggestions: "Suggest new relationships between memories (default: true)";
|
|
123
|
+
};
|
|
124
|
+
readonly display: {
|
|
125
|
+
readonly date_format: "Date format string (default: MM/DD/YYYY)";
|
|
126
|
+
readonly time_format: "Time format: 12h or 24h (default: 12h)";
|
|
127
|
+
readonly timezone: "Timezone identifier (default: America/Los_Angeles)";
|
|
128
|
+
readonly language: "Language code (default: en)";
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Generate dynamic preference description for tool schema
|
|
133
|
+
*/
|
|
134
|
+
export declare function getPreferenceDescription(): string;
|
|
135
|
+
/**
|
|
136
|
+
* Generate JSON schema for preferences
|
|
137
|
+
*/
|
|
138
|
+
export declare function getPreferencesSchema(): {
|
|
139
|
+
type: string;
|
|
140
|
+
properties: {
|
|
141
|
+
templates: {
|
|
142
|
+
type: string;
|
|
143
|
+
description: string;
|
|
144
|
+
properties: {
|
|
145
|
+
auto_suggest: {
|
|
146
|
+
type: string;
|
|
147
|
+
};
|
|
148
|
+
suggestion_threshold: {
|
|
149
|
+
type: string;
|
|
150
|
+
minimum: number;
|
|
151
|
+
maximum: number;
|
|
152
|
+
};
|
|
153
|
+
max_suggestions: {
|
|
154
|
+
type: string;
|
|
155
|
+
minimum: number;
|
|
156
|
+
maximum: number;
|
|
157
|
+
};
|
|
158
|
+
show_preview: {
|
|
159
|
+
type: string;
|
|
160
|
+
};
|
|
161
|
+
remember_choice: {
|
|
162
|
+
type: string;
|
|
163
|
+
};
|
|
164
|
+
suppressed_categories: {
|
|
165
|
+
type: string;
|
|
166
|
+
items: {
|
|
167
|
+
type: string;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
suppressed_templates: {
|
|
171
|
+
type: string;
|
|
172
|
+
items: {
|
|
173
|
+
type: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
always_suggest: {
|
|
177
|
+
type: string;
|
|
178
|
+
items: {
|
|
179
|
+
type: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
search: {
|
|
185
|
+
type: string;
|
|
186
|
+
description: string;
|
|
187
|
+
properties: {
|
|
188
|
+
default_limit: {
|
|
189
|
+
type: string;
|
|
190
|
+
minimum: number;
|
|
191
|
+
maximum: number;
|
|
192
|
+
};
|
|
193
|
+
include_low_trust: {
|
|
194
|
+
type: string;
|
|
195
|
+
};
|
|
196
|
+
weight_by_access: {
|
|
197
|
+
type: string;
|
|
198
|
+
};
|
|
199
|
+
weight_by_recency: {
|
|
200
|
+
type: string;
|
|
201
|
+
};
|
|
202
|
+
default_alpha: {
|
|
203
|
+
type: string;
|
|
204
|
+
minimum: number;
|
|
205
|
+
maximum: number;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
location: {
|
|
210
|
+
type: string;
|
|
211
|
+
description: string;
|
|
212
|
+
properties: {
|
|
213
|
+
auto_capture: {
|
|
214
|
+
type: string;
|
|
215
|
+
};
|
|
216
|
+
precision: {
|
|
217
|
+
type: string;
|
|
218
|
+
enum: string[];
|
|
219
|
+
};
|
|
220
|
+
share_with_memories: {
|
|
221
|
+
type: string;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
privacy: {
|
|
226
|
+
type: string;
|
|
227
|
+
description: string;
|
|
228
|
+
properties: {
|
|
229
|
+
default_trust_level: {
|
|
230
|
+
type: string;
|
|
231
|
+
minimum: number;
|
|
232
|
+
maximum: number;
|
|
233
|
+
};
|
|
234
|
+
allow_cross_user_access: {
|
|
235
|
+
type: string;
|
|
236
|
+
};
|
|
237
|
+
auto_approve_requests: {
|
|
238
|
+
type: string;
|
|
239
|
+
};
|
|
240
|
+
audit_logging: {
|
|
241
|
+
type: string;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
notifications: {
|
|
246
|
+
type: string;
|
|
247
|
+
description: string;
|
|
248
|
+
properties: {
|
|
249
|
+
trust_violations: {
|
|
250
|
+
type: string;
|
|
251
|
+
};
|
|
252
|
+
access_requests: {
|
|
253
|
+
type: string;
|
|
254
|
+
};
|
|
255
|
+
memory_reminders: {
|
|
256
|
+
type: string;
|
|
257
|
+
};
|
|
258
|
+
relationship_suggestions: {
|
|
259
|
+
type: string;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
display: {
|
|
264
|
+
type: string;
|
|
265
|
+
description: string;
|
|
266
|
+
properties: {
|
|
267
|
+
date_format: {
|
|
268
|
+
type: string;
|
|
269
|
+
};
|
|
270
|
+
time_format: {
|
|
271
|
+
type: string;
|
|
272
|
+
enum: string[];
|
|
273
|
+
};
|
|
274
|
+
timezone: {
|
|
275
|
+
type: string;
|
|
276
|
+
};
|
|
277
|
+
language: {
|
|
278
|
+
type: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
//# sourceMappingURL=preferences.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Weaviate v3 Filter Builder Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides helper functions to build Weaviate v3 filters using the fluent API.
|
|
5
|
+
* Replaces old v2 filter format (path/operator/valueText) with v3 collection.filter.byProperty()
|
|
6
|
+
*/
|
|
7
|
+
import type { SearchFilters } from '../types/memory.js';
|
|
8
|
+
/**
|
|
9
|
+
* Build filters for searching both memories and relationships
|
|
10
|
+
* Uses OR logic: (doc_type=memory AND memory_filters) OR (doc_type=relationship AND relationship_filters)
|
|
11
|
+
*
|
|
12
|
+
* @param collection - Weaviate collection instance
|
|
13
|
+
* @param filters - Optional search filters
|
|
14
|
+
* @returns Combined filter or undefined if no filters
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildCombinedSearchFilters(collection: any, filters?: SearchFilters): any;
|
|
17
|
+
/**
|
|
18
|
+
* Build filters for memory-only search (backward compatibility)
|
|
19
|
+
*
|
|
20
|
+
* @param collection - Weaviate collection instance
|
|
21
|
+
* @param filters - Optional search filters
|
|
22
|
+
* @returns Combined filter or undefined if no filters
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildMemoryOnlyFilters(collection: any, filters?: SearchFilters): any;
|
|
25
|
+
/**
|
|
26
|
+
* Build filters specifically for relationship-only search
|
|
27
|
+
*
|
|
28
|
+
* @param collection - Weaviate collection instance
|
|
29
|
+
* @param filters - Optional search filters
|
|
30
|
+
* @returns Combined filter or undefined if no filters
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildRelationshipOnlyFilters(collection: any, filters?: SearchFilters): any;
|
|
33
|
+
/**
|
|
34
|
+
* Helper to check if a filter result is empty
|
|
35
|
+
*/
|
|
36
|
+
export declare function hasFilters(filter: any): boolean;
|
|
37
|
+
//# sourceMappingURL=weaviate-filters.d.ts.map
|
package/package.json
CHANGED
package/src/server-factory.ts
CHANGED
|
@@ -28,6 +28,10 @@ import { updateRelationshipTool, handleUpdateRelationship } from './tools/update
|
|
|
28
28
|
import { searchRelationshipTool, handleSearchRelationship } from './tools/search-relationship.js';
|
|
29
29
|
import { deleteRelationshipTool, handleDeleteRelationship } from './tools/delete-relationship.js';
|
|
30
30
|
|
|
31
|
+
// Import preference tools
|
|
32
|
+
import { setPreferenceTool, handleSetPreference } from './tools/set-preference.js';
|
|
33
|
+
import { getPreferencesTool, handleGetPreferences } from './tools/get-preferences.js';
|
|
34
|
+
|
|
31
35
|
export interface ServerOptions {
|
|
32
36
|
name?: string;
|
|
33
37
|
version?: string;
|
|
@@ -177,6 +181,9 @@ function registerHandlers(server: Server, userId: string, accessToken: string):
|
|
|
177
181
|
updateRelationshipTool,
|
|
178
182
|
searchRelationshipTool,
|
|
179
183
|
deleteRelationshipTool,
|
|
184
|
+
// Preference tools
|
|
185
|
+
setPreferenceTool,
|
|
186
|
+
getPreferencesTool,
|
|
180
187
|
],
|
|
181
188
|
};
|
|
182
189
|
});
|
|
@@ -233,6 +240,14 @@ function registerHandlers(server: Server, userId: string, accessToken: string):
|
|
|
233
240
|
result = await handleDeleteRelationship(args as any, userId);
|
|
234
241
|
break;
|
|
235
242
|
|
|
243
|
+
case 'remember_set_preference':
|
|
244
|
+
result = await handleSetPreference(args as any, userId);
|
|
245
|
+
break;
|
|
246
|
+
|
|
247
|
+
case 'remember_get_preferences':
|
|
248
|
+
result = await handleGetPreferences(args as any, userId);
|
|
249
|
+
break;
|
|
250
|
+
|
|
236
251
|
default:
|
|
237
252
|
throw new McpError(
|
|
238
253
|
ErrorCode.MethodNotFound,
|
package/src/server.ts
CHANGED
|
@@ -27,6 +27,10 @@ import { updateRelationshipTool, handleUpdateRelationship } from './tools/update
|
|
|
27
27
|
import { searchRelationshipTool, handleSearchRelationship } from './tools/search-relationship.js';
|
|
28
28
|
import { deleteRelationshipTool, handleDeleteRelationship } from './tools/delete-relationship.js';
|
|
29
29
|
|
|
30
|
+
// Import preference tools
|
|
31
|
+
import { setPreferenceTool, handleSetPreference } from './tools/set-preference.js';
|
|
32
|
+
import { getPreferencesTool, handleGetPreferences } from './tools/get-preferences.js';
|
|
33
|
+
|
|
30
34
|
/**
|
|
31
35
|
* Initialize remember-mcp server
|
|
32
36
|
*/
|
|
@@ -91,6 +95,9 @@ function registerHandlers(server: Server): void {
|
|
|
91
95
|
updateRelationshipTool,
|
|
92
96
|
searchRelationshipTool,
|
|
93
97
|
deleteRelationshipTool,
|
|
98
|
+
// Preference tools
|
|
99
|
+
setPreferenceTool,
|
|
100
|
+
getPreferencesTool,
|
|
94
101
|
],
|
|
95
102
|
};
|
|
96
103
|
});
|
|
@@ -147,6 +154,14 @@ function registerHandlers(server: Server): void {
|
|
|
147
154
|
result = await handleDeleteRelationship(args as any, userId);
|
|
148
155
|
break;
|
|
149
156
|
|
|
157
|
+
case 'remember_set_preference':
|
|
158
|
+
result = await handleSetPreference(args as any, userId);
|
|
159
|
+
break;
|
|
160
|
+
|
|
161
|
+
case 'remember_get_preferences':
|
|
162
|
+
result = await handleGetPreferences(args as any, userId);
|
|
163
|
+
break;
|
|
164
|
+
|
|
150
165
|
default:
|
|
151
166
|
throw new McpError(
|
|
152
167
|
ErrorCode.MethodNotFound,
|