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.
@@ -0,0 +1,11 @@
1
+ {
2
+ "default": [
3
+ {
4
+ "key": "test-api",
5
+ "value": "REST with JWT",
6
+ "namespace": "default",
7
+ "timestamp": 1761424106926,
8
+ "redacted": false
9
+ }
10
+ ]
11
+ }
@@ -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.16",
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 isBetterSqliteError = error.message?.includes('BetterSqlite3') ||
427
- error.message?.includes('better-sqlite3');
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 (isBetterSqliteError && isNpx) {
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
- if (error.message?.includes('BetterSqlite3 is not a constructor') ||
48
- error.message?.includes('better-sqlite3')) {
49
- const isNpx = process.env.npm_config_user_agent?.includes('npx') ||
50
- process.cwd().includes('_npx');
51
-
52
- if (isNpx) {
53
- console.error('\nāš ļø NPX LIMITATION DETECTED\n');
54
- console.error('ReasoningBank requires better-sqlite3, which is not available in npx temp directories.\n');
55
- console.error('šŸ“š Solutions:\n');
56
- console.error(' 1. LOCAL INSTALL (Recommended):');
57
- console.error(' npm install && node_modules/.bin/claude-flow memory store "key" "value"\n');
58
- console.error(' 2. USE MCP TOOLS instead:');
59
- console.error(' mcp__claude-flow__memory_usage({ action: "store", key: "test", value: "data" })\n');
60
- console.error(' 3. USE JSON FALLBACK:');
61
- console.error(' npx claude-flow@alpha memory store "key" "value" --no-reasoningbank\n');
62
- console.error('See: docs/MEMORY_COMMAND_FIX.md for details\n');
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 true;
84
+ const result = await ensureInitialized();
85
+ return result;
80
86
  }
81
87
 
82
88
  /**