mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 22:28:10 +09:00
🔖 Checkpoint: Edit /workspaces/claude-code-flow/src/cli/simple-commands/memory-consolidation.js
This commit is contained in:
1 parent
fa963ce295
commit
1aecbe29fe
3 files changed
+28
-3
No files matched your search
@@ -0,0 +1 @@
|
||||
{"branch": "checkpoint/pre-edit-20250805-142734", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/memory-consolidation.js", "timestamp": "2025-08-05T14:27:34Z", "type": "pre-edit", "original_branch": "alpha-86"}
|
||||
@@ -0,0 +1 @@
|
||||
{"tag": "checkpoint-20250805-142735", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/memory-consolidation.js", "timestamp": "2025-08-05T14:27:35Z", "type": "post-edit", "branch": "alpha-86", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 2898 ++++++++++------------- .claude-flow/metrics/task-metrics.json | 6 +- .claude/checkpoints/1754404029.json | 1 + .claude/checkpoints/1754404031.json | 1 + memory/memory-store.json | 6 + src/cli/simple-commands/memory-consolidation.js | 17 +- 7 files changed, 1272 insertions(+), 1659 deletions(-) "}
|
||||
@@ -270,9 +270,13 @@ export class MemoryConsolidator {
|
||||
* Convert JSON memory stores to SQLite
|
||||
*/
|
||||
async convertJsonToSqlite(jsonFiles, dbPath) {
|
||||
if (!sqlite3 || !sqliteOpen) {
|
||||
throw new Error('SQLite modules not available. Install sqlite3 and sqlite packages.');
|
||||
}
|
||||
|
||||
await fs.mkdir(path.dirname(dbPath), { recursive: true });
|
||||
|
||||
const db = await open({
|
||||
const db = await sqliteOpen({
|
||||
filename: dbPath,
|
||||
driver: sqlite3.Database
|
||||
});
|
||||
@@ -332,7 +336,11 @@ export class MemoryConsolidator {
|
||||
* Merge multiple SQLite databases
|
||||
*/
|
||||
async mergeSqliteDatabases(dbFiles, targetDb) {
|
||||
const db = await open({
|
||||
if (!sqlite3 || !sqliteOpen) {
|
||||
throw new Error('SQLite modules not available. Install sqlite3 and sqlite packages.');
|
||||
}
|
||||
|
||||
const db = await sqliteOpen({
|
||||
filename: targetDb,
|
||||
driver: sqlite3.Database
|
||||
});
|
||||
@@ -383,7 +391,11 @@ export class MemoryConsolidator {
|
||||
* Optimize the unified database
|
||||
*/
|
||||
async optimizeDatabase(dbPath) {
|
||||
const db = await open({
|
||||
if (!sqlite3 || !sqliteOpen) {
|
||||
throw new Error('SQLite modules not available. Install sqlite3 and sqlite packages.');
|
||||
}
|
||||
|
||||
const db = await sqliteOpen({
|
||||
filename: dbPath,
|
||||
driver: sqlite3.Database
|
||||
});
|
||||
@@ -479,6 +491,9 @@ export class MemoryConsolidator {
|
||||
* Memory consolidation command
|
||||
*/
|
||||
export async function memoryConsolidationCommand(subArgs, flags) {
|
||||
// Load SQLite modules if available
|
||||
const sqliteAvailable = await loadSqliteModules();
|
||||
|
||||
const consolidator = new MemoryConsolidator();
|
||||
const action = subArgs[0];
|
||||
|
||||
@@ -555,6 +570,14 @@ async function createConsolidationPlan(consolidator) {
|
||||
}
|
||||
|
||||
async function executeConsolidation(consolidator, flags) {
|
||||
const sqliteAvailable = await loadSqliteModules();
|
||||
|
||||
if (!sqliteAvailable) {
|
||||
printError('SQLite modules not available.');
|
||||
printInfo('Install required packages: npm install sqlite3 sqlite');
|
||||
return;
|
||||
}
|
||||
|
||||
const scanResults = await consolidator.scanMemoryLocations();
|
||||
|
||||
if (scanResults.total === 0) {
|
||||
|
||||
Reference in new issue
Block a user