claude-flow 2.7.16 ā 2.7.18
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/bin/claude-flow +1 -1
- package/dist/src/cli/simple-cli.js +172 -182
- package/dist/src/cli/simple-cli.js.map +1 -1
- package/dist/src/cli/simple-commands/memory.js +3 -2
- package/dist/src/cli/simple-commands/memory.js.map +1 -1
- package/dist/src/cli/validation-helper.js.map +1 -1
- package/dist/src/core/version.js +1 -1
- package/dist/src/reasoningbank/reasoningbank-adapter.js +17 -17
- package/dist/src/reasoningbank/reasoningbank-adapter.js.map +1 -1
- package/dist/src/utils/key-redactor.js.map +1 -1
- package/docker-test/.claude-flow/metrics/performance.json +3 -3
- package/docker-test/.claude-flow/metrics/task-metrics.json +3 -3
- package/docker-test/Dockerfile.npx-test +20 -0
- package/docker-test/memory/memory-store.json +11 -0
- package/docker-test/test-npx-memory.sh +84 -0
- package/package.json +1 -1
- package/src/cli/simple-commands/memory.js +6 -3
- package/src/reasoningbank/reasoningbank-adapter.js +27 -21
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Test npx memory commands in Docker to validate v2.7.17 fix
|
|
3
|
+
# This simulates a clean remote environment without local dependencies
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "š³ Testing claude-flow@alpha npx memory commands in Docker"
|
|
8
|
+
echo "============================================================"
|
|
9
|
+
echo ""
|
|
10
|
+
|
|
11
|
+
# Test 1: Version check
|
|
12
|
+
echo "š Test 1: Version Check"
|
|
13
|
+
echo "Command: npx claude-flow@alpha --version"
|
|
14
|
+
npx claude-flow@alpha --version
|
|
15
|
+
echo "ā
Version check passed"
|
|
16
|
+
echo ""
|
|
17
|
+
|
|
18
|
+
# Test 2: Memory store (should auto-fallback to JSON)
|
|
19
|
+
echo "š Test 2: Memory Store with Auto-Fallback"
|
|
20
|
+
echo "Command: npx claude-flow@alpha memory store 'api-design' 'REST with JWT auth'"
|
|
21
|
+
npx claude-flow@alpha memory store "api-design" "REST with JWT auth" 2>&1 | tee /tmp/store-output.txt
|
|
22
|
+
echo ""
|
|
23
|
+
|
|
24
|
+
# Validate output
|
|
25
|
+
if grep -q "Automatically using JSON fallback" /tmp/store-output.txt; then
|
|
26
|
+
echo "ā
Auto-fallback message detected"
|
|
27
|
+
else
|
|
28
|
+
echo "ā ļø Auto-fallback message NOT found (may be using different mode)"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
if grep -q "Stored:" /tmp/store-output.txt || grep -q "ā
" /tmp/store-output.txt; then
|
|
32
|
+
echo "ā
Memory store succeeded"
|
|
33
|
+
else
|
|
34
|
+
echo "ā Memory store FAILED"
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
echo ""
|
|
38
|
+
|
|
39
|
+
# Test 3: Memory query
|
|
40
|
+
echo "š Test 3: Memory Query"
|
|
41
|
+
echo "Command: npx claude-flow@alpha memory query 'authentication'"
|
|
42
|
+
npx claude-flow@alpha memory query "authentication" 2>&1 | tee /tmp/query-output.txt
|
|
43
|
+
echo ""
|
|
44
|
+
|
|
45
|
+
# Validate query output
|
|
46
|
+
if grep -q "api-design" /tmp/query-output.txt || grep -q "REST" /tmp/query-output.txt; then
|
|
47
|
+
echo "ā
Memory query found stored data"
|
|
48
|
+
else
|
|
49
|
+
echo "ā ļø Memory query did not find data (may be namespace issue)"
|
|
50
|
+
fi
|
|
51
|
+
echo ""
|
|
52
|
+
|
|
53
|
+
# Test 4: Memory stats
|
|
54
|
+
echo "š Test 4: Memory Statistics"
|
|
55
|
+
echo "Command: npx claude-flow@alpha memory stats"
|
|
56
|
+
npx claude-flow@alpha memory stats 2>&1 | tee /tmp/stats-output.txt
|
|
57
|
+
echo ""
|
|
58
|
+
|
|
59
|
+
if grep -q "Total Entries:" /tmp/stats-output.txt; then
|
|
60
|
+
echo "ā
Memory stats succeeded"
|
|
61
|
+
else
|
|
62
|
+
echo "ā Memory stats FAILED"
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
65
|
+
echo ""
|
|
66
|
+
|
|
67
|
+
# Test 5: Memory list
|
|
68
|
+
echo "š Test 5: Memory List"
|
|
69
|
+
echo "Command: npx claude-flow@alpha memory list"
|
|
70
|
+
npx claude-flow@alpha memory list 2>&1
|
|
71
|
+
echo "ā
Memory list succeeded"
|
|
72
|
+
echo ""
|
|
73
|
+
|
|
74
|
+
echo "============================================================"
|
|
75
|
+
echo "ā
ALL TESTS PASSED!"
|
|
76
|
+
echo ""
|
|
77
|
+
echo "Summary:"
|
|
78
|
+
echo "- Version check: ā
"
|
|
79
|
+
echo "- Memory store with auto-fallback: ā
"
|
|
80
|
+
echo "- Memory query: ā
"
|
|
81
|
+
echo "- Memory stats: ā
"
|
|
82
|
+
echo "- Memory list: ā
"
|
|
83
|
+
echo ""
|
|
84
|
+
echo "The npx memory command fix in v2.7.17 is working correctly!"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.18",
|
|
4
4
|
"description": "Enterprise-grade AI agent orchestration with WASM-powered ReasoningBank memory and AgentDB vector database (always uses latest agentic-flow)",
|
|
5
5
|
"mcpName": "io.github.ruvnet/claude-flow",
|
|
6
6
|
"main": "cli.mjs",
|
|
@@ -423,13 +423,16 @@ async function detectMemoryMode(flags, subArgs) {
|
|
|
423
423
|
return 'reasoningbank';
|
|
424
424
|
} catch (error) {
|
|
425
425
|
// SQLite initialization failed - fall back to JSON
|
|
426
|
-
const
|
|
427
|
-
|
|
426
|
+
const isSqliteError = error.message?.includes('BetterSqlite3') ||
|
|
427
|
+
error.message?.includes('better-sqlite3') ||
|
|
428
|
+
error.message?.includes('could not run migrations') ||
|
|
429
|
+
error.message?.includes('ReasoningBank initialization failed');
|
|
428
430
|
const isNpx = process.env.npm_config_user_agent?.includes('npx') ||
|
|
429
431
|
process.cwd().includes('_npx');
|
|
430
432
|
|
|
431
|
-
if (
|
|
433
|
+
if (isSqliteError && isNpx) {
|
|
432
434
|
// Silent fallback for npx - error already shown by adapter
|
|
435
|
+
console.log('\nā
Automatically using JSON fallback for this command\n');
|
|
433
436
|
return 'basic';
|
|
434
437
|
} else {
|
|
435
438
|
printWarning(`ā ļø SQLite unavailable, using JSON fallback`);
|
|
@@ -41,28 +41,33 @@ async function ensureInitialized() {
|
|
|
41
41
|
console.log('[ReasoningBank] Node.js backend initialized successfully');
|
|
42
42
|
return true;
|
|
43
43
|
} catch (error) {
|
|
44
|
-
console.error('[ReasoningBank] Backend initialization failed:', error);
|
|
45
|
-
|
|
46
44
|
// Check if this is the better-sqlite3 missing error (npx issue)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
45
|
+
const isSqliteError = error.message?.includes('BetterSqlite3 is not a constructor') ||
|
|
46
|
+
error.message?.includes('better-sqlite3') ||
|
|
47
|
+
error.message?.includes('could not run migrations');
|
|
48
|
+
const isNpx = process.env.npm_config_user_agent?.includes('npx') ||
|
|
49
|
+
process.cwd().includes('_npx');
|
|
50
|
+
|
|
51
|
+
if (isSqliteError && isNpx) {
|
|
52
|
+
// NPX limitation - show helpful message but DON'T throw
|
|
53
|
+
// This allows the command to fall back to JSON mode
|
|
54
|
+
console.error('\nā ļø NPX LIMITATION DETECTED\n');
|
|
55
|
+
console.error('ReasoningBank requires better-sqlite3, which is not available in npx temp directories.\n');
|
|
56
|
+
console.error('š Solutions:\n');
|
|
57
|
+
console.error(' 1. LOCAL INSTALL (Recommended):');
|
|
58
|
+
console.error(' npm install && node_modules/.bin/claude-flow memory store "key" "value"\n');
|
|
59
|
+
console.error(' 2. USE MCP TOOLS instead:');
|
|
60
|
+
console.error(' mcp__claude-flow__memory_usage({ action: "store", key: "test", value: "data" })\n');
|
|
61
|
+
console.error(' 3. USE JSON FALLBACK (automatic):');
|
|
62
|
+
console.error(' Command will continue with JSON storage...\n');
|
|
63
|
+
console.error('See: docs/MEMORY_COMMAND_FIX.md for details\n');
|
|
64
|
+
|
|
65
|
+
// Return false to signal initialization failed but allow fallback
|
|
66
|
+
return false;
|
|
64
67
|
}
|
|
65
68
|
|
|
69
|
+
// Not npx or not SQLite error - log and throw
|
|
70
|
+
console.error('[ReasoningBank] Backend initialization failed:', error);
|
|
66
71
|
throw new Error(`Failed to initialize ReasoningBank: ${error.message}`);
|
|
67
72
|
}
|
|
68
73
|
})();
|
|
@@ -72,11 +77,12 @@ async function ensureInitialized() {
|
|
|
72
77
|
|
|
73
78
|
/**
|
|
74
79
|
* Initialize ReasoningBank database (Node.js version)
|
|
80
|
+
* Returns true if initialized, false if failed (allows fallback)
|
|
75
81
|
*/
|
|
76
82
|
export async function initializeReasoningBank() {
|
|
77
83
|
// Initialize the Node.js backend
|
|
78
|
-
await ensureInitialized();
|
|
79
|
-
return
|
|
84
|
+
const result = await ensureInitialized();
|
|
85
|
+
return result;
|
|
80
86
|
}
|
|
81
87
|
|
|
82
88
|
/**
|