claude-flow 3.25.1 → 3.25.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/.claude/helpers/metrics-db.mjs +17 -2
- package/package.json +1 -1
- package/v3/@claude-flow/cli/dist/src/fs-secure.d.ts +19 -0
- package/v3/@claude-flow/cli/dist/src/fs-secure.js +74 -15
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +3 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +19 -8
- package/v3/@claude-flow/cli/dist/src/services/memory-backup.d.ts +29 -0
- package/v3/@claude-flow/cli/dist/src/services/memory-backup.js +104 -0
- package/v3/@claude-flow/cli/package.json +1 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import initSqlJs from 'sql.js';
|
|
9
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync } from 'fs';
|
|
9
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync, openSync, writeSync, fsyncSync, closeSync, renameSync, rmSync } from 'fs';
|
|
10
10
|
import { dirname, join, basename } from 'path';
|
|
11
11
|
import { fileURLToPath } from 'url';
|
|
12
12
|
import { execSync } from 'child_process';
|
|
@@ -138,7 +138,22 @@ async function initDatabase() {
|
|
|
138
138
|
function persist() {
|
|
139
139
|
const data = db.export();
|
|
140
140
|
const buffer = Buffer.from(data);
|
|
141
|
-
|
|
141
|
+
// Atomic write (issue #2584): temp → fsync → rename so a kill/OOM mid-flush
|
|
142
|
+
// or a concurrent writer can't leave a torn, malformed metrics.db image.
|
|
143
|
+
const tmp = `${DB_PATH}.tmp-${process.pid}-${Date.now().toString(36)}`;
|
|
144
|
+
let fd;
|
|
145
|
+
try {
|
|
146
|
+
fd = openSync(tmp, 'wx');
|
|
147
|
+
if (buffer.length > 0) writeSync(fd, buffer, 0, buffer.length, 0);
|
|
148
|
+
fsyncSync(fd);
|
|
149
|
+
closeSync(fd);
|
|
150
|
+
fd = undefined;
|
|
151
|
+
renameSync(tmp, DB_PATH);
|
|
152
|
+
} catch (e) {
|
|
153
|
+
if (fd !== undefined) { try { closeSync(fd); } catch { /* */ } }
|
|
154
|
+
try { rmSync(tmp, { force: true }); } catch { /* */ }
|
|
155
|
+
throw e;
|
|
156
|
+
}
|
|
142
157
|
}
|
|
143
158
|
|
|
144
159
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow",
|
|
3
|
-
"version": "3.25.
|
|
3
|
+
"version": "3.25.2",
|
|
4
4
|
"description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,25 @@
|
|
|
16
16
|
* sniff so legacy plaintext files keep working unchanged during the
|
|
17
17
|
* incremental migration.
|
|
18
18
|
*/
|
|
19
|
+
/**
|
|
20
|
+
* Crash-safe atomic file write (issue #2584).
|
|
21
|
+
*
|
|
22
|
+
* A plain `writeFileSync(dbPath, db.export())` of a large sql.js image is NOT
|
|
23
|
+
* crash-safe: a kill/OOM mid-write — or a second process rewriting the same
|
|
24
|
+
* path concurrently — leaves a half-written image, and reopening it yields
|
|
25
|
+
* `database disk image is malformed`. The corruption window scales with file
|
|
26
|
+
* size, so a 185 MB monolithic flush is especially exposed.
|
|
27
|
+
*
|
|
28
|
+
* This writes to a unique temp sibling, fsyncs the bytes to disk, then
|
|
29
|
+
* `rename()`s over the target. rename() is atomic on POSIX within one
|
|
30
|
+
* filesystem, so a reader/reopen sees either the old complete image or the new
|
|
31
|
+
* complete image — never a torn one. The directory entry is best-effort fsynced
|
|
32
|
+
* so the rename itself survives a crash. On any failure the temp file is
|
|
33
|
+
* removed and the original is left untouched.
|
|
34
|
+
*/
|
|
35
|
+
export declare function writeFileAtomic(path: string, data: Buffer, opts?: {
|
|
36
|
+
mode?: number;
|
|
37
|
+
}): void;
|
|
19
38
|
/**
|
|
20
39
|
* Create a directory tree with mode 0700 (owner-only). No-op if exists.
|
|
21
40
|
* Uses recursive: true so missing parents are created with the same mode.
|
|
@@ -16,8 +16,76 @@
|
|
|
16
16
|
* sniff so legacy plaintext files keep working unchanged during the
|
|
17
17
|
* incremental migration.
|
|
18
18
|
*/
|
|
19
|
-
import { chmodSync, mkdirSync, readFileSync,
|
|
19
|
+
import { chmodSync, closeSync, fsyncSync, mkdirSync, openSync, readFileSync, renameSync, unlinkSync, writeSync, } from 'node:fs';
|
|
20
|
+
import { basename, dirname, join } from 'node:path';
|
|
20
21
|
import { decryptBuffer, encryptBuffer, getKey, isEncryptedBlob, isEncryptionEnabled, } from './encryption/vault.js';
|
|
22
|
+
/**
|
|
23
|
+
* Crash-safe atomic file write (issue #2584).
|
|
24
|
+
*
|
|
25
|
+
* A plain `writeFileSync(dbPath, db.export())` of a large sql.js image is NOT
|
|
26
|
+
* crash-safe: a kill/OOM mid-write — or a second process rewriting the same
|
|
27
|
+
* path concurrently — leaves a half-written image, and reopening it yields
|
|
28
|
+
* `database disk image is malformed`. The corruption window scales with file
|
|
29
|
+
* size, so a 185 MB monolithic flush is especially exposed.
|
|
30
|
+
*
|
|
31
|
+
* This writes to a unique temp sibling, fsyncs the bytes to disk, then
|
|
32
|
+
* `rename()`s over the target. rename() is atomic on POSIX within one
|
|
33
|
+
* filesystem, so a reader/reopen sees either the old complete image or the new
|
|
34
|
+
* complete image — never a torn one. The directory entry is best-effort fsynced
|
|
35
|
+
* so the rename itself survives a crash. On any failure the temp file is
|
|
36
|
+
* removed and the original is left untouched.
|
|
37
|
+
*/
|
|
38
|
+
export function writeFileAtomic(path, data, opts = {}) {
|
|
39
|
+
const mode = opts.mode ?? 0o600;
|
|
40
|
+
const dir = dirname(path);
|
|
41
|
+
const tmp = join(dir, `.${basename(path)}.tmp-${process.pid}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`);
|
|
42
|
+
let fd;
|
|
43
|
+
try {
|
|
44
|
+
fd = openSync(tmp, 'wx', mode);
|
|
45
|
+
if (data.length > 0)
|
|
46
|
+
writeSync(fd, data, 0, data.length, 0);
|
|
47
|
+
fsyncSync(fd); // durability: force bytes to disk BEFORE the rename
|
|
48
|
+
closeSync(fd);
|
|
49
|
+
fd = undefined;
|
|
50
|
+
renameSync(tmp, path); // atomic swap — readers never see a torn image
|
|
51
|
+
try {
|
|
52
|
+
chmodSync(path, mode);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// Windows / FS without POSIX modes — silently skip.
|
|
56
|
+
}
|
|
57
|
+
// Best-effort: fsync the directory so the rename survives a power loss.
|
|
58
|
+
try {
|
|
59
|
+
const dfd = openSync(dir, 'r');
|
|
60
|
+
try {
|
|
61
|
+
fsyncSync(dfd);
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
closeSync(dfd);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// Directory fsync unsupported (e.g. Windows) — the rename is still atomic.
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
if (fd !== undefined) {
|
|
73
|
+
try {
|
|
74
|
+
closeSync(fd);
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
/* already closed */
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
unlinkSync(tmp);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
/* temp never created / already gone */
|
|
85
|
+
}
|
|
86
|
+
throw e;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
21
89
|
/**
|
|
22
90
|
* Create a directory tree with mode 0700 (owner-only). No-op if exists.
|
|
23
91
|
* Uses recursive: true so missing parents are created with the same mode.
|
|
@@ -45,20 +113,11 @@ export function writeFileRestricted(path, data, optsOrEncoding = 'utf-8') {
|
|
|
45
113
|
const plaintext = Buffer.isBuffer(data) ? data : Buffer.from(data, encoding);
|
|
46
114
|
payload = encryptBuffer(plaintext, getKey());
|
|
47
115
|
}
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
writeFileSync(path, payload, encoding);
|
|
55
|
-
}
|
|
56
|
-
try {
|
|
57
|
-
chmodSync(path, 0o600);
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
// Windows / FS without POSIX modes — silently skip.
|
|
61
|
-
}
|
|
116
|
+
// Atomic write (temp → fsync → rename) so a torn/concurrent flush can never
|
|
117
|
+
// leave a half-written file — the failure mode behind issue #2584. Buffers go
|
|
118
|
+
// straight through; strings are encoded first (default utf-8).
|
|
119
|
+
const buf = Buffer.isBuffer(payload) ? payload : Buffer.from(payload, encoding);
|
|
120
|
+
writeFileAtomic(path, buf, { mode: 0o600 });
|
|
62
121
|
}
|
|
63
122
|
export function readFileMaybeEncrypted(path, encoding = 'utf-8') {
|
|
64
123
|
const raw = readFileSync(path);
|
|
@@ -262,6 +262,9 @@ export declare function recoverMemoryDatabase(dbPath: string, opts?: {
|
|
|
262
262
|
backupPath?: string;
|
|
263
263
|
rows?: number;
|
|
264
264
|
reason?: string;
|
|
265
|
+
restoredFromBackup?: boolean;
|
|
266
|
+
from?: string;
|
|
267
|
+
restoreReason?: string;
|
|
265
268
|
}>;
|
|
266
269
|
export declare function repairVectorIndexes(dbPath: string, opts?: {
|
|
267
270
|
verbose?: boolean;
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
import * as fs from 'fs';
|
|
12
12
|
import * as path from 'path';
|
|
13
13
|
import { createRequire } from 'node:module';
|
|
14
|
-
import { readFileMaybeEncrypted, writeFileRestricted } from '../fs-secure.js';
|
|
14
|
+
import { readFileMaybeEncrypted, writeFileAtomic, writeFileRestricted } from '../fs-secure.js';
|
|
15
|
+
import { restoreMemoryDbFromBackup } from '../services/memory-backup.js';
|
|
15
16
|
/**
|
|
16
17
|
* #2356 — cached, synchronous capability probe for @ruvector/core. `getHNSWStatus`
|
|
17
18
|
* is sync and is called by `neural status` in a fresh process that never warms
|
|
@@ -1182,6 +1183,16 @@ async function activateControllerRegistry(dbPath, verbose) {
|
|
|
1182
1183
|
export async function recoverMemoryDatabase(dbPath, opts = {}) {
|
|
1183
1184
|
if (!dbPath || !fs.existsSync(dbPath))
|
|
1184
1185
|
return { recovered: false, reason: 'no-db' };
|
|
1186
|
+
// Fallback for when the in-place rebuild can't produce a verified DB (issue
|
|
1187
|
+
// #2584): rebuild-from-corrupt salvages nothing when the damage is total, so
|
|
1188
|
+
// restore the newest integrity-ok backup instead of leaving the store dead.
|
|
1189
|
+
const restoreFromBackup = async (reason) => {
|
|
1190
|
+
const r = await restoreMemoryDbFromBackup(dbPath, { verbose: opts.verbose });
|
|
1191
|
+
if (r.restored) {
|
|
1192
|
+
return { recovered: true, restoredFromBackup: true, backupPath: r.corruptBackupPath, rows: r.rows, from: r.from };
|
|
1193
|
+
}
|
|
1194
|
+
return { recovered: false, reason, restoreReason: r.skipped };
|
|
1195
|
+
};
|
|
1185
1196
|
let Database;
|
|
1186
1197
|
try {
|
|
1187
1198
|
// Module name behind a variable so TS does not statically resolve the
|
|
@@ -1190,7 +1201,7 @@ export async function recoverMemoryDatabase(dbPath, opts = {}) {
|
|
|
1190
1201
|
Database = (await import(mod)).default;
|
|
1191
1202
|
}
|
|
1192
1203
|
catch {
|
|
1193
|
-
return
|
|
1204
|
+
return await restoreFromBackup('no-native');
|
|
1194
1205
|
}
|
|
1195
1206
|
const ts = Date.now();
|
|
1196
1207
|
const tmpPath = `${dbPath}.recovering-${ts}`;
|
|
@@ -1287,9 +1298,9 @@ export async function recoverMemoryDatabase(dbPath, opts = {}) {
|
|
|
1287
1298
|
}
|
|
1288
1299
|
catch { /* */ }
|
|
1289
1300
|
if (opts.verbose) {
|
|
1290
|
-
console.log(`memory DB
|
|
1301
|
+
console.log(`memory DB rebuild-in-place failed (integrity=${integ}, rows ${dstRows}/${srcRows}) — trying newest good backup`);
|
|
1291
1302
|
}
|
|
1292
|
-
return
|
|
1303
|
+
return await restoreFromBackup('verify-failed');
|
|
1293
1304
|
}
|
|
1294
1305
|
// Back up the corrupt DB, then atomically swap in the verified rebuild.
|
|
1295
1306
|
fs.copyFileSync(dbPath, bakPath);
|
|
@@ -1323,8 +1334,8 @@ export async function recoverMemoryDatabase(dbPath, opts = {}) {
|
|
|
1323
1334
|
}
|
|
1324
1335
|
catch { /* */ }
|
|
1325
1336
|
if (opts.verbose)
|
|
1326
|
-
console.log(`memory DB
|
|
1327
|
-
return
|
|
1337
|
+
console.log(`memory DB rebuild-in-place error (${e?.message ?? e}) — trying newest good backup`);
|
|
1338
|
+
return await restoreFromBackup('error');
|
|
1328
1339
|
}
|
|
1329
1340
|
}
|
|
1330
1341
|
export async function repairVectorIndexes(dbPath, opts = {}) {
|
|
@@ -1717,9 +1728,9 @@ export async function applyTemporalDecay(dbPath) {
|
|
|
1717
1728
|
`;
|
|
1718
1729
|
db.run(decayQuery, [now, now, now]);
|
|
1719
1730
|
const changes = db.getRowsModified();
|
|
1720
|
-
// Save
|
|
1731
|
+
// Save (atomic — issue #2584: a torn full-image flush corrupts the store)
|
|
1721
1732
|
const data = db.export();
|
|
1722
|
-
|
|
1733
|
+
writeFileAtomic(path_, Buffer.from(data));
|
|
1723
1734
|
db.close();
|
|
1724
1735
|
return {
|
|
1725
1736
|
success: true,
|
|
@@ -21,4 +21,33 @@ export interface BackupResult {
|
|
|
21
21
|
}
|
|
22
22
|
export declare function defaultMemoryDbPath(cwd?: string): string;
|
|
23
23
|
export declare function backupMemoryDb(opts?: BackupOptions): Promise<BackupResult>;
|
|
24
|
+
export interface RestoreResult {
|
|
25
|
+
restored: boolean;
|
|
26
|
+
/** The backup file that was restored. */
|
|
27
|
+
from?: string;
|
|
28
|
+
/** memory_entries count in the restored DB (-1 if it couldn't be verified). */
|
|
29
|
+
rows?: number;
|
|
30
|
+
/** Where the corrupt live DB was parked before the swap. */
|
|
31
|
+
corruptBackupPath?: string;
|
|
32
|
+
skipped?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Restore the newest integrity-ok backup over a corrupt/malformed memory DB
|
|
36
|
+
* (issue #2584).
|
|
37
|
+
*
|
|
38
|
+
* The in-place rebuild path (`recoverMemoryDatabase`) rebuilds FROM the corrupt
|
|
39
|
+
* image, so when the damage is bad enough that `sqlite3 .recover` salvages
|
|
40
|
+
* nothing, that rebuild also salvages nothing and every `memory_store` keeps
|
|
41
|
+
* erroring. This is the missing fallback: scan `<db dir>/backups/` newest-first,
|
|
42
|
+
* pick the newest snapshot that passes `PRAGMA integrity_check` (and has rows),
|
|
43
|
+
* park the corrupt live DB at `<db>.corrupt-<ts>.bak`, then ATOMICALLY install
|
|
44
|
+
* the good backup (copy → fsync → rename, no full-image buffer in memory). Drops
|
|
45
|
+
* stale -wal/-shm. Non-destructive on failure: the live DB is only replaced once
|
|
46
|
+
* a verified backup is in hand.
|
|
47
|
+
*/
|
|
48
|
+
export declare function restoreMemoryDbFromBackup(dbPath: string, opts?: {
|
|
49
|
+
destDir?: string;
|
|
50
|
+
timestamp?: number;
|
|
51
|
+
verbose?: boolean;
|
|
52
|
+
}): Promise<RestoreResult>;
|
|
24
53
|
//# sourceMappingURL=memory-backup.d.ts.map
|
|
@@ -91,4 +91,108 @@ export async function backupMemoryDb(opts = {}) {
|
|
|
91
91
|
}
|
|
92
92
|
return { backedUp: true, path: destPath, sizeBytes, rotatedAway, gcsUri };
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Restore the newest integrity-ok backup over a corrupt/malformed memory DB
|
|
96
|
+
* (issue #2584).
|
|
97
|
+
*
|
|
98
|
+
* The in-place rebuild path (`recoverMemoryDatabase`) rebuilds FROM the corrupt
|
|
99
|
+
* image, so when the damage is bad enough that `sqlite3 .recover` salvages
|
|
100
|
+
* nothing, that rebuild also salvages nothing and every `memory_store` keeps
|
|
101
|
+
* erroring. This is the missing fallback: scan `<db dir>/backups/` newest-first,
|
|
102
|
+
* pick the newest snapshot that passes `PRAGMA integrity_check` (and has rows),
|
|
103
|
+
* park the corrupt live DB at `<db>.corrupt-<ts>.bak`, then ATOMICALLY install
|
|
104
|
+
* the good backup (copy → fsync → rename, no full-image buffer in memory). Drops
|
|
105
|
+
* stale -wal/-shm. Non-destructive on failure: the live DB is only replaced once
|
|
106
|
+
* a verified backup is in hand.
|
|
107
|
+
*/
|
|
108
|
+
export async function restoreMemoryDbFromBackup(dbPath, opts = {}) {
|
|
109
|
+
if (!dbPath)
|
|
110
|
+
return { restored: false, skipped: 'no-db-path' };
|
|
111
|
+
const destDir = opts.destDir ?? path.join(path.dirname(dbPath), 'backups');
|
|
112
|
+
let snaps;
|
|
113
|
+
try {
|
|
114
|
+
snaps = fs
|
|
115
|
+
.readdirSync(destDir)
|
|
116
|
+
.filter(f => /^memory-.*\.db$/.test(f))
|
|
117
|
+
.map(f => path.join(destDir, f))
|
|
118
|
+
.sort() // ISO-stamped names sort chronologically
|
|
119
|
+
.reverse(); // newest first
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return { restored: false, skipped: 'no-backups-dir' };
|
|
123
|
+
}
|
|
124
|
+
if (!snaps.length)
|
|
125
|
+
return { restored: false, skipped: 'no-backups' };
|
|
126
|
+
// better-sqlite3 verifies a candidate's integrity. Absent (WASM-only host) →
|
|
127
|
+
// accept the newest non-empty snapshot, flagged rows=-1 (unverified).
|
|
128
|
+
let Database = null;
|
|
129
|
+
try {
|
|
130
|
+
const mod = 'better-sqlite3';
|
|
131
|
+
Database = (await import(mod)).default;
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
/* verifier unavailable — trust newest non-empty */
|
|
135
|
+
}
|
|
136
|
+
let chosen = null;
|
|
137
|
+
for (const file of snaps) {
|
|
138
|
+
try {
|
|
139
|
+
if (Database) {
|
|
140
|
+
const db = new Database(file, { readonly: true });
|
|
141
|
+
const integ = String(db.pragma('integrity_check', { simple: true }) ?? '');
|
|
142
|
+
let rows = 0;
|
|
143
|
+
try {
|
|
144
|
+
rows = db.prepare('SELECT COUNT(*) AS c FROM memory_entries').get()?.c ?? 0;
|
|
145
|
+
}
|
|
146
|
+
catch { /* no entries table — not a usable memory DB */ }
|
|
147
|
+
db.close();
|
|
148
|
+
if (integ.toLowerCase() === 'ok' && rows > 0) {
|
|
149
|
+
chosen = { file, rows };
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else if (fs.statSync(file).size > 0) {
|
|
154
|
+
chosen = { file, rows: -1 };
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch { /* unreadable snapshot — try the next-older one */ }
|
|
159
|
+
}
|
|
160
|
+
if (!chosen)
|
|
161
|
+
return { restored: false, skipped: 'no-integrity-ok-backup' };
|
|
162
|
+
const ts = opts.timestamp ?? Date.now();
|
|
163
|
+
const corruptBackupPath = `${dbPath}.corrupt-${ts}.bak`;
|
|
164
|
+
const tmp = `${dbPath}.restoring-${ts}`;
|
|
165
|
+
try {
|
|
166
|
+
if (fs.existsSync(dbPath))
|
|
167
|
+
fs.copyFileSync(dbPath, corruptBackupPath);
|
|
168
|
+
fs.copyFileSync(chosen.file, tmp); // stream copy — no 185MB buffer
|
|
169
|
+
const fd = fs.openSync(tmp, 'r+');
|
|
170
|
+
try {
|
|
171
|
+
fs.fsyncSync(fd);
|
|
172
|
+
}
|
|
173
|
+
finally {
|
|
174
|
+
fs.closeSync(fd);
|
|
175
|
+
} // durable before swap
|
|
176
|
+
fs.renameSync(tmp, dbPath); // atomic install
|
|
177
|
+
for (const s of ['-wal', '-shm']) {
|
|
178
|
+
try {
|
|
179
|
+
fs.rmSync(`${dbPath}${s}`, { force: true });
|
|
180
|
+
}
|
|
181
|
+
catch { /* */ }
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
catch (e) {
|
|
185
|
+
try {
|
|
186
|
+
fs.rmSync(tmp, { force: true });
|
|
187
|
+
}
|
|
188
|
+
catch { /* */ }
|
|
189
|
+
return { restored: false, skipped: `install failed: ${e?.message ?? e}` };
|
|
190
|
+
}
|
|
191
|
+
if (opts.verbose) {
|
|
192
|
+
console.log(`memory DB restored from backup ${path.basename(chosen.file)}` +
|
|
193
|
+
(chosen.rows >= 0 ? ` (${chosen.rows} rows)` : ' (unverified)') +
|
|
194
|
+
`. Corrupt original saved to ${corruptBackupPath}`);
|
|
195
|
+
}
|
|
196
|
+
return { restored: true, from: chosen.file, rows: chosen.rows, corruptBackupPath };
|
|
197
|
+
}
|
|
94
198
|
//# sourceMappingURL=memory-backup.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.25.
|
|
3
|
+
"version": "3.25.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
|
|
6
6
|
"main": "dist/src/index.js",
|