moflo 4.3.1 → 4.6.0

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 (66) hide show
  1. package/.claude/guidance/agent-bootstrap.md +2 -2
  2. package/.claude/guidance/guidance-memory-strategy.md +262 -0
  3. package/.claude/guidance/memory-strategy.md +204 -0
  4. package/.claude/guidance/moflo.md +594 -0
  5. package/.claude/guidance/task-swarm-integration.md +348 -0
  6. package/.claude/helpers/hook-handler.cjs +83 -1
  7. package/.claude/helpers/metrics-db.mjs +492 -488
  8. package/.claude/helpers/statusline.cjs +85 -16
  9. package/.claude/settings.json +10 -25
  10. package/.claude/settings.local.json +14 -0
  11. package/README.md +279 -181
  12. package/bin/build-embeddings.mjs +2 -2
  13. package/bin/generate-code-map.mjs +1 -1
  14. package/bin/index-guidance.mjs +85 -15
  15. package/bin/semantic-search.mjs +6 -6
  16. package/bin/setup-project.mjs +9 -9
  17. package/package.json +8 -7
  18. package/src/@claude-flow/cli/dist/src/commands/appliance.js +12 -12
  19. package/src/@claude-flow/cli/dist/src/commands/benchmark.js +2 -2
  20. package/src/@claude-flow/cli/dist/src/commands/claims.js +1 -1
  21. package/src/@claude-flow/cli/dist/src/commands/config.js +3 -3
  22. package/src/@claude-flow/cli/dist/src/commands/daemon.js +25 -3
  23. package/src/@claude-flow/cli/dist/src/commands/deployment.js +1 -1
  24. package/src/@claude-flow/cli/dist/src/commands/doctor.js +23 -6
  25. package/src/@claude-flow/cli/dist/src/commands/embeddings.js +1 -1
  26. package/src/@claude-flow/cli/dist/src/commands/gate.d.ts +8 -8
  27. package/src/@claude-flow/cli/dist/src/commands/gate.js +13 -13
  28. package/src/@claude-flow/cli/dist/src/commands/hooks.js +1 -1
  29. package/src/@claude-flow/cli/dist/src/commands/init.js +14 -12
  30. package/src/@claude-flow/cli/dist/src/commands/neural.js +1 -1
  31. package/src/@claude-flow/cli/dist/src/commands/orc.d.ts +6 -6
  32. package/src/@claude-flow/cli/dist/src/commands/orc.js +25 -25
  33. package/src/@claude-flow/cli/dist/src/commands/performance.js +1 -1
  34. package/src/@claude-flow/cli/dist/src/commands/plugins.js +1 -1
  35. package/src/@claude-flow/cli/dist/src/commands/providers.js +1 -1
  36. package/src/@claude-flow/cli/dist/src/commands/security.js +1 -1
  37. package/src/@claude-flow/cli/dist/src/commands/start.js +11 -11
  38. package/src/@claude-flow/cli/dist/src/commands/status.js +3 -3
  39. package/src/@claude-flow/cli/dist/src/commands/transfer-store.js +1 -1
  40. package/src/@claude-flow/cli/dist/src/config/moflo-config.d.ts +30 -0
  41. package/src/@claude-flow/cli/dist/src/config/moflo-config.js +103 -7
  42. package/src/@claude-flow/cli/dist/src/index.d.ts +1 -1
  43. package/src/@claude-flow/cli/dist/src/index.js +3 -3
  44. package/src/@claude-flow/cli/dist/src/init/claudemd-generator.js +1 -1
  45. package/src/@claude-flow/cli/dist/src/init/executor.js +9 -12
  46. package/src/@claude-flow/cli/dist/src/init/helpers-generator.js +640 -640
  47. package/src/@claude-flow/cli/dist/src/init/moflo-init.js +522 -67
  48. package/src/@claude-flow/cli/dist/src/init/settings-generator.js +7 -12
  49. package/src/@claude-flow/cli/dist/src/init/statusline-generator.d.ts +1 -1
  50. package/src/@claude-flow/cli/dist/src/init/statusline-generator.js +784 -784
  51. package/src/@claude-flow/cli/dist/src/mcp-tools/agentdb-tools.js +12 -12
  52. package/src/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +122 -66
  53. package/src/@claude-flow/cli/dist/src/memory/intelligence.js +5 -1
  54. package/src/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +1 -1
  55. package/src/@claude-flow/cli/dist/src/memory/memory-initializer.js +371 -371
  56. package/src/@claude-flow/cli/dist/src/parser.d.ts +10 -0
  57. package/src/@claude-flow/cli/dist/src/parser.js +49 -3
  58. package/src/@claude-flow/cli/dist/src/plugins/store/discovery.js +1 -1
  59. package/src/@claude-flow/cli/dist/src/runtime/headless.js +30 -30
  60. package/src/@claude-flow/cli/dist/src/services/claim-service.js +1 -1
  61. package/src/@claude-flow/cli/dist/src/services/ruvector-training.js +11 -5
  62. package/src/@claude-flow/cli/dist/src/services/workflow-gate.d.ts +13 -3
  63. package/src/@claude-flow/cli/dist/src/services/workflow-gate.js +73 -5
  64. package/src/@claude-flow/cli/dist/src/types.d.ts +1 -1
  65. package/src/@claude-flow/cli/dist/src/types.js +1 -1
  66. package/src/@claude-flow/memory/package.json +44 -42
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * RuFlo V3 Statusline Generator (Optimized)
3
+ * Moflo V4 Statusline Generator (Optimized)
4
4
  * Displays real-time V3 implementation progress and system status
