@claude-flow/cli 3.1.0-alpha.5 → 3.1.0-alpha.50

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 (53) hide show
  1. package/.claude/helpers/auto-memory-hook.mjs +350 -0
  2. package/.claude/helpers/hook-handler.cjs +232 -0
  3. package/.claude/helpers/intelligence.cjs +916 -0
  4. package/.claude/helpers/session.js +8 -0
  5. package/.claude/helpers/statusline.cjs +96 -28
  6. package/.claude/settings.json +86 -141
  7. package/README.md +830 -353
  8. package/bin/cli.js +28 -0
  9. package/bin/mcp-server.js +28 -0
  10. package/bin/preinstall.cjs +111 -0
  11. package/dist/src/commands/hooks.d.ts.map +1 -1
  12. package/dist/src/commands/hooks.js +224 -32
  13. package/dist/src/commands/hooks.js.map +1 -1
  14. package/dist/src/commands/init.d.ts.map +1 -1
  15. package/dist/src/commands/init.js +191 -4
  16. package/dist/src/commands/init.js.map +1 -1
  17. package/dist/src/commands/memory.d.ts.map +1 -1
  18. package/dist/src/commands/memory.js +12 -2
  19. package/dist/src/commands/memory.js.map +1 -1
  20. package/dist/src/index.js +2 -2
  21. package/dist/src/index.js.map +1 -1
  22. package/dist/src/init/executor.d.ts +8 -2
  23. package/dist/src/init/executor.d.ts.map +1 -1
  24. package/dist/src/init/executor.js +310 -41
  25. package/dist/src/init/executor.js.map +1 -1
  26. package/dist/src/init/helpers-generator.d.ts +18 -0
  27. package/dist/src/init/helpers-generator.d.ts.map +1 -1
  28. package/dist/src/init/helpers-generator.js +498 -0
  29. package/dist/src/init/helpers-generator.js.map +1 -1
  30. package/dist/src/init/mcp-generator.d.ts +6 -0
  31. package/dist/src/init/mcp-generator.d.ts.map +1 -1
  32. package/dist/src/init/mcp-generator.js +52 -16
  33. package/dist/src/init/mcp-generator.js.map +1 -1
  34. package/dist/src/init/settings-generator.d.ts.map +1 -1
  35. package/dist/src/init/settings-generator.js +134 -91
  36. package/dist/src/init/settings-generator.js.map +1 -1
  37. package/dist/src/init/statusline-generator.d.ts +16 -8
  38. package/dist/src/init/statusline-generator.d.ts.map +1 -1
  39. package/dist/src/init/statusline-generator.js +424 -931
  40. package/dist/src/init/statusline-generator.js.map +1 -1
  41. package/dist/src/init/types.d.ts +12 -0
  42. package/dist/src/init/types.d.ts.map +1 -1
  43. package/dist/src/init/types.js +12 -0
  44. package/dist/src/init/types.js.map +1 -1
  45. package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
  46. package/dist/src/mcp-tools/memory-tools.js +4 -1
  47. package/dist/src/mcp-tools/memory-tools.js.map +1 -1
  48. package/dist/src/memory/memory-initializer.d.ts +1 -0
  49. package/dist/src/memory/memory-initializer.d.ts.map +1 -1
  50. package/dist/src/memory/memory-initializer.js +14 -9
  51. package/dist/src/memory/memory-initializer.js.map +1 -1
  52. package/dist/tsconfig.tsbuildinfo +1 -1
  53. package/package.json +5 -2
@@ -2,6 +2,11 @@
2
2
  * MCP Configuration Generator
3
3
  * Creates .mcp.json for Claude Code MCP server integration
4
4
  * Handles cross-platform compatibility (Windows requires cmd /c wrapper)
5
+ *
6
+ * Uses a shell wrapper on Unix to auto-repair npm cache corruption
7
+ * (ENOTEMPTY/ECOMPROMISED) before running npx. This is critical for
8
+ * remote environments like Codespaces where interrupted installs
9
+ * leave stale artifacts that prevent subsequent npx runs.
5
10
  */
