@prmichaelsen/remember-mcp 3.14.4 → 3.14.6

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.
@@ -1168,7 +1168,32 @@ var DEFAULT_PREFERENCES = {
1168
1168
  };
1169
1169
 
1170
1170
  // node_modules/@prmichaelsen/remember-core/dist/types/space.types.js
1171
- var SUPPORTED_SPACES = ["the_void", "profiles", "spaces"];
1171
+ var SUPPORTED_SPACES = [
1172
+ "the_void",
1173
+ "profiles",
1174
+ "spaces",
1175
+ "ghosts",
1176
+ "poems",
1177
+ "recipes",
1178
+ "quotes",
1179
+ "dreams",
1180
+ "travel",
1181
+ "music",
1182
+ "pets",
1183
+ "books",
1184
+ "funny",
1185
+ "ideas",
1186
+ "art",
1187
+ "fitness",
1188
+ "how_to",
1189
+ "movies",
1190
+ "nature",
1191
+ "journal"
1192
+ ];
1193
+ var SPACE_CONTENT_TYPE_RESTRICTIONS = {
1194
+ profiles: "profile",
1195
+ ghosts: "ghost"
1196
+ };
1172
1197
 
1173
1198
  // node_modules/@prmichaelsen/remember-core/dist/constants/content-types.js
