claude-flow 3.10.1 → 3.10.3
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/README.md +1 -0
- package/package.json +1 -1
- package/v3/@claude-flow/cli/README.md +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/analyze.js +0 -1
- package/v3/@claude-flow/cli/dist/src/commands/memory.js +37 -15
- package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.js +1 -1
- package/v3/@claude-flow/cli/dist/src/memory/embedding-quantization.js +9 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +9 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +18 -0
- package/v3/@claude-flow/cli/package.json +5 -5
package/README.md
CHANGED
|
@@ -382,6 +382,7 @@ Four docs for four audiences:
|
|
|
382
382
|
| **[User Guide](docs/USERGUIDE.md)** | Daily reference — every command, every config flag, every plugin. The *how-do-I* doc. |
|
|
383
383
|
| **[Benchmarks](https://gist.github.com/ruvnet/298f8c668c8859b369f91734a0e9cbbe)** | v3.8.0 SOTA matrix vs LangGraph / AutoGen / CrewAI on darwin-arm64 + linux-x64. ruflo wins cold start, single turn, RSS by 1.3×–1953×. The *is-it-fast* doc. |
|
|
384
384
|
| **[Verification](verification.md)** | Cryptographically prove your installed bytes match the signed witness — `ruflo verify`. The *trust-but-verify* doc. |
|
|
385
|
+
| **[Team Gateway Checklist](docs/TEAM-GATEWAY-CHECKLIST.md)** | Before-merge gates, dual-mode handoff, memory namespace sharing, and witness manifest entry per merge. The *safer-team-workflows* doc. |
|
|
385
386
|
|
|
386
387
|
Benchmark internals (for reproduction): [`sota-workload-spec.md`](https://github.com/ruvnet/ruflo/blob/perf/sota-comparator-benchmarks/docs/benchmarks/sota-workload-spec.md) · [`SOTA-PROGRESS.md`](https://github.com/ruvnet/ruflo/blob/perf/sota-comparator-benchmarks/docs/benchmarks/SOTA-PROGRESS.md) · [raw matrix JSON: darwin](https://github.com/ruvnet/ruflo/blob/perf/sota-comparator-benchmarks/docs/benchmarks/sota-matrix.json) · [linux](https://github.com/ruvnet/ruflo/blob/perf/sota-comparator-benchmarks/docs/benchmarks/sota-matrix-linux.json)
|
|
387
388
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.3",
|
|
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",
|
|
@@ -382,6 +382,7 @@ Four docs for four audiences:
|
|
|
382
382
|
| **[User Guide](docs/USERGUIDE.md)** | Daily reference — every command, every config flag, every plugin. The *how-do-I* doc. |
|
|
383
383
|
| **[Benchmarks](https://gist.github.com/ruvnet/298f8c668c8859b369f91734a0e9cbbe)** | v3.8.0 SOTA matrix vs LangGraph / AutoGen / CrewAI on darwin-arm64 + linux-x64. ruflo wins cold start, single turn, RSS by 1.3×–1953×. The *is-it-fast* doc. |
|
|
384
384
|
| **[Verification](verification.md)** | Cryptographically prove your installed bytes match the signed witness — `ruflo verify`. The *trust-but-verify* doc. |
|
|
385
|
+
| **[Team Gateway Checklist](docs/TEAM-GATEWAY-CHECKLIST.md)** | Before-merge gates, dual-mode handoff, memory namespace sharing, and witness manifest entry per merge. The *safer-team-workflows* doc. |
|
|
385
386
|
|
|
386
387
|
Benchmark internals (for reproduction): [`sota-workload-spec.md`](https://github.com/ruvnet/ruflo/blob/perf/sota-comparator-benchmarks/docs/benchmarks/sota-workload-spec.md) · [`SOTA-PROGRESS.md`](https://github.com/ruvnet/ruflo/blob/perf/sota-comparator-benchmarks/docs/benchmarks/SOTA-PROGRESS.md) · [raw matrix JSON: darwin](https://github.com/ruvnet/ruflo/blob/perf/sota-comparator-benchmarks/docs/benchmarks/sota-matrix.json) · [linux](https://github.com/ruvnet/ruflo/blob/perf/sota-comparator-benchmarks/docs/benchmarks/sota-matrix-linux.json)
|
|
387
388
|
|
|
@@ -12,6 +12,14 @@ const BACKENDS = [
|
|
|
12
12
|
{ value: 'hybrid', label: 'Hybrid', hint: 'SQLite + AgentDB (recommended)' },
|
|
13
13
|
{ value: 'memory', label: 'In-Memory', hint: 'Fast but non-persistent' }
|
|
14
14
|
];
|
|
15
|
+
// #2105: shared --path option for memory subcommands.
|
|
16
|
+
// Precedence: --path > CLAUDE_FLOW_DB_PATH env var > default root
|
|
17
|
+
const DB_PATH_OPTION = {
|
|
18
|
+
name: 'path',
|
|
19
|
+
description: 'Override DB file path (also: CLAUDE_FLOW_DB_PATH env var). ' +
|
|
20
|
+
'Precedence: --path > CLAUDE_FLOW_DB_PATH > CLAUDE_FLOW_MEMORY_PATH/memory.db > cwd/.swarm/memory.db',
|
|
21
|
+
type: 'string',
|
|
22
|
+
};
|
|
15
23
|
// Store command
|
|
16
24
|
const storeCommand = {
|
|
17
25
|
name: 'store',
|
|
@@ -59,7 +67,8 @@ const storeCommand = {
|
|
|
59
67
|
description: 'Update if key exists (insert or replace)',
|
|
60
68
|
type: 'boolean',
|
|
61
69
|
default: false
|
|
62
|
-
}
|
|
70
|
+
},
|
|
71
|
+
DB_PATH_OPTION
|
|
63
72
|
],
|
|
64
73
|
examples: [
|
|
65
74
|
{ command: 'claude-flow memory store -k "api/auth" -v "JWT implementation"', description: 'Store text' },
|
|
@@ -101,7 +110,8 @@ const storeCommand = {
|
|
|
101
110
|
output.printInfo(`Storing in ${namespace}/${key}...`);
|
|
102
111
|
// Use direct sql.js storage with automatic embedding generation
|
|
103
112
|
try {
|
|
104
|
-
const { storeEntry } = await import('../memory/memory-initializer.js');
|
|
113
|
+
const { storeEntry, resolveDbPath: _rdbStore } = await import('../memory/memory-initializer.js');
|
|
114
|
+
const dbPath = _rdbStore(ctx.flags.path);
|
|
105
115
|
if (asVector) {
|
|
106
116
|
output.writeln(output.dim(' Generating embedding vector...'));
|
|
107
117
|
}
|
|
@@ -112,7 +122,8 @@ const storeCommand = {
|
|
|
112
122
|
generateEmbeddingFlag: true, // Always generate embeddings for semantic search
|
|
113
123
|
tags,
|
|
114
124
|
ttl,
|
|
115
|
-
upsert
|
|
125
|
+
upsert,
|
|
126
|
+
dbPath
|
|
116
127
|
});
|
|
117
128
|
if (!result.success) {
|
|
118
129
|
output.printError(result.error || 'Failed to store');
|
|
@@ -175,7 +186,8 @@ const retrieveCommand = {
|
|
|
175
186
|
description: 'Print only the stored value to stdout (no wrapper)',
|
|
176
187
|
type: 'boolean',
|
|
177
188
|
default: false
|
|
178
|
-
}
|
|
189
|
+
},
|
|
190
|
+
DB_PATH_OPTION
|
|
179
191
|
],
|
|
180
192
|
action: async (ctx) => {
|
|
181
193
|
const key = ctx.flags.key || ctx.args[0];
|
|
@@ -186,8 +198,9 @@ const retrieveCommand = {
|
|
|
186
198
|
}
|
|
187
199
|
// Use sql.js directly for consistent data access
|
|
188
200
|
try {
|
|
189
|
-
const { getEntry } = await import('../memory/memory-initializer.js');
|
|
190
|
-
const
|
|
201
|
+
const { getEntry, resolveDbPath: _rdbRetrieve } = await import('../memory/memory-initializer.js');
|
|
202
|
+
const dbPathRetrieve = _rdbRetrieve(ctx.flags.path);
|
|
203
|
+
const result = await getEntry({ key, namespace, dbPath: dbPathRetrieve });
|
|
191
204
|
if (!result.success) {
|
|
192
205
|
output.printError(`Failed to retrieve: ${result.error}`);
|
|
193
206
|
return { success: false, exitCode: 1 };
|
|
@@ -283,7 +296,8 @@ const searchCommand = {
|
|
|
283
296
|
description: 'Use SmartRetrieval pipeline (query expansion, RRF, MMR, recency)',
|
|
284
297
|
type: 'boolean',
|
|
285
298
|
default: false
|
|
286
|
-
}
|
|
299
|
+
},
|
|
300
|
+
DB_PATH_OPTION
|
|
287
301
|
],
|
|
288
302
|
examples: [
|
|
289
303
|
{ command: 'claude-flow memory search -q "authentication patterns"', description: 'Semantic search' },
|
|
@@ -331,7 +345,8 @@ const searchCommand = {
|
|
|
331
345
|
output.writeln();
|
|
332
346
|
// Use direct sql.js search with vector similarity
|
|
333
347
|
try {
|
|
334
|
-
const { searchEntries } = await import('../memory/memory-initializer.js');
|
|
348
|
+
const { searchEntries, resolveDbPath: _rdbSearch } = await import('../memory/memory-initializer.js');
|
|
349
|
+
const dbPathSearch = _rdbSearch(ctx.flags.path);
|
|
335
350
|
const useSmart = (ctx.flags.smart || ctx.flags.s);
|
|
336
351
|
let results;
|
|
337
352
|
let searchTimeMs;
|
|
@@ -365,6 +380,7 @@ const searchCommand = {
|
|
|
365
380
|
namespace: req.namespace || namespace,
|
|
366
381
|
limit: req.limit || limit * 3,
|
|
367
382
|
threshold: req.threshold ?? threshold,
|
|
383
|
+
dbPath: dbPathSearch,
|
|
368
384
|
});
|
|
369
385
|
return {
|
|
370
386
|
results: r.results.map(e => ({
|
|
@@ -397,7 +413,8 @@ const searchCommand = {
|
|
|
397
413
|
query,
|
|
398
414
|
namespace,
|
|
399
415
|
limit,
|
|
400
|
-
threshold
|
|
416
|
+
threshold,
|
|
417
|
+
dbPath: dbPathSearch
|
|
401
418
|
});
|
|
402
419
|
if (!searchResult.success) {
|
|
403
420
|
output.printError(searchResult.error || 'Search failed');
|
|
@@ -470,15 +487,17 @@ const listCommand = {
|
|
|
470
487
|
description: 'Maximum entries',
|
|
471
488
|
type: 'number',
|
|
472
489
|
default: 20
|
|
473
|
-
}
|
|
490
|
+
},
|
|
491
|
+
DB_PATH_OPTION
|
|
474
492
|
],
|
|
475
493
|
action: async (ctx) => {
|
|
476
494
|
const namespace = ctx.flags.namespace;
|
|
477
495
|
const limit = ctx.flags.limit;
|
|
478
496
|
// Use sql.js directly for consistent data access
|
|
479
497
|
try {
|
|
480
|
-
const { listEntries } = await import('../memory/memory-initializer.js');
|
|
481
|
-
const
|
|
498
|
+
const { listEntries, resolveDbPath: _rdbList } = await import('../memory/memory-initializer.js');
|
|
499
|
+
const dbPathList = _rdbList(ctx.flags.path);
|
|
500
|
+
const listResult = await listEntries({ namespace, limit, offset: 0, dbPath: dbPathList });
|
|
482
501
|
if (!listResult.success) {
|
|
483
502
|
output.printError(`Failed to list: ${listResult.error}`);
|
|
484
503
|
return { success: false, exitCode: 1 };
|
|
@@ -567,7 +586,8 @@ const deleteCommand = {
|
|
|
567
586
|
description: 'Skip confirmation',
|
|
568
587
|
type: 'boolean',
|
|
569
588
|
default: false
|
|
570
|
-
}
|
|
589
|
+
},
|
|
590
|
+
DB_PATH_OPTION
|
|
571
591
|
],
|
|
572
592
|
examples: [
|
|
573
593
|
{ command: 'claude-flow memory delete -k "mykey"', description: 'Delete entry with default namespace' },
|
|
@@ -595,8 +615,9 @@ const deleteCommand = {
|
|
|
595
615
|
}
|
|
596
616
|
// Use sql.js directly for consistent data access (Issue #980)
|
|
597
617
|
try {
|
|
598
|
-
const { deleteEntry } = await import('../memory/memory-initializer.js');
|
|
599
|
-
const
|
|
618
|
+
const { deleteEntry, resolveDbPath: _rdbDelete } = await import('../memory/memory-initializer.js');
|
|
619
|
+
const dbPathDelete = _rdbDelete(ctx.flags.path);
|
|
620
|
+
const result = await deleteEntry({ key, namespace, dbPath: dbPathDelete });
|
|
600
621
|
if (!result.success) {
|
|
601
622
|
output.printError(result.error || 'Failed to delete');
|
|
602
623
|
return { success: false, exitCode: 1 };
|
|
@@ -620,6 +641,7 @@ const deleteCommand = {
|
|
|
620
641
|
const statsCommand = {
|
|
621
642
|
name: 'stats',
|
|
622
643
|
description: 'Show memory statistics',
|
|
644
|
+
options: [DB_PATH_OPTION],
|
|
623
645
|
action: async (ctx) => {
|
|
624
646
|
// Call MCP memory/stats tool for real statistics
|
|
625
647
|
try {
|
|
@@ -667,7 +667,7 @@ export const coordinationTools = [
|
|
|
667
667
|
topology: store.topology.type,
|
|
668
668
|
// Honest stub: no executor wired up yet. Don't lie about completion time.
|
|
669
669
|
executor: 'none',
|
|
670
|
-
_note: 'coordination_orchestrate currently records the orchestration request but does not execute it. For real multi-agent execution use agent_spawn + the Task tool, or hive-mind_spawn for queen-led coordination.',
|
|
670
|
+
_note: 'coordination_orchestrate currently records the orchestration request but does not execute it. For real multi-agent execution use agent_spawn + the Task tool, or hive-mind_spawn for queen-led coordination. Real executor tracked in issue #2140.',
|
|
671
671
|
};
|
|
672
672
|
},
|
|
673
673
|
},
|
|
@@ -87,9 +87,18 @@ export function decodeEmbedding(embeddingRef) {
|
|
|
87
87
|
const b64 = embeddingRef.slice(INLINE_PREFIX.length);
|
|
88
88
|
const raw = Buffer.from(b64, 'base64');
|
|
89
89
|
const view = new DataView(raw.buffer, raw.byteOffset, raw.byteLength);
|
|
90
|
+
if (raw.byteLength < 16)
|
|
91
|
+
return null; // too short for the header
|
|
90
92
|
if (view.getUint32(0, true) !== PQ_MAGIC)
|
|
91
93
|
return null;
|
|
92
94
|
const dims = view.getUint32(4, true);
|
|
95
|
+
// Validate claimed dims against actual buffer size (#security-review-v3.10):
|
|
96
|
+
// (a) dims=0 or buffer too short -> malformed blob, reject.
|
|
97
|
+
// (b) dims > 8192 -> oversized allocation guard (DoS via crafted blob).
|
|
98
|
+
// Normal production blobs are 384-dim; 8192 is a generous upper bound
|
|
99
|
+
// for any supported model without allowing unbounded allocations.
|
|
100
|
+
if (dims === 0 || dims > 8192 || raw.byteLength < 16 + dims)
|
|
101
|
+
return null;
|
|
93
102
|
const gMin = view.getFloat32(8, true);
|
|
94
103
|
const gMax = view.getFloat32(12, true);
|
|
95
104
|
const range = gMax - gMin;
|
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
export declare function getMemoryRoot(): string;
|
|
12
12
|
/** For tests + the `memory configure` flow that mutates the config at runtime. */
|
|
13
13
|
export declare function _resetMemoryRootCache(): void;
|
|
14
|
+
/**
|
|
15
|
+
* #2105: Resolve the full path to the SQLite memory database.
|
|
16
|
+
* Precedence (highest to lowest):
|
|
17
|
+
* 1. cliFlag - explicit --path flag passed by a subcommand
|
|
18
|
+
* 2. CLAUDE_FLOW_DB_PATH - full file-path override (new in #2105)
|
|
19
|
+
* 3. getMemoryRoot()/memory.db - directory from CLAUDE_FLOW_MEMORY_PATH /
|
|
20
|
+
* config / default cwd/.swarm
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveDbPath(cliFlag?: string): string;
|
|
14
23
|
/**
|
|
15
24
|
* Enhanced schema with pattern confidence, temporal decay, versioning
|
|
16
25
|
* Vector embeddings enabled for semantic search
|
|
@@ -66,6 +66,24 @@ export function getMemoryRoot() {
|
|
|
66
66
|
export function _resetMemoryRootCache() {
|
|
67
67
|
_memoryRootCache = undefined;
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* #2105: Resolve the full path to the SQLite memory database.
|
|
71
|
+
* Precedence (highest to lowest):
|
|
72
|
+
* 1. cliFlag - explicit --path flag passed by a subcommand
|
|
73
|
+
* 2. CLAUDE_FLOW_DB_PATH - full file-path override (new in #2105)
|
|
74
|
+
* 3. getMemoryRoot()/memory.db - directory from CLAUDE_FLOW_MEMORY_PATH /
|
|
75
|
+
* config / default cwd/.swarm
|
|
76
|
+
*/
|
|
77
|
+
export function resolveDbPath(cliFlag) {
|
|
78
|
+
if (cliFlag && cliFlag.trim().length > 0) {
|
|
79
|
+
return path.resolve(cliFlag);
|
|
80
|
+
}
|
|
81
|
+
const envDb = process.env.CLAUDE_FLOW_DB_PATH;
|
|
82
|
+
if (envDb && envDb.trim().length > 0) {
|
|
83
|
+
return path.resolve(envDb);
|
|
84
|
+
}
|
|
85
|
+
return path.join(getMemoryRoot(), 'memory.db');
|
|
86
|
+
}
|
|
69
87
|
// ADR-053: Lazy import of AgentDB v3 bridge
|
|
70
88
|
let _bridge;
|
|
71
89
|
async function getBridge() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.3",
|
|
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",
|
|
@@ -102,10 +102,7 @@
|
|
|
102
102
|
"@noble/ed25519": "^2.1.0",
|
|
103
103
|
"@ruvector/rabitq-wasm": "^0.1.0",
|
|
104
104
|
"semver": "^7.6.0",
|
|
105
|
-
"yaml": "^2.8.0"
|
|
106
|
-
"@claude-flow/memory": "^3.0.0-alpha.17",
|
|
107
|
-
"@claude-flow/embeddings": "^3.0.0-alpha.18",
|
|
108
|
-
"@claude-flow/security": "^3.0.0-alpha.8"
|
|
105
|
+
"yaml": "^2.8.0"
|
|
109
106
|
},
|
|
110
107
|
"optionalDependencies": {
|
|
111
108
|
"@claude-flow/aidefence": "^3.0.2",
|
|
@@ -129,5 +126,8 @@
|
|
|
129
126
|
"publishConfig": {
|
|
130
127
|
"access": "public",
|
|
131
128
|
"tag": "latest"
|
|
129
|
+
},
|
|
130
|
+
"overrides": {
|
|
131
|
+
"protobufjs": ">=7.5.6"
|
|
132
132
|
}
|
|
133
133
|
}
|