@prmichaelsen/remember-mcp 3.14.14 → 3.14.15

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.
@@ -851,24 +851,7 @@ var DEFAULT_PREFERENCES = {
851
851
  var SUPPORTED_SPACES = [
852
852
  "the_void",
853
853
  "profiles",
854
- "spaces",
855
- "ghosts",
856
- "poems",
857
- "recipes",
858
- "quotes",
859
- "dreams",
860
- "travel",
861
- "music",
862
- "pets",
863
- "books",
864
- "funny",
865
- "ideas",
866
- "art",
867
- "fitness",
868
- "how_to",
869
- "movies",
870
- "nature",
871
- "journal"
854
+ "ghosts"
872
855
  ];
873
856
  var SPACE_CONTENT_TYPE_RESTRICTIONS = {
874
857
  profiles: "profile",
@@ -1557,6 +1540,12 @@ function buildDocTypeFilters(collection, docType, filters) {
1557
1540
  if (filters?.date_to) {
1558
1541
  filterList.push(collection.filter.byProperty("created_at").lessOrEqual(new Date(filters.date_to)));
1559
1542
  }
1543
+ if (filters?.relationship_count_min !== void 0) {
1544
+ filterList.push(collection.filter.byProperty("relationship_count").greaterOrEqual(filters.relationship_count_min));
1545
+ }
1546
+ if (filters?.relationship_count_max !== void 0) {
1547
+ filterList.push(collection.filter.byProperty("relationship_count").lessOrEqual(filters.relationship_count_max));
1548
+ }
1560
1549
  if (filters?.tags && filters.tags.length > 0) {
1561
1550
  filterList.push(collection.filter.byProperty("tags").containsAny(filters.tags));
1562
1551
  }
@@ -1727,7 +1716,7 @@ var PreferencesDatabaseService = class {
1727
1716
  };
1728
1717
 
1729
1718
  // node_modules/@prmichaelsen/remember-core/dist/services/confirmation-token.service.js
1730
- import { randomUUID } from "crypto";
1719
+ var randomUUID = () => globalThis.crypto.randomUUID();
1731
1720
  var ConfirmationTokenService = class {
1732
1721
  EXPIRY_MINUTES = 5;
1733
1722
  logger;
@@ -2103,12 +2092,7 @@ var MemoryService = class {
2103
2092
  const combinedFilters = combineFiltersWithAnd([deletedFilter, memoryFilters, ...ghostFilters].filter((f) => f !== null));
2104
2093
  const queryOptions = {
2105
2094
  limit: limit + offset,
2106
- sort: [
2107
- {
2108
- property: "created_at",
2109
- order: direction
2110
- }
2111
- ]
2095
+ sort: this.collection.sort.byProperty("created_at", direction === "asc")
2112
2096
  };
2113
2097
  if (combinedFilters) {
2114
2098
  queryOptions.filters = combinedFilters;
@@ -2152,13 +2136,7 @@ var MemoryService = class {
2152
2136
  const combinedFilters = combineFiltersWithAnd([deletedFilter, memoryFilters, ...ghostFilters, ...densityFilters].filter((f) => f !== null));
2153
2137
  const queryOptions = {
2154
2138
  limit: limit + offset,
2155
- sort: [
2156
- {
2157
- property: "relationship_count",
2158
- order: "desc"
2159
- // Highest first
2160
- }
2161
- ]
2139
+ sort: this.collection.sort.byProperty("relationship_count", false)
2162
2140
  };
2163
2141
  if (combinedFilters) {
2164
2142
  queryOptions.filters = combinedFilters;
@@ -2660,6 +2638,18 @@ async function registerCollection(entry) {
2660
2638
  }
2661
2639
 
2662
2640
  // node_modules/@prmichaelsen/remember-core/dist/database/weaviate/v2-collections.js
2641
+ var collectionCache = /* @__PURE__ */ new Map();
2642
+ var COLLECTION_CACHE_TTL_MS = 6e4;
2643
+ function isCollectionCached(collectionName) {
2644
+ const expiresAt = collectionCache.get(collectionName);
2645
+ if (expiresAt !== void 0 && Date.now() < expiresAt)
2646
+ return true;
2647
+ collectionCache.delete(collectionName);
2648
+ return false;
2649
+ }
2650
+ function cacheCollection(collectionName) {
2651
+ collectionCache.set(collectionName, Date.now() + COLLECTION_CACHE_TTL_MS);
2652
+ }
2663
2653
  var COMMON_MEMORY_PROPERTIES = [
2664
2654
  // Core content
2665
2655
  { name: "content", dataType: configure.dataType.TEXT },
@@ -2818,9 +2808,12 @@ async function reconcileCollectionProperties(client2, collectionName, expectedPr
2818
2808
  }
2819
2809
  async function ensureGroupCollection(client2, groupId) {
2820
2810
  const collectionName = `Memory_groups_${groupId}`;
2811
+ if (isCollectionCached(collectionName))
2812
+ return false;
2821
2813
  const exists = await client2.collections.exists(collectionName);
2822
2814
  if (exists) {
2823
2815
  await reconcileCollectionProperties(client2, collectionName, [...COMMON_MEMORY_PROPERTIES, ...PUBLISHED_MEMORY_PROPERTIES]);
2816
+ cacheCollection(collectionName);
2824
2817
  return false;
2825
2818
  }
2826
2819
  const schema = createGroupCollectionSchema(groupId);
@@ -2831,6 +2824,7 @@ async function ensureGroupCollection(client2, groupId) {
2831
2824
  owner_id: groupId,
2832
2825
  created_at: (/* @__PURE__ */ new Date()).toISOString()
2833
2826
  });
2827
+ cacheCollection(collectionName);
2834
2828
  return true;
2835
2829
  }
2836
2830
 
@@ -2841,10 +2835,13 @@ function isValidSpaceId(spaceId) {
2841
2835
  }
2842
2836
  async function ensurePublicCollection(client2) {
2843
2837
  const collectionName = PUBLIC_COLLECTION_NAME;
2844
- const exists = await client2.collections.exists(collectionName);
2845
- if (!exists) {
2846
- const schema = createSpaceCollectionSchema();
2847
- await client2.collections.create(schema);
2838
+ if (!isCollectionCached(collectionName)) {
2839
+ const exists = await client2.collections.exists(collectionName);
2840
+ if (!exists) {
2841
+ const schema = createSpaceCollectionSchema();
2842
+ await client2.collections.create(schema);
2843
+ }
2844
+ cacheCollection(collectionName);
2848
2845
  }
2849
2846
  return client2.collections.get(collectionName);
2850
2847
  }
package/dist/server.js CHANGED
@@ -855,24 +855,7 @@ var DEFAULT_PREFERENCES = {
855
855
  var SUPPORTED_SPACES = [
856
856
  "the_void",
857
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"
858
+ "ghosts"
876
859
  ];
877
860
  var SPACE_CONTENT_TYPE_RESTRICTIONS = {
878
861
  profiles: "profile",
@@ -1561,6 +1544,12 @@ function buildDocTypeFilters(collection, docType, filters) {
1561
1544
  if (filters?.date_to) {
1562
1545
  filterList.push(collection.filter.byProperty("created_at").lessOrEqual(new Date(filters.date_to)));
1563
1546
  }
1547
+ if (filters?.relationship_count_min !== void 0) {
1548
+ filterList.push(collection.filter.byProperty("relationship_count").greaterOrEqual(filters.relationship_count_min));
1549
+ }
1550
+ if (filters?.relationship_count_max !== void 0) {
1551
+ filterList.push(collection.filter.byProperty("relationship_count").lessOrEqual(filters.relationship_count_max));
1552
+ }
1564
1553
  if (filters?.tags && filters.tags.length > 0) {
1565
1554
  filterList.push(collection.filter.byProperty("tags").containsAny(filters.tags));
1566
1555
  }
@@ -1731,7 +1720,7 @@ var PreferencesDatabaseService = class {
1731
1720
  };
1732
1721
 
1733
1722
  // node_modules/@prmichaelsen/remember-core/dist/services/confirmation-token.service.js
1734
- import { randomUUID } from "crypto";
1723
+ var randomUUID = () => globalThis.crypto.randomUUID();
1735
1724
  var ConfirmationTokenService = class {
1736
1725
  EXPIRY_MINUTES = 5;
1737
1726
  logger;
@@ -2107,12 +2096,7 @@ var MemoryService = class {
2107
2096
  const combinedFilters = combineFiltersWithAnd([deletedFilter, memoryFilters, ...ghostFilters].filter((f) => f !== null));
2108
2097
  const queryOptions = {
2109
2098
  limit: limit + offset,
2110
- sort: [
2111
- {
2112
- property: "created_at",
2113
- order: direction
2114
- }
2115
- ]
2099
+ sort: this.collection.sort.byProperty("created_at", direction === "asc")
2116
2100
  };
2117
2101
  if (combinedFilters) {
2118
2102
  queryOptions.filters = combinedFilters;
@@ -2156,13 +2140,7 @@ var MemoryService = class {
2156
2140
  const combinedFilters = combineFiltersWithAnd([deletedFilter, memoryFilters, ...ghostFilters, ...densityFilters].filter((f) => f !== null));
2157
2141
  const queryOptions = {
2158
2142
  limit: limit + offset,
2159
- sort: [
2160
- {
2161
- property: "relationship_count",
2162
- order: "desc"
2163
- // Highest first
2164
- }
2165
- ]
2143
+ sort: this.collection.sort.byProperty("relationship_count", false)
2166
2144
  };
2167
2145
  if (combinedFilters) {
2168
2146
  queryOptions.filters = combinedFilters;
@@ -2664,6 +2642,18 @@ async function registerCollection(entry) {
2664
2642
  }
2665
2643
 
2666
2644
  // node_modules/@prmichaelsen/remember-core/dist/database/weaviate/v2-collections.js
2645
+ var collectionCache = /* @__PURE__ */ new Map();
2646
+ var COLLECTION_CACHE_TTL_MS = 6e4;
2647
+ function isCollectionCached(collectionName) {
2648
+ const expiresAt = collectionCache.get(collectionName);
2649
+ if (expiresAt !== void 0 && Date.now() < expiresAt)
2650
+ return true;
2651
+ collectionCache.delete(collectionName);
2652
+ return false;
2653
+ }
2654
+ function cacheCollection(collectionName) {
2655
+ collectionCache.set(collectionName, Date.now() + COLLECTION_CACHE_TTL_MS);
2656
+ }
2667
2657
  var COMMON_MEMORY_PROPERTIES = [
2668
2658
  // Core content
2669
2659
  { name: "content", dataType: configure.dataType.TEXT },
@@ -2822,9 +2812,12 @@ async function reconcileCollectionProperties(client2, collectionName, expectedPr
2822
2812
  }
2823
2813
  async function ensureGroupCollection(client2, groupId) {
2824
2814
  const collectionName = `Memory_groups_${groupId}`;
2815
+ if (isCollectionCached(collectionName))
2816
+ return false;
2825
2817
  const exists = await client2.collections.exists(collectionName);
2826
2818
  if (exists) {
2827
2819
  await reconcileCollectionProperties(client2, collectionName, [...COMMON_MEMORY_PROPERTIES, ...PUBLISHED_MEMORY_PROPERTIES]);
2820
+ cacheCollection(collectionName);
2828
2821
  return false;
2829
2822
  }
2830
2823
  const schema = createGroupCollectionSchema(groupId);
@@ -2835,6 +2828,7 @@ async function ensureGroupCollection(client2, groupId) {
2835
2828
  owner_id: groupId,
2836
2829
  created_at: (/* @__PURE__ */ new Date()).toISOString()
2837
2830
  });
2831
+ cacheCollection(collectionName);
2838
2832
  return true;
2839
2833
  }
2840
2834
 
@@ -2845,10 +2839,13 @@ function isValidSpaceId(spaceId) {
2845
2839
  }
2846
2840
  async function ensurePublicCollection(client2) {
2847
2841
  const collectionName = PUBLIC_COLLECTION_NAME;
2848
- const exists = await client2.collections.exists(collectionName);
2849
- if (!exists) {
2850
- const schema = createSpaceCollectionSchema();
2851
- await client2.collections.create(schema);
2842
+ if (!isCollectionCached(collectionName)) {
2843
+ const exists = await client2.collections.exists(collectionName);
2844
+ if (!exists) {
2845
+ const schema = createSpaceCollectionSchema();
2846
+ await client2.collections.create(schema);
2847
+ }
2848
+ cacheCollection(collectionName);
2852
2849
  }
2853
2850
  return client2.collections.get(collectionName);
2854
2851
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prmichaelsen/remember-mcp",
3
- "version": "3.14.14",
3
+ "version": "3.14.15",
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.22.5",
53
+ "@prmichaelsen/remember-core": "^0.24.2",
54
54
  "dotenv": "^16.4.5",
55
55
  "uuid": "^13.0.0",
56
56
  "weaviate-client": "^3.2.0"