@claude-flow/cli 3.1.0-alpha.50 β†’ 3.1.0-alpha.52

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.
Files changed (36) hide show
  1. package/README.md +58 -60
  2. package/dist/src/commands/hooks.d.ts.map +1 -1
  3. package/dist/src/commands/hooks.js +56 -43
  4. package/dist/src/commands/hooks.js.map +1 -1
  5. package/dist/src/init/executor.d.ts.map +1 -1
  6. package/dist/src/init/executor.js +11 -1
  7. package/dist/src/init/executor.js.map +1 -1
  8. package/dist/src/init/settings-generator.d.ts.map +1 -1
  9. package/dist/src/init/settings-generator.js +4 -4
  10. package/dist/src/init/settings-generator.js.map +1 -1
  11. package/dist/src/init/statusline-generator.d.ts.map +1 -1
  12. package/dist/src/init/statusline-generator.js +85 -2
  13. package/dist/src/init/statusline-generator.js.map +1 -1
  14. package/dist/src/mcp-client.d.ts.map +1 -1
  15. package/dist/src/mcp-client.js +4 -0
  16. package/dist/src/mcp-client.js.map +1 -1
  17. package/dist/src/mcp-tools/agentdb-tools.d.ts +21 -0
  18. package/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -0
  19. package/dist/src/mcp-tools/agentdb-tools.js +267 -0
  20. package/dist/src/mcp-tools/agentdb-tools.js.map +1 -0
  21. package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
  22. package/dist/src/mcp-tools/hooks-tools.js +184 -32
  23. package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
  24. package/dist/src/memory/intelligence.d.ts.map +1 -1
  25. package/dist/src/memory/intelligence.js +34 -6
  26. package/dist/src/memory/intelligence.js.map +1 -1
  27. package/dist/src/memory/memory-bridge.d.ts +339 -0
  28. package/dist/src/memory/memory-bridge.d.ts.map +1 -0
  29. package/dist/src/memory/memory-bridge.js +1250 -0
  30. package/dist/src/memory/memory-bridge.js.map +1 -0
  31. package/dist/src/memory/memory-initializer.d.ts +3 -0
  32. package/dist/src/memory/memory-initializer.d.ts.map +1 -1
  33. package/dist/src/memory/memory-initializer.js +105 -0
  34. package/dist/src/memory/memory-initializer.js.map +1 -1
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/package.json +1 -1
package/README.md CHANGED
@@ -2395,85 +2395,83 @@ npx ruflo hive-mind status # Check status
2395
2395
  <details>
2396
2396
  <summary>πŸ“Š <strong>V3 Statusline</strong> β€” Real-time development status for Claude Code</summary>
2397
2397
 
2398
- Real-time development status display for Claude Code integration showing DDD progress, swarm activity, security status, and system metrics.
2398
+ Real-time development status display integrated directly into Claude Code's status bar. Shows DDD progress, swarm activity, security status, AgentDB metrics, and live session data (model, context usage, cost).
2399
+
2400
+ **How It Works:**
2401
+
2402
+ Claude Code pipes JSON session data via **stdin** to the statusline script after each assistant message (debounced ~300ms). The script reads this data and combines it with local project metrics to produce a single-line status output.
2399
2403
 
2400
2404
  **Output Format:**
2401
2405
  ```
2402
- β–Š Ruflo V3 ● ruvnet β”‚ βŽ‡ v3 β”‚ Opus 4.5
2403
- ─────────────────────────────────────────────────────
2404
- πŸ—οΈ DDD Domains [●●●●●] 5/5 ⚑ 1.0x β†’ 2.49x-7.47x
2405
- πŸ€– Swarm β—‰ [58/15] πŸ‘₯ 0 🟒 CVE 3/3 πŸ’Ύ 22282MB πŸ“‚ 47% 🧠 10%
2406
- πŸ”§ Architecture DDD ● 98% β”‚ Security ●CLEAN β”‚ Memory ●AgentDB β”‚ Integration ●
2406
+ β–Š Claude Flow V3 ● ruvnet β”‚ βŽ‡ main β”‚ Opus 4.6 | ●42% ctx | $0.15
2407
+ πŸ—οΈ DDD [●●●●○] 4/5 ⚑ HNSW 150x πŸ€– β—‰ [12/8] πŸ‘₯ 3 🟒 CVE 3/3 πŸ’Ύ 512MB 🧠 15% πŸ“¦ AgentDB ●1.2K vectors
2407
2408
  ```
