@prmichaelsen/remember-mcp 0.2.5 → 1.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.
@@ -0,0 +1,280 @@
1
+ /**
2
+ * User preferences types
3
+ * Stored in Firestore at users/{userId}/preferences
4
+ */
5
+
6
+ /**
7
+ * Template preferences
8
+ */
9
+ export interface TemplatePreferences {
10
+ auto_suggest: boolean;
11
+ suggestion_threshold: number;
12
+ max_suggestions: number;
13
+ show_preview: boolean;
14
+ remember_choice: boolean;
15
+ suppressed_categories?: string[];
16
+ suppressed_templates?: string[];
17
+ always_suggest?: string[];
18
+ }
19
+
20
+ /**
21
+ * Search preferences
22
+ */
23
+ export interface SearchPreferences {
24
+ default_limit: number;
25
+ include_low_trust: boolean;
26
+ weight_by_access: boolean;
27
+ weight_by_recency: boolean;
28
+ default_alpha: number;
29
+ }
30
+
31
+ /**
32
+ * Location preferences
33
+ */
34
+ export interface LocationPreferences {
35
+ auto_capture: boolean;
36
+ precision: 'exact' | 'approximate' | 'city' | 'none';
37
+ share_with_memories: boolean;
38
+ }
39
+
40
+ /**
41
+ * Privacy preferences
42
+ */
43
+ export interface PrivacyPreferences {
44
+ default_trust_level: number;
45
+ allow_cross_user_access: boolean;
46
+ auto_approve_requests: boolean;
47
+ audit_logging: boolean;
48
+ }
49
+
50
+ /**
51
+ * Notification preferences
52
+ */
53
+ export interface NotificationPreferences {
54
+ trust_violations: boolean;
55
+ access_requests: boolean;
56
+ memory_reminders: boolean;
57
+ relationship_suggestions: boolean;
58
+ }
59
+
60
+ /**
61
+ * Display preferences
62
+ */
63
+ export interface DisplayPreferences {
64
+ date_format: string;
65
+ time_format: string;
66
+ timezone: string;
67
+ language: string;
68
+ }
69
+
70
+ /**
71
+ * Complete user preferences
72
+ */
73
+ export interface UserPreferences {
74
+ user_id: string;
75
+ templates: TemplatePreferences;
76
+ search: SearchPreferences;
77
+ location: LocationPreferences;
78
+ privacy: PrivacyPreferences;
79
+ notifications: NotificationPreferences;
80
+ display: DisplayPreferences;
81
+ created_at: string;
82
+ updated_at: string;
83
+ }
84
+
85
+ /**
86
+ * Default preferences
87
+ */
88
+ export const DEFAULT_PREFERENCES: Omit<UserPreferences, 'user_id' | 'created_at' | 'updated_at'> = {
89
+ templates: {
90
+ auto_suggest: true,
91
+ suggestion_threshold: 0.6,
92
+ max_suggestions: 3,
93
+ show_preview: true,
94
+ remember_choice: true,
95
+ suppressed_categories: [],
96
+ suppressed_templates: [],
97
+ always_suggest: [],
98
+ },
99
+ search: {
100
+ default_limit: 10,
101
+ include_low_trust: false,
102
+ weight_by_access: true,
103
+ weight_by_recency: true,
104
+ default_alpha: 0.7,
105
+ },
106
+ location: {
107
+ auto_capture: true,
108
+ precision: 'approximate',
109
+ share_with_memories: true,
110
+ },
111
+ privacy: {
112
+ default_trust_level: 0.5,
113
+ allow_cross_user_access: false,
114
+ auto_approve_requests: false,
115
+ audit_logging: true,
116
+ },
117
+ notifications: {
118
+ trust_violations: true,
119
+ access_requests: true,
120
+ memory_reminders: false,
121
+ relationship_suggestions: true,
122
+ },
123
+ display: {
124
+ date_format: 'MM/DD/YYYY',
125
+ time_format: '12h',
126
+ timezone: 'America/Los_Angeles',
127
+ language: 'en',
128
+ },
129
+ };
130
+
131
+ /**
132
+ * Valid preference categories
133
+ */
134
+ export const PREFERENCE_CATEGORIES = [
135
+ 'templates',
136
+ 'search',
137
+ 'location',
138
+ 'privacy',
139
+ 'notifications',
140
+ 'display',
141
+ ] as const;
142
+
143
+ export type PreferenceCategory = typeof PREFERENCE_CATEGORIES[number];
144
+
145
+ /**
146
+ * Preference field descriptions for dynamic tool schema generation
147
+ */
148
+ export const PREFERENCE_DESCRIPTIONS = {
149
+ templates: {
150
+ auto_suggest: 'Automatically suggest templates when creating memories (default: true)',
151
+ suggestion_threshold: 'Minimum confidence to show template suggestion, 0-1 (default: 0.6)',
152
+ max_suggestions: 'Maximum number of templates to suggest, 1-5 (default: 3)',
153
+ show_preview: 'Show template preview in suggestion (default: true)',
154
+ remember_choice: 'Remember "don\'t suggest for this type" choices (default: true)',
155
+ suppressed_categories: 'Categories to never suggest templates for (default: [])',
156
+ suppressed_templates: 'Specific templates to never suggest (default: [])',
157
+ always_suggest: 'Templates to always suggest regardless of confidence (default: [])',
158
+ },
159
+ search: {
160
+ default_limit: 'Default number of search results to return, 1-100 (default: 10)',
161
+ include_low_trust: 'Include low-trust memories in search results (default: false)',
162
+ weight_by_access: 'Use access count in search ranking (default: true)',
163
+ weight_by_recency: 'Use recency in search ranking (default: true)',
164
+ default_alpha: 'Default hybrid search alpha (0=keyword, 1=semantic, default: 0.7)',
165
+ },
166
+ location: {
167
+ auto_capture: 'Automatically capture location for memories (default: true)',
168
+ precision: 'Location precision level: exact, approximate, city, none (default: approximate)',
169
+ share_with_memories: 'Include location data in memories (default: true)',
170
+ },
171
+ privacy: {
172
+ default_trust_level: 'Default trust level for new memories, 0-1 (default: 0.5)',
173
+ allow_cross_user_access: 'Allow other users to request access to memories (default: false)',
174
+ auto_approve_requests: 'Automatically approve access requests (default: false)',
175
+ audit_logging: 'Enable audit logging for preference changes (default: true)',
176
+ },
177
+ notifications: {
178
+ trust_violations: 'Notify on trust violations (default: true)',
179
+ access_requests: 'Notify on access requests from other users (default: true)',
180
+ memory_reminders: 'Send reminders about important memories (default: false)',
181
+ relationship_suggestions: 'Suggest new relationships between memories (default: true)',
182
+ },
183
+ display: {
184
+ date_format: 'Date format string (default: MM/DD/YYYY)',
185
+ time_format: 'Time format: 12h or 24h (default: 12h)',
186
+ timezone: 'Timezone identifier (default: America/Los_Angeles)',
187
+ language: 'Language code (default: en)',
188
+ },
189
+ } as const;
190
+
191
+ /**
192
+ * Generate dynamic preference description for tool schema
193
+ */
194
+ export function getPreferenceDescription(): string {
195
+ const categories = Object.entries(PREFERENCE_DESCRIPTIONS)
196
+ .map(([category, fields]) => {
197
+ const fieldList = Object.entries(fields)
198
+ .map(([field, desc]) => ` - ${field}: ${desc}`)
199
+ .join('\n');
200
+ return `${category}:\n${fieldList}`;
201
+ })
202
+ .join('\n\n');
203
+
204
+ return `User preferences control system behavior. Available preference categories and fields:\n\n${categories}`;
205
+ }
206
+
207
+ /**
208
+ * Generate JSON schema for preferences
209
+ */
210
+ export function getPreferencesSchema() {
211
+ return {
212
+ type: 'object',
213
+ properties: {
214
+ templates: {
215
+ type: 'object',
216
+ description: 'Template suggestion preferences',
217
+ properties: {
218
+ auto_suggest: { type: 'boolean' },
219
+ suggestion_threshold: { type: 'number', minimum: 0, maximum: 1 },
220
+ max_suggestions: { type: 'number', minimum: 1, maximum: 5 },
221
+ show_preview: { type: 'boolean' },
222
+ remember_choice: { type: 'boolean' },
223
+ suppressed_categories: { type: 'array', items: { type: 'string' } },
224
+ suppressed_templates: { type: 'array', items: { type: 'string' } },
225
+ always_suggest: { type: 'array', items: { type: 'string' } },
226
+ },
227
+ },
228
+ search: {
229
+ type: 'object',
230
+ description: 'Search behavior preferences',
231
+ properties: {
232
+ default_limit: { type: 'number', minimum: 1, maximum: 100 },
233
+ include_low_trust: { type: 'boolean' },
234
+ weight_by_access: { type: 'boolean' },
235
+ weight_by_recency: { type: 'boolean' },
236
+ default_alpha: { type: 'number', minimum: 0, maximum: 1 },
237
+ },
238
+ },
239
+ location: {
240
+ type: 'object',
241
+ description: 'Location capture preferences',
242
+ properties: {
243
+ auto_capture: { type: 'boolean' },
244
+ precision: { type: 'string', enum: ['exact', 'approximate', 'city', 'none'] },
245
+ share_with_memories: { type: 'boolean' },
246
+ },
247
+ },
248
+ privacy: {
249
+ type: 'object',
250
+ description: 'Privacy and trust preferences',
251
+ properties: {
252
+ default_trust_level: { type: 'number', minimum: 0, maximum: 1 },
253
+ allow_cross_user_access: { type: 'boolean' },
254
+ auto_approve_requests: { type: 'boolean' },
255
+ audit_logging: { type: 'boolean' },
256
+ },
257
+ },
258
+ notifications: {
259
+ type: 'object',
260
+ description: 'Notification preferences',
261
+ properties: {
262
+ trust_violations: { type: 'boolean' },
263
+ access_requests: { type: 'boolean' },
264
+ memory_reminders: { type: 'boolean' },
265
+ relationship_suggestions: { type: 'boolean' },
266
+ },
267
+ },
268
+ display: {
269
+ type: 'object',
270
+ description: 'Display format preferences',
271
+ properties: {
272
+ date_format: { type: 'string' },
273
+ time_format: { type: 'string', enum: ['12h', '24h'] },
274
+ timezone: { type: 'string' },
275
+ language: { type: 'string' },
276
+ },
277
+ },
278
+ },
279
+ };
280
+ }