@lumenflow/memory 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.
- package/LICENSE +190 -0
- package/README.md +181 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/mem-checkpoint-core.d.ts +91 -0
- package/dist/mem-checkpoint-core.d.ts.map +1 -0
- package/dist/mem-checkpoint-core.js +175 -0
- package/dist/mem-checkpoint-core.js.map +1 -0
- package/dist/mem-cleanup-core.d.ts +202 -0
- package/dist/mem-cleanup-core.d.ts.map +1 -0
- package/dist/mem-cleanup-core.js +364 -0
- package/dist/mem-cleanup-core.js.map +1 -0
- package/dist/mem-create-core.d.ts +93 -0
- package/dist/mem-create-core.d.ts.map +1 -0
- package/dist/mem-create-core.js +369 -0
- package/dist/mem-create-core.js.map +1 -0
- package/dist/mem-id.d.ts +91 -0
- package/dist/mem-id.d.ts.map +1 -0
- package/dist/mem-id.js +136 -0
- package/dist/mem-id.js.map +1 -0
- package/dist/mem-init-core.d.ts +91 -0
- package/dist/mem-init-core.d.ts.map +1 -0
- package/dist/mem-init-core.js +138 -0
- package/dist/mem-init-core.js.map +1 -0
- package/dist/mem-ready-core.d.ts +56 -0
- package/dist/mem-ready-core.d.ts.map +1 -0
- package/dist/mem-ready-core.js +232 -0
- package/dist/mem-ready-core.js.map +1 -0
- package/dist/mem-signal-core.d.ts +132 -0
- package/dist/mem-signal-core.d.ts.map +1 -0
- package/dist/mem-signal-core.js +249 -0
- package/dist/mem-signal-core.js.map +1 -0
- package/dist/mem-start-core.d.ts +76 -0
- package/dist/mem-start-core.d.ts.map +1 -0
- package/dist/mem-start-core.js +133 -0
- package/dist/mem-start-core.js.map +1 -0
- package/dist/mem-summarize-core.d.ts +105 -0
- package/dist/mem-summarize-core.d.ts.map +1 -0
- package/dist/mem-summarize-core.js +263 -0
- package/dist/mem-summarize-core.js.map +1 -0
- package/dist/mem-triage-core.d.ts +127 -0
- package/dist/mem-triage-core.d.ts.map +1 -0
- package/dist/mem-triage-core.js +332 -0
- package/dist/mem-triage-core.js.map +1 -0
- package/dist/memory-schema.d.ts +150 -0
- package/dist/memory-schema.d.ts.map +1 -0
- package/dist/memory-schema.js +149 -0
- package/dist/memory-schema.js.map +1 -0
- package/dist/memory-store.d.ts +108 -0
- package/dist/memory-store.d.ts.map +1 -0
- package/dist/memory-store.js +234 -0
- package/dist/memory-store.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory Store (WU-1463)
|
|
3
|
+
*
|
|
4
|
+
* JSONL-based memory store with load, query, and append operations.
|
|
5
|
+
* Git-friendly format with one node per line for merge-safe diffs.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Append-only writes (no full file rewrite)
|
|
9
|
+
* - Indexed lookups by ID and WU
|
|
10
|
+
* - Deterministic queryReady() ordering by priority then createdAt
|
|
11
|
+
*
|
|
12
|
+
* @see {@link tools/lib/__tests__/memory-store.test.mjs} - Tests
|
|
13
|
+
* @see {@link tools/lib/memory-schema.mjs} - Schema definitions
|
|
14
|
+
*/
|
|
15
|
+
import { type MemoryNode } from './memory-schema.js';
|
|
16
|
+
/**
|
|
17
|
+
* Memory file name constant
|
|
18
|
+
*/
|
|
19
|
+
export declare const MEMORY_FILE_NAME = "memory.jsonl";
|
|
20
|
+
/**
|
|
21
|
+
* Indexed memory result from loadMemory
|
|
22
|
+
*/
|
|
23
|
+
export interface IndexedMemory {
|
|
24
|
+
/** All loaded nodes in file order */
|
|
25
|
+
nodes: MemoryNode[];
|
|
26
|
+
/** Nodes indexed by ID */
|
|
27
|
+
byId: Map<string, MemoryNode>;
|
|
28
|
+
/** Nodes indexed by WU ID */
|
|
29
|
+
byWu: Map<string, MemoryNode[]>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Loads memory from JSONL file and returns indexed nodes.
|
|
33
|
+
*
|
|
34
|
+
* Handles:
|
|
35
|
+
* - Missing file: returns empty result
|
|
36
|
+
* - Empty file: returns empty result
|
|
37
|
+
* - Empty lines: skipped gracefully
|
|
38
|
+
* - Malformed JSON: throws error with line info
|
|
39
|
+
* - Invalid nodes: throws validation error
|
|
40
|
+
*
|
|
41
|
+
* @param baseDir - Directory containing memory.jsonl
|
|
42
|
+
* @returns Indexed memory nodes
|
|
43
|
+
* @throws If file contains malformed JSON or invalid nodes
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* const memory = await loadMemory('/path/to/project');
|
|
47
|
+
* const node = memory.byId.get('mem-abc1');
|
|
48
|
+
* const wuNodes = memory.byWu.get('WU-1463') ?? [];
|
|
49
|
+
*/
|
|
50
|
+
export declare function loadMemory(baseDir: string): Promise<IndexedMemory>;
|
|
51
|
+
/**
|
|
52
|
+
* Appends a single node to the memory file.
|
|
53
|
+
*
|
|
54
|
+
* Uses append mode to avoid full file rewrite.
|
|
55
|
+
* Creates file if it doesn't exist.
|
|
56
|
+
* Validates node before appending.
|
|
57
|
+
*
|
|
58
|
+
* @param baseDir - Directory containing memory.jsonl
|
|
59
|
+
* @param node - Node to append
|
|
60
|
+
* @returns The appended node
|
|
61
|
+
* @throws If node fails validation
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* const node = await appendNode('/path/to/project', {
|
|
65
|
+
* id: 'mem-abc1',
|
|
66
|
+
* type: 'discovery',
|
|
67
|
+
* lifecycle: 'wu',
|
|
68
|
+
* content: 'Found relevant file',
|
|
69
|
+
* created_at: new Date().toISOString(),
|
|
70
|
+
* wu_id: 'WU-1463',
|
|
71
|
+
* });
|
|
72
|
+
*/
|
|
73
|
+
export declare function appendNode(baseDir: string, node: MemoryNode): Promise<MemoryNode>;
|
|
74
|
+
/**
|
|
75
|
+
* Queries nodes ready for processing by WU ID.
|
|
76
|
+
*
|
|
77
|
+
* Returns nodes linked to the WU in deterministic order:
|
|
78
|
+
* 1. Priority (P0 first, then P1, P2, P3; nodes without priority last)
|
|
79
|
+
* 2. Created timestamp (oldest first for same priority)
|
|
80
|
+
* 3. ID (for stable sort when priority and timestamp match)
|
|
81
|
+
*
|
|
82
|
+
* @param baseDir - Directory containing memory.jsonl
|
|
83
|
+
* @param wuId - WU ID to query (e.g., 'WU-1463')
|
|
84
|
+
* @returns Deterministically ordered nodes for WU
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* const ready = await queryReady('/path/to/project', 'WU-1463');
|
|
88
|
+
* // Process highest priority, oldest items first
|
|
89
|
+
* for (const node of ready) {
|
|
90
|
+
* await processNode(node);
|
|
91
|
+
* }
|
|
92
|
+
*/
|
|
93
|
+
export declare function queryReady(baseDir: string, wuId: string): Promise<MemoryNode[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Queries all nodes linked to a WU ID.
|
|
96
|
+
*
|
|
97
|
+
* Returns nodes in file order (insertion order).
|
|
98
|
+
* Use queryReady() instead if you need deterministic priority ordering.
|
|
99
|
+
*
|
|
100
|
+
* @param baseDir - Directory containing memory.jsonl
|
|
101
|
+
* @param wuId - WU ID to query (e.g., 'WU-1463')
|
|
102
|
+
* @returns All nodes for WU in file order
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* const nodes = await queryByWu('/path/to/project', 'WU-1463');
|
|
106
|
+
* console.log(`Found ${nodes.length} nodes for WU-1463`);
|
|
107
|
+
*/
|
|
108
|
+
export declare function queryByWu(baseDir: string, wuId: string): Promise<MemoryNode[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-store.d.ts","sourceRoot":"","sources":["../src/memory-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH;;GAEG;AACH,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAsE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,UAAU,CAAC,OAAO,KAAA;;;;GAiEvC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,UAAU,CAAC,OAAO,KAAA,EAAE,IAAI,KAAA,gBAiB7C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,UAAU,CAAC,OAAO,KAAA,EAAE,IAAI,KAAA,kBAQ7C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,SAAS,CAAC,OAAO,KAAA,EAAE,IAAI,KAAA,gBAG5C"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory Store (WU-1463)
|
|
3
|
+
*
|
|
4
|
+
* JSONL-based memory store with load, query, and append operations.
|
|
5
|
+
* Git-friendly format with one node per line for merge-safe diffs.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Append-only writes (no full file rewrite)
|
|
9
|
+
* - Indexed lookups by ID and WU
|
|
10
|
+
* - Deterministic queryReady() ordering by priority then createdAt
|
|
11
|
+
*
|
|
12
|
+
* @see {@link tools/lib/__tests__/memory-store.test.mjs} - Tests
|
|
13
|
+
* @see {@link tools/lib/memory-schema.mjs} - Schema definitions
|
|
14
|
+
*/
|
|
15
|
+
import fs from 'node:fs/promises';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import { validateMemoryNode } from './memory-schema.js';
|
|
18
|
+
/**
|
|
19
|
+
* Memory file name constant
|
|
20
|
+
*/
|
|
21
|
+
export const MEMORY_FILE_NAME = 'memory.jsonl';
|
|
22
|
+
/**
|
|
23
|
+
* Priority ranking for deterministic ordering.
|
|
24
|
+
* Lower rank = higher priority.
|
|
25
|
+
* P0 is highest priority, nodes without priority are lowest.
|
|
26
|
+
*/
|
|
27
|
+
const PRIORITY_RANK = {
|
|
28
|
+
P0: 0,
|
|
29
|
+
P1: 1,
|
|
30
|
+
P2: 2,
|
|
31
|
+
P3: 3,
|
|
32
|
+
};
|
|
33
|
+
/** Default rank for nodes without priority (lowest priority) */
|
|
34
|
+
const DEFAULT_PRIORITY_RANK = 999;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the priority rank for a node.
|
|
37
|
+
* Lower rank = higher priority.
|
|
38
|
+
*
|
|
39
|
+
* @param node - Memory node
|
|
40
|
+
* @returns Priority rank
|
|
41
|
+
*/
|
|
42
|
+
function getPriorityRank(node) {
|
|
43
|
+
const priority = node.metadata?.priority;
|
|
44
|
+
if (!priority) {
|
|
45
|
+
return DEFAULT_PRIORITY_RANK;
|
|
46
|
+
}
|
|
47
|
+
return PRIORITY_RANK[priority] ?? DEFAULT_PRIORITY_RANK;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Comparator for deterministic ordering: priority first, then createdAt.
|
|
51
|
+
*
|
|
52
|
+
* @param a - First node
|
|
53
|
+
* @param b - Second node
|
|
54
|
+
* @returns Comparison result (-1, 0, 1)
|
|
55
|
+
*/
|
|
56
|
+
function compareNodes(a, b) {
|
|
57
|
+
// Primary: sort by priority (lower rank first)
|
|
58
|
+
const priorityDiff = getPriorityRank(a) - getPriorityRank(b);
|
|
59
|
+
if (priorityDiff !== 0) {
|
|
60
|
+
return priorityDiff;
|
|
61
|
+
}
|
|
62
|
+
// Secondary: sort by created_at (oldest first)
|
|
63
|
+
const aTime = new Date(a.created_at).getTime();
|
|
64
|
+
const bTime = new Date(b.created_at).getTime();
|
|
65
|
+
if (aTime !== bTime) {
|
|
66
|
+
return aTime - bTime;
|
|
67
|
+
}
|
|
68
|
+
// Tertiary: stable sort by ID for identical priority and timestamp
|
|
69
|
+
return a.id.localeCompare(b.id);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Loads memory from JSONL file and returns indexed nodes.
|
|
73
|
+
*
|
|
74
|
+
* Handles:
|
|
75
|
+
* - Missing file: returns empty result
|
|
76
|
+
* - Empty file: returns empty result
|
|
77
|
+
* - Empty lines: skipped gracefully
|
|
78
|
+
* - Malformed JSON: throws error with line info
|
|
79
|
+
* - Invalid nodes: throws validation error
|
|
80
|
+
*
|
|
81
|
+
* @param baseDir - Directory containing memory.jsonl
|
|
82
|
+
* @returns Indexed memory nodes
|
|
83
|
+
* @throws If file contains malformed JSON or invalid nodes
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* const memory = await loadMemory('/path/to/project');
|
|
87
|
+
* const node = memory.byId.get('mem-abc1');
|
|
88
|
+
* const wuNodes = memory.byWu.get('WU-1463') ?? [];
|
|
89
|
+
*/
|
|
90
|
+
export async function loadMemory(baseDir) {
|
|
91
|
+
const filePath = path.join(baseDir, MEMORY_FILE_NAME);
|
|
92
|
+
const result = {
|
|
93
|
+
nodes: [],
|
|
94
|
+
byId: new Map(),
|
|
95
|
+
byWu: new Map(),
|
|
96
|
+
};
|
|
97
|
+
// Check if file exists
|
|
98
|
+
let content;
|
|
99
|
+
try {
|
|
100
|
+
content = await fs.readFile(filePath, { encoding: 'utf-8' });
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
const error = err;
|
|
104
|
+
if (error.code === 'ENOENT') {
|
|
105
|
+
// File doesn't exist - return empty result
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
// Parse JSONL content
|
|
111
|
+
const lines = content.split('\n');
|
|
112
|
+
for (let i = 0; i < lines.length; i++) {
|
|
113
|
+
const rawLine = lines[i];
|
|
114
|
+
const line = rawLine ? rawLine.trim() : '';
|
|
115
|
+
// Skip empty lines
|
|
116
|
+
if (!line) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
// Parse JSON line
|
|
120
|
+
let parsed;
|
|
121
|
+
try {
|
|
122
|
+
parsed = JSON.parse(line);
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
126
|
+
throw new Error(`Malformed JSON on line ${i + 1}: ${errMsg}`);
|
|
127
|
+
}
|
|
128
|
+
// Validate against schema
|
|
129
|
+
const validation = validateMemoryNode(parsed);
|
|
130
|
+
if (!validation.success) {
|
|
131
|
+
const issues = validation.error.issues
|
|
132
|
+
.map((issue) => `${issue.path.join('.')}: ${issue.message}`)
|
|
133
|
+
.join(', ');
|
|
134
|
+
throw new Error(`Validation error on line ${i + 1}: ${issues}`);
|
|
135
|
+
}
|
|
136
|
+
const node = validation.data;
|
|
137
|
+
// Add to nodes array
|
|
138
|
+
result.nodes.push(node);
|
|
139
|
+
// Index by ID
|
|
140
|
+
result.byId.set(node.id, node);
|
|
141
|
+
// Index by WU ID if present
|
|
142
|
+
if (node.wu_id) {
|
|
143
|
+
if (!result.byWu.has(node.wu_id)) {
|
|
144
|
+
result.byWu.set(node.wu_id, []);
|
|
145
|
+
}
|
|
146
|
+
const wuNodes = result.byWu.get(node.wu_id);
|
|
147
|
+
if (wuNodes) {
|
|
148
|
+
wuNodes.push(node);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Appends a single node to the memory file.
|
|
156
|
+
*
|
|
157
|
+
* Uses append mode to avoid full file rewrite.
|
|
158
|
+
* Creates file if it doesn't exist.
|
|
159
|
+
* Validates node before appending.
|
|
160
|
+
*
|
|
161
|
+
* @param baseDir - Directory containing memory.jsonl
|
|
162
|
+
* @param node - Node to append
|
|
163
|
+
* @returns The appended node
|
|
164
|
+
* @throws If node fails validation
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* const node = await appendNode('/path/to/project', {
|
|
168
|
+
* id: 'mem-abc1',
|
|
169
|
+
* type: 'discovery',
|
|
170
|
+
* lifecycle: 'wu',
|
|
171
|
+
* content: 'Found relevant file',
|
|
172
|
+
* created_at: new Date().toISOString(),
|
|
173
|
+
* wu_id: 'WU-1463',
|
|
174
|
+
* });
|
|
175
|
+
*/
|
|
176
|
+
export async function appendNode(baseDir, node) {
|
|
177
|
+
// Validate node before appending
|
|
178
|
+
const validation = validateMemoryNode(node);
|
|
179
|
+
if (!validation.success) {
|
|
180
|
+
const issues = validation.error.issues
|
|
181
|
+
.map((issue) => `${issue.path.join('.')}: ${issue.message}`)
|
|
182
|
+
.join(', ');
|
|
183
|
+
throw new Error(`Validation error: ${issues}`);
|
|
184
|
+
}
|
|
185
|
+
const filePath = path.join(baseDir, MEMORY_FILE_NAME);
|
|
186
|
+
const line = JSON.stringify(node) + '\n';
|
|
187
|
+
// Use append flag to avoid rewriting the file
|
|
188
|
+
await fs.appendFile(filePath, line, { encoding: 'utf-8' });
|
|
189
|
+
return node;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Queries nodes ready for processing by WU ID.
|
|
193
|
+
*
|
|
194
|
+
* Returns nodes linked to the WU in deterministic order:
|
|
195
|
+
* 1. Priority (P0 first, then P1, P2, P3; nodes without priority last)
|
|
196
|
+
* 2. Created timestamp (oldest first for same priority)
|
|
197
|
+
* 3. ID (for stable sort when priority and timestamp match)
|
|
198
|
+
*
|
|
199
|
+
* @param baseDir - Directory containing memory.jsonl
|
|
200
|
+
* @param wuId - WU ID to query (e.g., 'WU-1463')
|
|
201
|
+
* @returns Deterministically ordered nodes for WU
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* const ready = await queryReady('/path/to/project', 'WU-1463');
|
|
205
|
+
* // Process highest priority, oldest items first
|
|
206
|
+
* for (const node of ready) {
|
|
207
|
+
* await processNode(node);
|
|
208
|
+
* }
|
|
209
|
+
*/
|
|
210
|
+
export async function queryReady(baseDir, wuId) {
|
|
211
|
+
const memory = await loadMemory(baseDir);
|
|
212
|
+
// Get nodes for this WU
|
|
213
|
+
const wuNodes = memory.byWu.get(wuId) ?? [];
|
|
214
|
+
// Return sorted copy (don't mutate original)
|
|
215
|
+
return [...wuNodes].sort(compareNodes);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Queries all nodes linked to a WU ID.
|
|
219
|
+
*
|
|
220
|
+
* Returns nodes in file order (insertion order).
|
|
221
|
+
* Use queryReady() instead if you need deterministic priority ordering.
|
|
222
|
+
*
|
|
223
|
+
* @param baseDir - Directory containing memory.jsonl
|
|
224
|
+
* @param wuId - WU ID to query (e.g., 'WU-1463')
|
|
225
|
+
* @returns All nodes for WU in file order
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* const nodes = await queryByWu('/path/to/project', 'WU-1463');
|
|
229
|
+
* console.log(`Found ${nodes.length} nodes for WU-1463`);
|
|
230
|
+
*/
|
|
231
|
+
export async function queryByWu(baseDir, wuId) {
|
|
232
|
+
const memory = await loadMemory(baseDir);
|
|
233
|
+
return memory.byWu.get(wuId) ?? [];
|
|
234
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-store.js","sourceRoot":"","sources":["../src/memory-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAE/C;;;;GAIG;AACH,MAAM,aAAa,GAAG;IACpB,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;CACN,CAAC;AAEF,gEAAgE;AAChE,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC;;GAEG;AAEH;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,IAAI;IAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACzC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IACD,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,qBAAqB,CAAC;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,SAAS,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;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAO,EAAE,IAAI;IAC5C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IAEzC,wBAAwB;IACxB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAE5C,6CAA6C;IAC7C,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAO,EAAE,IAAI;IAC3C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IACzC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AACrC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lumenflow/memory",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Memory layer for LumenFlow workflow framework - session tracking, context recovery, and agent coordination",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"lumenflow",
|
|
7
|
+
"workflow",
|
|
8
|
+
"memory",
|
|
9
|
+
"session",
|
|
10
|
+
"context",
|
|
11
|
+
"coordination"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/hellmai/os",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/hellmai/os.git",
|
|
17
|
+
"directory": "packages/@lumenflow/memory"
|
|
18
|
+
},
|
|
19
|
+
"license": "Apache-2.0",
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "HellmAI",
|
|
22
|
+
"url": "https://hellm.ai"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": "./dist/index.js",
|
|
27
|
+
"./checkpoint": "./dist/mem-checkpoint-core.js",
|
|
28
|
+
"./init": "./dist/mem-init-core.js",
|
|
29
|
+
"./start": "./dist/mem-start-core.js",
|
|
30
|
+
"./ready": "./dist/mem-ready-core.js",
|
|
31
|
+
"./signal": "./dist/mem-signal-core.js",
|
|
32
|
+
"./cleanup": "./dist/mem-cleanup-core.js",
|
|
33
|
+
"./create": "./dist/mem-create-core.js",
|
|
34
|
+
"./summarize": "./dist/mem-summarize-core.js",
|
|
35
|
+
"./triage": "./dist/mem-triage-core.js",
|
|
36
|
+
"./schema": "./dist/memory-schema.js",
|
|
37
|
+
"./store": "./dist/memory-store.js",
|
|
38
|
+
"./dist/*": "./dist/*"
|
|
39
|
+
},
|
|
40
|
+
"main": "./dist/index.js",
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"LICENSE",
|
|
44
|
+
"README.md"
|
|
45
|
+
],
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"ms": "^2.1.3",
|
|
48
|
+
"yaml": "^2.8.0",
|
|
49
|
+
"zod": "^4.3.5"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"typescript": "^5.7.0",
|
|
53
|
+
"vitest": "^2.1.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@lumenflow/core": "1.0.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"@lumenflow/core": {
|
|
60
|
+
"optional": true
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=22"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"build": "tsc",
|
|
71
|
+
"build:dist": "tsc -p tsconfig.build.json",
|
|
72
|
+
"pack:dist": "pnpm pack",
|
|
73
|
+
"clean": "rm -rf dist *.tgz",
|
|
74
|
+
"test": "vitest run"
|
|
75
|
+
}
|
|
76
|
+
}
|