1174
1199
  var CONTENT_TYPES = [
@@ -1224,7 +1249,9 @@ var CONTENT_TYPES = [
1224
1249
  "history",
1225
1250
  // Cross-user & Threading
1226
1251
  "ghost",
1227
- "comment"
1252
+ "comment",
1253
+ // Profile
1254
+ "profile"
1228
1255
  ];
1229
1256
  var CONTENT_TYPE_METADATA = {
1230
1257
  // Core Types
@@ -1533,6 +1560,13 @@ var CONTENT_TYPE_METADATA = {
1533
1560
  description: "Threaded comments on shared memories in spaces and groups",
1534
1561
  examples: ["Comments on shared memories", "Discussion replies", "Feedback"],
1535
1562
  common_fields: ["parent_id", "thread_root_id"]
1563
+ },
1564
+ // Profile
1565
+ profile: {
1566
+ name: "profile",
1567
+ category: "cross_user",
1568
+ description: "User profile published to the profiles space for people discovery",
1569
+ examples: ["User bio", "About me", "Profile introduction"]
1536
1570
  }
1537
1571
  };
1538
1572
  function isValidContentType(type) {
@@ -1914,6 +1948,9 @@ var BASE = getBasePrefix();
1914
1948
  function getUserPreferencesPath(userId) {
1915
1949
  return `${BASE}.users/${userId}/preferences`;
1916
1950
  }
1951
+ function getCollectionRegistryPath() {
1952
+ return `${BASE}.collection_registry`;
1953
+ }
1917
1954
 
1918
1955
  // node_modules/@prmichaelsen/remember-core/dist/services/preferences.service.js
1919
1956
  var PreferencesDatabaseService = class {
@@ -2202,6 +2239,7 @@ var ALL_MEMORY_PROPERTIES = [
2202
2239
  "relationship_type",
2203
2240
  "observation",
2204
2241
  "strength",
2242
+ "source",
2205
2243
  "access_count",
2206
2244
  "last_accessed_at",
2207
2245
  "tags",
@@ -2270,6 +2308,15 @@ var MemoryService = class {
2270
2308
  throw err2;
2271
2309
  }
2272
2310
  }
2311
+ // ── Get by ID ────────────────────────────────────────────────────────
2312
+ async getById(memoryId) {
2313
+ const existing = await fetchMemoryWithAllProperties(this.collection, memoryId);
2314
+ if (!existing?.properties)
2315
+ throw new Error(`Memory not found: ${memoryId}`);
2316
+ if (existing.properties.user_id !== this.userId)
2317
+ throw new Error("Unauthorized");
2318
+ return { memory: { id: existing.uuid, ...existing.properties } };
2319
+ }
2273
2320
  // ── Create ──────────────────────────────────────────────────────────
2274
2321
  async create(input) {
2275
2322
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -2604,6 +2651,7 @@ var RelationshipService = class {
2604
2651
  observation: input.observation,
2605
2652
  strength: input.strength ?? 0.5,
2606
2653
  confidence: input.confidence ?? 0.8,
2654
+ source: input.source ?? "user",
2607
2655
  created_at: now,
2608
2656
  updated_at: now,
2609
2657
  version: 1,
@@ -2714,6 +2762,45 @@ var RelationshipService = class {
2714
2762
  }));
2715
2763
  return { relationships, total: results.objects.length, offset, limit };
2716
2764
  }
2765
+ // ── Find by Memory IDs ──────────────────────────────────────────────
2766
+ async findByMemoryIds(input) {
2767
+ if (input.memory_ids.length === 0) {
2768
+ return { relationships: [], total: 0 };
2769
+ }
2770
+ const limit = input.limit ?? 100;
2771
+ const filterList = [
2772
+ this.collection.filter.byProperty("doc_type").equal("relationship"),
2773
+ this.collection.filter.byProperty("related_memory_ids").containsAny(input.memory_ids)
2774
+ ];
2775
+ if (input.source_filter) {
2776
+ filterList.push(this.collection.filter.byProperty("source").equal(input.source_filter));
2777
+ }
2778
+ const combinedFilters = combineFiltersWithAnd(filterList);
2779
+ const results = await this.collection.query.fetchObjects({
2780
+ filters: combinedFilters,
2781
+ limit,
2782
+ returnProperties: [
2783
+ "user_id",
2784
+ "doc_type",
2785
+ "related_memory_ids",
2786
+ "memory_ids",
2787
+ "relationship_type",
2788
+ "observation",
2789
+ "strength",
2790
+ "confidence",
2791
+ "source",
2792
+ "tags",
2793
+ "created_at",
2794
+ "updated_at",
2795
+ "version"
2796
+ ]
2797
+ });
2798
+ const relationships = results.objects.map((obj) => ({
2799
+ id: obj.uuid,
2800
+ ...obj.properties
2801
+ }));
2802
+ return { relationships, total: relationships.length };
2803
+ }
2717
2804
  // ── Delete ──────────────────────────────────────────────────────────
2718
2805
  async delete(input) {
2719
2806
  const existing = await this.collection.query.fetchObjectById(input.relationship_id, {
@@ -2758,6 +2845,14 @@ import { Filters as Filters4 } from "weaviate-client";
2758
2845
 
2759
2846
  // node_modules/@prmichaelsen/remember-core/dist/database/weaviate/v2-collections.js
2760
2847
  import { configure } from "weaviate-client";
2848
+
2849
+ // node_modules/@prmichaelsen/remember-core/dist/database/collection-registry.js
2850
+ async function registerCollection(entry) {
2851
+ const path = getCollectionRegistryPath();
2852
+ await setDocument2(path, entry.collection_name, entry);
2853
+ }
2854
+
2855
+ // node_modules/@prmichaelsen/remember-core/dist/database/weaviate/v2-collections.js
2761
2856
  var COMMON_MEMORY_PROPERTIES = [
2762
2857
  // Core content
2763
2858
  { name: "content", dataType: configure.dataType.TEXT },
@@ -2812,6 +2907,7 @@ var COMMON_MEMORY_PROPERTIES = [
2812
2907
  { name: "relationship_type", dataType: configure.dataType.TEXT },
2813
2908
  { name: "related_memory_ids", dataType: configure.dataType.TEXT_ARRAY },
2814
2909
  { name: "observation", dataType: configure.dataType.TEXT },
2910
+ { name: "source", dataType: configure.dataType.TEXT },
2815
2911
  // Relationships (v1 compat)
2816
2912
  { name: "relationships", dataType: configure.dataType.TEXT_ARRAY },
2817
2913
  { name: "memory_ids", dataType: configure.dataType.TEXT_ARRAY },
@@ -2921,6 +3017,12 @@ async function ensureGroupCollection(client2, groupId) {
2921
3017
  }
2922
3018
  const schema = createGroupCollectionSchema(groupId);
2923
3019
  await client2.collections.create(schema);
3020
+ await registerCollection({
3021
+ collection_name: collectionName,
3022
+ collection_type: "groups",
3023
+ owner_id: groupId,
3024
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
3025
+ });
2924
3026
  return true;
2925
3027
  }
2926
3028
 
@@ -3009,6 +3111,13 @@ var SpaceService = class {
3009
3111
  throw new Error("Permission denied: not memory owner");
3010
3112
  if (memory.properties.doc_type !== "memory")
3011
3113
  throw new Error("Only memories can be published");
3114
+ const memoryContentType = memory.properties.content_type;
3115
+ for (const spaceId of spaces) {
3116
+ const requiredType = SPACE_CONTENT_TYPE_RESTRICTIONS[spaceId];
3117
+ if (requiredType && memoryContentType !== requiredType) {
3118
+ throw new Error(`Space '${spaceId}' only accepts content_type '${requiredType}', got '${memoryContentType ?? "undefined"}'`);
3119
+ }
3120
+ }
3012
3121
  const { token } = await this.confirmationTokenService.createRequest(this.userId, "publish_memory", {
3013
3122
  memory_id: input.memory_id,
3014
3123
  spaces,
package/dist/server.js CHANGED
@@ -852,7 +852,32 @@ var DEFAULT_PREFERENCES = {
852
852
  };
853
853
 
854
854
  // node_modules/@prmichaelsen/remember-core/dist/types/space.types.js
855
- var SUPPORTED_SPACES = ["the_void", "profiles", "spaces"];
855
+ var SUPPORTED_SPACES = [
856
+ "the_void",
857
+ "profiles",
858
+ "spaces",
859
+ "ghosts",
860
+ "poems",
861
+ "recipes",
862
+ "quotes",
863
+ "dreams",
864
+ "travel",
865
+ "music",
866
+ "pets",
867
+ "books",
868
+ "funny",
869
+ "ideas",
870
+ "art",
871
+ "fitness",
872
+ "how_to",
873
+ "movies",
874
+ "nature",
875
+ "journal"
876
+ ];
877
+ var SPACE_CONTENT_TYPE_RESTRICTIONS = {
878
+ profiles: "profile",
879
+ ghosts: "ghost"
880
+ };
856
881
 
857
882
  // node_modules/@prmichaelsen/remember-core/dist/constants/content-types.js
858
883
  var CONTENT_TYPES = [
@@ -908,7 +933,9 @@ var CONTENT_TYPES = [
908
933
  "history",
909
934
  // Cross-user & Threading
910
935
  "ghost",
911
- "comment"
936
+ "comment",
937
+ // Profile
938
+ "profile"
912
939
  ];
913
940
  var CONTENT_TYPE_METADATA = {
914
941
  // Core Types
@@ -1217,6 +1244,13 @@ var CONTENT_TYPE_METADATA = {
1217
1244
  description: "Threaded comments on shared memories in spaces and groups",
1218
1245
  examples: ["Comments on shared memories", "Discussion replies", "Feedback"],
1219
1246
  common_fields: ["parent_id", "thread_root_id"]
1247
+ },
1248
+ // Profile
1249
+ profile: {
1250
+ name: "profile",
1251
+ category: "cross_user",
1252
+ description: "User profile published to the profiles space for people discovery",
1253
+ examples: ["User bio", "About me", "Profile introduction"]
1220
1254
  }
1221
1255
  };
1222
1256
  function isValidContentType(type) {
@@ -1598,6 +1632,9 @@ var BASE = getBasePrefix();
1598
1632
  function getUserPreferencesPath(userId) {
1599
1633
  return `${BASE}.users/${userId}/preferences`;
1600
1634
  }
1635
+ function getCollectionRegistryPath() {
1636
+ return `${BASE}.collection_registry`;
1637
+ }
1601
1638
 
1602
1639
  // node_modules/@prmichaelsen/remember-core/dist/services/preferences.service.js
1603
1640
  var PreferencesDatabaseService = class {
@@ -1886,6 +1923,7 @@ var ALL_MEMORY_PROPERTIES = [
1886
1923
  "relationship_type",
1887
1924
  "observation",
1888
1925
  "strength",
1926
+ "source",
1889
1927
  "access_count",
1890
1928
  "last_accessed_at",
1891
1929
  "tags",
@@ -1954,6 +1992,15 @@ var MemoryService = class {
1954
1992
  throw err2;
1955
1993
  }
1956
1994
  }
1995
+ // ── Get by ID ────────────────────────────────────────────────────────
1996
+ async getById(memoryId) {
1997
+ const existing = await fetchMemoryWithAllProperties(this.collection, memoryId);
1998
+ if (!existing?.properties)
1999
+ throw new Error(`Memory not found: ${memoryId}`);
2000
+ if (existing.properties.user_id !== this.userId)
2001
+ throw new Error("Unauthorized");
2002
+ return { memory: { id: existing.uuid, ...existing.properties } };
2003
+ }
1957
2004
  // ── Create ──────────────────────────────────────────────────────────
1958
2005
  async create(input) {
1959
2006
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -2288,6 +2335,7 @@ var RelationshipService = class {
2288
2335
  observation: input.observation,
2289
2336
  strength: input.strength ?? 0.5,
2290
2337
  confidence: input.confidence ?? 0.8,
2338
+ source: input.source ?? "user",
2291
2339
  created_at: now,
2292
2340
  updated_at: now,
2293
2341
  version: 1,
@@ -2398,6 +2446,45 @@ var RelationshipService = class {
2398
2446
  }));
2399
2447
  return { relationships, total: results.objects.length, offset, limit };
2400
2448
  }
2449
+ // ── Find by Memory IDs ──────────────────────────────────────────────
2450
+ async findByMemoryIds(input) {
2451
+ if (input.memory_ids.length === 0) {
2452
+ return { relationships: [], total: 0 };
2453
+ }
2454
+ const limit = input.limit ?? 100;
2455
+ const filterList = [
2456
+ this.collection.filter.byProperty("doc_type").equal("relationship"),
2457
+ this.collection.filter.byProperty("related_memory_ids").containsAny(input.memory_ids)
2458
+ ];
2459
+ if (input.source_filter) {
2460
+ filterList.push(this.collection.filter.byProperty("source").equal(input.source_filter));
2461
+ }
2462
+ const combinedFilters = combineFiltersWithAnd(filterList);
2463
+ const results = await this.collection.query.fetchObjects({
2464
+ filters: combinedFilters,
2465
+ limit,
2466
+ returnProperties: [
2467
+ "user_id",
2468
+ "doc_type",
2469
+ "related_memory_ids",
2470
+ "memory_ids",
2471
+ "relationship_type",
2472
+ "observation",
2473
+ "strength",
2474
+ "confidence",
2475
+ "source",
2476
+ "tags",
2477
+ "created_at",
2478
+ "updated_at",
2479
+ "version"
2480
+ ]
2481
+ });
2482
+ const relationships = results.objects.map((obj) => ({
2483
+ id: obj.uuid,
2484
+ ...obj.properties
2485
+ }));
2486
+ return { relationships, total: relationships.length };
2487
+ }
2401
2488
  // ── Delete ──────────────────────────────────────────────────────────
2402
2489
  async delete(input) {
2403
2490
  const existing = await this.collection.query.fetchObjectById(input.relationship_id, {
@@ -2442,6 +2529,14 @@ import { Filters as Filters4 } from "weaviate-client";
2442
2529
 
2443
2530
  // node_modules/@prmichaelsen/remember-core/dist/database/weaviate/v2-collections.js
2444
2531
  import { configure } from "weaviate-client";
2532
+
2533
+ // node_modules/@prmichaelsen/remember-core/dist/database/collection-registry.js
2534
+ async function registerCollection(entry) {
2535
+ const path = getCollectionRegistryPath();
2536
+ await setDocument2(path, entry.collection_name, entry);
2537
+ }
2538
+
2539
+ // node_modules/@prmichaelsen/remember-core/dist/database/weaviate/v2-collections.js
2445
2540
  var COMMON_MEMORY_PROPERTIES = [
2446
2541
  // Core content
2447
2542
  { name: "content", dataType: configure.dataType.TEXT },
@@ -2496,6 +2591,7 @@ var COMMON_MEMORY_PROPERTIES = [
2496
2591
  { name: "relationship_type", dataType: configure.dataType.TEXT },
2497
2592
  { name: "related_memory_ids", dataType: configure.dataType.TEXT_ARRAY },
2498
2593
  { name: "observation", dataType: configure.dataType.TEXT },
2594
+ { name: "source", dataType: configure.dataType.TEXT },
2499
2595
  // Relationships (v1 compat)
2500
2596
  { name: "relationships", dataType: configure.dataType.TEXT_ARRAY },
2501
2597
  { name: "memory_ids", dataType: configure.dataType.TEXT_ARRAY },
@@ -2605,6 +2701,12 @@ async function ensureGroupCollection(client2, groupId) {
2605
2701
  }
2606
2702
  const schema = createGroupCollectionSchema(groupId);
2607
2703
  await client2.collections.create(schema);
2704
+ await registerCollection({
2705
+ collection_name: collectionName,
2706
+ collection_type: "groups",
2707
+ owner_id: groupId,
2708
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
2709
+ });
2608
2710
  return true;
2609
2711
  }
2610
2712
 
@@ -2693,6 +2795,13 @@ var SpaceService = class {
2693
2795
  throw new Error("Permission denied: not memory owner");
2694
2796
  if (memory.properties.doc_type !== "memory")
2695
2797
  throw new Error("Only memories can be published");
2798
+ const memoryContentType = memory.properties.content_type;
2799
+ for (const spaceId of spaces) {
2800
+ const requiredType = SPACE_CONTENT_TYPE_RESTRICTIONS[spaceId];
2801
+ if (requiredType && memoryContentType !== requiredType) {
2802
+ throw new Error(`Space '${spaceId}' only accepts content_type '${requiredType}', got '${memoryContentType ?? "undefined"}'`);
2803
+ }
2804
+ }
2696
2805
  const { token } = await this.confirmationTokenService.createRequest(this.userId, "publish_memory", {
2697
2806
  memory_id: input.memory_id,
2698
2807
  spaces,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prmichaelsen/remember-mcp",
3
- "version": "3.14.4",
3
+ "version": "3.14.6",
4
4
  "description": "Multi-tenant memory system MCP server with vector search and relationships",
5
5
  "main": "dist/server.js",
6
6
  "type": "module",
@@ -50,7 +50,7 @@
50
50
  "@modelcontextprotocol/sdk": "^1.0.4",
51
51
  "@prmichaelsen/firebase-admin-sdk-v8": "^2.2.0",
52
52
  "@prmichaelsen/mcp-auth": "^7.0.4",
53
- "@prmichaelsen/remember-core": "^0.16.9",
53
+ "@prmichaelsen/remember-core": "^0.19.1",
54
54
  "@prmichaelsen/remember-mcp": "^2.7.3",
55
55
  "dotenv": "^16.4.5",
56
56
  "uuid": "^13.0.0",