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
@@ -8,10 +8,10 @@
8
8
  *
9
9
  * Usage:
10
10
  * node node_modules/moflo/bin/semantic-search.mjs "your search query"
11
- * npx moflo-search "your search query"
12
- * npx moflo-search "query" --limit 10
13
- * npx moflo-search "query" --namespace guidance
14
- * npx moflo-search "query" --threshold 0.3
11
+ * npx flo-search "your search query"
12
+ * npx flo-search "query" --limit 10
13
+ * npx flo-search "query" --namespace guidance
14
+ * npx flo-search "query" --threshold 0.3
15
15
  */
16
16
 
17
17
  import { existsSync, readFileSync } from 'fs';
@@ -45,7 +45,7 @@ const json = args.includes('--json');
45
45
  const debug = args.includes('--debug');
46
46
 
47
47
  if (!query) {
48
- console.error('Usage: npx moflo-search "your query" [--limit N] [--namespace X] [--threshold N]');
48
+ console.error('Usage: npx flo-search "your query" [--limit N] [--namespace X] [--threshold N]');
49
49
  process.exit(1);
50
50
  }
51
51
 
@@ -262,7 +262,7 @@ async function generateQueryEmbedding(queryText, db) {
262
262
  // Neural failed — warn about model mismatch
263
263
  if (!json) {
264
264
  console.error('[semantic-search] WARNING: Stored embeddings use neural model but Transformers.js unavailable.');
265
- console.error('[semantic-search] Results may be poor. Run: npx moflo-embeddings --force');
265
+ console.error('[semantic-search] Results may be poor. Run: npx flo-embeddings --force');
266
266
  }
267
267
  }
268
268
 
@@ -6,9 +6,9 @@
6
6
  * adds a CLAUDE.md section so subagents automatically follow the protocol.
7
7
  *
8
8
  * Usage:
9
- * npx moflo-setup # First-time setup
10
- * npx moflo-setup --update # Refresh bootstrap file after moflo upgrade
11
- * npx moflo-setup --check # Check if setup is current
9
+ * npx flo-setup # First-time setup
10
+ * npx flo-setup --update # Refresh bootstrap file after moflo upgrade
11
+ * npx flo-setup --check # Check if setup is current
12
12
  *
13
13
  * What it does:
14
14
  * 1. Copies .claude/guidance/agent-bootstrap.md → project's .claude/guidance/moflo-bootstrap.md
@@ -68,10 +68,10 @@ Load via ToolSearch first: \`+claude-flow memory\`
68
68
 
69
69
  ### Fallback: CLI Scripts
70
70
  \`\`\`bash
71
- npx moflo-search "[query]" --namespace guidance # Semantic search
72
- npx moflo-embeddings # Rebuild embeddings
73
- npx moflo-index # Re-index guidance docs
74
- npx moflo-codemap --force # Regenerate code-map
71
+ npx flo-search "[query]" --namespace guidance # Semantic search
72
+ npx flo-embeddings # Rebuild embeddings
73
+ npx flo-index # Re-index guidance docs
74
+ npx flo-codemap --force # Regenerate code-map
75
75
  \`\`\`
76
76
 
77
77
  ### Where Content Goes
@@ -93,7 +93,7 @@ If \`.claude/guidance/agent-bootstrap.md\` also exists, read it next for project
93
93
  ${MARKER_END}`;
94
94
 
95
95
  function log(msg) {
96
- console.log(`[moflo-setup] ${msg}`);
96
+ console.log(`[flo-setup] ${msg}`);
97
97
  }
98
98
 
