moflo 4.8.32 → 4.8.34

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 (40) hide show
  1. package/bin/generate-code-map.mjs +955 -955
  2. package/bin/index-guidance.mjs +905 -905
  3. package/bin/index-tests.mjs +728 -728
  4. package/bin/setup-project.mjs +252 -252
  5. package/package.json +10 -5
  6. package/src/@claude-flow/cli/dist/src/commands/doctor.js +1339 -1107
  7. package/src/@claude-flow/cli/dist/src/index.js +2 -18
  8. package/src/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +17 -0
  9. package/src/@claude-flow/cli/dist/src/memory/memory-initializer.js +4 -7
  10. package/src/@claude-flow/cli/dist/src/version.js +6 -0
  11. package/src/@claude-flow/cli/package.json +1 -1
  12. package/src/@claude-flow/neural/README.md +260 -0
  13. package/src/@claude-flow/neural/dist/algorithms/a2c.js +361 -0
  14. package/src/@claude-flow/neural/dist/algorithms/curiosity.js +392 -0
  15. package/src/@claude-flow/neural/dist/algorithms/decision-transformer.js +415 -0
  16. package/src/@claude-flow/neural/dist/algorithms/dqn.js +303 -0
  17. package/src/@claude-flow/neural/dist/algorithms/index.js +74 -0
  18. package/src/@claude-flow/neural/dist/algorithms/ppo.js +331 -0
  19. package/src/@claude-flow/neural/dist/algorithms/q-learning.js +259 -0
  20. package/src/@claude-flow/neural/dist/algorithms/sarsa.js +297 -0
  21. package/src/@claude-flow/neural/dist/application/index.js +7 -0
  22. package/src/@claude-flow/neural/dist/application/services/neural-application-service.js +161 -0
  23. package/src/@claude-flow/neural/dist/domain/entities/pattern.js +134 -0
  24. package/src/@claude-flow/neural/dist/domain/index.js +8 -0
  25. package/src/@claude-flow/neural/dist/domain/services/learning-service.js +195 -0
  26. package/src/@claude-flow/neural/dist/index.js +201 -0
  27. package/src/@claude-flow/neural/dist/modes/balanced.js +234 -0
  28. package/src/@claude-flow/neural/dist/modes/base.js +77 -0
  29. package/src/@claude-flow/neural/dist/modes/batch.js +316 -0
  30. package/src/@claude-flow/neural/dist/modes/edge.js +310 -0
  31. package/src/@claude-flow/neural/dist/modes/index.js +13 -0
  32. package/src/@claude-flow/neural/dist/modes/real-time.js +196 -0
  33. package/src/@claude-flow/neural/dist/modes/research.js +389 -0
  34. package/src/@claude-flow/neural/dist/pattern-learner.js +603 -0
  35. package/src/@claude-flow/neural/dist/reasoning-bank.js +993 -0
  36. package/src/@claude-flow/neural/dist/reasoningbank-adapter.js +463 -0
  37. package/src/@claude-flow/neural/dist/sona-integration.js +326 -0
  38. package/src/@claude-flow/neural/dist/sona-manager.js +695 -0
  39. package/src/@claude-flow/neural/dist/types.js +11 -0
  40. package/src/@claude-flow/neural/package.json +26 -0