6
11
  /**
7
12
  * Check if running on Windows
@@ -11,20 +16,30 @@ function isWindows() {
11
16
  }
12
17
  /**
13
18
  * Generate platform-specific MCP server entry
14
- * Windows requires 'cmd /c' wrapper to execute npx commands
19
+ * - Windows: uses 'cmd /c npx' directly
20
+ * - Unix: uses 'sh -c' with retry-on-failure for npm cache corruption
21
+ *
22
+ * The Unix wrapper tries npx normally first. If it fails with ENOTEMPTY
23
+ * or ECOMPROMISED (common in Codespaces/remote envs), it nukes the
24
+ * corrupted cache and retries once. This adds 0ms on success and ~5s
25
+ * on the retry path — acceptable since MCP servers start once per session.
15
26
  */
16
27
  function createMCPServerEntry(npxArgs, env, additionalProps = {}) {
17
28
  if (isWindows()) {
18
29
  return {
19
30
  command: 'cmd',
20
- args: ['/c', 'npx', ...npxArgs],
31
+ args: ['/c', 'npx', '-y', ...npxArgs],
21
32
  env,
22
33
  ...additionalProps,
23
34
  };
24
35
  }
36
+ // Unix: npx with automatic retry on cache corruption
37
+ const npxCmd = ['npx', '-y', ...npxArgs].join(' ');
38
+ // Try normal launch; on ENOTEMPTY/ECOMPROMISED nuke cache and retry
39
+ const retryScript = `${npxCmd} 2>/tmp/.cf-err.$$ || { if grep -qE 'ENOTEMPTY|ECOMPROMISED' /tmp/.cf-err.$$ 2>/dev/null; then rm -rf ~/.npm/_npx ~/.npm/_cacache 2>/dev/null; exec ${npxCmd}; else cat /tmp/.cf-err.$$ >&2; exit 1; fi; }`;
25
40
  return {
26
- command: 'npx',
27
- args: npxArgs,
41
+ command: 'sh',
42
+ args: ['-c', retryScript],
28
43
  env,
29
44
  ...additionalProps,
30
45
  };
@@ -35,9 +50,17 @@ function createMCPServerEntry(npxArgs, env, additionalProps = {}) {
35
50
  export function generateMCPConfig(options) {
36
51
  const config = options.mcp;
37
52
  const mcpServers = {};
53
+ // Shared env vars that prevent npm cache corruption issues
54
+ // npm_config_prefer_online: skip stale cache integrity (fixes ECOMPROMISED)
55
+ // npm_config_update_notifier: suppress update check (faster startup)
56
+ const npmCacheEnv = {
57
+ npm_config_prefer_online: 'true',
58
+ npm_config_update_notifier: 'false',
59
+ };
38
60
  // Claude Flow MCP server (core)
39
61
  if (config.claudeFlow) {
40
62
  mcpServers['claude-flow'] = createMCPServerEntry(['@claude-flow/cli@latest', 'mcp', 'start'], {
63
+ ...npmCacheEnv,
41
64
  CLAUDE_FLOW_MODE: 'v3',
42
65
  CLAUDE_FLOW_HOOKS_ENABLED: 'true',
43
66
  CLAUDE_FLOW_TOPOLOGY: options.runtime.topology,
@@ -47,11 +70,11 @@ export function generateMCPConfig(options) {
47
70
  }
48
71
  // Ruv-Swarm MCP server (enhanced coordination)
49
72
  if (config.ruvSwarm) {
50
- mcpServers['ruv-swarm'] = createMCPServerEntry(['ruv-swarm', 'mcp', 'start'], {}, { optional: true });
73
+ mcpServers['ruv-swarm'] = createMCPServerEntry(['ruv-swarm', 'mcp', 'start'], { ...npmCacheEnv }, { optional: true });
51
74
  }
52
75
  // Flow Nexus MCP server (cloud features)
53
76
  if (config.flowNexus) {
54
- mcpServers['flow-nexus'] = createMCPServerEntry(['flow-nexus@latest', 'mcp', 'start'], {}, { optional: true, requiresAuth: true });
77
+ mcpServers['flow-nexus'] = createMCPServerEntry(['flow-nexus@latest', 'mcp', 'start'], { ...npmCacheEnv }, { optional: true, requiresAuth: true });
55
78
  }
56
79
  return { mcpServers };
57
80
  }
@@ -64,21 +87,34 @@ export function generateMCPJson(options) {
64
87
  }
65
88
  /**
66
89
  * Generate MCP server add commands for manual setup
90
+ * Unix wraps npx with cache repair to prevent ENOTEMPTY/ECOMPROMISED
67
91
  * Windows uses 'cmd /c' wrapper for npx execution
68
92
  */
69
93
  export function generateMCPCommands(options) {
70
94
  const commands = [];
71
95
  const config = options.mcp;
72
- // Windows requires different command format
73
- const prefix = isWindows() ? 'cmd /c ' : '';
74
- if (config.claudeFlow) {
75
- commands.push(`claude mcp add claude-flow -- ${prefix}npx @claude-flow/cli@latest mcp start`);
76
- }
77
- if (config.ruvSwarm) {
78
- commands.push(`claude mcp add ruv-swarm -- ${prefix}npx ruv-swarm mcp start`);
96
+ if (isWindows()) {
97
+ if (config.claudeFlow) {
98
+ commands.push('claude mcp add claude-flow -- cmd /c npx -y @claude-flow/cli@latest mcp start');
99
+ }
100
+ if (config.ruvSwarm) {
101
+ commands.push('claude mcp add ruv-swarm -- cmd /c npx -y ruv-swarm mcp start');
102
+ }
103
+ if (config.flowNexus) {
104
+ commands.push('claude mcp add flow-nexus -- cmd /c npx -y flow-nexus@latest mcp start');
105
+ }
79
106
  }
80
- if (config.flowNexus) {
81
- commands.push(`claude mcp add flow-nexus -- ${prefix}npx flow-nexus@latest mcp start`);
107
+ else {
108
+ // Unix: wrap with retry-on-failure for cache corruption resilience
109
+ if (config.claudeFlow) {
110
+ commands.push("claude mcp add claude-flow -- npx -y @claude-flow/cli@latest mcp start");
111
+ }
112
+ if (config.ruvSwarm) {
113
+ commands.push("claude mcp add ruv-swarm -- npx -y ruv-swarm mcp start");
114
+ }
115
+ if (config.flowNexus) {
116
+ commands.push("claude mcp add flow-nexus -- npx -y flow-nexus@latest mcp start");
117
+ }
82
118
  }
83
119
  return commands;
84
120
  }
@@ -94,7 +130,7 @@ export function getPlatformInstructions() {
94
130
  }
95
131
  return {
96
132
  platform: process.platform === 'darwin' ? 'macOS' : 'Linux',
97
- note: 'MCP configuration uses native npx execution.',
133
+ note: 'MCP configuration uses sh wrapper with automatic npm cache repair for remote environment resilience.',
98
134
  };
99
135
  }
100
136
  //# sourceMappingURL=mcp-generator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-generator.js","sourceRoot":"","sources":["../../../src/init/mcp-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,SAAS,SAAS;IAChB,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,SAAS,oBAAoB,CAC3B,OAAiB,EACjB,GAA2B,EAC3B,kBAA2C,EAAE;IAE7C,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;YAC/B,GAAG;YACH,GAAG,eAAe;SACnB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,OAAO;QACb,GAAG;QACH,GAAG,eAAe;KACnB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAoB;IACpD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAC3B,MA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YACrB,QAAQ,CAAC,IAAI,CAAC,wEAAwE,CAAC,CAAC;QAC1F,CAAC;IACH,CAAC;SAAM,CAAC;QACN,mEAAmE;QACnE,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACtB,QAAQ,CAAC,IAAI,CAAC,wEAAwE,CAAC,CAAC;QAC1F,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,QAAQ,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;QAC1E,CAAC;QACD,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,QAAQ,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,OAAO;YACL,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,8DAA8D;SACrE,CAAC;IACJ,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;QAC3D,IAAI,EAAE,sGAAsG;KAC7G,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"settings-generator.d.ts","sourceRoot":"","sources":["../../../src/init/settings-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,YAAY,CAAC;AAE3D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA0G7D;AAiMD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAGjE"}
1
+ {"version":3,"file":"settings-generator.d.ts","sourceRoot":"","sources":["../../../src/init/settings-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,YAAY,CAAC;AAE3D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA+I7D;AA2MD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAGjE"}
@@ -17,15 +17,16 @@ export function generateSettings(options) {
17
17
  }
18
18
  // Add permissions
19
19
  settings.permissions = {
20
- // Auto-allow claude-flow MCP tools
21
- // Note: Use ":*" for prefix matching (not just "*")
22
20
  allow: [
23
- 'Bash(npx claude-flow:*)',
24
- 'Bash(npx @claude-flow/cli:*)',
21
+ 'Bash(npx @claude-flow*)',
22
+ 'Bash(npx claude-flow*)',
23
+ 'Bash(node .claude/*)',
25
24
  'mcp__claude-flow__:*',
26
25
  ],
27
- // Auto-deny dangerous operations
28
- deny: [],
26
+ deny: [
27
+ 'Read(./.env)',
28
+ 'Read(./.env.*)',
29
+ ],
29
30
  };
30
31
  // Add claude-flow attribution for git commits and PRs
31
32
  settings.attribution = {
@@ -35,6 +36,14 @@ export function generateSettings(options) {
35
36
  // Note: Claude Code expects 'model' to be a string, not an object
36
37
  // Model preferences are stored in claudeFlow settings instead
37
38
  // settings.model = 'claude-sonnet-4-5-20250929'; // Uncomment if you want to set a default model
39
+ // Add Agent Teams configuration (experimental feature)
40
+ settings.env = {
41
+ // Enable Claude Code Agent Teams for multi-agent coordination
42
+ CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1',
43
+ // Claude Flow specific environment
44
+ CLAUDE_FLOW_V3_ENABLED: 'true',
45
+ CLAUDE_FLOW_HOOKS_ENABLED: 'true',
46
+ };
38
47
  // Add V3-specific settings
39
48
  settings.claudeFlow = {
40
49
  version: '3.0.0',
@@ -43,6 +52,30 @@ export function generateSettings(options) {
43
52
  default: 'claude-opus-4-6',
44
53
  routing: 'claude-haiku-4-5-20251001',
45
54
  },
55
+ agentTeams: {
56
+ enabled: true,
57
+ teammateMode: 'auto', // 'auto' | 'in-process' | 'tmux'
58
+ taskListEnabled: true,
59
+ mailboxEnabled: true,
60
+ coordination: {
61
+ autoAssignOnIdle: true, // Auto-assign pending tasks when teammate is idle
62
+ trainPatternsOnComplete: true, // Train neural patterns when tasks complete
63
+ notifyLeadOnComplete: true, // Notify team lead when tasks complete
64
+ sharedMemoryNamespace: 'agent-teams', // Memory namespace for team coordination
65
+ },
66
+ hooks: {
67
+ teammateIdle: {
68
+ enabled: true,
69
+ autoAssign: true,
70
+ checkTaskList: true,
71
+ },
72
+ taskCompleted: {
73
+ enabled: true,
74
+ trainPatterns: true,
75
+ notifyLead: true,
76
+ },
77
+ },
78
+ },
46
79
  swarm: {
47
80
  topology: options.runtime.topology,
48
81
  maxAgents: options.runtime.maxAgents,
@@ -50,6 +83,9 @@ export function generateSettings(options) {
50
83
  memory: {
51
84
  backend: options.runtime.memoryBackend,
52
85
  enableHNSW: options.runtime.enableHNSW,
86
+ learningBridge: { enabled: options.runtime.enableLearningBridge ?? true },
87
+ memoryGraph: { enabled: options.runtime.enableMemoryGraph ?? true },
88
+ agentScopes: { enabled: options.runtime.enableAgentScopes ?? true },
53
89
  },
54
90
  neural: {
55
91
  enabled: options.runtime.enableNeural,
@@ -107,181 +143,188 @@ export function generateSettings(options) {
107
143
  }
108
144
  /**
109
145
  * Generate statusLine configuration for Claude Code
110
- * This configures the Claude Code status bar to show V3 metrics
146
+ * Uses local helper script for cross-platform compatibility (no npx cold-start)
111
147
  */
112
148
  function generateStatusLineConfig(options) {
113
149
  const config = options.statusline;
114
- // Build the command that generates the statusline
115
- // Uses npx @claude-flow/cli@latest (or @alpha) to run the hooks statusline command
116
- // Falls back to local helper script or simple "V3" if CLI not available
117
- // Default: full multi-line statusline with progress bars, metrics, and architecture status
118
- const statuslineCommand = 'npx @claude-flow/cli@latest hooks statusline 2>/dev/null || node .claude/helpers/statusline.cjs 2>/dev/null || echo "▊ Claude Flow V3"';
119
150
  return {
120
- // Type must be "command" for Claude Code validation
121
151
  type: 'command',
122
- // Command to execute for statusline content
123
- command: statuslineCommand,
124
- // Refresh interval in milliseconds (5 seconds default)
152
+ command: 'node .claude/helpers/statusline.cjs',
125
153
  refreshMs: config.refreshInterval,
126
- // Enable the statusline
127
154
  enabled: config.enabled,
128
155
  };
129
156
  }
130
157
  /**
131
158
  * Generate hooks configuration
159
+ * Uses local hook-handler.cjs for cross-platform compatibility.
160
+ * All hooks delegate to `node .claude/helpers/hook-handler.cjs <command>`
161
+ * which works identically on Windows, macOS, and Linux without
162
+ * shell-specific syntax (no bash 2>/dev/null, no PowerShell 2>$null).
132
163
  */
133
164
  function generateHooksConfig(config) {
134
165
  const hooks = {};
135
- // PreToolUse hooks - cross-platform via npx with defensive guards
166
+ // Node.js scripts handle errors internally via try/catch.
167
+ // No shell-level error suppression needed (2>/dev/null || true breaks Windows).
168
+ // PreToolUse — validate commands before execution
136
169
  if (config.preToolUse) {
137
170
  hooks.PreToolUse = [
138
- // File edit hooks with intelligence routing
139
171
  {
140
- matcher: '^(Write|Edit|MultiEdit)$',
172
+ matcher: 'Bash',
141
173
  hooks: [
142
174
  {
143
175
  type: 'command',
144
- command: '[ -n "$TOOL_INPUT_file_path" ] && npx @claude-flow/cli@latest hooks pre-edit --file "$TOOL_INPUT_file_path" 2>/dev/null || true',
176
+ command: 'node .claude/helpers/hook-handler.cjs pre-bash',
145
177
  timeout: config.timeout,
146
- continueOnError: true,
147
178
  },
148
179
  ],
149
180
  },
150
- // Bash command hooks with safety validation
181
+ ];
182
+ }
183
+ // PostToolUse — record edits for session metrics / learning
184
+ if (config.postToolUse) {
185
+ hooks.PostToolUse = [
151
186
  {
152
- matcher: '^Bash$',
187
+ matcher: 'Write|Edit|MultiEdit',
153
188
  hooks: [
154
189
  {
155
190
  type: 'command',
156
- command: '[ -n "$TOOL_INPUT_command" ] && npx @claude-flow/cli@latest hooks pre-command --command "$TOOL_INPUT_command" 2>/dev/null || true',
157
- timeout: config.timeout,
158
- continueOnError: true,
191
+ command: 'node .claude/helpers/hook-handler.cjs post-edit',
192
+ timeout: 10000,
159
193
  },
160
194
  ],
161
195
  },
162
- // Task/Agent hooks - require task-id for tracking
196
+ ];
197
+ }
198
+ // UserPromptSubmit — intelligent task routing
199
+ if (config.userPromptSubmit) {
200
+ hooks.UserPromptSubmit = [
163
201
  {
164
- matcher: '^Task$',
165
202
  hooks: [
166
203
  {
167
204
  type: 'command',
168
- command: '[ -n "$TOOL_INPUT_prompt" ] && npx @claude-flow/cli@latest hooks pre-task --task-id "task-$(date +%s)" --description "$TOOL_INPUT_prompt" 2>/dev/null || true',
169
- timeout: config.timeout,
170
- continueOnError: true,
205
+ command: 'node .claude/helpers/hook-handler.cjs route',
206
+ timeout: 10000,
171
207
  },
172
208
  ],
173
209
  },
174
210
  ];
175
211
  }
176
- // PostToolUse hooks - cross-platform via npx with defensive guards
177
- if (config.postToolUse) {
178
- hooks.PostToolUse = [
179
- // File edit hooks with neural pattern training
212
+ // SessionStart restore session state + import auto memory
213
+ if (config.sessionStart) {
214
+ hooks.SessionStart = [
180
215
  {
181
- matcher: '^(Write|Edit|MultiEdit)$',
182
216
  hooks: [
183
217
  {
184
218
  type: 'command',
185
- command: '[ -n "$TOOL_INPUT_file_path" ] && npx @claude-flow/cli@latest hooks post-edit --file "$TOOL_INPUT_file_path" --success "${TOOL_SUCCESS:-true}" 2>/dev/null || true',
186
- timeout: config.timeout,
187
- continueOnError: true,
219
+ command: 'node .claude/helpers/hook-handler.cjs session-restore',
220
+ timeout: 15000,
188
221
  },
189
- ],
190
- },
191
- // Bash command hooks with metrics tracking
192
- {
193
- matcher: '^Bash$',
194
- hooks: [
195
222
  {
196
223
  type: 'command',
197
- command: '[ -n "$TOOL_INPUT_command" ] && npx @claude-flow/cli@latest hooks post-command --command "$TOOL_INPUT_command" --success "${TOOL_SUCCESS:-true}" 2>/dev/null || true',
198
- timeout: config.timeout,
199
- continueOnError: true,
224
+ command: 'node .claude/helpers/auto-memory-hook.mjs import',
225
+ timeout: 8000,
200
226
  },
201
227
  ],
202
228
  },
203
- // Task completion hooks - use task-id
229
+ ];
230
+ }
231
+ // SessionEnd — persist session state
232
+ if (config.sessionStart) {
233
+ hooks.SessionEnd = [
204
234
  {
205
- matcher: '^Task$',
206
235
  hooks: [
207
236
  {
208
237
  type: 'command',
209
- command: '[ -n "$TOOL_RESULT_agent_id" ] && npx @claude-flow/cli@latest hooks post-task --task-id "$TOOL_RESULT_agent_id" --success "${TOOL_SUCCESS:-true}" 2>/dev/null || true',
210
- timeout: config.timeout,
211
- continueOnError: true,
238
+ command: 'node .claude/helpers/hook-handler.cjs session-end',
239
+ timeout: 10000,
212
240
  },
213
241
  ],
214
242
  },
215
243
  ];
216
244
  }
217
- // UserPromptSubmit for intelligent routing
218
- if (config.userPromptSubmit) {
219
- hooks.UserPromptSubmit = [
245
+ // Stop sync auto memory on exit
246
+ if (config.stop) {
247
+ hooks.Stop = [
220
248
  {
221
249
  hooks: [
222
250
  {
223
251
  type: 'command',
224
- command: '[ -n "$PROMPT" ] && npx @claude-flow/cli@latest hooks route --task "$PROMPT" || true',
225
- timeout: config.timeout,
226
- continueOnError: true,
252
+ command: 'node .claude/helpers/auto-memory-hook.mjs sync',
253
+ timeout: 10000,
227
254
  },
228
255
  ],
229
256
  },
230
257
  ];
231
258
  }
232
- // SessionStart for context loading and daemon auto-start
233
- if (config.sessionStart) {
234
- hooks.SessionStart = [
259
+ // PreCompact preserve context before compaction
260
+ if (config.preCompact) {
261
+ hooks.PreCompact = [
235
262
  {
263
+ matcher: 'manual',
236
264
  hooks: [
237
265
  {
238
266
  type: 'command',
239
- command: 'npx @claude-flow/cli@latest daemon start --quiet 2>/dev/null || true',
240
- timeout: 5000,
241
- continueOnError: true,
267
+ command: 'node .claude/helpers/hook-handler.cjs compact-manual',
242
268
  },
243
269
  {
244
270
  type: 'command',
245
- command: '[ -n "$SESSION_ID" ] && npx @claude-flow/cli@latest hooks session-restore --session-id "$SESSION_ID" 2>/dev/null || true',
246
- timeout: 10000,
247
- continueOnError: true,
271
+ command: 'node .claude/helpers/hook-handler.cjs session-end',
272
+ timeout: 5000,
248
273
  },
249
274
  ],
250
275
  },
251
- ];
252
- }
253
- // Stop hooks for task evaluation - always return ok by default
254
- // The hook outputs JSON that Claude Code validates
255
- if (config.stop) {
256
- hooks.Stop = [
257
276
  {
277
+ matcher: 'auto',
258
278
  hooks: [
259
279
  {
260
280
  type: 'command',
261
- command: 'echo \'{"ok": true}\'',
262
- timeout: 1000,
281
+ command: 'node .claude/helpers/hook-handler.cjs compact-auto',
263
282
  },
264
- ],
265
- },
266
- ];
267
- }
268
- // Notification hooks - store notifications in memory for swarm awareness
269
- if (config.notification) {
270
- hooks.Notification = [
271
- {
272
- hooks: [
273
283
  {
274
284
  type: 'command',
275
- command: '[ -n "$NOTIFICATION_MESSAGE" ] && npx @claude-flow/cli@latest memory store --namespace notifications --key "notify-$(date +%s)" --value "$NOTIFICATION_MESSAGE" 2>/dev/null || true',
276
- timeout: 3000,
277
- continueOnError: true,
285
+ command: 'node .claude/helpers/hook-handler.cjs session-end',
286
+ timeout: 6000,
278
287
  },
279
288
  ],
280
289
  },
281
290
  ];
282
291
  }
283
- // Note: PermissionRequest is NOT a valid Claude Code hook type
284
- // Auto-allow behavior is configured via settings.permissions.allow instead
292
+ // SubagentStart status update
293
+ hooks.SubagentStart = [
294
+ {
295
+ hooks: [
296
+ {
297
+ type: 'command',
298
+ command: 'node .claude/helpers/hook-handler.cjs status',
299
+ timeout: 3000,
300
+ },
301
+ ],
302
+ },
303
+ ];
304
+ // TeammateIdle — auto-assign pending tasks to idle teammates
305
+ hooks.TeammateIdle = [
306
+ {
307
+ hooks: [
308
+ {
309
+ type: 'command',
310
+ command: 'node .claude/helpers/hook-handler.cjs post-task',
311
+ timeout: 5000,
312
+ },
313
+ ],
314
+ },
315
+ ];
316
+ // TaskCompleted — train patterns and record completion
317
+ hooks.TaskCompleted = [
318
+ {
319
+ hooks: [
320
+ {
321
+ type: 'command',
322
+ command: 'node .claude/helpers/hook-handler.cjs post-task',
323
+ timeout: 5000,
324
+ },
325
+ ],
326
+ },
327
+ ];
285
328
  return hooks;
286
329
  }
287
330
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"settings-generator.js","sourceRoot":"","sources":["../../../src/init/settings-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAoB;IACnD,MAAM,QAAQ,GAA4B,EAAE,CAAC;IAE7C,uBAAuB;IACvB,IAAI,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAChC,QAAQ,CAAC,KAAK,GAAG,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,0CAA0C;IAC1C,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAC/B,QAAQ,CAAC,UAAU,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,kBAAkB;IAClB,QAAQ,CAAC,WAAW,GAAG;QACrB,mCAAmC;QACnC,oDAAoD;QACpD,KAAK,EAAE;YACL,yBAAyB;YACzB,8BAA8B;YAC9B,sBAAsB;SACvB;QACD,iCAAiC;QACjC,IAAI,EAAE,EAAE;KACT,CAAC;IAEF,sDAAsD;IACtD,QAAQ,CAAC,WAAW,GAAG;QACrB,MAAM,EAAE,2CAA2C;QACnD,EAAE,EAAE,wEAAwE;KAC7E,CAAC;IAEF,kEAAkE;IAClE,8DAA8D;IAC9D,iGAAiG;IAEjG,2BAA2B;IAC3B,QAAQ,CAAC,UAAU,GAAG;QACpB,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,IAAI;QACb,gBAAgB,EAAE;YAChB,OAAO,EAAE,iBAAiB;YAC1B,OAAO,EAAE,2BAA2B;SACrC;QACD,KAAK,EAAE;YACL,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ;YAClC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS;SAC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IAAI,EAAE,SAAS;wBACf,OAAO,EAAE,oDAAoD;qBAC9D;oBACD;wBACE,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE,mDAAmD;wBAC5D,OAAO,EAAE,IAAI;qBACd;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED,gCAAgC;IAChC,KAAK,CAAC,aAAa,GAAG;QACpB;YACE,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,8CAA8C;oBACvD,OAAO,EAAE,IAAI;iBACd;aACF;SACF;KACF,CAAC;IAEF,6DAA6D;IAC7D,KAAK,CAAC,YAAY,GAAG;QACnB;YACE,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,iDAAiD;oBAC1D,OAAO,EAAE,IAAI;iBACd;aACF;SACF;KACF,CAAC;IAEF,uDAAuD;IACvD,KAAK,CAAC,aAAa,GAAG;QACpB;YACE,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,iDAAiD;oBAC1D,OAAO,EAAE,IAAI;iBACd;aACF;SACF;KACF,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAoB;IACvD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC3C,CAAC"}
@@ -1,16 +1,24 @@
1
1
  /**
2
- * Statusline Configuration Generator
3
- * Creates statusline configuration for V3 progress display
2
+ * Statusline Configuration Generator (Optimized)
3
+ * Creates fast, reliable statusline for V3 progress display
4
+ *
5
+ * Performance:
6
+ * - Single combined git execSync call (not 8+ separate ones)
7
+ * - process.memoryUsage() instead of ps aux
8
+ * - No recursive test file content reading
9
+ * - Shared settings cache
10
+ * - Strict 2s timeouts on all shell calls
4
11
  */
5
12
  import type { InitOptions } from './types.js';
6
13
  /**
7
- * Generate statusline configuration script
8
- * Matches the advanced format:
9
- * ▊ Claude Flow V3 ● user │ ⎇ v3 │ Opus 4.5
14
+ * Generate optimized statusline script
15
+ * Output format:
16
+ * ▊ Claude Flow V3 ● user │ ⎇ branch │ Opus 4.6
10
17
  * ─────────────────────────────────────────────────────
11
- * 🏗️ DDD Domains [●●●●●] 5/5 ⚡ HNSW 12500x (or 📚 22.9k patterns)
12
- * 🤖 Swarm ◉ [12/15] 👥 0 🟢 CVE 3/3 💾 5177MB 📂 56% 🧠 30%
13
- * 🔧 Architecture DDD100% │ SecurityCLEAN │ Memory ●AgentDBIntegration
18
+ * 🏗️ DDD Domains [●●○○○] 2/5 ⚡ HNSW 150x
19
+ * 🤖 Swarm ◉ [ 5/15] 👥 2 🪝 10/17 🟢 CVE 3/3 💾 4MB 🧠 63%
20
+ * 🔧 Architecture ADRs71% │ DDD13%SecurityCLEAN
21
+ * 📊 AgentDB Vectors ●3104⚡ │ Size 216KB │ Tests ●6 (~24 cases) │ MCP ●1/1
14
22
  */
15
23
  export declare function generateStatuslineScript(options: InitOptions): string;
16
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"statusline-generator.d.ts","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,YAAY,CAAC;AAEhE;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA6qCrE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA2BnE"}
1
+ {"version":3,"file":"statusline-generator.d.ts","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAuqBrE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA8BnE"}