99
99
  function findProjectRoot() {
@@ -135,7 +135,7 @@ function copyBootstrap(projectRoot) {
135
135
 
136
136
  // Read source content and prepend auto-generated notice
137
137
  const content = readFileSync(source, 'utf-8');
138
- const header = `<!-- AUTO-GENERATED by moflo-setup. Do not edit — changes will be overwritten. -->
138
+ const header = `<!-- AUTO-GENERATED by flo-setup. Do not edit — changes will be overwritten. -->
139
139
  <!-- Source: node_modules/moflo/.claude/guidance/agent-bootstrap.md -->
140
140
  <!-- To customize, create .claude/guidance/agent-bootstrap.md for project-specific rules. -->
141
141
 
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "moflo",
3
- "version": "4.3.1",
3
+ "version": "4.6.0",
4
4
  "description": "MoFlo — AI agent orchestration for Claude Code. Forked from ruflo/claude-flow with patches applied to source, plus feature-level orchestration.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
7
7
  "bin": {
8
+ "flo": "bin/cli.js",
9
+ "flo-setup": "bin/setup-project.mjs",
10
+ "flo-codemap": "bin/generate-code-map.mjs",
11
+ "flo-search": "bin/semantic-search.mjs",
12
+ "flo-embeddings": "bin/build-embeddings.mjs",
13
+ "flo-index": "bin/index-guidance.mjs",
14
+ "flo-learn": ".claude/helpers/learning-service.mjs",
8
15
  "moflo": "bin/cli.js",
9
- "moflo-setup": "bin/setup-project.mjs",
10
- "moflo-codemap": "bin/generate-code-map.mjs",
11
- "moflo-search": "bin/semantic-search.mjs",
12
- "moflo-embeddings": "bin/build-embeddings.mjs",
13
- "moflo-index": "bin/index-guidance.mjs",
14
- "moflo-learn": ".claude/helpers/learning-service.mjs",
15
16
  "claude-flow": "bin/cli.js"
16
17
  },
17
18
  "homepage": "https://github.com/eric-cielo/moflo#readme",
@@ -83,7 +83,7 @@ const buildCommand = {
83
83
  return { success: false, exitCode: 1 };
84
84
  const steps = [
85
85
  'Collecting kernel artifacts', 'Bundling runtime environment',
86
- 'Packaging ruflo CLI + MCP tools', 'Compressing sections',
86
+ 'Packaging flo CLI + MCP tools', 'Compressing sections',
87
87
  'Computing SHA-256 checksums', 'Writing RVFA container',
88
88
  ];
89
89
  if (profile !== 'cloud' && models.length > 0)
@@ -365,19 +365,19 @@ export const applianceCommand = {
365
365
  aliases: ['rvfa'],
366
366
  subcommands: [buildCommand, inspectCommand, verifyCommand, extractCommand, runCommand, signCommand, publishCommand, updateAppCommand],
367
367
  examples: [
368
- { command: 'ruflo appliance build -p cloud', description: 'Build a cloud appliance' },
369
- { command: 'ruflo appliance inspect -f ruflo.rvf', description: 'Inspect appliance contents' },
370
- { command: 'ruflo appliance verify -f ruflo.rvf', description: 'Verify integrity' },
371
- { command: 'ruflo appliance extract -f ruflo.rvf', description: 'Extract sections' },
372
- { command: 'ruflo appliance run -f ruflo.rvf', description: 'Boot and run appliance' },
373
- { command: 'ruflo appliance sign -f ruflo.rvf --generate-keys', description: 'Generate keys and sign' },
374
- { command: 'ruflo appliance publish -f ruflo.rvf', description: 'Publish to IPFS via Pinata' },
375
- { command: 'ruflo appliance update -f ruflo.rvf -s ruflo -d ./new-ruflo.bin', description: 'Hot-patch a section' },
368
+ { command: 'flo appliance build -p cloud', description: 'Build a cloud appliance' },
369
+ { command: 'flo appliance inspect -f ruflo.rvf', description: 'Inspect appliance contents' },
370
+ { command: 'flo appliance verify -f ruflo.rvf', description: 'Verify integrity' },
371
+ { command: 'flo appliance extract -f ruflo.rvf', description: 'Extract sections' },
372
+ { command: 'flo appliance run -f ruflo.rvf', description: 'Boot and run appliance' },
373
+ { command: 'flo appliance sign -f ruflo.rvf --generate-keys', description: 'Generate keys and sign' },
374
+ { command: 'flo appliance publish -f ruflo.rvf', description: 'Publish to IPFS via Pinata' },
375
+ { command: 'flo appliance update -f ruflo.rvf -s ruflo -d ./new-ruflo.bin', description: 'Hot-patch a section' },
376
376
  ],
377
377
  action: async () => {
378
378
  output.writeln();
379
- output.writeln(output.bold('Ruflo Appliance (RVFA)'));
380
- output.writeln(output.dim('Self-contained deployment format for the full Ruflo platform.'));
379
+ output.writeln(output.bold('MoFlo Appliance (RVFA)'));
380
+ output.writeln(output.dim('Self-contained deployment format for the full MoFlo platform.'));
381
381
  output.writeln();
382
382
  output.writeln('Subcommands:');
383
383
  output.printList([
@@ -398,7 +398,7 @@ export const applianceCommand = {
398
398
  `${output.bold('offline')} - Fully air-gapped with bundled models (~4 GB)`,
399
399
  ]);
400
400
  output.writeln();
401
- output.writeln(output.dim('Use "ruflo appliance <subcommand> --help" for details.'));
401
+ output.writeln(output.dim('Use "flo appliance <subcommand> --help" for details.'));
402
402
  return { success: true };
403
403
  },
404
404
  };
@@ -371,7 +371,7 @@ const allCommand = {
371
371
  action: async (ctx) => {
372
372
  output.writeln();
373
373
  output.writeln(output.bold(output.highlight('═'.repeat(65))));
374
- output.writeln(output.bold(' RuFlo V3 - Full Benchmark Suite'));
374
+ output.writeln(output.bold(' MoFlo V4 - Full Benchmark Suite'));
375
375
  output.writeln(output.bold(output.highlight('═'.repeat(65))));
376
376
  const startTime = Date.now();
377
377
  const allResults = {};
@@ -439,7 +439,7 @@ export const benchmarkCommand = {
439
439
  ],
440
440
  action: async (_ctx) => {
441
441
  output.writeln();
442
- output.writeln(output.bold('RuFlo V3 Benchmark Suite'));
442
+ output.writeln(output.bold('MoFlo V4 Benchmark Suite'));
443
443
  output.writeln(output.dim('─'.repeat(50)));
444
444
  output.writeln();
445
445
  output.writeln('Available subcommands:');
@@ -344,7 +344,7 @@ export const claimsCommand = {
344
344
  ],
345
345
  action: async () => {
346
346
  output.writeln();
347
- output.writeln(output.bold('RuFlo Claims System'));
347
+ output.writeln(output.bold('MoFlo Claims System'));
348
348
  output.writeln(output.dim('Fine-grained authorization and access control'));
349
349
  output.writeln();
350
350
  output.writeln('Subcommands:');
@@ -33,7 +33,7 @@ const initCommand = {
33
33
  const sparc = ctx.flags.sparc;
34
34
  const v3 = ctx.flags.v3;
35
35
  output.writeln();
36
- output.printInfo('Initializing RuFlo configuration...');
36
+ output.printInfo('Initializing MoFlo configuration...');
37
37
  output.writeln();
38
38
  // Create default configuration
39
39
  const config = {
@@ -380,7 +380,7 @@ const showCommand = {
380
380
  { name: 'format', short: 'f', description: 'Output format (json or yaml)', type: 'string', default: 'json' },
381
381
  ],
382
382
  examples: [
383
- { command: 'moflo config show', description: 'Show merged config as JSON' },
383
+ { command: 'flo config show', description: 'Show merged config as JSON' },
384
384
  ],
385
385
  action: async (ctx) => {
386
386
  const { loadMofloConfig } = await import('../config/moflo-config.js');
@@ -395,7 +395,7 @@ const generateCommand = {
395
395
  description: 'Generate moflo.yaml config file',
396
396
  options: [],
397
397
  examples: [
398
- { command: 'moflo config generate', description: 'Auto-detect and write moflo.yaml' },
398
+ { command: 'flo config generate', description: 'Auto-detect and write moflo.yaml' },
399
399
  ],
400
400
  action: async (_ctx) => {
401
401
  const { writeMofloConfig } = await import('../config/moflo-config.js');
@@ -86,6 +86,28 @@ const startCommand = {
86
86
  if (!fs.existsSync(stateDir)) {
87
87
  fs.mkdirSync(stateDir, { recursive: true });
88
88
  }
89
+ // Check if another foreground daemon is already running (prevents duplicate daemons)
90
+ if (fs.existsSync(pidFile)) {
91
+ try {
92
+ const existingPid = parseInt(fs.readFileSync(pidFile, 'utf-8').trim(), 10);
93
+ if (!isNaN(existingPid) && existingPid !== process.pid) {
94
+ try {
95
+ process.kill(existingPid, 0); // Check if alive
96
+ // Another daemon is running — exit silently
97
+ if (!quiet) {
98
+ output.printWarning(`Daemon already running (PID: ${existingPid})`);
99
+ }
100
+ return { success: true };
101
+ }
102
+ catch {
103
+ // Process not running — stale PID file, continue startup
104
+ }
105
+ }
106
+ }
107
+ catch {
108
+ // Can't read PID file — continue startup
109
+ }
110
+ }
89
111
  // Write PID file for foreground mode
90
112
  fs.writeFileSync(pidFile, String(process.pid));
91
113
  // Clean up PID file on exit
@@ -418,7 +440,7 @@ const statusCommand = {
418
440
  `Max Concurrent: ${status.config.maxConcurrent}`,
419
441
  `Max CPU Load: ${status.config.resourceThresholds.maxCpuLoad}`,
420
442
  `Min Free Memory: ${status.config.resourceThresholds.minFreeMemoryPercent}%`,
421
- ].filter(Boolean).join('\n'), 'RuFlo Daemon');
443
+ ].filter(Boolean).join('\n'), 'MoFlo Daemon');
422
444
  output.writeln();
423
445
  output.writeln(output.bold('Worker Status'));
424
446
  const workerData = status.config.workers.map(w => {
@@ -489,7 +511,7 @@ const statusCommand = {
489
511
  `Status: ${output.error('○')} ${output.error('NOT INITIALIZED')}`,
490
512
  '',
491
513
  'Run "claude-flow daemon start" to start the daemon',
492
- ].join('\n'), 'RuFlo Daemon');
514
+ ].join('\n'), 'MoFlo Daemon');
493
515
  return { success: true };
494
516
  }
495
517
  },
@@ -614,7 +636,7 @@ export const daemonCommand = {
614
636
  ],
615
637
  action: async () => {
616
638
  output.writeln();
617
- output.writeln(output.bold('RuFlo Daemon - Background Task Management'));
639
+ output.writeln(output.bold('MoFlo Daemon - Background Task Management'));
618
640
  output.writeln();
619
641
  output.writeln('Node.js-based background worker system that auto-runs like shell daemons.');
620
642
  output.writeln('Manages 12 specialized workers for continuous optimization and monitoring.');
@@ -260,7 +260,7 @@ export const deploymentCommand = {
260
260
  ],
261
261
  action: async () => {
262
262
  output.writeln();
263
- output.writeln(output.bold('RuFlo Deployment'));
263
+ output.writeln(output.bold('MoFlo Deployment'));
264
264
  output.writeln(output.dim('Multi-environment deployment management'));
265
265
  output.writeln();
266
266
  output.writeln('Subcommands:');
@@ -59,12 +59,13 @@ async function checkNpmVersion() {
59
59
  }
60
60
  // Check config file
61
61
  async function checkConfigFile() {
62
- const configPaths = [
62
+ // JSON configs (parse-validated)
63
+ const jsonPaths = [
63
64
  '.claude-flow/config.json',
64
65
  'claude-flow.config.json',
65
66
  '.claude-flow.json'
66
67
  ];
67
- for (const configPath of configPaths) {
68
+ for (const configPath of jsonPaths) {
68
69
  if (existsSync(configPath)) {
69
70
  try {
70
71
  const content = readFileSync(configPath, 'utf8');
@@ -76,6 +77,17 @@ async function checkConfigFile() {
76
77
  }
77
78
  }
78
79
  }
80
+ // YAML configs (existence-checked only — no heavy yaml parser dependency)
81
+ const yamlPaths = [
82
+ '.claude-flow/config.yaml',
83
+ '.claude-flow/config.yml',
84
+ 'claude-flow.config.yaml'
85
+ ];
86
+ for (const configPath of yamlPaths) {
87
+ if (existsSync(configPath)) {
88
+ return { name: 'Config File', status: 'pass', message: `Found: ${configPath}` };
89
+ }
90
+ }
79
91
  return { name: 'Config File', status: 'warn', message: 'No config file (using defaults)', fix: 'claude-flow config init' };
80
92
  }
81
93
  // Check daemon status
@@ -128,9 +140,14 @@ async function checkApiKeys() {
128
140
  found.push(key);
129
141
  }
130
142
  }
143
+ // Detect Claude Code environment — API keys are managed internally
144
+ const inClaudeCode = !!(process.env.CLAUDE_CODE || process.env.CLAUDE_PROJECT_DIR || process.env.MCP_SESSION_ID);
131
145
  if (found.includes('ANTHROPIC_API_KEY') || found.includes('CLAUDE_API_KEY')) {
132
146
  return { name: 'API Keys', status: 'pass', message: `Found: ${found.join(', ')}` };
133
147
  }
148
+ else if (inClaudeCode) {
149
+ return { name: 'API Keys', status: 'pass', message: 'Claude Code (managed internally)' };
150
+ }
134
151
  else if (found.length > 0) {
135
152
  return { name: 'API Keys', status: 'warn', message: `Found: ${found.join(', ')} (no Claude key)`, fix: 'export ANTHROPIC_API_KEY=your_key' };
136
153
  }
@@ -171,12 +188,12 @@ async function checkMcpServers() {
171
188
  const content = JSON.parse(readFileSync(configPath, 'utf8'));
172
189
  const servers = content.mcpServers || content.servers || {};
173
190
  const count = Object.keys(servers).length;
174
- const hasClaudeFlow = 'claude-flow' in servers || 'claude-flow_alpha' in servers;
191
+ const hasClaudeFlow = 'claude-flow' in servers || 'claude-flow_alpha' in servers || 'ruflo' in servers || 'ruflo_alpha' in servers;
175
192
  if (hasClaudeFlow) {
176
- return { name: 'MCP Servers', status: 'pass', message: `${count} servers (claude-flow configured)` };
193
+ return { name: 'MCP Servers', status: 'pass', message: `${count} servers (flo configured)` };
177
194
  }
178
195
  else {
179
- return { name: 'MCP Servers', status: 'warn', message: `${count} servers (claude-flow not found)`, fix: 'claude mcp add claude-flow npx @claude-flow/cli@v3alpha mcp start' };
196
+ return { name: 'MCP Servers', status: 'warn', message: `${count} servers (flo not found)`, fix: 'claude mcp add ruflo -- npx -y ruflo@latest mcp start' };
180
197
  }
181
198
  }
182
199
  catch {
@@ -460,7 +477,7 @@ export const doctorCommand = {
460
477
  const component = ctx.flags.component;
461
478
  const verbose = ctx.flags.verbose;
462
479
  output.writeln();
463
- output.writeln(output.bold('RuFlo Doctor'));
480
+ output.writeln(output.bold('MoFlo Doctor'));
464
481
  output.writeln(output.dim('System diagnostics and health check'));
465
482
  output.writeln(output.dim('─'.repeat(50)));
466
483
  output.writeln();
@@ -1536,7 +1536,7 @@ export const embeddingsCommand = {
1536
1536
  ],
1537
1537
  action: async () => {
1538
1538
  output.writeln();
1539
- output.writeln(output.bold('RuFlo Embeddings'));
1539
+ output.writeln(output.bold('MoFlo Embeddings'));
1540
1540
  output.writeln(output.dim('Vector embeddings and semantic search'));
1541
1541
  output.writeln();
1542
1542
  output.writeln('Core Commands:');
@@ -8,14 +8,14 @@
8
8
  * - Context bracket tracking (FRESH/MODERATE/DEPLETED/CRITICAL)
9
9
  *
10
10
  * Usage from hooks:
11
- * npx moflo gate check-before-scan
12
- * npx moflo gate check-before-read
13
- * npx moflo gate check-before-agent
14
- * npx moflo gate record-task-created
15
- * npx moflo gate record-memory-searched
16
- * npx moflo gate check-bash-memory
17
- * npx moflo gate prompt-reminder
18
- * npx moflo gate session-reset
11
+ * npx flo gate check-before-scan
12
+ * npx flo gate check-before-read
13
+ * npx flo gate check-before-agent
14
+ * npx flo gate record-task-created
15
+ * npx flo gate record-memory-searched
16
+ * npx flo gate check-bash-memory
17
+ * npx flo gate prompt-reminder
18
+ * npx flo gate session-reset
19
19
  */
20
20
  import type { Command } from '../types.js';
21
21
  declare const gateCommand: Command;
@@ -8,14 +8,14 @@
8
8
  * - Context bracket tracking (FRESH/MODERATE/DEPLETED/CRITICAL)
9
9
  *
10
10
  * Usage from hooks:
11
- * npx moflo gate check-before-scan
12
- * npx moflo gate check-before-read
13
- * npx moflo gate check-before-agent
14
- * npx moflo gate record-task-created
15
- * npx moflo gate record-memory-searched
16
- * npx moflo gate check-bash-memory
17
- * npx moflo gate prompt-reminder
18
- * npx moflo gate session-reset
11
+ * npx flo gate check-before-scan
12
+ * npx flo gate check-before-read
13
+ * npx flo gate check-before-agent
14
+ * npx flo gate record-task-created
15
+ * npx flo gate record-memory-searched
16
+ * npx flo gate check-bash-memory
17
+ * npx flo gate prompt-reminder
18
+ * npx flo gate session-reset
19
19
  */
20
20
  import { processGateCommand } from '../services/workflow-gate.js';
21
21
  const gateCommand = {
@@ -23,15 +23,15 @@ const gateCommand = {
23
23
  description: 'Workflow gate enforcement for Claude Code hooks',
24
24
  options: [],
25
25
  examples: [
26
- { command: 'moflo gate check-before-scan', description: 'Check memory-first before Glob/Grep' },
27
- { command: 'moflo gate check-before-agent', description: 'Check TaskCreate before Agent tool' },
28
- { command: 'moflo gate prompt-reminder', description: 'Reset per-prompt state, show context bracket' },
29
- { command: 'moflo gate session-reset', description: 'Reset all workflow state' },
26
+ { command: 'flo gate check-before-scan', description: 'Check memory-first before Glob/Grep' },
27
+ { command: 'flo gate check-before-agent', description: 'Check TaskCreate before Agent tool' },
28
+ { command: 'flo gate prompt-reminder', description: 'Reset per-prompt state, show context bracket' },
29
+ { command: 'flo gate session-reset', description: 'Reset all workflow state' },
30
30
  ],
31
31
  action: async (ctx) => {
32
32
  const subcommand = ctx.args?.[0];
33
33
  if (!subcommand) {
34
- console.log('Usage: moflo gate <command>');
34
+ console.log('Usage: flo gate <command>');
35
35
  console.log('');
36
36
  console.log('Commands:');
37
37
  console.log(' check-before-scan Check memory searched before Glob/Grep');
@@ -2790,7 +2790,7 @@ const statuslineCommand = {
2790
2790
  return '[' + '●'.repeat(filled) + '○'.repeat(empty) + ']';
2791
2791
  };
2792
2792
  // Generate lines
2793
- let header = `${c.bold}${c.brightPurple}▊ RuFlo V3 ${c.reset}`;
2793
+ let header = `${c.bold}${c.brightPurple}▊ MoFlo V4${c.reset}`;
2794
2794
  header += `${swarm.coordinationActive ? c.brightCyan : c.dim}● ${c.brightCyan}${user.name}${c.reset}`;
2795
2795
  if (user.gitBranch) {
2796
2796
  header += ` ${c.dim}│${c.reset} ${c.brightBlue}⎇ ${user.gitBranch}${c.reset}`;
@@ -11,7 +11,7 @@ import { executeInit, executeUpgrade, executeUpgradeWithMissing, DEFAULT_INIT_OP
11
11
  async function initCodexAction(ctx, options) {
12
12
  const { force, minimal, full, dualMode } = options;
13
13
  output.writeln();
14
- output.writeln(output.bold('Initializing RuFlo V3 for OpenAI Codex'));
14
+ output.writeln(output.bold('Initializing MoFlo V4 for OpenAI Codex'));
15
15
  output.writeln();
16
16
  // Determine template
17
17
  const template = minimal ? 'minimal' : full ? 'full' : 'default';
@@ -21,9 +21,11 @@ async function initCodexAction(ctx, options) {
21
21
  // Dynamic import of the Codex initializer with lazy loading fallback
22
22
  let CodexInitializer;
23
23
  // Try multiple resolution strategies for the @claude-flow/codex package
24
+ // Use a variable to prevent TypeScript from statically resolving the optional module
25
+ const codexModuleId = '@claude-flow/codex';
24
26
  const resolutionStrategies = [
25
27
  // Strategy 1: Direct import (works if installed as CLI dependency)
26
- async () => (await import('@claude-flow/codex')).CodexInitializer,
28
+ async () => (await import(codexModuleId)).CodexInitializer,
27
29
  // Strategy 2: Project node_modules (works if installed in user's project)
28
30
  async () => {
29
31
  const projectPath = path.join(ctx.cwd, 'node_modules', '@claude-flow', 'codex', 'dist', 'index.js');
@@ -180,7 +182,7 @@ const initAction = async (ctx) => {
180
182
  const initialized = isInitialized(cwd);
181
183
  const hasExisting = initialized.claude || initialized.claudeFlow;
182
184
  if (hasExisting && !force) {
183
- output.printWarning('RuFlo appears to be already initialized');
185
+ output.printWarning('MoFlo appears to be already initialized');
184
186
  if (initialized.claude)
185
187
  output.printInfo(' Found: .claude/settings.json');
186
188
  if (initialized.claudeFlow)
@@ -200,7 +202,7 @@ const initAction = async (ctx) => {
200
202
  }
201
203
  }
202
204
  output.writeln();
203
- output.writeln(output.bold('Initializing RuFlo V3'));
205
+ output.writeln(output.bold('Initializing MoFlo V4'));
204
206
  output.writeln();
205
207
  // Build init options based on flags
206
208
  let options;
@@ -240,7 +242,7 @@ const initAction = async (ctx) => {
240
242
  }
241
243
  return { success: false, exitCode: 1 };
242
244
  }
243
- spinner.succeed('RuFlo V3 initialized successfully!');
245
+ spinner.succeed('MoFlo V4 initialized successfully!');
244
246
  output.writeln();
245
247
  // Display summary
246
248
  const summary = [];
@@ -391,7 +393,7 @@ const wizardCommand = {
391
393
  description: 'Interactive setup wizard for comprehensive configuration',
392
394
  action: async (ctx) => {
393
395
  output.writeln();
394
- output.writeln(output.bold('RuFlo V3 Setup Wizard'));
396
+ output.writeln(output.bold('MoFlo V4 Setup Wizard'));
395
397
  output.writeln(output.dim('Answer questions to configure your project'));
396
398
  output.writeln();
397
399
  try {
@@ -625,7 +627,7 @@ const wizardCommand = {
625
627
  // Check subcommand
626
628
  const checkCommand = {
627
629
  name: 'check',
628
- description: 'Check if RuFlo is initialized',
630
+ description: 'Check if MoFlo is initialized',
629
631
  action: async (ctx) => {
630
632
  const initialized = isInitialized(ctx.cwd);
631
633
  const result = {
@@ -642,7 +644,7 @@ const checkCommand = {
642
644
  return { success: true, data: result };
643
645
  }
644
646
  if (result.initialized) {
645
- output.printSuccess('RuFlo is initialized');
647
+ output.printSuccess('MoFlo is initialized');
646
648
  if (initialized.claude) {
647
649
  output.printInfo(` Claude Code: .claude/settings.json`);
648
650
  }
@@ -651,8 +653,8 @@ const checkCommand = {
651
653
  }
652
654
  }
653
655
  else {
654
- output.printWarning('RuFlo is not initialized in this directory');
655
- output.printInfo('Run "ruflo init" to initialize');
656
+ output.printWarning('MoFlo is not initialized in this directory');
657
+ output.printInfo('Run "flo init" to initialize');
656
658
  }
657
659
  return { success: true, data: result };
658
660
  },
@@ -795,7 +797,7 @@ const upgradeCommand = {
795
797
  const addMissing = (ctx.flags['add-missing'] || ctx.flags.addMissing);
796
798
  const upgradeSettings = (ctx.flags.settings);
797
799
  output.writeln();
798
- output.writeln(output.bold('Upgrading RuFlo'));
800
+ output.writeln(output.bold('Upgrading MoFlo'));
799
801
  if (addMissing && upgradeSettings) {
800
802
  output.writeln(output.dim('Updates helpers, settings, and adds any missing skills/agents/commands'));
801
803
  }
@@ -895,7 +897,7 @@ const upgradeCommand = {
895
897
  // Main init command
896
898
  export const initCommand = {
897
899
  name: 'init',
898
- description: 'Initialize RuFlo in the current directory',
900
+ description: 'Initialize MoFlo in the current directory',
899
901
  subcommands: [wizardCommand, checkCommand, skillsCommand, hooksCommand, upgradeCommand],
900
902
  options: [
901
903
  {
@@ -1435,7 +1435,7 @@ export const neuralCommand = {
1435
1435
  ],
1436
1436
  action: async () => {
1437
1437
  output.writeln();
1438
- output.writeln(output.bold('RuFlo Neural System'));
1438
+ output.writeln(output.bold('MoFlo Neural System'));
1439
1439
  output.writeln(output.dim('Advanced AI pattern learning and inference'));
1440
1440
  output.writeln();
1441
1441
  output.writeln('Use --help with subcommands for more info');
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * MoFlo Orc Command
3
- * Feature orchestrator that sequences GitHub issues through /mf workflows.
3
+ * Feature orchestrator that sequences GitHub issues through /flo workflows.
4
4
  *
5
5
  * Loads a feature YAML definition, resolves story dependencies via topological
6
- * sort, then executes each story sequentially by spawning `claude -p "/mf ..."`.
6
+ * sort, then executes each story sequentially by spawning `claude -p "/flo ..."`.
7
7
  *
8
8
  * Usage:
9
- * moflo orc run <feature.yaml> Execute a feature
10
- * moflo orc run <feature.yaml> --dry-run Show execution plan
11
- * moflo orc status <feature-id> Check progress
12
- * moflo orc reset <feature-id> Reset for re-run
9
+ * flo orc run <feature.yaml> Execute a feature
10
+ * flo orc run <feature.yaml> --dry-run Show execution plan
11
+ * flo orc status <feature-id> Check progress
12
+ * flo orc reset <feature-id> Reset for re-run
13
13
  */
14
14
  import type { Command } from '../types.js';
15
15
  declare const orcCommand: Command;