5
5
  *
6
6
  * Usage: node statusline.cjs [--json] [--compact]
@@ -26,6 +26,68 @@ const CONFIG = {
26
26
 
27
27
  const CWD = process.cwd();
28
28
 
29
+ // Load status_line config from moflo.yaml (show/hide individual items)
30
+ function loadStatusLineConfig() {
31
+ const defaults = {
32
+ enabled: true,
33
+ branding: 'Moflo V4',
34
+ show_git: true,
35
+ show_model: true,
36
+ show_session: true,
37
+ show_intelligence: true,
38
+ show_swarm: true,
39
+ show_hooks: true,
40
+ show_mcp: true,
41
+ show_security: true,
42
+ show_adrs: true,
43
+ show_agentdb: true,
44
+ show_tests: true,
45
+ mode: 'single-line',
46
+ };
47
+
48
+ // Try moflo.yaml
49
+ const yamlPath = path.join(CWD, 'moflo.yaml');
50
+ if (fs.existsSync(yamlPath)) {
51
+ try {
52
+ const content = fs.readFileSync(yamlPath, 'utf-8');
53
+ // Parse status_line block with simple regex
54
+ const block = content.match(/status_line:\s*\n((?:\s+\w+:.*\n?)+)/);
55
+ if (block) {
56
+ const lines = block[1].split('\n');
57
+ for (const line of lines) {
58
+ const m = line.match(/^\s+(\w+):\s*(.+)/);
59
+ if (!m) continue;
60
+ const [, key, val] = m;
61
+ const v = val.trim().replace(/^["']|["']$/g, '');
62
+ if (key === 'enabled') defaults.enabled = v !== 'false';
63
+ else if (key === 'branding') defaults.branding = v;
64
+ else if (key === 'mode') defaults.mode = v;
65
+ else if (key.startsWith('show_')) defaults[key] = v !== 'false';
66
+ }
67
+ }
68
+ } catch { /* ignore */ }
69
+ }
70
+
71
+ // Try moflo.config.json
72
+ const jsonPath = path.join(CWD, 'moflo.config.json');
73
+ if (!fs.existsSync(yamlPath) && fs.existsSync(jsonPath)) {
74
+ try {
75
+ const raw = JSON.parse(fs.readFileSync(jsonPath, 'utf-8'));
76
+ const sl = raw.status_line || raw.statusLine || {};
77
+ for (const key of Object.keys(defaults)) {
78
+ if (sl[key] !== undefined) defaults[key] = sl[key];
79
+ // Also check camelCase variants
80
+ const camel = key.replace(/_(\w)/g, (_, c) => c.toUpperCase());
81
+ if (sl[camel] !== undefined) defaults[key] = sl[camel];
82
+ }
83
+ } catch { /* ignore */ }
84
+ }
85
+
86
+ return defaults;
87
+ }
88
+
89
+ const SL_CONFIG = loadStatusLineConfig();
90
+
29
91
  // ANSI colors
30
92
  const c = {
31
93
  reset: '\x1b[0m',
@@ -53,6 +115,7 @@ function safeExec(cmd, timeoutMs = 2000) {
53
115
  encoding: 'utf-8',
54
116
  timeout: timeoutMs,
55
117
  stdio: ['pipe', 'pipe', 'pipe'],
118
+ windowsHide: true,
56
119
  }).trim();
57
120
  } catch {
58
121
  return '';
@@ -546,17 +609,19 @@ function generateStatusline() {
546
609
  const hooks = getHooksStatus();
547
610
  const integration = getIntegrationStatus();
548
611
 
612
+ if (!SL_CONFIG.enabled) return '';
613
+
549
614
  const parts = [];
550
615
 
551
- // Branding
552
- parts.push(`${c.bold}${c.brightPurple}\u258A RuFlo V3${c.reset}`);
616
+ // Branding (always shown when enabled)
617
+ parts.push(`${c.bold}${c.brightPurple}\u258A ${SL_CONFIG.branding}${c.reset}`);
553
618
 
554
619
  // User + swarm indicator
555
620
  const dot = swarm.coordinationActive ? `${c.brightGreen}\u25CF${c.reset}` : `${c.brightCyan}\u25CF${c.reset}`;
556
621
  parts.push(`${dot} ${c.brightCyan}${git.name}${c.reset}`);
557
622
 
558
623
  // Git branch + changes
559
- if (git.gitBranch) {
624
+ if (SL_CONFIG.show_git && git.gitBranch) {
560
625
  let branchPart = `${c.brightBlue}\u23C7 ${git.gitBranch}${c.reset}`;
561
626
  const changes = [];
562
627
  if (git.staged > 0) changes.push(`${c.brightGreen}+${git.staged}${c.reset}`);
@@ -569,29 +634,33 @@ function generateStatusline() {
569
634
  }
570
635
 
571
636
  // Model
572
- parts.push(`${c.purple}${modelName}${c.reset}`);
637
+ if (SL_CONFIG.show_model) {
638
+ parts.push(`${c.purple}${modelName}${c.reset}`);
639
+ }
573
640
 
574
641
  // Session duration
575
- if (session.duration) {
642
+ if (SL_CONFIG.show_session && session.duration) {
576
643
  parts.push(`${c.cyan}\u23F1 ${session.duration}${c.reset}`);
577
644
  }
578
645
 
579
646
  // Intelligence %
580
- const intellColor = system.intelligencePct >= 80 ? c.brightGreen : system.intelligencePct >= 40 ? c.brightYellow : c.dim;
581
- parts.push(`${intellColor}\u25CF ${system.intelligencePct}%${c.reset}`);
647
+ if (SL_CONFIG.show_intelligence) {
648
+ const intellColor = system.intelligencePct >= 80 ? c.brightGreen : system.intelligencePct >= 40 ? c.brightYellow : c.dim;
649
+ parts.push(`${intellColor}\u25CF ${system.intelligencePct}%${c.reset}`);
650
+ }
582
651
 
583
652
  // Swarm agents (only if active)
584
- if (swarm.activeAgents > 0 || swarm.coordinationActive) {
653
+ if (SL_CONFIG.show_swarm && (swarm.activeAgents > 0 || swarm.coordinationActive)) {
585
654
  parts.push(`${c.brightYellow}\u25C9 ${swarm.activeAgents}/${swarm.maxAgents}${c.reset}`);
586
655
  }
587
656
 
588
657
  // Hooks (compact)
589
- if (hooks.enabled > 0) {
658
+ if (SL_CONFIG.show_hooks && hooks.enabled > 0) {
590
659
  parts.push(`${c.brightGreen}\u2713${hooks.enabled}h${c.reset}`);
591
660
  }
592
661
 
593
662
  // MCP (compact)
594
- if (integration.mcpServers.total > 0) {
663
+ if (SL_CONFIG.show_mcp && integration.mcpServers.total > 0) {
595
664
  const mcpCol = integration.mcpServers.enabled === integration.mcpServers.total ? c.brightGreen : c.brightYellow;
596
665
  parts.push(`${mcpCol}MCP${integration.mcpServers.enabled}${c.reset}`);
597
666
  }
@@ -616,7 +685,7 @@ function generateDashboard() {
616
685
  const lines = [];
617
686
 
618
687
  // Header
619
- let header = `${c.bold}${c.brightPurple}\u258A RuFlo V3 ${c.reset}`;
688
+ let header = `${c.bold}${c.brightPurple}\u258A ${SL_CONFIG.branding}${c.reset}`;
620
689
  header += `${swarm.coordinationActive ? c.brightCyan : c.dim}\u25CF ${c.brightCyan}${git.name}${c.reset}`;
621
690
  if (git.gitBranch) {
622
691
  header += ` ${c.dim}\u2502${c.reset} ${c.brightBlue}\u23C7 ${git.gitBranch}${c.reset}`;
@@ -734,9 +803,9 @@ if (process.argv.includes('--json')) {
734
803
  console.log(JSON.stringify(generateJSON(), null, 2));
735
804
  } else if (process.argv.includes('--compact')) {
736
805
  console.log(JSON.stringify(generateJSON()));
737
- } else if (process.argv.includes('--single-line')) {
738
- console.log(generateStatusline());
739
- } else {
740
- // Default: multi-line dashboard
806
+ } else if (process.argv.includes('--dashboard') || SL_CONFIG.mode === 'dashboard') {
741
807
  console.log(generateDashboard());
808
+ } else {
809
+ // Default: single-line statusline
810
+ console.log(generateStatusline());
742
811
  }
@@ -8,31 +8,16 @@
8
8
  },
9
9
  "permissions": {
10
10
  "allow": [
11
- "Bash(npx @claude-flow*)",
12
- "Bash(npx claude-flow*)",
13
- "Bash(node .claude/*)",
14
- "Bash(npm run:*)",
15
- "Bash(npm test:*)",
16
- "Bash(git status)",
17
- "Bash(git diff:*)",
18
- "Bash(git log:*)",
19
- "Bash(git add:*)",
20
- "Bash(git commit:*)",
21
- "Bash(git push)",
22
- "Bash(git config:*)",
23
- "Bash(git tag:*)",
24
- "Bash(git branch:*)",
25
- "Bash(git checkout:*)",
26
- "Bash(git stash:*)",
27
- "Bash(jq:*)",
28
- "Bash(node:*)",
29
- "Bash(which:*)",
30
- "Bash(pwd)",
31
- "Bash(ls:*)",
32
- "Bash(npx:*)",
33
- "mcp__claude-flow__*",
34
- "mcp__ruv-swarm__*",
35
- "mcp__flow-nexus__*"
11
+ "Bash",
12
+ "Read",
13
+ "Write",
14
+ "Edit",
15
+ "MultiEdit",
16
+ "Glob",
17
+ "Grep",
18
+ "Task",
19
+ "WebFetch(domain:*)",
20
+ "mcp__*"
36
21
  ],
37
22
  "deny": [
38
23
  "Read(./.env)",
@@ -0,0 +1,14 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(node -e \"require\\(''''./.claude/helpers/hook-handler.cjs''''\\)\")",
5
+ "Bash(node -e \"require\\(''./.claude/helpers/hook-handler.cjs''\\)\")",
6
+ "Bash(grep -n \"^## \\\\|^---$\" .claude/guidance/moflo.md)",
7
+ "Bash(tasklist /FI 'IMAGENAME eq node.exe' /V)",
8
+ "Bash(tasklist.exe /FI \"IMAGENAME eq node.exe\" /V)",
9
+ "Bash(powershell.exe -NoProfile -Command \"Get-Process node -ErrorAction SilentlyContinue | Select-Object Id,ProcessName,StartTime,CommandLine | Format-Table -AutoSize\")",
10
+ "Bash(npm version:*)",
11
+ "Bash(gh pr:*)"
12
+ ]
13
+ }
14
+ }