@melandlabs/memory-store 1.2.4 → 1.3.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.
@@ -1,10 +1,11 @@
1
1
  import { VectorSearchResult } from '@melandlabs/rag/vector-service';
2
- import { a as MemoryStoreEnv } from '../config-DfvVZ--0.js';
2
+ import { a as MemoryStoreEnv } from '../config-CbE2t4SW.js';
3
3
  import '@melandlabs/memory-consolidation';
4
4
  import '@melandlabs/contracts/peer';
5
5
  import '@melandlabs/contracts';
6
6
  import '@melandlabs/contracts/derived-fact';
7
7
  import '@melandlabs/contracts/entity-edge';
8
+ import '@melandlabs/indexeddb';
8
9
 
9
10
  /**
10
11
  * SQLite-vec-backed raw-message + insight vector index.
@@ -24,7 +24,7 @@ function isInsightSQLiteVecEnabled(_env) {
24
24
  }
25
25
  async function getInsightSQLiteVecStore(_env) {
26
26
  const dbPath = resolveSQLiteRawMessageDbPath();
27
- const { getSQLiteVecStore } = await import('@melandlabs/rag/sqlite-vec-store');
27
+ const { getSQLiteVecStore } = await import('@melandlabs/ai-rag/sqlite-vec-store');
28
28
  return await getSQLiteVecStore(dbPath, void 0, {
29
29
  collectionName: process.env.SQLITE_VEC_INSIGHTS_COLLECTION || "opencontext_insights"
30
30
  });
@@ -1,7 +1,17 @@
1
- import { S as SearchTier, b as UnifiedMemorySearchWarning, c as SearchEvidence, U as UnifiedSearchDeps, d as SearchInput, e as SearchOutput, f as UnifiedMemorySearchInput, g as UnifiedMemorySearchOutput, h as UnifiedMemorySearchResult } from './config-DfvVZ--0.js';
1
+ import { S as SearchTier, b as UnifiedMemorySearchWarning, c as SearchEvidence, U as UnifiedSearchDeps, d as SearchInput, e as SearchOutput, f as UnifiedMemorySearchInput, g as UnifiedMemorySearchOutput, h as UnifiedMemorySearchResult } from './config-CbE2t4SW.js';
2
+ import { MemoryApplicabilityContext, OwnerScope, MemoryConsolidationPlan, ReflectApplyClusterKeyFn, MemoryStorageAdapterLike, MemoryGraphStoreWithOperationHistory, MemoryGraphUpdateResult } from '@melandlabs/memory-consolidation';
2
3
  import { MemoryStorageAdapter } from '@melandlabs/ai/memory';
3
4
  import { Peer } from '@melandlabs/contracts/peer';
4
- import { OwnerScope, MemoryConsolidationPlan, ReflectApplyClusterKeyFn, MemoryStorageAdapterLike, MemoryGraphStoreWithOperationHistory, MemoryGraphUpdateResult } from '@melandlabs/memory-consolidation';
5
+
6
+ /**
7
+ * Trusted, in-process context for one `search()` call. Hosts must derive these
8
+ * contexts from authenticated server-side state rather than public payloads.
9
+ * An explicit empty array requests global-only retrieval; omitting the runtime
10
+ * context preserves legacy unscoped behaviour.
11
+ */
12
+ interface SearchRuntimeContext {
13
+ applicabilityContexts: readonly MemoryApplicabilityContext[];
14
+ }
5
15
 
6
16
  /**
7
17
  * `applyReflectedPlan` — agentic write-back facade.
@@ -87,16 +97,17 @@ declare function applyReflectedPlan(deps: UnifiedSearchDeps, store: MemoryStoreL
87
97
  * dependencies via `UnifiedSearchDeps` so this module stays
88
98
  * framework-agnostic.
89
99
  *
90
- * The public entry point is `search(input)` — a single method. Set
100
+ * The public entry point is `search(input, runtimeContext?)` — a single method. Set
91
101
  * `synthesize: true` to opt into the LLM synthesis step.
92
102
  */
93
103
 