2408
2409
 
2409
- | Indicator | Description | Values |
2410
+ | Indicator | Description | Source |
2410
2411
  |-----------|-------------|--------|
2411
- | `β–Š Ruflo V3` | Project header | Always shown |
2412
- | `● ruvnet` | GitHub user (via `gh` CLI) | Dynamic |
2413
- | `βŽ‡ v3` | Current git branch | Dynamic |
2414
- | `Opus 4.5` | Claude model name | From Claude Code |
2415
- | `[●●●●●]` | DDD domain progress bar | 0-5 domains |
2416
- | `⚑ 1.0x β†’ 2.49x-7.47x` | Performance speedup target | Current β†’ Target |
2417
- | `β—‰/β—‹` | Swarm coordination status | Active/Inactive |
2418
- | `[58/15]` | Active agents / max agents | Process count |
2419
- | `πŸ‘₯ 0` | Sub-agents spawned | Task tool agents |
2420
- | `🟒 CVE 3/3` | Security CVE remediation | Fixed/Total |
2421
- | `πŸ’Ύ 22282MB` | Memory usage (Node.js processes) | Real-time |
2422
- | `πŸ“‚ 47%` | Context window usage | From Claude Code |
2423
- | `🧠 10%` | Intelligence score (patterns learned) | 0-100% |
2424
- | `DDD ● 98%` | Domain-Driven Design progress | Percentage |
2425
- | `Security ●CLEAN` | Security audit status | CLEAN/PENDING/FAILED |
2426
- | `Memory ●AgentDB` | Memory backend in use | AgentDB/SQLite/Hybrid |
2427
- | `Integration ●` | agentic-flow integration status | Active/Inactive |
2428
-
2429
- **Usage:**
2430
- ```bash
2431
- # Default: Safe multi-line (avoids Claude Code collision zone)
2432
- npx ruflo@v3alpha hooks statusline
2433
-
2434
- # Single-line mode (completely avoids collision)
2435
- npx ruflo@v3alpha hooks statusline --single
2412
+ | `β–Š Claude Flow V3` | Project header | Always shown |
2413
+ | `● ruvnet` | GitHub user | `gh api user` CLI |
2414
+ | `βŽ‡ main` | Current git branch | `git branch --show-current` |
2415
+ | `Opus 4.6` | Claude model name | Stdin JSON `model.display_name` |
2416
+ | `●42% ctx` | Context window usage | Stdin JSON `context_window.used_percentage` |
2417
+ | `$0.15` | Session cost | Stdin JSON `cost.total_cost_usd` |
2418
+ | `[●●●●○]` | DDD domain progress bar | `.claude-flow/metrics/v3-progress.json` |
2419
+ | `⚑ HNSW 150x` | HNSW search speedup | AgentDB file stats |
2420
+ | `β—‰/β—‹` | Swarm coordination status | Process detection |
2421
+ | `[12/8]` | Active agents / max agents | `ps aux` process count |
2422
+ | `πŸ‘₯ 3` | Sub-agents spawned | Task tool agent count |
2423
+ | `🟒 CVE 3/3` | Security CVE remediation | `.claude-flow/security/audit-status.json` |
2424
+ | `πŸ’Ύ 512MB` | Memory usage | Node.js process RSS |
2425
+ | `🧠 15%` | Intelligence score | Pattern count from AgentDB |
2426
+ | `πŸ“¦ AgentDB ●1.2K` | AgentDB vector count | File size estimate (`size / 2KB`) |
2427
+
2428
+ **Setup (Automatic):**
2429
+
2430
+ Run `npx claude-flow@v3alpha init` β€” this generates `.claude/settings.json` with the correct statusline config and creates the helper script at `.claude/helpers/statusline.cjs`.
2431
+
2432
+ The generated config uses a **fast local script** (no `npx` cold-start):
2433
+ ```json
2434
+ {
2435
+ "statusLine": {
2436
+ "type": "command",
2437
+ "command": "node .claude/helpers/statusline.cjs"
2438
+ }
2439
+ }
2440
+ ```
2436
2441
 
2437
- # Legacy multi-line (original behavior, may have bleeding)
2438
- npx ruflo@v3alpha hooks statusline --legacy
2442
+ > **Note:** Only `type`, `command`, and `padding` are valid statusLine fields. Do not add `refreshMs`, `enabled`, or other fields β€” Claude Code will ignore them.
2439
2443
 
2440
- # JSON output for scripting
2441
- npx ruflo@v3alpha hooks statusline --json
2444
+ **For Existing Users:**
2442
2445
 
2443
- # Compact JSON (single line)
2444
- npx ruflo@v3alpha hooks statusline --compact
2446
+ If your statusline is not updating, run the upgrade command to regenerate helpers and fix the config:
2447
+ ```bash
2448
+ npx claude-flow@v3alpha init --update --settings
2445
2449
  ```
2446
2450
 
2447
- **Collision Zone Fix (Issue #985):**
2451
+ This removes invalid config fields and regenerates the statusline helper with stdin support.
2448
2452
 
2449
- Claude Code writes internal status (e.g., `7s β€’ 1p`) at absolute terminal coordinates (columns 15-25 on the second-to-last line). The safe mode pads the collision line with spaces to push content past column 25, preventing character bleeding.
2450
-
2451
- | Option | Description |
2452
- |--------|-------------|
2453
- | (default) | Safe multi-line with collision zone avoidance |
2454
- | `--single` | Single-line output (complete collision avoidance) |
2455
- | `--legacy` | Original multi-line (may cause bleeding) |
2456
- | `--json` | JSON output with pretty printing |
2457
- | `--compact` | JSON output without formatting |
2453
+ **Stdin JSON Protocol:**
2458
2454
 
2459
- **Claude Code Integration:**
2460
-
2461
- Add to `.claude/settings.json`:
2455
+ Claude Code provides session data via stdin in this format:
2462
2456
  ```json
