@claude-flow/cli 3.0.0-alpha.1 → 3.0.0-alpha.11
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.
- package/.agentic-flow/intelligence.json +4 -3
- package/.claude-flow/agents/store.json +16 -0
- package/.claude-flow/daemon-state.json +123 -0
- package/.claude-flow/daemon-test.log +0 -0
- package/.claude-flow/daemon.log +0 -0
- package/.claude-flow/daemon2.log +0 -0
- package/.claude-flow/daemon3.log +0 -0
- package/.claude-flow/hive-mind/state.json +51 -0
- package/.claude-flow/metrics/codebase-map.json +11 -0
- package/.claude-flow/metrics/consolidation.json +6 -0
- package/.claude-flow/metrics/performance.json +3 -3
- package/.claude-flow/metrics/security-audit.json +10 -0
- package/.claude-flow/metrics/task-metrics.json +3 -3
- package/.claude-flow/metrics/test-gaps.json +6 -0
- package/agents/architect.yaml +11 -0
- package/agents/coder.yaml +11 -0
- package/agents/reviewer.yaml +10 -0
- package/agents/security-architect.yaml +10 -0
- package/agents/tester.yaml +10 -0
- package/bin/cli.js +0 -0
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +43 -27
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/claims.d.ts +10 -0
- package/dist/src/commands/claims.d.ts.map +1 -0
- package/dist/src/commands/claims.js +288 -0
- package/dist/src/commands/claims.js.map +1 -0
- package/dist/src/commands/config.js +2 -2
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.d.ts +8 -0
- package/dist/src/commands/daemon.d.ts.map +1 -0
- package/dist/src/commands/daemon.js +545 -0
- package/dist/src/commands/daemon.js.map +1 -0
- package/dist/src/commands/deployment.d.ts +10 -0
- package/dist/src/commands/deployment.d.ts.map +1 -0
- package/dist/src/commands/deployment.js +289 -0
- package/dist/src/commands/deployment.js.map +1 -0
- package/dist/src/commands/embeddings.d.ts +10 -0
- package/dist/src/commands/embeddings.d.ts.map +1 -0
- package/dist/src/commands/embeddings.js +294 -0
- package/dist/src/commands/embeddings.js.map +1 -0
- package/dist/src/commands/hive-mind.d.ts.map +1 -1
- package/dist/src/commands/hive-mind.js +252 -35
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.js +1 -1
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +9 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +31 -1
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/mcp.js +1 -1
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +234 -168
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +1 -1
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.d.ts +10 -0
- package/dist/src/commands/neural.d.ts.map +1 -0
- package/dist/src/commands/neural.js +224 -0
- package/dist/src/commands/neural.js.map +1 -0
- package/dist/src/commands/performance.d.ts +10 -0
- package/dist/src/commands/performance.d.ts.map +1 -0
- package/dist/src/commands/performance.js +262 -0
- package/dist/src/commands/performance.js.map +1 -0
- package/dist/src/commands/plugins.d.ts +10 -0
- package/dist/src/commands/plugins.d.ts.map +1 -0
- package/dist/src/commands/plugins.js +280 -0
- package/dist/src/commands/plugins.js.map +1 -0
- package/dist/src/commands/process.d.ts.map +1 -1
- package/dist/src/commands/process.js +95 -20
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/providers.d.ts +10 -0
- package/dist/src/commands/providers.d.ts.map +1 -0
- package/dist/src/commands/providers.js +232 -0
- package/dist/src/commands/providers.js.map +1 -0
- package/dist/src/commands/security.d.ts +10 -0
- package/dist/src/commands/security.d.ts.map +1 -0
- package/dist/src/commands/security.js +261 -0
- package/dist/src/commands/security.js.map +1 -0
- package/dist/src/commands/start.js +2 -2
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +26 -2
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +6 -6
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +48 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +5 -0
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts.map +1 -1
- package/dist/src/init/helpers-generator.js +1 -1
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +22 -12
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +2 -2
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +15 -1
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts.map +1 -1
- package/dist/src/mcp-server.js +5 -0
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +350 -14
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/config-tools.d.ts +1 -1
- package/dist/src/mcp-tools/config-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +262 -15
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/hive-mind-tools.js +447 -0
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -0
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +80 -15
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +4 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +4 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +157 -9
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.d.ts +8 -0
- package/dist/src/mcp-tools/session-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/session-tools.js +315 -0
- package/dist/src/mcp-tools/session-tools.js.map +1 -0
- package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +37 -2
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.d.ts +8 -0
- package/dist/src/mcp-tools/task-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/task-tools.js +302 -0
- package/dist/src/mcp-tools/task-tools.js.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
- package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/workflow-tools.js +481 -0
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -0
- package/dist/src/output.d.ts +16 -0
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +42 -0
- package/dist/src/output.js.map +1 -1
- package/dist/src/services/index.d.ts +7 -0
- package/dist/src/services/index.d.ts.map +1 -0
- package/dist/src/services/index.js +6 -0
- package/dist/src/services/index.js.map +1 -0
- package/dist/src/services/worker-daemon.d.ts +153 -0
- package/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/dist/src/services/worker-daemon.js +567 -0
- package/dist/src/services/worker-daemon.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/scripts/publish.sh +46 -0
- package/src/commands/agent.ts +43 -29
- package/src/commands/claims.ts +317 -0
- package/src/commands/config.ts +2 -2
- package/src/commands/daemon.ts +621 -0
- package/src/commands/deployment.ts +323 -0
- package/src/commands/embeddings.ts +332 -0
- package/src/commands/hive-mind.ts +229 -63
- package/src/commands/hooks.ts +1 -1
- package/src/commands/index.ts +31 -1
- package/src/commands/mcp.ts +1 -1
- package/src/commands/memory.ts +279 -181
- package/src/commands/migrate.ts +1 -1
- package/src/commands/neural.ts +253 -0
- package/src/commands/performance.ts +292 -0
- package/src/commands/plugins.ts +316 -0
- package/src/commands/process.ts +98 -20
- package/src/commands/providers.ts +259 -0
- package/src/commands/security.ts +288 -0
- package/src/commands/start.ts +2 -2
- package/src/commands/status.ts +33 -2
- package/src/commands/swarm.ts +6 -6
- package/src/index.ts +52 -4
- package/src/init/executor.ts +6 -0
- package/src/init/helpers-generator.ts +1 -1
- package/src/init/settings-generator.ts +22 -12
- package/src/init/types.ts +3 -3
- package/src/mcp-client.ts +15 -1
- package/src/mcp-server.ts +6 -0
- package/src/mcp-tools/agent-tools.ts +388 -14
- package/src/mcp-tools/config-tools.ts +297 -15
- package/src/mcp-tools/hive-mind-tools.ts +521 -0
- package/src/mcp-tools/hooks-tools.ts +84 -15
- package/src/mcp-tools/index.ts +4 -0
- package/src/mcp-tools/memory-tools.ts +190 -9
- package/src/mcp-tools/session-tools.ts +359 -0
- package/src/mcp-tools/swarm-tools.ts +38 -2
- package/src/mcp-tools/task-tools.ts +347 -0
- package/src/mcp-tools/workflow-tools.ts +573 -0
- package/src/output.ts +47 -1
- package/src/services/index.ts +15 -0
- package/src/services/worker-daemon.ts +726 -0
- package/tmp.json +0 -0
package/src/index.ts
CHANGED
|
@@ -1,14 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* V3 CLI Main Entry Point
|
|
3
3
|
* Modernized CLI for Claude Flow V3
|
|
4
|
+
*
|
|
5
|
+
* Created with ❤️ by ruv.io
|
|
4
6
|
*/
|
|
5
7
|
|
|
8
|
+
import { readFileSync } from 'fs';
|
|
9
|
+
import { fileURLToPath } from 'url';
|
|
10
|
+
import { dirname, join } from 'path';
|
|
6
11
|
import type { Command, CommandContext, CommandResult, V3Config, CLIError } from './types.js';
|
|
7
12
|
import { CommandParser, commandParser } from './parser.js';
|
|
8
13
|
import { OutputFormatter, output } from './output.js';
|
|
9
14
|
import { commands, commandRegistry, getCommand } from './commands/index.js';
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
// Read version from package.json at runtime
|
|
17
|
+
function getPackageVersion(): string {
|
|
18
|
+
try {
|
|
19
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
+
const __dirname = dirname(__filename);
|
|
21
|
+
// Navigate from dist/src to package root
|
|
22
|
+
const pkgPath = join(__dirname, '..', '..', 'package.json');
|
|
23
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
24
|
+
return pkg.version || '3.0.0';
|
|
25
|
+
} catch {
|
|
26
|
+
return '3.0.0';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const VERSION = getPackageVersion();
|
|
12
31
|
|
|
13
32
|
export interface CLIOptions {
|
|
14
33
|
name?: string;
|
|
@@ -61,6 +80,21 @@ export class CLI {
|
|
|
61
80
|
this.output.setColorEnabled(false);
|
|
62
81
|
}
|
|
63
82
|
|
|
83
|
+
// Set verbosity level based on flags
|
|
84
|
+
if (flags.quiet) {
|
|
85
|
+
this.output.setVerbosity('quiet');
|
|
86
|
+
} else if (flags.verbose) {
|
|
87
|
+
this.output.setVerbosity(process.env.DEBUG ? 'debug' : 'verbose');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Verbose mode: show parsed arguments
|
|
91
|
+
if (this.output.isVerbose()) {
|
|
92
|
+
this.output.printDebug(`Command: ${commandPath.join(' ') || '(none)'}`);
|
|
93
|
+
this.output.printDebug(`Positional: [${positional.join(', ')}]`);
|
|
94
|
+
this.output.printDebug(`Flags: ${JSON.stringify(Object.fromEntries(Object.entries(flags).filter(([k]) => k !== '_')))}`);
|
|
95
|
+
this.output.printDebug(`CWD: ${process.cwd()}`);
|
|
96
|
+
}
|
|
97
|
+
|
|
64
98
|
// No command - show help
|
|
65
99
|
if (commandPath.length === 0 || flags.help || flags.h) {
|
|
66
100
|
if (commandPath.length > 0) {
|
|
@@ -89,6 +123,7 @@ export class CLI {
|
|
|
89
123
|
let subcommandArgs = positional;
|
|
90
124
|
|
|
91
125
|
// Process command path (e.g., ['hooks', 'worker', 'list'])
|
|
126
|
+
// Note: When parser includes subcommand in commandPath, positional already excludes it
|
|
92
127
|
if (commandPath.length > 1 && command.subcommands) {
|
|
93
128
|
const subcommandName = commandPath[1];
|
|
94
129
|
const subcommand = command.subcommands.find(
|
|
@@ -97,7 +132,8 @@ export class CLI {
|
|
|
97
132
|
|
|
98
133
|
if (subcommand) {
|
|
99
134
|
targetCommand = subcommand;
|
|
100
|
-
|
|
135
|
+
// Parser already extracted subcommand from positional, so use as-is
|
|
136
|
+
subcommandArgs = positional;
|
|
101
137
|
|
|
102
138
|
// Check for nested subcommand (level 2)
|
|
103
139
|
if (commandPath.length > 2 && subcommand.subcommands) {
|
|
@@ -107,7 +143,8 @@ export class CLI {
|
|
|
107
143
|
);
|
|
108
144
|
if (nestedSubcommand) {
|
|
109
145
|
targetCommand = nestedSubcommand;
|
|
110
|
-
|
|
146
|
+
// Parser already extracted nested subcommand too
|
|
147
|
+
subcommandArgs = positional;
|
|
111
148
|
}
|
|
112
149
|
}
|
|
113
150
|
}
|
|
@@ -156,8 +193,17 @@ export class CLI {
|
|
|
156
193
|
|
|
157
194
|
// Execute command
|
|
158
195
|
if (targetCommand.action) {
|
|
196
|
+
if (this.output.isVerbose()) {
|
|
197
|
+
this.output.printDebug(`Executing: ${targetCommand.name}`);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const startTime = Date.now();
|
|
159
201
|
const result = await targetCommand.action(ctx);
|
|
160
202
|
|
|
203
|
+
if (this.output.isVerbose()) {
|
|
204
|
+
this.output.printDebug(`Completed in ${Date.now() - startTime}ms`);
|
|
205
|
+
}
|
|
206
|
+
|
|
161
207
|
if (result && !result.success) {
|
|
162
208
|
process.exit(result.exitCode || 1);
|
|
163
209
|
}
|
|
@@ -223,6 +269,8 @@ export class CLI {
|
|
|
223
269
|
|
|
224
270
|
this.output.writeln(this.output.dim('Run "claude-flow <command> --help" for command help'));
|
|
225
271
|
this.output.writeln();
|
|
272
|
+
this.output.writeln(this.output.dim('Created with ❤️ by ruv.io'));
|
|
273
|
+
this.output.writeln();
|
|
226
274
|
}
|
|
227
275
|
|
|
228
276
|
/**
|
|
@@ -359,7 +407,7 @@ export * from './types.js';
|
|
|
359
407
|
export { CommandParser, commandParser } from './parser.js';
|
|
360
408
|
|
|
361
409
|
// Output
|
|
362
|
-
export { OutputFormatter, output, Progress, Spinner } from './output.js';
|
|
410
|
+
export { OutputFormatter, output, Progress, Spinner, type VerbosityLevel } from './output.js';
|
|
363
411
|
|
|
364
412
|
// Prompt
|
|
365
413
|
export * from './prompt.js';
|
package/src/init/executor.ts
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
import * as fs from 'fs';
|
|
7
7
|
import * as path from 'path';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import { dirname } from 'path';
|
|
10
|
+
|
|
11
|
+
// ESM-compatible __dirname
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = dirname(__filename);
|
|
8
14
|
import type { InitOptions, InitResult, PlatformInfo } from './types.js';
|
|
9
15
|
import { detectPlatform } from './types.js';
|
|
10
16
|
import { generateSettingsJson } from './settings-generator.js';
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { InitOptions } from './types.js';
|
|
7
|
+
import { generateStatuslineScript, generateStatuslineHook } from './statusline-generator.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Generate pre-commit hook script
|
|
@@ -619,7 +620,6 @@ export function generateHelpers(options: InitOptions): Record<string, string> {
|
|
|
619
620
|
}
|
|
620
621
|
|
|
621
622
|
if (options.components.statusline) {
|
|
622
|
-
const { generateStatuslineScript, generateStatuslineHook } = require('./statusline-generator.js');
|
|
623
623
|
helpers['statusline.js'] = generateStatuslineScript(options);
|
|
624
624
|
helpers['statusline-hook.sh'] = generateStatuslineHook(options);
|
|
625
625
|
}
|
|
@@ -50,6 +50,10 @@ export function generateSettings(options: InitOptions): object {
|
|
|
50
50
|
neural: {
|
|
51
51
|
enabled: options.runtime.enableNeural,
|
|
52
52
|
},
|
|
53
|
+
daemon: {
|
|
54
|
+
autoStart: true,
|
|
55
|
+
workers: ['map', 'audit', 'optimize', 'consolidate', 'testgaps'],
|
|
56
|
+
},
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
return settings;
|
|
@@ -70,7 +74,7 @@ function generateHooksConfig(config: HooksConfig): object {
|
|
|
70
74
|
hooks: [
|
|
71
75
|
{
|
|
72
76
|
type: 'command',
|
|
73
|
-
command: 'npx
|
|
77
|
+
command: 'npx claude-flow@v3alpha hooks pre-edit --file "$TOOL_INPUT_file_path" --intelligence',
|
|
74
78
|
timeout: config.timeout,
|
|
75
79
|
continueOnError: config.continueOnError,
|
|
76
80
|
},
|
|
@@ -82,7 +86,7 @@ function generateHooksConfig(config: HooksConfig): object {
|
|
|
82
86
|
hooks: [
|
|
83
87
|
{
|
|
84
88
|
type: 'command',
|
|
85
|
-
command: 'npx
|
|
89
|
+
command: 'npx claude-flow@v3alpha hooks pre-command --command "$TOOL_INPUT_command"',
|
|
86
90
|
timeout: config.timeout,
|
|
87
91
|
continueOnError: config.continueOnError,
|
|
88
92
|
},
|
|
@@ -94,7 +98,7 @@ function generateHooksConfig(config: HooksConfig): object {
|
|
|
94
98
|
hooks: [
|
|
95
99
|
{
|
|
96
100
|
type: 'command',
|
|
97
|
-
command: 'npx
|
|
101
|
+
command: 'npx claude-flow@v3alpha hooks pre-task --task-id "task-$(date +%s)" --description "$TOOL_INPUT_prompt"',
|
|
98
102
|
timeout: config.timeout,
|
|
99
103
|
continueOnError: config.continueOnError,
|
|
100
104
|
},
|
|
@@ -106,7 +110,7 @@ function generateHooksConfig(config: HooksConfig): object {
|
|
|
106
110
|
hooks: [
|
|
107
111
|
{
|
|
108
112
|
type: 'command',
|
|
109
|
-
command: 'npx
|
|
113
|
+
command: 'npx claude-flow@v3alpha hooks pre-search --pattern "$TOOL_INPUT_pattern"',
|
|
110
114
|
timeout: 2000,
|
|
111
115
|
continueOnError: true,
|
|
112
116
|
},
|
|
@@ -124,7 +128,7 @@ function generateHooksConfig(config: HooksConfig): object {
|
|
|
124
128
|
hooks: [
|
|
125
129
|
{
|
|
126
130
|
type: 'command',
|
|
127
|
-
command: 'npx
|
|
131
|
+
command: 'npx claude-flow@v3alpha hooks post-edit --file "$TOOL_INPUT_file_path" --success "$TOOL_SUCCESS" --train-patterns',
|
|
128
132
|
timeout: config.timeout,
|
|
129
133
|
continueOnError: config.continueOnError,
|
|
130
134
|
},
|
|
@@ -136,7 +140,7 @@ function generateHooksConfig(config: HooksConfig): object {
|
|
|
136
140
|
hooks: [
|
|
137
141
|
{
|
|
138
142
|
type: 'command',
|
|
139
|
-
command: 'npx
|
|
143
|
+
command: 'npx claude-flow@v3alpha hooks post-command --command "$TOOL_INPUT_command" --success "$TOOL_SUCCESS" --exit-code "$TOOL_EXIT_CODE"',
|
|
140
144
|
timeout: config.timeout,
|
|
141
145
|
continueOnError: config.continueOnError,
|
|
142
146
|
},
|
|
@@ -148,7 +152,7 @@ function generateHooksConfig(config: HooksConfig): object {
|
|
|
148
152
|
hooks: [
|
|
149
153
|
{
|
|
150
154
|
type: 'command',
|
|
151
|
-
command: 'npx
|
|
155
|
+
command: 'npx claude-flow@v3alpha hooks post-task --agent-id "$TOOL_RESULT_agent_id" --success "$TOOL_SUCCESS" --analyze',
|
|
152
156
|
timeout: config.timeout,
|
|
153
157
|
continueOnError: config.continueOnError,
|
|
154
158
|
},
|
|
@@ -160,7 +164,7 @@ function generateHooksConfig(config: HooksConfig): object {
|
|
|
160
164
|
hooks: [
|
|
161
165
|
{
|
|
162
166
|
type: 'command',
|
|
163
|
-
command: 'npx
|
|
167
|
+
command: 'npx claude-flow@v3alpha hooks post-search --cache-results',
|
|
164
168
|
timeout: 2000,
|
|
165
169
|
continueOnError: true,
|
|
166
170
|
},
|
|
@@ -176,7 +180,7 @@ function generateHooksConfig(config: HooksConfig): object {
|
|
|
176
180
|
hooks: [
|
|
177
181
|
{
|
|
178
182
|
type: 'command',
|
|
179
|
-
command: 'npx
|
|
183
|
+
command: 'npx claude-flow@v3alpha hooks route --task "$PROMPT" --intelligence --include-explanation',
|
|
180
184
|
timeout: config.timeout,
|
|
181
185
|
continueOnError: config.continueOnError,
|
|
182
186
|
},
|
|
@@ -185,14 +189,20 @@ function generateHooksConfig(config: HooksConfig): object {
|
|
|
185
189
|
];
|
|
186
190
|
}
|
|
187
191
|
|
|
188
|
-
// SessionStart for context loading
|
|
192
|
+
// SessionStart for context loading and daemon auto-start
|
|
189
193
|
if (config.sessionStart) {
|
|
190
194
|
hooks.SessionStart = [
|
|
191
195
|
{
|
|
192
196
|
hooks: [
|
|
193
197
|
{
|
|
194
198
|
type: 'command',
|
|
195
|
-
command: 'npx
|
|
199
|
+
command: 'npx claude-flow@v3alpha daemon start --quiet 2>/dev/null || true',
|
|
200
|
+
timeout: 5000,
|
|
201
|
+
continueOnError: true,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
type: 'command',
|
|
205
|
+
command: 'npx claude-flow@v3alpha hooks session-start --session-id "$SESSION_ID" --load-context',
|
|
196
206
|
timeout: 10000,
|
|
197
207
|
continueOnError: true,
|
|
198
208
|
},
|
|
@@ -227,7 +237,7 @@ Respond with {"decision": "stop"} if complete, or {"decision": "continue", "reas
|
|
|
227
237
|
hooks: [
|
|
228
238
|
{
|
|
229
239
|
type: 'command',
|
|
230
|
-
command: 'npx
|
|
240
|
+
command: 'npx claude-flow@v3alpha hooks notify --message "$NOTIFICATION_MESSAGE" --swarm-status',
|
|
231
241
|
timeout: 3000,
|
|
232
242
|
continueOnError: true,
|
|
233
243
|
},
|
package/src/init/types.ts
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Configuration options for initializing Claude Code integration
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import os from 'os';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
|
|
6
9
|
/**
|
|
7
10
|
* Components that can be initialized
|
|
8
11
|
*/
|
|
@@ -187,9 +190,6 @@ export interface PlatformInfo {
|
|
|
187
190
|
* Detect current platform
|
|
188
191
|
*/
|
|
189
192
|
export function detectPlatform(): PlatformInfo {
|
|
190
|
-
const os = require('os');
|
|
191
|
-
const path = require('path');
|
|
192
|
-
|
|
193
193
|
const platform = os.platform();
|
|
194
194
|
const arch = os.arch();
|
|
195
195
|
const homeDir = os.homedir();
|
package/src/mcp-client.ts
CHANGED
|
@@ -16,6 +16,10 @@ import { swarmTools } from './mcp-tools/swarm-tools.js';
|
|
|
16
16
|
import { memoryTools } from './mcp-tools/memory-tools.js';
|
|
17
17
|
import { configTools } from './mcp-tools/config-tools.js';
|
|
18
18
|
import { hooksTools } from './mcp-tools/hooks-tools.js';
|
|
19
|
+
import { taskTools } from './mcp-tools/task-tools.js';
|
|
20
|
+
import { sessionTools } from './mcp-tools/session-tools.js';
|
|
21
|
+
import { hiveMindTools } from './mcp-tools/hive-mind-tools.js';
|
|
22
|
+
import { workflowTools } from './mcp-tools/workflow-tools.js';
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
25
|
* MCP Tool Registry
|
|
@@ -31,7 +35,17 @@ function registerTools(tools: MCPTool[]): void {
|
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
// Initialize registry with all available tools
|
|
34
|
-
registerTools([
|
|
38
|
+
registerTools([
|
|
39
|
+
...agentTools,
|
|
40
|
+
...swarmTools,
|
|
41
|
+
...memoryTools,
|
|
42
|
+
...configTools,
|
|
43
|
+
...hooksTools,
|
|
44
|
+
...taskTools,
|
|
45
|
+
...sessionTools,
|
|
46
|
+
...hiveMindTools,
|
|
47
|
+
...workflowTools,
|
|
48
|
+
]);
|
|
35
49
|
|
|
36
50
|
/**
|
|
37
51
|
* MCP Client Error
|
package/src/mcp-server.ts
CHANGED
|
@@ -23,6 +23,12 @@ import { createServer, Server } from 'http';
|
|
|
23
23
|
import * as path from 'path';
|
|
24
24
|
import * as fs from 'fs';
|
|
25
25
|
import * as os from 'os';
|
|
26
|
+
import { fileURLToPath } from 'url';
|
|
27
|
+
import { dirname } from 'path';
|
|
28
|
+
|
|
29
|
+
// ESM-compatible __dirname
|
|
30
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
31
|
+
const __dirname = dirname(__filename);
|
|
26
32
|
|
|
27
33
|
/**
|
|
28
34
|
* MCP Server configuration
|