94
104
  interface UnifiedSearch {
95
105
  /**
96
106
  * Single unified read entry point. Set `synthesize: true` to opt into
97
- * LLM synthesis.
107
+ * LLM synthesis. The optional second argument is trusted in-process
108
+ * applicability context and is intentionally separate from `SearchInput`.
98
109
  */
99
- search(input: SearchInput): Promise<SearchOutput>;
110
+ search(input: SearchInput, runtimeContext?: SearchRuntimeContext): Promise<SearchOutput>;
100
111
  /**
101
112
  * @deprecated Use `search(input)` instead. Forwarding shim kept for
102
113
  * one release window.
@@ -119,4 +130,4 @@ interface UnifiedSearch {
119
130
  }
120
131
  declare function createUnifiedSearch(deps?: UnifiedSearchDeps): UnifiedSearch;
121
132
 
122
- export { type ApplyConsolidateInput as A, type UnifiedSearch as U, type ApplyConsolidateOutput as a, applyReflectedPlan as b, createUnifiedSearch as c };
133
+ export { type ApplyConsolidateInput as A, type SearchRuntimeContext as S, type UnifiedSearch as U, type ApplyConsolidateOutput as a, applyReflectedPlan as b, createUnifiedSearch as c };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melandlabs/memory-store",
3
- "version": "1.2.4",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -28,6 +28,10 @@
28
28
  "./postgres-raw-message-factory": "./dist/storage/postgres-raw-message-factory.js",
29
29
  "./sqlite-vector-index": "./dist/storage/sqlite-vector-index.js",
30
30
  "./chroma-memory-index": "./dist/storage/chroma-memory-index.js",
31
+ "./cli-shared": {
32
+ "types": "./dist/server/cli-shared.d.ts",
33
+ "import": "./dist/server/cli-shared.js"
34
+ },
31
35
  "./unified-search": "./dist/search/unified-search.js",
32
36
  "./memory-graph-write-policy": "./dist/policies/memory-graph-write-policy.js",
33
37
  "./memory-graph-correction-policy": "./dist/policies/memory-graph-correction-policy.js"
@@ -60,19 +64,19 @@
60
64
  "@modelcontextprotocol/sdk": "^1.25.3",
61
65
  "hono": "^4.6.14",
62
66
  "zod": "^4.3.6",
63
- "@melandlabs/ai": "0.10.2",
64
67
  "@melandlabs/contracts": "0.7.0",
65
- "@melandlabs/memory-consolidation": "0.5.2",
66
- "@melandlabs/rag": "0.3.0",
67
- "@melandlabs/sqlite": "0.5.2",
68
- "@melandlabs/okf": "0.3.1",
69
- "@melandlabs/vsa": "0.3.0",
68
+ "@melandlabs/ai": "0.10.4",
69
+ "@melandlabs/okf": "0.3.2",
70
+ "@melandlabs/memory-consolidation": "0.5.3",
71
+ "@melandlabs/rag": "0.3.1",
72
+ "@melandlabs/shared": "0.4.1",
70
73
  "@melandlabs/env-config": "0.4.0",
71
- "@melandlabs/shared": "0.4.0"
74
+ "@melandlabs/sqlite": "0.5.3",
75
+ "@melandlabs/vsa": "0.3.0"
72
76
  },
73
77
  "peerDependencies": {
74
- "@melandlabs/ai-rag": "0.2.9",
75
- "@melandlabs/indexeddb": "0.5.8"
78
+ "@melandlabs/ai-rag": "0.2.10",
79
+ "@melandlabs/indexeddb": "0.5.9"
76
80
  },
77
81
  "peerDependenciesMeta": {
78
82
  "@melandlabs/ai-rag": {
@@ -86,7 +90,7 @@
86
90
  "@types/node": "^22.13.10",
87
91
  "typescript": "^5.6.3",
88
92
  "@melandlabs/config": "0.3.0",
89
- "@melandlabs/ai-rag": "0.2.9"
93
+ "@melandlabs/ai-rag": "0.2.10"
90
94
  },
91
95
  "scripts": {
92
96
  "build": "tsup",