2463
2457
  {
2464
- "statusLine": {
2465
- "type": "command",
2466
- "command": "npx ruflo@v3alpha hooks statusline --single"
2467
- }
2458
+ "model": { "display_name": "Opus 4.6" },
2459
+ "context_window": { "used_percentage": 42, "remaining_percentage": 58 },
2460
+ "cost": { "total_cost_usd": 0.15, "total_duration_ms": 45000 },
2461
+ "workspace": { "current_dir": "/path/to/project" },
2462
+ "session_id": "abc-123"
2468
2463
  }
2469
2464
  ```
2470
2465
 
2466
+ The statusline script reads stdin synchronously, falls back to local detection when run manually (TTY mode).
2467
+
2471
2468
  **Data Sources:**
2472
- - `.ruflo/metrics/v3-progress.json` - DDD domain progress
2473
- - `.ruflo/metrics/swarm-activity.json` - Active agent counts
2474
- - `.ruflo/security/audit-status.json` - CVE remediation status
2475
- - `.ruflo/learning/patterns.db` - Intelligence score (pattern count)
2476
- - Process detection via `ps aux` - Real-time memory and agent counts
2469
+ - **Stdin JSON** β€” Model name, context %, cost, duration (from Claude Code)
2470
+ - `.claude-flow/metrics/v3-progress.json` β€” DDD domain progress
2471
+ - `.claude-flow/metrics/swarm-activity.json` β€” Active agent counts
2472
+ - `.claude-flow/security/audit-status.json` β€” CVE remediation status
2473
+ - **AgentDB files** β€” Vector count (estimated from file size), HNSW index status
2474
+ - Process detection via `ps aux` β€” Real-time memory and agent counts
2477
2475
  - Git branch via `git branch --show-current`
2478
2476
  - GitHub user via `gh api user`
2479
2477
 
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AAizI1E,eAAO,MAAM,YAAY,EAAE,OAyG1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AA6zI1E,eAAO,MAAM,YAAY,EAAE,OAyG1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -915,13 +915,14 @@ const metricsCommand = {
915
915
  ]
916
916
  });
917
917
  if (v3Dashboard && result.performance) {
918
+ const p = result.performance;
918
919
  output.writeln();
919
920
  output.writeln(output.bold('πŸš€ V3 Performance Gains'));
920
921
  output.printList([
921
- `Flash Attention: ${output.success(result.performance.flashAttention)}`,
922
- `Memory Reduction: ${output.success(result.performance.memoryReduction)}`,
923
- `Search Improvement: ${output.success(result.performance.searchImprovement)}`,
924
- `Token Reduction: ${output.success(result.performance.tokenReduction)}`
922
+ `Flash Attention: ${output.success(p.flashAttention ?? 'N/A')}`,
923
+ `Memory Reduction: ${output.success(p.memoryReduction ?? 'N/A')}`,
924
+ `Search Improvement: ${output.success(p.searchImprovement ?? 'N/A')}`,
925
+ `Token Reduction: ${output.success(p.tokenReduction ?? 'N/A')}`
925
926
  ]);
926
927
  }
927
928
  return { success: true, data: result };
@@ -1634,19 +1635,20 @@ const intelligenceCommand = {
1634
1635
  // SONA Component
1635
1636
  output.writeln();
1636
1637
  output.writeln(output.bold('🧠 SONA (Sub-0.05ms Learning)'));
1637
- if (result.components.sona.enabled) {
1638
+ const sona = result.components?.sona;
1639
+ if (sona?.enabled) {
1638
1640
  output.printTable({
1639
1641
  columns: [
1640
1642
  { key: 'metric', header: 'Metric', width: 25 },
1641
1643
  { key: 'value', header: 'Value', width: 20, align: 'right' }
1642
1644
  ],
1643
1645
  data: [
1644
- { metric: 'Status', value: formatIntelligenceStatus(result.components.sona.status) },
1645
- { metric: 'Learning Time', value: `${result.components.sona.learningTimeMs.toFixed(3)}ms` },
1646
- { metric: 'Adaptation Time', value: `${result.components.sona.adaptationTimeMs.toFixed(3)}ms` },
1647
- { metric: 'Trajectories', value: result.components.sona.trajectoriesRecorded },
1648
- { metric: 'Patterns Learned', value: result.components.sona.patternsLearned },
1649
- { metric: 'Avg Quality', value: `${(result.components.sona.avgQuality * 100).toFixed(1)}%` }
1646
+ { metric: 'Status', value: formatIntelligenceStatus(sona.status) },
1647
+ { metric: 'Learning Time', value: `${(sona.learningTimeMs ?? 0).toFixed(3)}ms` },
1648
+ { metric: 'Adaptation Time', value: `${(sona.adaptationTimeMs ?? 0).toFixed(3)}ms` },
1649
+ { metric: 'Trajectories', value: sona.trajectoriesRecorded ?? 0 },
1650
+ { metric: 'Patterns Learned', value: sona.patternsLearned ?? 0 },
1651
+ { metric: 'Avg Quality', value: `${((sona.avgQuality ?? 0) * 100).toFixed(1)}%` }
1650
1652
  ]
1651
1653
  });
1652
1654
  }
@@ -1656,17 +1658,18 @@ const intelligenceCommand = {
1656
1658
  // MoE Component
1657
1659
  output.writeln();
1658
1660
  output.writeln(output.bold('πŸ”€ Mixture of Experts (MoE)'));
1659
- if (result.components.moe.enabled) {
1661
+ const moe = result.components?.moe;
1662
+ if (moe?.enabled) {
1660
1663
  output.printTable({
1661
1664
  columns: [
1662
1665
  { key: 'metric', header: 'Metric', width: 25 },
1663
1666
  { key: 'value', header: 'Value', width: 20, align: 'right' }
1664
1667
  ],
1665
1668
  data: [
1666
- { metric: 'Status', value: formatIntelligenceStatus(result.components.moe.status) },
1667
- { metric: 'Active Experts', value: result.components.moe.expertsActive },
1668
- { metric: 'Routing Accuracy', value: `${(result.components.moe.routingAccuracy * 100).toFixed(1)}%` },
1669
- { metric: 'Load Balance', value: `${(result.components.moe.loadBalance * 100).toFixed(1)}%` }
1669
+ { metric: 'Status', value: formatIntelligenceStatus(moe.status) },
1670
+ { metric: 'Active Experts', value: moe.expertsActive ?? 0 },
1671
+ { metric: 'Routing Accuracy', value: `${((moe.routingAccuracy ?? 0) * 100).toFixed(1)}%` },
1672
+ { metric: 'Load Balance', value: `${((moe.loadBalance ?? 0) * 100).toFixed(1)}%` }
1670
1673
  ]
1671
1674
  });
1672
1675
  }
@@ -1676,18 +1679,19 @@ const intelligenceCommand = {
1676
1679
  // HNSW Component
1677
1680
  output.writeln();
1678
1681
  output.writeln(output.bold('πŸ” HNSW (150x Faster Search)'));
1679
- if (result.components.hnsw.enabled) {
1682
+ const hnsw = result.components?.hnsw;
1683
+ if (hnsw?.enabled) {
1680
1684
  output.printTable({
1681
1685
  columns: [
1682
1686
  { key: 'metric', header: 'Metric', width: 25 },
1683
1687
  { key: 'value', header: 'Value', width: 20, align: 'right' }
1684
1688
  ],
1685
1689
  data: [
1686
- { metric: 'Status', value: formatIntelligenceStatus(result.components.hnsw.status) },
1687
- { metric: 'Index Size', value: result.components.hnsw.indexSize.toLocaleString() },
1688
- { metric: 'Search Speedup', value: output.success(result.components.hnsw.searchSpeedup) },
1689
- { metric: 'Memory Usage', value: result.components.hnsw.memoryUsage },
1690
- { metric: 'Dimension', value: result.components.hnsw.dimension }
1690
+ { metric: 'Status', value: formatIntelligenceStatus(hnsw.status) },
1691
+ { metric: 'Index Size', value: (hnsw.indexSize ?? 0).toLocaleString() },
1692
+ { metric: 'Search Speedup', value: output.success(hnsw.searchSpeedup ?? 'N/A') },
1693
+ { metric: 'Memory Usage', value: hnsw.memoryUsage ?? 'N/A' },
1694
+ { metric: 'Dimension', value: hnsw.dimension ?? 384 }
1691
1695
  ]
1692
1696
  });
1693
1697
  }
@@ -1697,28 +1701,37 @@ const intelligenceCommand = {
1697
1701
  // Embeddings
1698
1702
  output.writeln();
1699
1703
  output.writeln(output.bold('πŸ“¦ Embeddings (ONNX)'));
1700
- output.printTable({
1701
- columns: [
1702
- { key: 'metric', header: 'Metric', width: 25 },
1703
- { key: 'value', header: 'Value', width: 20, align: 'right' }
1704
- ],
1705
- data: [
1706
- { metric: 'Provider', value: result.components.embeddings.provider },
1707
- { metric: 'Model', value: result.components.embeddings.model },
1708
- { metric: 'Dimension', value: result.components.embeddings.dimension },
1709
- { metric: 'Cache Hit Rate', value: `${(result.components.embeddings.cacheHitRate * 100).toFixed(1)}%` }
1710
- ]
1711
- });
1704
+ const emb = result.components?.embeddings;
1705
+ if (emb) {
1706
+ output.printTable({
1707
+ columns: [
1708
+ { key: 'metric', header: 'Metric', width: 25 },
1709
+ { key: 'value', header: 'Value', width: 20, align: 'right' }
1710
+ ],
1711
+ data: [
1712
+ { metric: 'Provider', value: emb.provider ?? 'N/A' },
1713
+ { metric: 'Model', value: emb.model ?? 'N/A' },
1714
+ { metric: 'Dimension', value: emb.dimension ?? 384 },
1715
+ { metric: 'Cache Hit Rate', value: `${((emb.cacheHitRate ?? 0) * 100).toFixed(1)}%` }
1716
+ ]
1717
+ });
1718
+ }
1719
+ else {
1720
+ output.writeln(output.dim(' Not initialized'));
1721
+ }
1712
1722
  // V3 Performance
1713
- output.writeln();
1714
- output.writeln(output.bold('πŸš€ V3 Performance Gains'));
1715
- output.printList([
1716
- `Flash Attention: ${output.success(result.performance.flashAttention)}`,
1717
- `Memory Reduction: ${output.success(result.performance.memoryReduction)}`,
1718
- `Search Improvement: ${output.success(result.performance.searchImprovement)}`,
1719
- `Token Reduction: ${output.success(result.performance.tokenReduction)}`,
1720
- `SWE-Bench Score: ${output.success(result.performance.sweBenchScore)}`
1721
- ]);
1723
+ const perf = result.performance;
1724
+ if (perf) {
1725
+ output.writeln();
1726
+ output.writeln(output.bold('πŸš€ V3 Performance Gains'));
1727
+ output.printList([
1728
+ `Flash Attention: ${output.success(perf.flashAttention ?? 'N/A')}`,
1729
+ `Memory Reduction: ${output.success(perf.memoryReduction ?? 'N/A')}`,
1730
+ `Search Improvement: ${output.success(perf.searchImprovement ?? 'N/A')}`,
1731
+ `Token Reduction: ${output.success(perf.tokenReduction ?? 'N/A')}`,
1732
+ `SWE-Bench Score: ${output.success(perf.sweBenchScore ?? 'N/A')}`
1733
+ ]);
1734
+ }
1722
1735
  return { success: true, data: result };
1723
1736
  }
1724
1737
  catch (error) {