@@ -1,253 +1,253 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * MoFlo Project Setup
4
- *
5
- * Copies the agent-bootstrap guidance into the consuming project and
6
- * adds a CLAUDE.md section so subagents automatically follow the protocol.
7
- *
8
- * Usage:
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
- *
13
- * What it does:
14
- * 1. Copies .claude/guidance/agent-bootstrap.md → project's .claude/guidance/moflo-bootstrap.md
15
- * 2. Appends a subagent protocol section to CLAUDE.md (idempotent, with markers)
16
- *
17
- * The project can layer its own .claude/guidance/agent-bootstrap.md on top for
18
- * project-specific rules (companyId, entity templates, etc.).
19
- */
20
-
21
- import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync } from 'node:fs';
22
- import { dirname, resolve, join } from 'node:path';
23
- import { fileURLToPath } from 'node:url';
24
-
25
- const __dirname = dirname(fileURLToPath(import.meta.url));
26
- const mofloRoot = resolve(__dirname, '..');
27
-
28
- const args = process.argv.slice(2);
29
- const updateOnly = args.includes('--update');
30
- const checkOnly = args.includes('--check');
31
-
32
- // Markers for idempotent CLAUDE.md updates — keep in sync with claudemd-generator.ts
33
- const MARKER_START = '<!-- MOFLO:INJECTED:START -->';
34
- const MARKER_END = '<!-- MOFLO:INJECTED:END -->';
35
- // Legacy markers to detect and replace
36
- const LEGACY_STARTS = ['<!-- MOFLO:SUBAGENT-PROTOCOL:START -->', '<!-- MOFLO:START -->'];
37
- const LEGACY_ENDS = ['<!-- MOFLO:SUBAGENT-PROTOCOL:END -->', '<!-- MOFLO:END -->'];
38
-
39
- // Minimal injection — just enough for Claude to work with moflo.
40
- // All detailed docs live in .claude/guidance/shipped/moflo.md.
41
- const CLAUDE_MD_SECTION = `${MARKER_START}
42
- ## MoFlo — AI Agent Orchestration
43
-
44
- This project uses [MoFlo](https://github.com/eric-cielo/moflo) for AI-assisted development workflows.
45
-
46
- ### FIRST ACTION ON EVERY PROMPT: Search Memory
47
-
48
- Your first tool call for every new user prompt MUST be a memory search. Do this BEFORE Glob, Grep, Read, or any file exploration.
49
-
50
- \`\`\`
51
- mcp__moflo__memory_search — query: "<task description>", namespace: "guidance" or "patterns" or "code-map"
52
- \`\`\`
53
-
54
- Search \`guidance\` and \`patterns\` namespaces on every prompt. Search \`code-map\` when navigating the codebase.
55
- When the user asks you to remember something: \`mcp__moflo__memory_store\` with namespace \`knowledge\`.
56
-
57
- ### Workflow Gates (enforced automatically)
58
-
59
- - **Memory-first**: Must search memory before Glob/Grep/Read
60
- - **TaskCreate-first**: Must call TaskCreate before spawning Agent tool
61
-
62
- - **Task Icons**: \`TaskCreate\` MUST use ICON+[Role] format — see \`.claude/guidance/task-icons.md\`
63
-
64
- ### MCP Tools (preferred over CLI)
65
-
66
- | Tool | Purpose |
67
- |------|---------|
68
- | \`mcp__moflo__memory_search\` | Semantic search across indexed knowledge |
69
- | \`mcp__moflo__memory_store\` | Store patterns and decisions |
70
- | \`mcp__moflo__hooks_route\` | Route task to optimal agent type |
71
- | \`mcp__moflo__hooks_pre-task\` | Record task start |
72
- | \`mcp__moflo__hooks_post-task\` | Record task completion for learning |
73
-
74
- ### CLI Fallback
75
-
76
- \`\`\`bash
77
- npx flo-search "[query]" --namespace guidance # Semantic search
78
- npx flo doctor --fix # Health check
79
- \`\`\`
80
-
81
- ### Full Reference
82
-
83
- For CLI commands, hooks, agents, swarm config, memory commands, and moflo.yaml options, see:
84
- \`.claude/guidance/shipped/moflo.md\`
85
- ${MARKER_END}`;
86
-
87
- function log(msg) {
88
- console.log(`[flo-setup] ${msg}`);
89
- }
90
-
91
- function findProjectRoot() {
92
- // Walk up from cwd looking for package.json that depends on moflo
93
- let dir = process.cwd();
94
- const root = resolve(dir, '/');
95
-
96
- while (dir !== root) {
97
- const pkgPath = join(dir, 'package.json');
98
- if (existsSync(pkgPath)) {
99
- try {
100
- const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
101
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
102
- if (deps && deps.moflo) {
103
- return dir;
104
- }
105
- } catch { /* ignore parse errors */ }
106
- }
107
- dir = dirname(dir);
108
- }
109
-
110
- // Fallback: use cwd if it has a package.json
111
- if (existsSync(join(process.cwd(), 'package.json'))) {
112
- return process.cwd();
113
- }
114
-
115
- return null;
116
- }
117
-
118
- function copyBootstrap(projectRoot) {
119
- const shippedSource = join(mofloRoot, '.claude', 'guidance', 'shipped', 'agent-bootstrap.md');
120
- const source = existsSync(shippedSource)
121
- ? shippedSource
122
- : join(mofloRoot, '.claude', 'guidance', 'agent-bootstrap.md');
123
- const targetDir = join(projectRoot, '.claude', 'guidance');
124
- const target = join(targetDir, 'moflo-bootstrap.md');
125
-
126
- if (!existsSync(source)) {
127
- log('❌ Source bootstrap not found in moflo package');
128
- return false;
129
- }
130
-
131
- // Read source content and prepend auto-generated notice
132
- const content = readFileSync(source, 'utf-8');
133
- const header = `<!-- AUTO-GENERATED by flo-setup. Do not edit — changes will be overwritten. -->
134
- <!-- Source: node_modules/moflo/.claude/guidance/agent-bootstrap.md -->
135
- <!-- To customize, create .claude/guidance/agent-bootstrap.md for project-specific rules. -->
136
-
137
- `;
138
-
139
- mkdirSync(targetDir, { recursive: true });
140
-
141
- // Check if file exists and is current
142
- if (existsSync(target)) {
143
- const existing = readFileSync(target, 'utf-8');
144
- const newContent = header + content;
145
- if (existing === newContent) {
146
- log('✅ moflo-bootstrap.md is current');
147
- return true;
148
- }
149
- log('📝 Updating moflo-bootstrap.md');
150
- } else {
151
- log('📝 Creating .claude/guidance/moflo-bootstrap.md');
152
- }
153
-
154
- if (!checkOnly) {
155
- writeFileSync(target, header + content, 'utf-8');
156
- }
157
- return true;
158
- }
159
-
160
- function updateClaudeMd(projectRoot) {
161
- const claudeMdPath = join(projectRoot, 'CLAUDE.md');
162
-
163
- if (!existsSync(claudeMdPath)) {
164
- if (checkOnly) {
165
- log('⚠️ No CLAUDE.md found');
166
- return false;
167
- }
168
- log('📝 Creating CLAUDE.md with subagent protocol section');
169
- writeFileSync(claudeMdPath, `# Project Configuration\n\n${CLAUDE_MD_SECTION}\n`, 'utf-8');
170
- return true;
171
- }
172
-
173
- const content = readFileSync(claudeMdPath, 'utf-8');
174
-
175
- // Check for current or legacy markers and replace
176
- const allStarts = [MARKER_START, ...LEGACY_STARTS];
177
- const allEnds = [MARKER_END, ...LEGACY_ENDS];
178
-
179
- for (let i = 0; i < allStarts.length; i++) {
180
- if (content.includes(allStarts[i])) {
181
- const startIdx = content.indexOf(allStarts[i]);
182
- const endIdx = content.indexOf(allEnds[i]);
183
-
184
- if (endIdx > startIdx) {
185
- // If current markers and content matches, we're up to date
186
- if (i === 0) {
187
- const existingSection = content.substring(startIdx, endIdx + allEnds[i].length);
188
- if (existingSection === CLAUDE_MD_SECTION) {
189
- log('✅ CLAUDE.md moflo section is current');
190
- return true;
191
- }
192
- }
193
-
194
- // Replace (current or legacy) with new section
195
- if (!checkOnly) {
196
- const updated = content.substring(0, startIdx) + CLAUDE_MD_SECTION + content.substring(endIdx + allEnds[i].length);
197
- writeFileSync(claudeMdPath, updated, 'utf-8');
198
- log(i === 0 ? '📝 Updated CLAUDE.md moflo section' : '📝 Replaced legacy CLAUDE.md section with minimal moflo injection');
199
- } else {
200
- log('⚠️ CLAUDE.md moflo section needs update');
201
- }
202
- return true;
203
- }
204
- }
205
- }
206
-
207
- if (updateOnly) {
208
- log('⚠️ CLAUDE.md has no moflo section (run without --update to add)');
209
- return false;
210
- }
211
-
212
- if (checkOnly) {
213
- log('⚠️ CLAUDE.md missing subagent protocol section');
214
- return false;
215
- }
216
-
217
- // Append section to end of CLAUDE.md
218
- const separator = content.endsWith('\n') ? '\n' : '\n\n';
219
- writeFileSync(claudeMdPath, content + separator + CLAUDE_MD_SECTION + '\n', 'utf-8');
220
- log('📝 Added subagent protocol section to CLAUDE.md');
221
- return true;
222
- }
223
-
224
- function main() {
225
- console.log('');
226
- console.log('MoFlo Project Setup');
227
- console.log('───────────────────');
228
-
229
- const projectRoot = findProjectRoot();
230
- if (!projectRoot) {
231
- log('❌ Could not find project root (no package.json with moflo dependency)');
232
- process.exit(1);
233
- }
234
-
235
- log(`Project: ${projectRoot}`);
236
- console.log('');
237
-
238
- // Step 1: Copy bootstrap file
239
- const bootstrapOk = copyBootstrap(projectRoot);
240
-
241
- // Step 2: Update CLAUDE.md (skip on --update, only refresh the file)
242
- const claudeOk = updateOnly ? true : updateClaudeMd(projectRoot);
243
-
244
- console.log('');
245
- if (checkOnly) {
246
- log(bootstrapOk && claudeOk ? '✅ Setup is current' : '⚠️ Setup needs attention');
247
- } else {
248
- log('✅ Done. Subagents will now follow the MoFlo bootstrap protocol.');
249
- }
250
- console.log('');
251
- }
252
-
253
- main();
2
+ /**
3
+ * MoFlo Project Setup
4
+ *
5
+ * Copies the agent-bootstrap guidance into the consuming project and
6
+ * adds a CLAUDE.md section so subagents automatically follow the protocol.
7
+ *
8
+ * Usage:
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
+ *
13
+ * What it does:
14
+ * 1. Copies .claude/guidance/agent-bootstrap.md → project's .claude/guidance/moflo-bootstrap.md
15
+ * 2. Appends a subagent protocol section to CLAUDE.md (idempotent, with markers)
16
+ *
17
+ * The project can layer its own .claude/guidance/agent-bootstrap.md on top for
18
+ * project-specific rules (companyId, entity templates, etc.).
19
+ */
20
+
21
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync } from 'node:fs';
22
+ import { dirname, resolve, join } from 'node:path';
23
+ import { fileURLToPath } from 'node:url';
24
+
25
+ const __dirname = dirname(fileURLToPath(import.meta.url));
26
+ const mofloRoot = resolve(__dirname, '..');
27
+
28
+ const args = process.argv.slice(2);
29
+ const updateOnly = args.includes('--update');
30
+ const checkOnly = args.includes('--check');
31
+
32
+ // Markers for idempotent CLAUDE.md updates — keep in sync with claudemd-generator.ts
33
+ const MARKER_START = '<!-- MOFLO:INJECTED:START -->';
34
+ const MARKER_END = '<!-- MOFLO:INJECTED:END -->';
35
+ // Legacy markers to detect and replace
36
+ const LEGACY_STARTS = ['<!-- MOFLO:SUBAGENT-PROTOCOL:START -->', '<!-- MOFLO:START -->'];
37
+ const LEGACY_ENDS = ['<!-- MOFLO:SUBAGENT-PROTOCOL:END -->', '<!-- MOFLO:END -->'];
38
+
39
+ // Minimal injection — just enough for Claude to work with moflo.
40
+ // All detailed docs live in .claude/guidance/shipped/moflo.md.
41
+ const CLAUDE_MD_SECTION = `${MARKER_START}
42
+ ## MoFlo — AI Agent Orchestration
43
+
44
+ This project uses [MoFlo](https://github.com/eric-cielo/moflo) for AI-assisted development workflows.
45
+
46
+ ### FIRST ACTION ON EVERY PROMPT: Search Memory
47
+
48
+ Your first tool call for every new user prompt MUST be a memory search. Do this BEFORE Glob, Grep, Read, or any file exploration.
49
+
50
+ \`\`\`
51
+ mcp__moflo__memory_search — query: "<task description>", namespace: "guidance" or "patterns" or "code-map"
52
+ \`\`\`
53
+
54
+ Search \`guidance\` and \`patterns\` namespaces on every prompt. Search \`code-map\` when navigating the codebase.
55
+ When the user asks you to remember something: \`mcp__moflo__memory_store\` with namespace \`knowledge\`.
56
+
57
+ ### Workflow Gates (enforced automatically)
58
+
59
+ - **Memory-first**: Must search memory before Glob/Grep/Read
60
+ - **TaskCreate-first**: Must call TaskCreate before spawning Agent tool
61
+
62
+ - **Task Icons**: \`TaskCreate\` MUST use ICON+[Role] format — see \`.claude/guidance/task-icons.md\`
63
+
64
+ ### MCP Tools (preferred over CLI)
65
+
66
+ | Tool | Purpose |
67
+ |------|---------|
68
+ | \`mcp__moflo__memory_search\` | Semantic search across indexed knowledge |
69
+ | \`mcp__moflo__memory_store\` | Store patterns and decisions |
70
+ | \`mcp__moflo__hooks_route\` | Route task to optimal agent type |
71
+ | \`mcp__moflo__hooks_pre-task\` | Record task start |
72
+ | \`mcp__moflo__hooks_post-task\` | Record task completion for learning |
73
+
74
+ ### CLI Fallback
75
+
76
+ \`\`\`bash
77
+ npx flo-search "[query]" --namespace guidance # Semantic search
78
+ npx flo doctor --fix # Health check
79
+ \`\`\`
80
+
81
+ ### Full Reference
82
+
83
+ For CLI commands, hooks, agents, swarm config, memory commands, and moflo.yaml options, see:
84
+ \`.claude/guidance/shipped/moflo.md\`
85
+ ${MARKER_END}`;
86
+
87
+ function log(msg) {
88
+ console.log(`[flo-setup] ${msg}`);
89
+ }
90
+
91
+ function findProjectRoot() {
92
+ // Walk up from cwd looking for package.json that depends on moflo
93
+ let dir = process.cwd();
94
+ const root = resolve(dir, '/');
95
+
96
+ while (dir !== root) {
97
+ const pkgPath = join(dir, 'package.json');
98
+ if (existsSync(pkgPath)) {
99
+ try {
100
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
101
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
102
+ if (deps && deps.moflo) {
103
+ return dir;
104
+ }
105
+ } catch { /* ignore parse errors */ }
106
+ }
107
+ dir = dirname(dir);
108
+ }
109
+
110
+ // Fallback: use cwd if it has a package.json
111
+ if (existsSync(join(process.cwd(), 'package.json'))) {
112
+ return process.cwd();
113
+ }
114
+
115
+ return null;
116
+ }
117
+
118
+ function copyBootstrap(projectRoot) {
119
+ const shippedSource = join(mofloRoot, '.claude', 'guidance', 'shipped', 'agent-bootstrap.md');
120
+ const source = existsSync(shippedSource)
121
+ ? shippedSource
122
+ : join(mofloRoot, '.claude', 'guidance', 'agent-bootstrap.md');
123
+ const targetDir = join(projectRoot, '.claude', 'guidance');
124
+ const target = join(targetDir, 'moflo-bootstrap.md');
125
+
126
+ if (!existsSync(source)) {
127
+ log('❌ Source bootstrap not found in moflo package');
128
+ return false;
129
+ }
130
+
131
+ // Read source content and prepend auto-generated notice
132
+ const content = readFileSync(source, 'utf-8');
133
+ const header = `<!-- AUTO-GENERATED by flo-setup. Do not edit — changes will be overwritten. -->
134
+ <!-- Source: node_modules/moflo/.claude/guidance/agent-bootstrap.md -->
135
+ <!-- To customize, create .claude/guidance/agent-bootstrap.md for project-specific rules. -->
136
+
137
+ `;
138
+
139
+ mkdirSync(targetDir, { recursive: true });
140
+
141
+ // Check if file exists and is current
142
+ if (existsSync(target)) {
143
+ const existing = readFileSync(target, 'utf-8');
144
+ const newContent = header + content;
145
+ if (existing === newContent) {
146
+ log('✅ moflo-bootstrap.md is current');
147
+ return true;
148
+ }
149
+ log('📝 Updating moflo-bootstrap.md');
150
+ } else {
151
+ log('📝 Creating .claude/guidance/moflo-bootstrap.md');
152
+ }
153
+
154
+ if (!checkOnly) {
155
+ writeFileSync(target, header + content, 'utf-8');
156
+ }
157
+ return true;
158
+ }
159
+
160
+ function updateClaudeMd(projectRoot) {
161
+ const claudeMdPath = join(projectRoot, 'CLAUDE.md');
162
+
163
+ if (!existsSync(claudeMdPath)) {
164
+ if (checkOnly) {
165
+ log('⚠️ No CLAUDE.md found');
166
+ return false;
167
+ }
168
+ log('📝 Creating CLAUDE.md with subagent protocol section');
169
+ writeFileSync(claudeMdPath, `# Project Configuration\n\n${CLAUDE_MD_SECTION}\n`, 'utf-8');
170
+ return true;
171
+ }
172
+
173
+ const content = readFileSync(claudeMdPath, 'utf-8');
174
+
175
+ // Check for current or legacy markers and replace
176
+ const allStarts = [MARKER_START, ...LEGACY_STARTS];
177
+ const allEnds = [MARKER_END, ...LEGACY_ENDS];
178
+
179
+ for (let i = 0; i < allStarts.length; i++) {
180
+ if (content.includes(allStarts[i])) {
181
+ const startIdx = content.indexOf(allStarts[i]);
182
+ const endIdx = content.indexOf(allEnds[i]);
183
+
184
+ if (endIdx > startIdx) {
185
+ // If current markers and content matches, we're up to date
186
+ if (i === 0) {
187
+ const existingSection = content.substring(startIdx, endIdx + allEnds[i].length);
188
+ if (existingSection === CLAUDE_MD_SECTION) {
189
+ log('✅ CLAUDE.md moflo section is current');
190
+ return true;
191
+ }
192
+ }
193
+
194
+ // Replace (current or legacy) with new section
195
+ if (!checkOnly) {
196
+ const updated = content.substring(0, startIdx) + CLAUDE_MD_SECTION + content.substring(endIdx + allEnds[i].length);
197
+ writeFileSync(claudeMdPath, updated, 'utf-8');
198
+ log(i === 0 ? '📝 Updated CLAUDE.md moflo section' : '📝 Replaced legacy CLAUDE.md section with minimal moflo injection');
199
+ } else {
200
+ log('⚠️ CLAUDE.md moflo section needs update');
201
+ }
202
+ return true;
203
+ }
204
+ }
205
+ }
206
+
207
+ if (updateOnly) {
208
+ log('⚠️ CLAUDE.md has no moflo section (run without --update to add)');
209
+ return false;
210
+ }
211
+
212
+ if (checkOnly) {
213
+ log('⚠️ CLAUDE.md missing subagent protocol section');
214
+ return false;
215
+ }
216
+
217
+ // Append section to end of CLAUDE.md
218
+ const separator = content.endsWith('\n') ? '\n' : '\n\n';
219
+ writeFileSync(claudeMdPath, content + separator + CLAUDE_MD_SECTION + '\n', 'utf-8');
220
+ log('📝 Added subagent protocol section to CLAUDE.md');
221
+ return true;
222
+ }
223
+
224
+ function main() {
225
+ console.log('');
226
+ console.log('MoFlo Project Setup');
227
+ console.log('───────────────────');
228
+
229
+ const projectRoot = findProjectRoot();
230
+ if (!projectRoot) {
231
+ log('❌ Could not find project root (no package.json with moflo dependency)');
232
+ process.exit(1);
233
+ }
234
+
235
+ log(`Project: ${projectRoot}`);
236
+ console.log('');
237
+
238
+ // Step 1: Copy bootstrap file
239
+ const bootstrapOk = copyBootstrap(projectRoot);
240
+
241
+ // Step 2: Update CLAUDE.md (skip on --update, only refresh the file)
242
+ const claudeOk = updateOnly ? true : updateClaudeMd(projectRoot);
243
+
244
+ console.log('');
245
+ if (checkOnly) {
246
+ log(bootstrapOk && claudeOk ? '✅ Setup is current' : '⚠️ Setup needs attention');
247
+ } else {
248
+ log('✅ Done. Subagents will now follow the MoFlo bootstrap protocol.');
249
+ }
250
+ console.log('');
251
+ }
252
+
253
+ main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moflo",
3
- "version": "4.8.32",
3
+ "version": "4.8.34",
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",
@@ -34,6 +34,9 @@
34
34
  "src/@claude-flow/memory/dist/**/*.js",
