agent-working-memory 0.5.0 → 0.5.2
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/dist/cli.js +15 -4
- package/dist/cli.js.map +1 -1
- package/dist/core/salience.d.ts.map +1 -1
- package/dist/core/salience.js +11 -10
- package/dist/core/salience.js.map +1 -1
- package/dist/engine/consolidation.d.ts.map +1 -1
- package/dist/engine/consolidation.js +26 -7
- package/dist/engine/consolidation.js.map +1 -1
- package/dist/mcp.js +90 -82
- package/dist/mcp.js.map +1 -1
- package/dist/storage/sqlite.d.ts +1 -0
- package/dist/storage/sqlite.d.ts.map +1 -1
- package/dist/storage/sqlite.js +11 -0
- package/dist/storage/sqlite.js.map +1 -1
- package/package.json +1 -1
- package/src/cli.ts +16 -4
- package/src/core/salience.ts +168 -162
- package/src/engine/consolidation.ts +469 -445
- package/src/hooks/sidecar.ts +289 -289
- package/src/mcp.ts +971 -963
- package/src/storage/sqlite.ts +14 -0
package/src/storage/sqlite.ts
CHANGED
|
@@ -197,9 +197,15 @@ export class EngramStore {
|
|
|
197
197
|
checkpoint_at TEXT,
|
|
198
198
|
last_consolidation_at TEXT,
|
|
199
199
|
last_mini_consolidation_at TEXT,
|
|
200
|
+
consolidation_cycle_count INTEGER NOT NULL DEFAULT 0,
|
|
200
201
|
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
201
202
|
)
|
|
202
203
|
`);
|
|
204
|
+
|
|
205
|
+
// Migration: add consolidation_cycle_count if missing (existing DBs)
|
|
206
|
+
try {
|
|
207
|
+
this.db.exec(`ALTER TABLE conscious_state ADD COLUMN consolidation_cycle_count INTEGER NOT NULL DEFAULT 0`);
|
|
208
|
+
} catch { /* column already exists */ }
|
|
203
209
|
}
|
|
204
210
|
|
|
205
211
|
// --- Engram CRUD ---
|
|
@@ -926,6 +932,7 @@ export class EngramStore {
|
|
|
926
932
|
last_mini_consolidation_at = ?,
|
|
927
933
|
write_count_since_consolidation = 0,
|
|
928
934
|
recall_count_since_consolidation = 0,
|
|
935
|
+
consolidation_cycle_count = consolidation_cycle_count + 1,
|
|
929
936
|
updated_at = ?
|
|
930
937
|
WHERE agent_id = ?
|
|
931
938
|
`).run(now, now, now, agentId);
|
|
@@ -943,6 +950,13 @@ export class EngramStore {
|
|
|
943
950
|
}));
|
|
944
951
|
}
|
|
945
952
|
|
|
953
|
+
getConsolidationCycleCount(agentId: string): number {
|
|
954
|
+
const row = this.db.prepare(
|
|
955
|
+
'SELECT consolidation_cycle_count FROM conscious_state WHERE agent_id = ?',
|
|
956
|
+
).get(agentId) as { consolidation_cycle_count: number } | undefined;
|
|
957
|
+
return row?.consolidation_cycle_count ?? 0;
|
|
958
|
+
}
|
|
959
|
+
|
|
946
960
|
close(): void {
|
|
947
961
|
this.db.close();
|
|
948
962
|
}
|