moflo 4.7.4 → 4.7.7

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,148 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ var fs = require('fs');
4
+ var path = require('path');
5
+
6
+ var PROJECT_DIR = process.env.CLAUDE_PROJECT_DIR || process.cwd();
7
+ var STATE_FILE = path.join(PROJECT_DIR, '.claude', 'workflow-state.json');
8
+
9
+ function readState() {
10
+ try {
11
+ if (fs.existsSync(STATE_FILE)) return JSON.parse(fs.readFileSync(STATE_FILE, 'utf-8'));
12
+ } catch (e) { /* reset on corruption */ }
13
+ return { tasksCreated: false, taskCount: 0, memorySearched: false, memoryRequired: true, interactionCount: 0, sessionStart: null, lastBlockedAt: null };
14
+ }
15
+
16
+ function writeState(s) {
17
+ try {
18
+ var dir = path.dirname(STATE_FILE);
19
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
20
+ fs.writeFileSync(STATE_FILE, JSON.stringify(s, null, 2));
21
+ } catch (e) { /* non-fatal */ }
22
+ }
23
+
24
+ // Load moflo.yaml gate config (defaults: all enabled)
25
+ function loadGateConfig() {
26
+ var defaults = { memory_first: true, task_create_first: true, context_tracking: true };
27
+ try {
28
+ var yamlPath = path.join(PROJECT_DIR, 'moflo.yaml');
29
+ if (fs.existsSync(yamlPath)) {
30
+ var content = fs.readFileSync(yamlPath, 'utf-8');
31
+ if (/memory_first:\s*false/i.test(content)) defaults.memory_first = false;
32
+ if (/task_create_first:\s*false/i.test(content)) defaults.task_create_first = false;
33
+ if (/context_tracking:\s*false/i.test(content)) defaults.context_tracking = false;
34
+ }
35
+ } catch (e) { /* use defaults */ }
36
+ return defaults;
37
+ }
38
+
39
+ var config = loadGateConfig();
40
+ var command = process.argv[2];
41
+
42
+ var EXEMPT = ['.claude/', '.claude\\', 'CLAUDE.md', 'MEMORY.md', 'workflow-state', 'node_modules'];
43
+ var DANGEROUS = ['rm -rf /', 'format c:', 'del /s /q c:\\', ':(){:|:&};:', 'mkfs.', '> /dev/sda'];
44
+ var DIRECTIVE_RE = /^(yes|no|yeah|yep|nope|sure|ok|okay|correct|right|exactly|perfect)\b/i;
45
+ var TASK_RE = /\b(fix|bug|error|implement|add|create|build|write|refactor|debug|test|feature|issue|security|optimi)\b/i;
46
+
47
+ switch (command) {
48
+ case 'check-before-agent': {
49
+ var s = readState();
50
+ if (config.task_create_first && !s.tasksCreated) {
51
+ console.log('BLOCKED: Call TaskCreate before spawning agents.');
52
+ process.exit(1);
53
+ }
54
+ if (config.memory_first && !s.memorySearched) {
55
+ console.log('BLOCKED: Search memory before spawning agents.');
56
+ process.exit(1);
57
+ }
58
+ break;
59
+ }
60
+ case 'check-before-scan': {
61
+ if (!config.memory_first) break;
62
+ var s = readState();
63
+ if (s.memorySearched || !s.memoryRequired) break;
64
+ var target = (process.env.TOOL_INPUT_pattern || '') + ' ' + (process.env.TOOL_INPUT_path || '');
65
+ if (EXEMPT.some(function(p) { return target.indexOf(p) >= 0; })) break;
66
+ var now = Date.now();
67
+ var last = s.lastBlockedAt ? new Date(s.lastBlockedAt).getTime() : 0;
68
+ if (now - last > 2000) {
69
+ s.lastBlockedAt = new Date(now).toISOString();
70
+ writeState(s);
71
+ console.log('BLOCKED: Search memory before exploring files.');
72
+ }
73
+ process.exit(1);
74
+ }
75
+ case 'check-before-read': {
76
+ if (!config.memory_first) break;
77
+ var s = readState();
78
+ if (s.memorySearched || !s.memoryRequired) break;
79
+ var fp = process.env.TOOL_INPUT_file_path || '';
80
+ if (fp.indexOf('.claude/guidance/') < 0 && fp.indexOf('.claude\\guidance\\') < 0) break;
81
+ var now = Date.now();
82
+ var last = s.lastBlockedAt ? new Date(s.lastBlockedAt).getTime() : 0;
83
+ if (now - last > 2000) {
84
+ s.lastBlockedAt = new Date(now).toISOString();
85
+ writeState(s);
86
+ console.log('BLOCKED: Search memory before reading guidance files.');
87
+ }
88
+ process.exit(1);
89
+ }
90
+ case 'record-task-created': {
91
+ var s = readState();
92
+ s.tasksCreated = true;
93
+ s.taskCount = (s.taskCount || 0) + 1;
94
+ writeState(s);
95
+ break;
96
+ }
97
+ case 'record-memory-searched': {
98
+ var s = readState();
99
+ s.memorySearched = true;
100
+ writeState(s);
101
+ break;
102
+ }
103
+ case 'check-bash-memory': {
104
+ var cmd = process.env.TOOL_INPUT_command || '';
105
+ if (/semantic-search|memory search|memory retrieve|memory-search/.test(cmd)) {
106
+ var s = readState();
107
+ s.memorySearched = true;
108
+ writeState(s);
109
+ }
110
+ break;
111
+ }
112
+ case 'check-dangerous-command': {
113
+ var cmd = (process.env.TOOL_INPUT_command || '').toLowerCase();
114
+ for (var i = 0; i < DANGEROUS.length; i++) {
115
+ if (cmd.indexOf(DANGEROUS[i]) >= 0) {
116
+ console.log('[BLOCKED] Dangerous command: ' + DANGEROUS[i]);
117
+ process.exit(2);
118
+ }
119
+ }
120
+ break;
121
+ }
122
+ case 'prompt-reminder': {
123
+ var s = readState();
124
+ s.memorySearched = false;
125
+ var prompt = process.env.CLAUDE_USER_PROMPT || '';
126
+ s.memoryRequired = prompt.length >= 4 && !DIRECTIVE_RE.test(prompt) && (TASK_RE.test(prompt) || prompt.length > 80);
127
+ s.interactionCount = (s.interactionCount || 0) + 1;
128
+ writeState(s);
129
+ if (!s.tasksCreated) console.log('REMINDER: Use TaskCreate before spawning agents. Task tool is blocked until then.');
130
+ if (config.context_tracking) {
131
+ var ic = s.interactionCount;
132
+ if (ic > 30) console.log('Context: CRITICAL. Commit, store learnings, suggest new session.');
133
+ else if (ic > 20) console.log('Context: DEPLETED. Checkpoint progress. Recommend /compact or fresh session.');
134
+ else if (ic > 10) console.log('Context: MODERATE. Re-state goal before architectural decisions.');
135
+ }
136
+ break;
137
+ }
138
+ case 'compact-guidance': {
139
+ console.log('Pre-Compact: Check CLAUDE.md for rules. Use memory search to recover context after compact.');
140
+ break;
141
+ }
142
+ case 'session-reset': {
143
+ writeState({ tasksCreated: false, taskCount: 0, memorySearched: false, memoryRequired: true, interactionCount: 0, sessionStart: new Date().toISOString(), lastBlockedAt: null });
144
+ break;
145
+ }
146
+ default:
147
+ break;
148
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "tasksCreated": false,
3
+ "taskCount": 0,
4
+ "memorySearched": false,
5
+ "memoryRequired": true,
6
+ "interactionCount": 10,
7
+ "sessionStart": null,
8
+ "lastBlockedAt": "2026-03-21T05:00:01.929Z"
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moflo",
3
- "version": "4.7.4",
3
+ "version": "4.7.7",
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",
@@ -85,6 +85,7 @@
85
85
  "@types/bcrypt": "^5.0.2",
86
86
  "@types/node": "^20.0.0",
87
87
  "eslint": "^8.0.0",
88
+ "moflo": "^4.7.4",
88
89
  "tsx": "^4.21.0",
89
90
  "typescript": "^5.0.0",
90
91
  "vitest": "^1.0.0"
@@ -118,7 +118,7 @@ _claude_flow_completions() {
118
118
  }
119
119
 
120
120
  complete -F _claude_flow_completions claude-flow
121
- complete -F _claude_flow_completions npx\\ @claude-flow/cli@v3alpha
121
+ complete -F _claude_flow_completions npx\\ moflo
122
122
  `;
123
123
  }
124
124
  // Generate zsh completion script
@@ -297,8 +297,8 @@ async function checkVersionFreshness() {
297
297
  (latest.major === current.major && latest.minor === current.minor && latest.patch === current.patch && latest.prerelease > current.prerelease));
298
298
  if (isOutdated) {
299
299
  const fix = isNpx
300
- ? 'rm -rf ~/.npm/_npx/* && npx -y @claude-flow/cli@latest'
301
- : 'npm update @claude-flow/cli';
300
+ ? 'rm -rf ~/.npm/_npx/* && npx -y moflo'
301
+ : 'npm update moflo';
302
302
  return {
303
303
  name: 'Version Freshness',
304
304
  status: 'warn',
@@ -364,7 +364,7 @@ function setupAndBoundary() {
364
364
  return `## Quick Setup
365
365
 
366
366
  \`\`\`bash
367
- claude mcp add claude-flow -- npx -y @claude-flow/cli@latest
367
+ claude mcp add claude-flow -- npx -y moflo
368
368
  npx moflo daemon start
369
369
  npx moflo doctor --fix
370
370
  \`\`\`
@@ -14,7 +14,7 @@ import { detectPlatform, DEFAULT_INIT_OPTIONS } from './types.js';
14
14
  import { generateSettingsJson, generateSettings } from './settings-generator.js';
15
15
  import { generateMCPJson } from './mcp-generator.js';
16
16
  import { generateStatuslineScript } from './statusline-generator.js';
17
- import { generatePreCommitHook, generatePostCommitHook, generateAutoMemoryHook, } from './helpers-generator.js';
17
+ import { generatePreCommitHook, generatePostCommitHook, generateAutoMemoryHook, generateGateScript, generateHookHandlerScript, } from './helpers-generator.js';
18
18
  import { generateClaudeMd } from './claudemd-generator.js';
19
19
  /**
20
20
  * Skills to copy based on configuration
@@ -284,14 +284,13 @@ function mergeSettingsForUpgrade(existing) {
284
284
  // Their configuration lives in claudeFlow.agentTeams.hooks instead.
285
285
  // 3. Fix statusLine config (remove invalid fields, ensure correct format)
286
286
  // Claude Code only supports: type, command, padding
287
+ // Always ensure statusLine is present — add it if missing (e.g. from older inits)
287
288
  const existingStatusLine = existing.statusLine;
288
- if (existingStatusLine) {
289
- merged.statusLine = {
290
- type: 'command',
291
- command: existingStatusLine.command || `node -e "var c=require('child_process'),p=require('path'),r;try{r=c.execSync('git rev-parse --show-toplevel',{encoding:'utf8'}).trim()}catch(e){r=process.cwd()}var s=p.join(r,'.claude/helpers/statusline.cjs');process.argv.splice(1,0,s);require(s)"`,
292
- // Remove invalid fields: refreshMs, enabled (not supported by Claude Code)
293
- };
294
- }
289
+ merged.statusLine = {
290
+ type: 'command',
291
+ command: existingStatusLine?.command || `node "$CLAUDE_PROJECT_DIR/.claude/helpers/statusline.cjs"`,
292
+ // Remove invalid fields: refreshMs, enabled (not supported by Claude Code)
293
+ };
295
294
  // 4. Merge claudeFlow settings (preserve existing, add agentTeams + memory)
296
295
  const existingClaudeFlow = existing.claudeFlow || {};
297
296
  const existingMemory = existingClaudeFlow.memory || {};
@@ -356,7 +355,7 @@ export async function executeUpgrade(targetDir, upgradeSettings = false) {
356
355
  // 0. ALWAYS update critical helpers (force overwrite)
357
356
  const sourceHelpersForUpgrade = findSourceHelpersDir();
358
357
  if (sourceHelpersForUpgrade) {
359
- const criticalHelpers = ['auto-memory-hook.mjs', 'hook-handler.cjs', 'intelligence.cjs'];
358
+ const criticalHelpers = ['auto-memory-hook.mjs', 'hook-handler.cjs', 'gate.cjs', 'intelligence.cjs'];
360
359
  for (const helperName of criticalHelpers) {
361
360
  const targetPath = path.join(targetDir, '.claude', 'helpers', helperName);
362
361
  const sourcePath = path.join(sourceHelpersForUpgrade, helperName);
@@ -379,6 +378,8 @@ export async function executeUpgrade(targetDir, upgradeSettings = false) {
379
378
  // Source not found (npx with broken paths) — use generated fallbacks
380
379
  const generatedCritical = {
381
380
  'auto-memory-hook.mjs': generateAutoMemoryHook(),
381
+ 'gate.cjs': generateGateScript(),
382
+ 'hook-handler.cjs': generateHookHandlerScript(),
382
383
  };
383
384
  for (const [helperName, content] of Object.entries(generatedCritical)) {
384
385
  const targetPath = path.join(targetDir, '.claude', 'helpers', helperName);
@@ -494,7 +495,22 @@ export async function executeUpgrade(targetDir, upgradeSettings = false) {
494
495
  else {
495
496
  result.preserved.push('.claude-flow/security/audit-status.json');
496
497
  }
497
- // 3. Merge settings if requested
498
+ // 3. Fix .mcp.json replace stale @claude-flow/cli references with moflo
499
+ const mcpPath = path.join(targetDir, '.mcp.json');
500
+ if (fs.existsSync(mcpPath)) {
501
+ try {
502
+ const mcpRaw = fs.readFileSync(mcpPath, 'utf-8');
503
+ if (mcpRaw.includes('@claude-flow/cli')) {
504
+ const mcpFixed = mcpRaw.replace(/@claude-flow\/cli(@latest)?/g, 'moflo');
505
+ fs.writeFileSync(mcpPath, mcpFixed, 'utf-8');
506
+ result.updated.push('.mcp.json (replaced @claude-flow/cli with moflo)');
507
+ }
508
+ }
509
+ catch {
510
+ // Non-fatal — .mcp.json may be malformed
511
+ }
512
+ }
513
+ // 4. Merge settings if requested
498
514
  if (upgradeSettings) {
499
515
  const settingsPath = path.join(targetDir, '.claude', 'settings.json');
500
516
  if (fs.existsSync(settingsPath)) {
@@ -853,7 +869,7 @@ function findSourceHelpersDir(sourceBaseDir) {
853
869
  // Strategy 1: require.resolve to find package root (most reliable for npx)
854
870
  try {
855
871
  const esmRequire = createRequire(import.meta.url);
856
- const pkgJsonPath = esmRequire.resolve('@claude-flow/cli/package.json');
872
+ const pkgJsonPath = esmRequire.resolve('moflo/package.json');
857
873
  const pkgRoot = path.dirname(pkgJsonPath);
858
874
  possiblePaths.push(path.join(pkgRoot, '.claude', 'helpers'));
859
875
  }
@@ -919,18 +935,17 @@ async function writeHelpers(targetDir, options, result) {
919
935
  result.skipped.push(`.claude/helpers/${file}`);
920
936
  }
921
937
  }
922
- if (copiedCount > 0) {
923
- return; // Skip generating if we copied from source
924
- }
938
+ // Don't return early — still need to generate any missing required helpers below
925
939
  }
926
- // Fall back to generating helpers if source not available.
927
- // Only generate actively used helpers — hooks now go through npx flo CLI,
928
- // so hook-handler.cjs, router.js, session.js, memory.js, intelligence.cjs
929
- // are no longer needed.
940
+ // Generate required helpers that weren't copied from source.
941
+ // gate.cjs and hook-handler.cjs are critical — hooks call them directly
942
+ // via `node` instead of `npx flo` to avoid CLI bootstrap overhead.
930
943
  const helpers = {
931
944
  'pre-commit': generatePreCommitHook(),
932
945
  'post-commit': generatePostCommitHook(),
933
946
  'auto-memory-hook.mjs': generateAutoMemoryHook(),
947
+ 'gate.cjs': generateGateScript(),
948
+ 'hook-handler.cjs': generateHookHandlerScript(),
934
949
  };
935
950
  for (const [name, content] of Object.entries(helpers)) {
936
951
  const filePath = path.join(helpersDir, name);
@@ -1571,7 +1586,7 @@ npx moflo hive-mind consensus --propose "task"
1571
1586
  ### MCP Server Setup
1572
1587
  \`\`\`bash
1573
1588
  # Add Claude Flow MCP
1574
- claude mcp add claude-flow -- npx -y @claude-flow/cli@latest
1589
+ claude mcp add claude-flow -- npx -y moflo
1575
1590
 
1576
1591
  # Optional servers
1577
1592
  claude mcp add ruv-swarm -- npx -y ruv-swarm mcp start
@@ -1653,7 +1668,7 @@ function findSourceDir(type, sourceBaseDir) {
1653
1668
  }
1654
1669
  // IMPORTANT: Check the package's own .claude directory first
1655
1670
  // This is the primary path when running as an npm package
1656
- // __dirname is typically /path/to/node_modules/@claude-flow/cli/dist/src/init
1671
+ // __dirname is typically /path/to/node_modules/moflo/dist/src/init
1657
1672
  // We need to go up 3 levels to reach the package root (dist/src/init -> dist/src -> dist -> root)
1658
1673
  const packageRoot = path.resolve(__dirname, '..', '..', '..');
1659
1674
  const packageDotClaude = path.join(packageRoot, '.claude', type);
@@ -21,4 +21,17 @@ export declare function generateAutoMemoryHook(): string;
21
21
  * Generate all helper files
22
22
  */
23
23
  export declare function generateHelpers(options: InitOptions): Record<string, string>;
24
+ /**
25
+ * Generate lightweight gate.cjs — workflow gates without CLI bootstrap.
26
+ * Handles JSON state file read/write for memory-first and TaskCreate gates.
27
+ * This replaces `npx flo gate <command>` to avoid spawning a full CLI process
28
+ * on every tool call (~500ms npx overhead → ~20ms direct node).
29
+ */
30
+ export declare function generateGateScript(): string;
31
+ /**
32
+ * Generate lightweight hook-handler.cjs — hook dispatch without CLI bootstrap.
33
+ * Handles routing, edit/task tracking, session lifecycle, and notifications.
34
+ * This replaces `npx flo hooks <command>` to avoid spawning a full CLI process.
35
+ */
36
+ export declare function generateHookHandlerScript(): string;
24
37
  //# sourceMappingURL=helpers-generator.d.ts.map
@@ -177,12 +177,253 @@ export function generateHelpers(options) {
177
177
  if (options.components.helpers) {
178
178
  helpers['pre-commit'] = generatePreCommitHook();
179
179
  helpers['post-commit'] = generatePostCommitHook();
180
- // Hook dispatch now goes through npx flo CLI — no more hook-handler.cjs,
181
- // router.js, session.js, memory.js, or intelligence.cjs stubs needed.
180
+ helpers['gate.cjs'] = generateGateScript();
181
+ helpers['hook-handler.cjs'] = generateHookHandlerScript();
182
182
  }
183
183
  if (options.components.statusline) {
184
184
  helpers['statusline.cjs'] = generateStatuslineScript(options);
185
185
  }
186
186
  return helpers;
187
187
  }
188
+ /**
189
+ * Generate lightweight gate.cjs — workflow gates without CLI bootstrap.
190
+ * Handles JSON state file read/write for memory-first and TaskCreate gates.
191
+ * This replaces `npx flo gate <command>` to avoid spawning a full CLI process
192
+ * on every tool call (~500ms npx overhead → ~20ms direct node).
193
+ */
194
+ export function generateGateScript() {
195
+ return `#!/usr/bin/env node
196
+ 'use strict';
197
+ var fs = require('fs');
198
+ var path = require('path');
199
+
200
+ var PROJECT_DIR = process.env.CLAUDE_PROJECT_DIR || process.cwd();
201
+ var STATE_FILE = path.join(PROJECT_DIR, '.claude', 'workflow-state.json');
202
+
203
+ function readState() {
204
+ try {
205
+ if (fs.existsSync(STATE_FILE)) return JSON.parse(fs.readFileSync(STATE_FILE, 'utf-8'));
206
+ } catch (e) { /* reset on corruption */ }
207
+ return { tasksCreated: false, taskCount: 0, memorySearched: false, memoryRequired: true, interactionCount: 0, sessionStart: null, lastBlockedAt: null };
208
+ }
209
+
210
+ function writeState(s) {
211
+ try {
212
+ var dir = path.dirname(STATE_FILE);
213
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
214
+ fs.writeFileSync(STATE_FILE, JSON.stringify(s, null, 2));
215
+ } catch (e) { /* non-fatal */ }
216
+ }
217
+
218
+ // Load moflo.yaml gate config (defaults: all enabled)
219
+ function loadGateConfig() {
220
+ var defaults = { memory_first: true, task_create_first: true, context_tracking: true };
221
+ try {
222
+ var yamlPath = path.join(PROJECT_DIR, 'moflo.yaml');
223
+ if (fs.existsSync(yamlPath)) {
224
+ var content = fs.readFileSync(yamlPath, 'utf-8');
225
+ if (/memory_first:\\s*false/i.test(content)) defaults.memory_first = false;
226
+ if (/task_create_first:\\s*false/i.test(content)) defaults.task_create_first = false;
227
+ if (/context_tracking:\\s*false/i.test(content)) defaults.context_tracking = false;
228
+ }
229
+ } catch (e) { /* use defaults */ }
230
+ return defaults;
231
+ }
232
+
233
+ var config = loadGateConfig();
234
+ var command = process.argv[2];
235
+
236
+ var EXEMPT = ['.claude/', '.claude\\\\', 'CLAUDE.md', 'MEMORY.md', 'workflow-state', 'node_modules'];
237
+ var DANGEROUS = ['rm -rf /', 'format c:', 'del /s /q c:\\\\', ':(){:|:&};:', 'mkfs.', '> /dev/sda'];
238
+ var DIRECTIVE_RE = /^(yes|no|yeah|yep|nope|sure|ok|okay|correct|right|exactly|perfect)\\b/i;
239
+ var TASK_RE = /\\b(fix|bug|error|implement|add|create|build|write|refactor|debug|test|feature|issue|security|optimi)\\b/i;
240
+
241
+ switch (command) {
242
+ case 'check-before-agent': {
243
+ var s = readState();
244
+ if (config.task_create_first && !s.tasksCreated) {
245
+ console.log('BLOCKED: Call TaskCreate before spawning agents.');
246
+ process.exit(1);
247
+ }
248
+ if (config.memory_first && !s.memorySearched) {
249
+ console.log('BLOCKED: Search memory before spawning agents.');
250
+ process.exit(1);
251
+ }
252
+ break;
253
+ }
254
+ case 'check-before-scan': {
255
+ if (!config.memory_first) break;
256
+ var s = readState();
257
+ if (s.memorySearched || !s.memoryRequired) break;
258
+ var target = (process.env.TOOL_INPUT_pattern || '') + ' ' + (process.env.TOOL_INPUT_path || '');
259
+ if (EXEMPT.some(function(p) { return target.indexOf(p) >= 0; })) break;
260
+ var now = Date.now();
261
+ var last = s.lastBlockedAt ? new Date(s.lastBlockedAt).getTime() : 0;
262
+ if (now - last > 2000) {
263
+ s.lastBlockedAt = new Date(now).toISOString();
264
+ writeState(s);
265
+ console.log('BLOCKED: Search memory before exploring files.');
266
+ }
267
+ process.exit(1);
268
+ }
269
+ case 'check-before-read': {
270
+ if (!config.memory_first) break;
271
+ var s = readState();
272
+ if (s.memorySearched || !s.memoryRequired) break;
273
+ var fp = process.env.TOOL_INPUT_file_path || '';
274
+ if (fp.indexOf('.claude/guidance/') < 0 && fp.indexOf('.claude\\\\guidance\\\\') < 0) break;
275
+ var now = Date.now();
276
+ var last = s.lastBlockedAt ? new Date(s.lastBlockedAt).getTime() : 0;
277
+ if (now - last > 2000) {
278
+ s.lastBlockedAt = new Date(now).toISOString();
279
+ writeState(s);
280
+ console.log('BLOCKED: Search memory before reading guidance files.');
281
+ }
282
+ process.exit(1);
283
+ }
284
+ case 'record-task-created': {
285
+ var s = readState();
286
+ s.tasksCreated = true;
287
+ s.taskCount = (s.taskCount || 0) + 1;
288
+ writeState(s);
289
+ break;
290
+ }
291
+ case 'record-memory-searched': {
292
+ var s = readState();
293
+ s.memorySearched = true;
294
+ writeState(s);
295
+ break;
296
+ }
297
+ case 'check-bash-memory': {
298
+ var cmd = process.env.TOOL_INPUT_command || '';
299
+ if (/semantic-search|memory search|memory retrieve|memory-search/.test(cmd)) {
300
+ var s = readState();
301
+ s.memorySearched = true;
302
+ writeState(s);
303
+ }
304
+ break;
305
+ }
306
+ case 'check-dangerous-command': {
307
+ var cmd = (process.env.TOOL_INPUT_command || '').toLowerCase();
308
+ for (var i = 0; i < DANGEROUS.length; i++) {
309
+ if (cmd.indexOf(DANGEROUS[i]) >= 0) {
310
+ console.log('[BLOCKED] Dangerous command: ' + DANGEROUS[i]);
311
+ process.exit(2);
312
+ }
313
+ }
314
+ break;
315
+ }
316
+ case 'prompt-reminder': {
317
+ var s = readState();
318
+ s.memorySearched = false;
319
+ var prompt = process.env.CLAUDE_USER_PROMPT || '';
320
+ s.memoryRequired = prompt.length >= 4 && !DIRECTIVE_RE.test(prompt) && (TASK_RE.test(prompt) || prompt.length > 80);
321
+ s.interactionCount = (s.interactionCount || 0) + 1;
322
+ writeState(s);
323
+ if (!s.tasksCreated) console.log('REMINDER: Use TaskCreate before spawning agents. Task tool is blocked until then.');
324
+ if (config.context_tracking) {
325
+ var ic = s.interactionCount;
326
+ if (ic > 30) console.log('Context: CRITICAL. Commit, store learnings, suggest new session.');
327
+ else if (ic > 20) console.log('Context: DEPLETED. Checkpoint progress. Recommend /compact or fresh session.');
328
+ else if (ic > 10) console.log('Context: MODERATE. Re-state goal before architectural decisions.');
329
+ }
330
+ break;
331
+ }
332
+ case 'compact-guidance': {
333
+ console.log('Pre-Compact: Check CLAUDE.md for rules. Use memory search to recover context after compact.');
334
+ break;
335
+ }
336
+ case 'session-reset': {
337
+ writeState({ tasksCreated: false, taskCount: 0, memorySearched: false, memoryRequired: true, interactionCount: 0, sessionStart: new Date().toISOString(), lastBlockedAt: null });
338
+ break;
339
+ }
340
+ default:
341
+ break;
342
+ }
343
+ `;
344
+ }
345
+ /**
346
+ * Generate lightweight hook-handler.cjs — hook dispatch without CLI bootstrap.
347
+ * Handles routing, edit/task tracking, session lifecycle, and notifications.
348
+ * This replaces `npx flo hooks <command>` to avoid spawning a full CLI process.
349
+ */
350
+ export function generateHookHandlerScript() {
351
+ return `#!/usr/bin/env node
352
+ 'use strict';
353
+ var fs = require('fs');
354
+ var path = require('path');
355
+
356
+ var PROJECT_DIR = process.env.CLAUDE_PROJECT_DIR || process.cwd();
357
+ var METRICS_FILE = path.join(PROJECT_DIR, '.claude-flow', 'metrics', 'learning.json');
358
+ var command = process.argv[2];
359
+
360
+ // Read stdin (Claude Code sends hook data as JSON)
361
+ function readStdin() {
362
+ if (process.stdin.isTTY) return Promise.resolve('');
363
+ return new Promise(function(resolve) {
364
+ var data = '';
365
+ var timer = setTimeout(function() {
366
+ process.stdin.removeAllListeners();
367
+ process.stdin.pause();
368
+ resolve(data);
369
+ }, 500);
370
+ process.stdin.setEncoding('utf8');
371
+ process.stdin.on('data', function(chunk) { data += chunk; });
372
+ process.stdin.on('end', function() { clearTimeout(timer); resolve(data); });
373
+ process.stdin.on('error', function() { clearTimeout(timer); resolve(data); });
374
+ process.stdin.resume();
375
+ });
376
+ }
377
+
378
+ function bumpMetric(key) {
379
+ try {
380
+ var metrics = {};
381
+ if (fs.existsSync(METRICS_FILE)) metrics = JSON.parse(fs.readFileSync(METRICS_FILE, 'utf-8'));
382
+ metrics[key] = (metrics[key] || 0) + 1;
383
+ metrics.lastUpdated = new Date().toISOString();
384
+ var dir = path.dirname(METRICS_FILE);
385
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
386
+ fs.writeFileSync(METRICS_FILE, JSON.stringify(metrics, null, 2));
387
+ } catch (e) { /* non-fatal */ }
388
+ }
389
+
390
+ readStdin().then(function(stdinData) {
391
+ var hookInput = {};
392
+ if (stdinData && stdinData.trim()) {
393
+ try { hookInput = JSON.parse(stdinData); } catch (e) { /* ignore */ }
394
+ }
395
+
396
+ switch (command) {
397
+ case 'route': {
398
+ var prompt = hookInput.prompt || hookInput.command || process.env.PROMPT || '';
399
+ if (prompt) console.log('[INFO] Routing: ' + prompt.substring(0, 80));
400
+ else console.log('[INFO] Ready');
401
+ break;
402
+ }
403
+ case 'pre-edit':
404
+ case 'post-edit':
405
+ bumpMetric('edits');
406
+ console.log('[OK] Edit recorded');
407
+ break;
408
+ case 'pre-task':
409
+ bumpMetric('tasks');
410
+ console.log('[OK] Task started');
411
+ break;
412
+ case 'post-task':
413
+ bumpMetric('tasksCompleted');
414
+ console.log('[OK] Task completed');
415
+ break;
416
+ case 'session-end':
417
+ console.log('[OK] Session ended');
418
+ break;
419
+ case 'notification':
420
+ // Silent — just acknowledge
421
+ break;
422
+ default:
423
+ if (command) console.log('[OK] Hook: ' + command);
424
+ break;
425
+ }
426
+ });
427
+ `;
428
+ }
188
429
  //# sourceMappingURL=helpers-generator.js.map
@@ -34,7 +34,7 @@ export function generateMCPConfig(options) {
34
34
  const deferProps = config.toolDefer ? { toolDefer: 'deferred' } : {};
35
35
  // Claude Flow MCP server (core)
36
36
  if (config.claudeFlow) {
37
- mcpServers['claude-flow'] = createMCPServerEntry(['@claude-flow/cli@latest', 'mcp', 'start'], {
37
+ mcpServers['claude-flow'] = createMCPServerEntry(['moflo', 'mcp', 'start'], {
38
38
  ...npmEnv,
39
39
  CLAUDE_FLOW_MODE: 'v3',
40
40
  CLAUDE_FLOW_HOOKS_ENABLED: 'true',
@@ -67,7 +67,7 @@ export function generateMCPCommands(options) {
67
67
  const commands = [];
68
68
  const config = options.mcp;
69
69
  if (config.claudeFlow) {
70
- commands.push('claude mcp add claude-flow -- npx -y @claude-flow/cli@latest mcp start');
70
+ commands.push('claude mcp add claude-flow -- npx -y moflo mcp start');
71
71
  }
72
72
  if (config.ruvSwarm) {
73
73
  commands.push('claude mcp add ruv-swarm -- npx -y ruv-swarm mcp start');
@@ -19,8 +19,8 @@ export function generateSettings(options) {
19
19
  // Add permissions
20
20
  settings.permissions = {
21
21
  allow: [
22
- 'Bash(npx @claude-flow*)',
23
- 'Bash(npx claude-flow*)',
22
+ 'Bash(npx moflo*)',
23
+ 'Bash(npx flo*)',
24
24
  'Bash(node .claude/*)',
25
25
  'mcp__claude-flow__:*',
26
26
  ],
@@ -172,6 +172,10 @@ function hookHandlerCmd(subcommand) {
172
172
  function autoMemoryCmd(subcommand) {
173
173
  return hookCmdEsm('"$CLAUDE_PROJECT_DIR/.claude/helpers/auto-memory-hook.mjs"', subcommand);
174
174
  }
175
+ /** Shorthand for gate commands (lightweight JSON state checks) */
176
+ function gateCmd(subcommand) {
177
+ return hookCmd('"$CLAUDE_PROJECT_DIR/.claude/helpers/gate.cjs"', subcommand);
178
+ }
175
179
  /**
176
180
  * Generate statusLine configuration for Claude Code
177
181
  * Uses local helper script for cross-platform compatibility (no npx cold-start)
@@ -189,8 +193,9 @@ function generateStatusLineConfig(_options) {
189
193
  }
190
194
  /**
191
195
  * Generate hooks configuration
192
- * All hooks route through the npx flo CLI for consistent behavior.
193
- * The CLI handles routing, gates, learning, and session management.
196
+ * All hooks use direct node invocation via lightweight helper scripts
197
+ * (gate.cjs, hook-handler.cjs) instead of `npx flo` to avoid spawning
198
+ * a full CLI process on every tool call.
194
199
  */
195
200
  function generateHooksConfig(config) {
196
201
  const hooks = {};
@@ -199,26 +204,26 @@ function generateHooksConfig(config) {
199
204
  hooks.PreToolUse = [
200
205
  {
201
206
  matcher: '^(Write|Edit|MultiEdit)$',
202
- hooks: [{ type: 'command', command: 'npx flo hooks pre-edit', timeout: 5000 }],
207
+ hooks: [{ type: 'command', command: hookHandlerCmd('post-edit'), timeout: 5000 }],
203
208
  },
204
209
  {
205
210
  matcher: '^(Glob|Grep)$',
206
- hooks: [{ type: 'command', command: 'npx flo gate check-before-scan', timeout: 3000 }],
211
+ hooks: [{ type: 'command', command: gateCmd('check-before-scan'), timeout: 3000 }],
207
212
  },
208
213
  {
209
214
  matcher: '^Read$',
210
- hooks: [{ type: 'command', command: 'npx flo gate check-before-read', timeout: 3000 }],
215
+ hooks: [{ type: 'command', command: gateCmd('check-before-read'), timeout: 3000 }],
211
216
  },
212
217
  {
213
218
  matcher: '^Task$',
214
219
  hooks: [
215
- { type: 'command', command: 'npx flo gate check-before-agent', timeout: 3000 },
216
- { type: 'command', command: 'npx flo hooks pre-task', timeout: 5000 },
220
+ { type: 'command', command: gateCmd('check-before-agent'), timeout: 3000 },
221
+ { type: 'command', command: hookHandlerCmd('pre-task'), timeout: 5000 },
217
222
  ],
218
223
  },
219
224
  {
220
225
  matcher: '^Bash$',
221
- hooks: [{ type: 'command', command: 'npx flo gate check-dangerous-command', timeout: 2000 }],
226
+ hooks: [{ type: 'command', command: gateCmd('check-dangerous-command'), timeout: 2000 }],
222
227
  },
223
228
  ];
224
229
  }
@@ -227,23 +232,23 @@ function generateHooksConfig(config) {
227
232
  hooks.PostToolUse = [
228
233
  {
229
234
  matcher: '^(Write|Edit|MultiEdit)$',
230
- hooks: [{ type: 'command', command: 'npx flo hooks post-edit', timeout: 5000 }],
235
+ hooks: [{ type: 'command', command: hookHandlerCmd('post-edit'), timeout: 5000 }],
231
236
  },
232
237
  {
233
238
  matcher: '^Task$',
234
- hooks: [{ type: 'command', command: 'npx flo hooks post-task', timeout: 5000 }],
239
+ hooks: [{ type: 'command', command: hookHandlerCmd('post-task'), timeout: 5000 }],
235
240
  },
236
241
  {
237
242
  matcher: '^TaskCreate$',
238
- hooks: [{ type: 'command', command: 'npx flo gate record-task-created', timeout: 2000 }],
243
+ hooks: [{ type: 'command', command: gateCmd('record-task-created'), timeout: 2000 }],
239
244
  },
240
245
  {
241
246
  matcher: '^Bash$',
242
- hooks: [{ type: 'command', command: 'npx flo gate check-bash-memory', timeout: 2000 }],
247
+ hooks: [{ type: 'command', command: gateCmd('check-bash-memory'), timeout: 2000 }],
243
248
  },
244
249
  {
245
250
  matcher: '^mcp__claude-flow__memory_(search|retrieve)$',
246
- hooks: [{ type: 'command', command: 'npx flo gate record-memory-searched', timeout: 2000 }],
251
+ hooks: [{ type: 'command', command: gateCmd('record-memory-searched'), timeout: 2000 }],
247
252
  },
248
253
  ];
249
254
  }
@@ -252,8 +257,8 @@ function generateHooksConfig(config) {
252
257
  hooks.UserPromptSubmit = [
253
258
  {
254
259
  hooks: [
255
- { type: 'command', command: 'npx flo gate prompt-reminder', timeout: 2000 },
256
- { type: 'command', command: 'npx flo hooks route', timeout: 5000 },
260
+ { type: 'command', command: gateCmd('prompt-reminder'), timeout: 2000 },
261
+ { type: 'command', command: hookHandlerCmd('route'), timeout: 5000 },
257
262
  ],
258
263
  },
259
264
  ];
@@ -282,7 +287,7 @@ function generateHooksConfig(config) {
282
287
  hooks.Stop = [
283
288
  {
284
289
  hooks: [
285
- { type: 'command', command: 'npx flo hooks session-end', timeout: 5000 },
290
+ { type: 'command', command: hookHandlerCmd('session-end'), timeout: 5000 },
286
291
  { type: 'command', command: autoMemoryCmd('sync'), timeout: 10000 },
287
292
  ],
288
293
  },
@@ -292,7 +297,7 @@ function generateHooksConfig(config) {
292
297
  if (config.preCompact) {
293
298
  hooks.PreCompact = [
294
299
  {
295
- hooks: [{ type: 'command', command: 'npx flo gate compact-guidance', timeout: 3000 }],
300
+ hooks: [{ type: 'command', command: gateCmd('compact-guidance'), timeout: 3000 }],
296
301
  },
297
302
  ];
298
303
  }
@@ -303,7 +308,7 @@ function generateHooksConfig(config) {
303
308
  hooks: [
304
309
  {
305
310
  type: 'command',
306
- command: 'npx flo hooks notification',
311
+ command: hookHandlerCmd('notification'),
307
312
  timeout: 3000,
308
313
  },
309
314
  ],
@@ -150,8 +150,8 @@ export const MINIMAL_INIT_OPTIONS = {
150
150
  skills: true,
151
151
  commands: false,
152
152
  agents: false,
153
- helpers: false,
154
- statusline: false,
153
+ helpers: true,
154
+ statusline: true,
155
155
  mcp: true,
156
156
  runtime: true,
157
157
  claudeMd: true,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Update checker for @claude-flow packages
2
+ * Update checker for moflo packages
3
3
  * Queries npm registry and compares versions
4
4
  */
5
5
  export interface UpdateCheckResult {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Update checker for @claude-flow packages
2
+ * Update checker for moflo packages
3
3
  * Queries npm registry and compares versions
4
4
  */
5
5
  import * as semver from 'semver';
@@ -13,21 +13,21 @@ const DEFAULT_CONFIG = {
13
13
  major: false,
14
14
  },
15
15
  priority: {
16
- '@claude-flow/security': 'critical',
17
- '@claude-flow/cli': 'high',
18
- '@claude-flow/embeddings': 'normal',
19
- '@claude-flow/integration': 'normal',
20
- '@claude-flow/testing': 'low',
16
+ 'moflo': 'high',
17
+ '@moflo/security': 'critical',
18
+ '@moflo/embeddings': 'normal',
19
+ '@moflo/integration': 'normal',
20
+ '@moflo/testing': 'low',
21
21
  },
22
22
  exclude: [],
23
23
  };
24
24
  // Packages to check for updates
25
25
  const CLAUDE_FLOW_PACKAGES = [
26
- '@claude-flow/cli',
27
- '@claude-flow/embeddings',
28
- '@claude-flow/security',
29
- '@claude-flow/integration',
30
- '@claude-flow/testing',
26
+ 'moflo',
27
+ '@moflo/embeddings',
28
+ '@moflo/security',
29
+ '@moflo/integration',
30
+ '@moflo/testing',
31
31
  ];
32
32
  async function fetchPackageInfo(packageName) {
33
33
  try {
@@ -3,31 +3,31 @@
3
3
  * Ensures updates don't break the ecosystem
4
4
  */
5
5
  import * as semver from 'semver';
6
- // Known compatibility matrix between @claude-flow packages
6
+ // Known compatibility matrix between moflo packages
7
7
  const COMPATIBILITY_MATRIX = {
8
- '@claude-flow/cli': {
9
- '@claude-flow/embeddings': { minVersion: '3.0.0-alpha.1' },
10
- '@claude-flow/security': { minVersion: '3.0.0-alpha.1' },
11
- '@claude-flow/integration': { minVersion: '3.0.0-alpha.1' },
8
+ 'moflo': {
9
+ '@moflo/embeddings': { minVersion: '3.0.0-alpha.1' },
10
+ '@moflo/security': { minVersion: '3.0.0-alpha.1' },
11
+ '@moflo/integration': { minVersion: '3.0.0-alpha.1' },
12
12
  },
13
- '@claude-flow/embeddings': {
14
- '@claude-flow/cli': { minVersion: '3.0.0-alpha.50' },
13
+ '@moflo/embeddings': {
14
+ 'moflo': { minVersion: '3.0.0-alpha.50' },
15
15
  },
16
- '@claude-flow/integration': {
17
- '@claude-flow/cli': { minVersion: '3.0.0-alpha.70' },
16
+ '@moflo/integration': {
17
+ 'moflo': { minVersion: '3.0.0-alpha.70' },
18
18
  'agentic-flow': { minVersion: '3.0.0-alpha.1' },
19
19
  },
20
20
  };
21
21
  // Known breaking changes by version
22
22
  const BREAKING_CHANGES = {
23
- '@claude-flow/cli': {
23
+ 'moflo': {
24
24
  '3.0.0': [
25
25
  'Memory API changed from key-value to vector-based',
26
26
  'Hooks system completely redesigned',
27
27
  'Agent spawning now requires type parameter',
28
28
  ],
29
29
  },
30
- '@claude-flow/embeddings': {
30
+ '@moflo/embeddings': {
31
31
  '3.0.0': [
32
32
  'Switched from better-sqlite3 to sql.js',
33
33
  'New initialization required with initEmbeddings()',
@@ -1,110 +1,110 @@
1
- {
2
- "name": "@moflo/cli",
3
- "version": "4.7.4",
4
- "type": "module",
5
- "description": "MoFlo CLI — AI agent orchestration with specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
- "main": "dist/src/index.js",
7
- "types": "dist/src/index.d.ts",
8
- "sideEffects": false,
9
- "bin": {
10
- "cli": "./bin/cli.js",
11
- "claude-flow": "./bin/cli.js",
12
- "claude-flow-mcp": "./bin/mcp-server.js"
13
- },
14
- "homepage": "https://github.com/eric-cielo/moflo#readme",
15
- "bugs": {
16
- "url": "https://github.com/eric-cielo/moflo/issues"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/eric-cielo/moflo.git",
21
- "directory": "v3/@claude-flow/cli"
22
- },
23
- "keywords": [
24
- "claude",
25
- "claude-code",
26
- "anthropic",
27
- "ai-agents",
28
- "multi-agent",
29
- "swarm",
30
- "mcp",
31
- "model-context-protocol",
32
- "llm",
33
- "cli",
34
- "orchestration",
35
- "automation",
36
- "developer-tools",
37
- "coding-assistant",
38
- "vector-database",
39
- "embeddings",
40
- "self-learning",
41
- "enterprise"
42
- ],
43
- "author": {
44
- "name": "Eric Cielo",
45
- "email": "eric@motailz.com",
46
- "url": "https://github.com/eric-cielo"
47
- },
48
- "license": "MIT",
49
- "exports": {
50
- ".": {
51
- "types": "./dist/src/index.d.ts",
52
- "import": "./dist/src/index.js"
53
- },
54
- "./ruvector": {
55
- "types": "./dist/src/ruvector/index.d.ts",
56
- "import": "./dist/src/ruvector/index.js"
57
- },
58
- "./ruvector/*": {
59
- "types": "./dist/src/ruvector/*.d.ts",
60
- "import": "./dist/src/ruvector/*.js"
61
- },
62
- "./mcp-tools": {
63
- "types": "./dist/src/mcp-tools/index.d.ts",
64
- "import": "./dist/src/mcp-tools/index.js"
65
- }
66
- },
67
- "files": [
68
- "dist",
69
- "bin",
70
- ".claude",
71
- "README.md"
72
- ],
73
- "scripts": {
74
- "build": "tsc",
75
- "test": "vitest run",
76
- "test:plugin-store": "npx tsx src/plugins/tests/standalone-test.ts",
77
- "test:pattern-store": "npx tsx src/transfer/store/tests/standalone-test.ts",
78
- "preinstall": "node bin/preinstall.cjs || true",
79
- "prepublishOnly": "cp ../../../README.md ./README.md",
80
- "release": "npm version prerelease --preid=alpha && npm run publish:all",
81
- "publish:all": "./scripts/publish.sh"
82
- },
83
- "devDependencies": {
84
- "typescript": "^5.3.0",
85
- "vitest": "^4.0.16"
86
- },
87
- "dependencies": {
88
- "@claude-flow/mcp": "^3.0.0-alpha.8",
89
- "@claude-flow/shared": "^3.0.0-alpha.1",
90
- "@noble/ed25519": "^2.1.0",
91
- "semver": "^7.6.0"
92
- },
93
- "optionalDependencies": {
94
- "@claude-flow/aidefence": "^3.0.2",
95
- "@claude-flow/codex": "^3.0.0-alpha.8",
96
- "@claude-flow/embeddings": "^3.0.0-alpha.12",
97
- "@claude-flow/guidance": "^3.0.0-alpha.1",
98
- "@claude-flow/memory": "^3.0.0-alpha.11",
99
- "@claude-flow/plugin-gastown-bridge": "^0.1.3",
100
- "agentic-flow": "^3.0.0-alpha.1",
101
- "@ruvector/attention": "^0.1.4",
102
- "@ruvector/learning-wasm": "^0.1.29",
103
- "@ruvector/router": "^0.1.27",
104
- "@ruvector/sona": "^0.1.5"
105
- },
106
- "publishConfig": {
107
- "access": "public",
108
- "tag": "latest"
109
- }
110
- }
1
+ {
2
+ "name": "@moflo/cli",
3
+ "version": "4.7.7",
4
+ "type": "module",
5
+ "description": "MoFlo CLI — AI agent orchestration with specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
+ "main": "dist/src/index.js",
7
+ "types": "dist/src/index.d.ts",
8
+ "sideEffects": false,
9
+ "bin": {
10
+ "cli": "./bin/cli.js",
11
+ "claude-flow": "./bin/cli.js",
12
+ "claude-flow-mcp": "./bin/mcp-server.js"
13
+ },
14
+ "homepage": "https://github.com/eric-cielo/moflo#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/eric-cielo/moflo/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/eric-cielo/moflo.git",
21
+ "directory": "v3/@claude-flow/cli"
22
+ },
23
+ "keywords": [
24
+ "claude",
25
+ "claude-code",
26
+ "anthropic",
27
+ "ai-agents",
28
+ "multi-agent",
29
+ "swarm",
30
+ "mcp",
31
+ "model-context-protocol",
32
+ "llm",
33
+ "cli",
34
+ "orchestration",
35
+ "automation",
36
+ "developer-tools",
37
+ "coding-assistant",
38
+ "vector-database",
39
+ "embeddings",
40
+ "self-learning",
41
+ "enterprise"
42
+ ],
43
+ "author": {
44
+ "name": "Eric Cielo",
45
+ "email": "eric@motailz.com",
46
+ "url": "https://github.com/eric-cielo"
47
+ },
48
+ "license": "MIT",
49
+ "exports": {
50
+ ".": {
51
+ "types": "./dist/src/index.d.ts",
52
+ "import": "./dist/src/index.js"
53
+ },
54
+ "./ruvector": {
55
+ "types": "./dist/src/ruvector/index.d.ts",
56
+ "import": "./dist/src/ruvector/index.js"
57
+ },
58
+ "./ruvector/*": {
59
+ "types": "./dist/src/ruvector/*.d.ts",
60
+ "import": "./dist/src/ruvector/*.js"
61
+ },
62
+ "./mcp-tools": {
63
+ "types": "./dist/src/mcp-tools/index.d.ts",
64
+ "import": "./dist/src/mcp-tools/index.js"
65
+ }
66
+ },
67
+ "files": [
68
+ "dist",
69
+ "bin",
70
+ ".claude",
71
+ "README.md"
72
+ ],
73
+ "scripts": {
74
+ "build": "tsc",
75
+ "test": "vitest run",
76
+ "test:plugin-store": "npx tsx src/plugins/tests/standalone-test.ts",
77
+ "test:pattern-store": "npx tsx src/transfer/store/tests/standalone-test.ts",
78
+ "preinstall": "node bin/preinstall.cjs || true",
79
+ "prepublishOnly": "cp ../../../README.md ./README.md",
80
+ "release": "npm version prerelease --preid=alpha && npm run publish:all",
81
+ "publish:all": "./scripts/publish.sh"
82
+ },
83
+ "devDependencies": {
84
+ "typescript": "^5.3.0",
85
+ "vitest": "^4.0.16"
86
+ },
87
+ "dependencies": {
88
+ "@claude-flow/mcp": "^3.0.0-alpha.8",
89
+ "@claude-flow/shared": "^3.0.0-alpha.1",
90
+ "@noble/ed25519": "^2.1.0",
91
+ "semver": "^7.6.0"
92
+ },
93
+ "optionalDependencies": {
94
+ "@claude-flow/aidefence": "^3.0.2",
95
+ "@claude-flow/codex": "^3.0.0-alpha.8",
96
+ "@claude-flow/embeddings": "^3.0.0-alpha.12",
97
+ "@claude-flow/guidance": "^3.0.0-alpha.1",
98
+ "@claude-flow/memory": "^3.0.0-alpha.11",
99
+ "@claude-flow/plugin-gastown-bridge": "^0.1.3",
100
+ "agentic-flow": "^3.0.0-alpha.1",
101
+ "@ruvector/attention": "^0.1.4",
102
+ "@ruvector/learning-wasm": "^0.1.29",
103
+ "@ruvector/router": "^0.1.27",
104
+ "@ruvector/sona": "^0.1.5"
105
+ },
106
+ "publishConfig": {
107
+ "access": "public",
108
+ "tag": "latest"
109
+ }
110
+ }