35
35
  "!src/@claude-flow/memory/dist/**/*.map",
36
36
  "src/@claude-flow/memory/package.json",
37
+ "src/@claude-flow/neural/dist/**/*.js",
38
+ "!src/@claude-flow/neural/dist/**/*.map",
39
+ "src/@claude-flow/neural/package.json",
37
40
  ".claude/commands/**/*.md",
38
41
  ".claude/agents/**/*.md",
39
42
  ".claude/helpers/**",
@@ -46,10 +49,12 @@
46
49
  ],
47
50
  "scripts": {
48
51
  "dev": "tsx watch src/index.ts",
52
+ "prebuild": "node scripts/sync-version.mjs",
49
53
  "build": "tsc -b",
50
- "build:ts": "cd src/@claude-flow/cli && npm run build || true",
51
- "build:guidance": "cd src/@claude-flow/guidance && npx tsc -p tsconfig.json || true",
52
- "prepublishOnly": "npm run build:ts && npm run build:guidance",
54
+ "build:ts": "cd src/@claude-flow/cli && npm run build",
55
+ "build:neural": "cd src/@claude-flow/neural && npx tsc -p tsconfig.json",
56
+ "build:guidance": "cd src/@claude-flow/guidance && npx tsc -p tsconfig.json",
57
+ "prepublishOnly": "npm run build",
53
58
  "test": "vitest run",
54
59
  "test:ui": "vitest --ui",
55
60
  "test:security": "vitest run src/__tests__/security/",
@@ -58,7 +63,7 @@
58
63
  "security:fix": "npm audit fix",
59
64
  "security:test": "npm run test:security",
60
65
  "moflo:security": "npm run security:audit && npm run security:test",
61
- "version": "node -e \"const v=require('./package.json').version;const p='src/@claude-flow/cli/package.json';const j=JSON.parse(require('fs').readFileSync(p));j.version=v;require('fs').writeFileSync(p,JSON.stringify(j,null,2)+'\\n')\" && git add src/@claude-flow/cli/package.json"
66
+ "version": "node scripts/sync-version.mjs && git add src/@claude-flow/cli/package.json src/@claude-flow/cli/src/version.ts"
62
67
  },
63
68
  "dependencies": {
64
69
  "@ruvector/learning-wasm": "^0.1.29",