claude-flow-novice 1.5.10 → 1.5.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/.claude-flow-novice/dist/src/cli/commands/index.js +1049 -1087
- package/.claude-flow-novice/dist/src/cli/commands/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/CLAUDE.md +301 -26
- package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/enhanced-templates.js +3 -40
- package/CLAUDE.md +326 -1910
- package/package.json +1 -1
- package/src/cli/simple-commands/init/templates/CLAUDE.md +276 -26
- package/src/cli/simple-commands/init/templates/enhanced-templates.js +3 -40
- package/.claude-flow-novice/dist/src/cli/simple-commands/init/CLAUDE.md +0 -188
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import chalk from
|
|
2
|
-
import { getErrorMessage } from
|
|
3
|
-
import { success, error, warning, info } from
|
|
4
|
-
import colors from
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { getErrorMessage } from "../../utils/error-handler.js";
|
|
3
|
+
import { success, error, warning, info } from "../cli-core.js";
|
|
4
|
+
import colors from "chalk";
|
|
5
5
|
const { bold, blue, yellow } = colors;
|
|
6
|
-
import { Orchestrator } from
|
|
7
|
-
import { ConfigManager } from
|
|
8
|
-
import { EventBus } from
|
|
9
|
-
import { Logger } from
|
|
10
|
-
import { JsonPersistenceManager } from
|
|
11
|
-
import { swarmAction } from
|
|
12
|
-
import { SimpleMemoryManager } from
|
|
13
|
-
import { sparcAction } from
|
|
14
|
-
import { createMigrateCommand } from
|
|
15
|
-
import { enterpriseCommands } from
|
|
6
|
+
import { Orchestrator } from "../../core/orchestrator-fixed.js";
|
|
7
|
+
import { ConfigManager } from "../../core/config.js";
|
|
8
|
+
import { EventBus } from "../../core/event-bus.js";
|
|
9
|
+
import { Logger } from "../../core/logger.js";
|
|
10
|
+
import { JsonPersistenceManager } from "../../core/json-persistence.js";
|
|
11
|
+
import { swarmAction } from "./swarm.js";
|
|
12
|
+
import { SimpleMemoryManager } from "./memory.js";
|
|
13
|
+
import { sparcAction } from "./sparc.js";
|
|
14
|
+
import { createMigrateCommand } from "./migrate.js";
|
|
15
|
+
import { enterpriseCommands } from "./enterprise.js";
|
|
16
|
+
import { createEnhancedClaudeMd } from "../simple-commands/init/templates/enhanced-templates.js";
|
|
16
17
|
let orchestrator = null;
|
|
17
18
|
let configManager = null;
|
|
18
19
|
let persistence = null;
|
|
@@ -28,9 +29,9 @@ async function getOrchestrator() {
|
|
|
28
29
|
const config = await getConfigManager();
|
|
29
30
|
const eventBus = EventBus.getInstance();
|
|
30
31
|
const logger = new Logger({
|
|
31
|
-
level:
|
|
32
|
-
format:
|
|
33
|
-
destination:
|
|
32
|
+
level: "info",
|
|
33
|
+
format: "text",
|
|
34
|
+
destination: "console"
|
|
34
35
|
});
|
|
35
36
|
orchestrator = new Orchestrator(config, eventBus, logger);
|
|
36
37
|
}
|
|
@@ -46,29 +47,29 @@ async function getConfigManager() {
|
|
|
46
47
|
export function setupCommands(cli) {
|
|
47
48
|
// Neural init command
|
|
48
49
|
cli.command({
|
|
49
|
-
name:
|
|
50
|
-
description:
|
|
50
|
+
name: "neural",
|
|
51
|
+
description: "Neural module management",
|
|
51
52
|
subcommands: [
|
|
52
53
|
{
|
|
53
|
-
name:
|
|
54
|
-
description:
|
|
54
|
+
name: "init",
|
|
55
|
+
description: "Initialize SAFLA neural module",
|
|
55
56
|
options: [
|
|
56
57
|
{
|
|
57
|
-
name:
|
|
58
|
-
short:
|
|
59
|
-
description:
|
|
60
|
-
type:
|
|
58
|
+
name: "force",
|
|
59
|
+
short: "f",
|
|
60
|
+
description: "Overwrite existing module",
|
|
61
|
+
type: "boolean"
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
|
-
name:
|
|
64
|
-
short:
|
|
65
|
-
description:
|
|
66
|
-
type:
|
|
67
|
-
defaultValue:
|
|
64
|
+
name: "target",
|
|
65
|
+
short: "t",
|
|
66
|
+
description: "Target directory",
|
|
67
|
+
type: "string",
|
|
68
|
+
defaultValue: ".claude/agents/neural"
|
|
68
69
|
}
|
|
69
70
|
],
|
|
70
71
|
action: async (ctx)=>{
|
|
71
|
-
const { initNeuralModule } = await import(
|
|
72
|
+
const { initNeuralModule } = await import("../../scripts/init-neural.js");
|
|
72
73
|
await initNeuralModule({
|
|
73
74
|
force: ctx.flags.force,
|
|
74
75
|
targetDir: ctx.flags.target
|
|
@@ -79,29 +80,29 @@ export function setupCommands(cli) {
|
|
|
79
80
|
});
|
|
80
81
|
// Goal init command
|
|
81
82
|
cli.command({
|
|
82
|
-
name:
|
|
83
|
-
description:
|
|
83
|
+
name: "goal",
|
|
84
|
+
description: "Goal module management",
|
|
84
85
|
subcommands: [
|
|
85
86
|
{
|
|
86
|
-
name:
|
|
87
|
-
description:
|
|
87
|
+
name: "init",
|
|
88
|
+
description: "Initialize GOAP goal module",
|
|
88
89
|
options: [
|
|
89
90
|
{
|
|
90
|
-
name:
|
|
91
|
-
short:
|
|
92
|
-
description:
|
|
93
|
-
type:
|
|
91
|
+
name: "force",
|
|
92
|
+
short: "f",
|
|
93
|
+
description: "Overwrite existing module",
|
|
94
|
+
type: "boolean"
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
|
-
name:
|
|
97
|
-
short:
|
|
98
|
-
description:
|
|
99
|
-
type:
|
|
100
|
-
defaultValue:
|
|
97
|
+
name: "target",
|
|
98
|
+
short: "t",
|
|
99
|
+
description: "Target directory",
|
|
100
|
+
type: "string",
|
|
101
|
+
defaultValue: ".claude/agents/goal"
|
|
101
102
|
}
|
|
102
103
|
],
|
|
103
104
|
action: async (ctx)=>{
|
|
104
|
-
const { initGoalModule } = await import(
|
|
105
|
+
const { initGoalModule } = await import("../../scripts/init-goal.js");
|
|
105
106
|
await initGoalModule({
|
|
106
107
|
force: ctx.flags.force,
|
|
107
108
|
targetDir: ctx.flags.target
|
|
@@ -112,75 +113,75 @@ export function setupCommands(cli) {
|
|
|
112
113
|
});
|
|
113
114
|
// Init command
|
|
114
115
|
cli.command({
|
|
115
|
-
name:
|
|
116
|
-
description:
|
|
116
|
+
name: "init",
|
|
117
|
+
description: "Initialize Claude Code integration files",
|
|
117
118
|
options: [
|
|
118
119
|
{
|
|
119
|
-
name:
|
|
120
|
-
short:
|
|
121
|
-
description:
|
|
122
|
-
type:
|
|
120
|
+
name: "force",
|
|
121
|
+
short: "f",
|
|
122
|
+
description: "Overwrite existing files",
|
|
123
|
+
type: "boolean"
|
|
123
124
|
},
|
|
124
125
|
{
|
|
125
|
-
name:
|
|
126
|
-
short:
|
|
127
|
-
description:
|
|
128
|
-
type:
|
|
126
|
+
name: "minimal",
|
|
127
|
+
short: "m",
|
|
128
|
+
description: "Create minimal configuration files",
|
|
129
|
+
type: "boolean"
|
|
129
130
|
}
|
|
130
131
|
],
|
|
131
132
|
action: async (ctx)=>{
|
|
132
133
|
try {
|
|
133
|
-
success(
|
|
134
|
+
success("Initializing Claude Code integration files...");
|
|
134
135
|
const force = ctx.flags.force || ctx.flags.f;
|
|
135
136
|
const minimal = ctx.flags.minimal || ctx.flags.m;
|
|
136
137
|
// Flow-nexus mode removed
|
|
137
138
|
// Check if files already exist for full init
|
|
138
139
|
const files = [
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
"CLAUDE.md",
|
|
141
|
+
"memory-bank.md",
|
|
142
|
+
"coordination.md"
|
|
142
143
|
];
|
|
143
144
|
const existingFiles = [];
|
|
144
145
|
for (const file of files){
|
|
145
|
-
const { access } = await import(
|
|
146
|
+
const { access } = await import("fs/promises");
|
|
146
147
|
const exists = await access(file).then(()=>true).catch(()=>false);
|
|
147
148
|
if (exists) {
|
|
148
149
|
existingFiles.push(file);
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
if (existingFiles.length > 0 && !force) {
|
|
152
|
-
warning(`The following files already exist: ${existingFiles.join(
|
|
153
|
-
console.log(
|
|
153
|
+
warning(`The following files already exist: ${existingFiles.join(", ")}`);
|
|
154
|
+
console.log("Use --force to overwrite existing files");
|
|
154
155
|
return;
|
|
155
156
|
}
|
|
156
157
|
// Create CLAUDE.md
|
|
157
158
|
const claudeMd = minimal ? createMinimalClaudeMd() : createFullClaudeMd();
|
|
158
|
-
const { writeFile } = await import(
|
|
159
|
-
await writeFile(
|
|
160
|
-
console.log(
|
|
159
|
+
const { writeFile } = await import("fs/promises");
|
|
160
|
+
await writeFile("CLAUDE.md", claudeMd);
|
|
161
|
+
console.log(" ✓ Created CLAUDE.md");
|
|
161
162
|
// Create memory-bank.md
|
|
162
163
|
const memoryBankMd = minimal ? createMinimalMemoryBankMd() : createFullMemoryBankMd();
|
|
163
|
-
await writeFile(
|
|
164
|
-
console.log(
|
|
164
|
+
await writeFile("memory-bank.md", memoryBankMd);
|
|
165
|
+
console.log(" ✓ Created memory-bank.md");
|
|
165
166
|
// Create coordination.md
|
|
166
167
|
const coordinationMd = minimal ? createMinimalCoordinationMd() : createFullCoordinationMd();
|
|
167
|
-
await writeFile(
|
|
168
|
-
console.log(
|
|
168
|
+
await writeFile("coordination.md", coordinationMd);
|
|
169
|
+
console.log(" ✓ Created coordination.md");
|
|
169
170
|
// Create directory structure
|
|
170
171
|
const directories = [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
172
|
+
"memory",
|
|
173
|
+
"memory/agents",
|
|
174
|
+
"memory/sessions",
|
|
175
|
+
"coordination",
|
|
176
|
+
"coordination/memory_bank",
|
|
177
|
+
"coordination/subtasks",
|
|
178
|
+
"coordination/orchestration"
|
|
178
179
|
];
|
|
179
180
|
// Ensure memory directory exists for SQLite database
|
|
180
|
-
if (!directories.includes(
|
|
181
|
-
directories.unshift(
|
|
181
|
+
if (!directories.includes("memory")) {
|
|
182
|
+
directories.unshift("memory");
|
|
182
183
|
}
|
|
183
|
-
const { mkdir } = await import(
|
|
184
|
+
const { mkdir } = await import("fs/promises");
|
|
184
185
|
for (const dir of directories){
|
|
185
186
|
try {
|
|
186
187
|
await mkdir(dir, {
|
|
@@ -188,34 +189,34 @@ export function setupCommands(cli) {
|
|
|
188
189
|
});
|
|
189
190
|
console.log(` ✓ Created ${dir}/ directory`);
|
|
190
191
|
} catch (err) {
|
|
191
|
-
if (err.code !==
|
|
192
|
+
if (err.code !== "EEXIST") {
|
|
192
193
|
throw err;
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
// Create placeholder files for memory directories
|
|
197
198
|
const agentsReadme = createAgentsReadme();
|
|
198
|
-
await writeFile(
|
|
199
|
-
console.log(
|
|
199
|
+
await writeFile("memory/agents/README.md", agentsReadme);
|
|
200
|
+
console.log(" ✓ Created memory/agents/README.md");
|
|
200
201
|
const sessionsReadme = createSessionsReadme();
|
|
201
|
-
await writeFile(
|
|
202
|
-
console.log(
|
|
202
|
+
await writeFile("memory/sessions/README.md", sessionsReadme);
|
|
203
|
+
console.log(" ✓ Created memory/sessions/README.md");
|
|
203
204
|
// Initialize the persistence database
|
|
204
205
|
const initialData = {
|
|
205
206
|
agents: [],
|
|
206
207
|
tasks: [],
|
|
207
208
|
lastUpdated: Date.now()
|
|
208
209
|
};
|
|
209
|
-
await writeFile(
|
|
210
|
-
console.log(
|
|
210
|
+
await writeFile("memory/claude-flow-data.json", JSON.stringify(initialData, null, 2));
|
|
211
|
+
console.log(" ✓ Created memory/claude-flow-data.json (persistence database)");
|
|
211
212
|
// Enhanced features for novice package: Agent system, MCP config, and hooks
|
|
212
|
-
console.log(
|
|
213
|
+
console.log("\n🤖 Setting up enhanced agent system...");
|
|
213
214
|
// Create .claude directory structure for agents
|
|
214
215
|
const claudeDirectories = [
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
".claude",
|
|
217
|
+
".claude/agents",
|
|
218
|
+
".claude/commands",
|
|
219
|
+
".claude/hooks"
|
|
219
220
|
];
|
|
220
221
|
for (const dir of claudeDirectories){
|
|
221
222
|
await mkdir(dir, {
|
|
@@ -224,69 +225,69 @@ export function setupCommands(cli) {
|
|
|
224
225
|
console.log(` ✓ Created ${dir}/ directory`);
|
|
225
226
|
}
|
|
226
227
|
// Create MCP configuration file
|
|
227
|
-
console.log(
|
|
228
|
+
console.log("\n🔌 Setting up MCP configuration...");
|
|
228
229
|
const mcpConfig = {
|
|
229
230
|
mcpServers: {
|
|
230
|
-
|
|
231
|
-
command:
|
|
231
|
+
"claude-flow-novice": {
|
|
232
|
+
command: "npx",
|
|
232
233
|
args: [
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
"claude-flow-novice@latest",
|
|
235
|
+
"mcp",
|
|
236
|
+
"start"
|
|
236
237
|
],
|
|
237
|
-
type:
|
|
238
|
+
type: "stdio"
|
|
238
239
|
},
|
|
239
|
-
|
|
240
|
-
command:
|
|
240
|
+
"ruv-swarm": {
|
|
241
|
+
command: "npx",
|
|
241
242
|
args: [
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
"ruv-swarm@latest",
|
|
244
|
+
"mcp",
|
|
245
|
+
"start"
|
|
245
246
|
],
|
|
246
|
-
type:
|
|
247
|
+
type: "stdio"
|
|
247
248
|
}
|
|
248
249
|
}
|
|
249
250
|
};
|
|
250
|
-
await writeFile(
|
|
251
|
-
console.log(
|
|
251
|
+
await writeFile(".mcp.json", JSON.stringify(mcpConfig, null, 2));
|
|
252
|
+
console.log(" ✓ Created .mcp.json with claude-flow-novice and ruv-swarm servers");
|
|
252
253
|
// Create hooks configuration
|
|
253
|
-
console.log(
|
|
254
|
+
console.log("\n🪝 Setting up hooks system...");
|
|
254
255
|
const hooksConfig = {
|
|
255
256
|
hooks: {
|
|
256
257
|
pre_task: {
|
|
257
258
|
enabled: true,
|
|
258
259
|
command: 'npx claude-flow-novice@latest hooks pre-task --description "$TASK_DESCRIPTION"',
|
|
259
|
-
description:
|
|
260
|
+
description: "Pre-task coordination hook"
|
|
260
261
|
},
|
|
261
262
|
post_edit: {
|
|
262
263
|
enabled: true,
|
|
263
264
|
command: 'npx claude-flow-novice@latest hooks post-edit --file "$FILE_PATH" --memory-key "swarm/$AGENT_ID/$STEP"',
|
|
264
|
-
description:
|
|
265
|
+
description: "Post-edit memory storage hook"
|
|
265
266
|
},
|
|
266
267
|
post_task: {
|
|
267
268
|
enabled: true,
|
|
268
269
|
command: 'npx claude-flow-novice@latest hooks post-task --task-id "$TASK_ID"',
|
|
269
|
-
description:
|
|
270
|
+
description: "Post-task completion hook"
|
|
270
271
|
}
|
|
271
272
|
},
|
|
272
273
|
memory: {
|
|
273
274
|
enabled: true,
|
|
274
|
-
persistence:
|
|
275
|
-
namespace:
|
|
275
|
+
persistence: "local",
|
|
276
|
+
namespace: "claude-flow-novice"
|
|
276
277
|
}
|
|
277
278
|
};
|
|
278
|
-
await writeFile(
|
|
279
|
-
console.log(
|
|
279
|
+
await writeFile(".claude/hooks.json", JSON.stringify(hooksConfig, null, 2));
|
|
280
|
+
console.log(" ✓ Created .claude/hooks.json with automated coordination");
|
|
280
281
|
// Create basic agent definitions (simplified for novice package)
|
|
281
282
|
const basicAgents = [
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
283
|
+
"coder",
|
|
284
|
+
"reviewer",
|
|
285
|
+
"tester",
|
|
286
|
+
"planner",
|
|
287
|
+
"researcher",
|
|
288
|
+
"backend-dev",
|
|
289
|
+
"system-architect",
|
|
290
|
+
"code-analyzer"
|
|
290
291
|
];
|
|
291
292
|
for (const agent of basicAgents){
|
|
292
293
|
const agentConfig = {
|
|
@@ -296,17 +297,17 @@ export function setupCommands(cli) {
|
|
|
296
297
|
capabilities: [
|
|
297
298
|
agent
|
|
298
299
|
],
|
|
299
|
-
version:
|
|
300
|
+
version: "1.0.0"
|
|
300
301
|
};
|
|
301
302
|
await writeFile(`.claude/agents/${agent}.json`, JSON.stringify(agentConfig, null, 2));
|
|
302
303
|
}
|
|
303
304
|
console.log(` ✓ Created ${basicAgents.length} essential agent definitions`);
|
|
304
|
-
success(
|
|
305
|
-
console.log(
|
|
306
|
-
console.log(
|
|
305
|
+
success("Claude Code integration files initialized successfully!");
|
|
306
|
+
console.log("\nNext steps:");
|
|
307
|
+
console.log("1. Review and customize the generated files for your project");
|
|
307
308
|
console.log("2. Run 'npx claude-flow-novice start' to begin the orchestration system");
|
|
308
309
|
console.log("3. Use 'claude --dangerously-skip-permissions' for unattended operation");
|
|
309
|
-
console.log(
|
|
310
|
+
console.log("\nNote: Persistence database initialized at memory/claude-flow-data.json");
|
|
310
311
|
} catch (err) {
|
|
311
312
|
error(`Failed to initialize files: ${err.message}`);
|
|
312
313
|
}
|
|
@@ -314,53 +315,53 @@ export function setupCommands(cli) {
|
|
|
314
315
|
});
|
|
315
316
|
// Start command
|
|
316
317
|
cli.command({
|
|
317
|
-
name:
|
|
318
|
-
description:
|
|
318
|
+
name: "start",
|
|
319
|
+
description: "Start the orchestration system",
|
|
319
320
|
options: [
|
|
320
321
|
{
|
|
321
|
-
name:
|
|
322
|
-
short:
|
|
323
|
-
description:
|
|
324
|
-
type:
|
|
322
|
+
name: "daemon",
|
|
323
|
+
short: "d",
|
|
324
|
+
description: "Run as daemon in background",
|
|
325
|
+
type: "boolean"
|
|
325
326
|
},
|
|
326
327
|
{
|
|
327
|
-
name:
|
|
328
|
-
short:
|
|
329
|
-
description:
|
|
330
|
-
type:
|
|
328
|
+
name: "port",
|
|
329
|
+
short: "p",
|
|
330
|
+
description: "MCP server port",
|
|
331
|
+
type: "number",
|
|
331
332
|
default: 3000
|
|
332
333
|
}
|
|
333
334
|
],
|
|
334
335
|
action: async (ctx)=>{
|
|
335
|
-
success(
|
|
336
|
+
success("Starting Claude-Flow orchestration system...");
|
|
336
337
|
try {
|
|
337
338
|
const orch = await getOrchestrator();
|
|
338
339
|
await orch.start();
|
|
339
|
-
success(
|
|
340
|
-
info(
|
|
341
|
-
console.log(
|
|
342
|
-
console.log(
|
|
343
|
-
console.log(
|
|
344
|
-
console.log(
|
|
345
|
-
console.log(
|
|
346
|
-
console.log(
|
|
340
|
+
success("System started successfully!");
|
|
341
|
+
info("Components initialized:");
|
|
342
|
+
console.log(" ✓ Event Bus");
|
|
343
|
+
console.log(" ✓ Orchestrator Engine");
|
|
344
|
+
console.log(" ✓ Memory Manager");
|
|
345
|
+
console.log(" ✓ Terminal Pool");
|
|
346
|
+
console.log(" ✓ MCP Server");
|
|
347
|
+
console.log(" ✓ Coordination Manager");
|
|
347
348
|
if (!ctx.flags.daemon) {
|
|
348
|
-
info(
|
|
349
|
+
info("Press Ctrl+C to stop the system");
|
|
349
350
|
// Keep the process running until interrupted
|
|
350
351
|
const controller = new AbortController();
|
|
351
352
|
const shutdown = ()=>{
|
|
352
|
-
console.log(
|
|
353
|
+
console.log("\nShutting down...");
|
|
353
354
|
controller.abort();
|
|
354
355
|
};
|
|
355
|
-
process.on(
|
|
356
|
-
process.on(
|
|
356
|
+
process.on("SIGINT", shutdown);
|
|
357
|
+
process.on("SIGTERM", shutdown);
|
|
357
358
|
try {
|
|
358
359
|
await new Promise((resolve)=>{
|
|
359
|
-
controller.signal.addEventListener(
|
|
360
|
+
controller.signal.addEventListener("abort", ()=>resolve());
|
|
360
361
|
});
|
|
361
362
|
} finally{
|
|
362
|
-
process.off(
|
|
363
|
-
process.off(
|
|
363
|
+
process.off("SIGINT", shutdown);
|
|
364
|
+
process.off("SIGTERM", shutdown);
|
|
364
365
|
}
|
|
365
366
|
}
|
|
366
367
|
} catch (err) {
|
|
@@ -371,18 +372,18 @@ export function setupCommands(cli) {
|
|
|
371
372
|
});
|
|
372
373
|
// Task command
|
|
373
374
|
cli.command({
|
|
374
|
-
name:
|
|
375
|
-
description:
|
|
375
|
+
name: "task",
|
|
376
|
+
description: "Manage tasks",
|
|
376
377
|
aliases: [
|
|
377
|
-
|
|
378
|
+
"tasks"
|
|
378
379
|
],
|
|
379
380
|
action: async (ctx)=>{
|
|
380
381
|
const subcommand = ctx.args[0];
|
|
381
382
|
switch(subcommand){
|
|
382
|
-
case
|
|
383
|
+
case "create":
|
|
383
384
|
{
|
|
384
|
-
const type = ctx.args[1] ||
|
|
385
|
-
const description = ctx.args.slice(2).join(
|
|
385
|
+
const type = ctx.args[1] || "general";
|
|
386
|
+
const description = ctx.args.slice(2).join(" ") || "No description";
|
|
386
387
|
try {
|
|
387
388
|
const persist = await getPersistence();
|
|
388
389
|
const taskId = `task-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
@@ -391,9 +392,9 @@ export function setupCommands(cli) {
|
|
|
391
392
|
id: taskId,
|
|
392
393
|
type,
|
|
393
394
|
description,
|
|
394
|
-
status:
|
|
395
|
+
status: "pending",
|
|
395
396
|
priority: ctx.flags.priority || 1,
|
|
396
|
-
dependencies: ctx.flags.deps ? ctx.flags.deps.split(
|
|
397
|
+
dependencies: ctx.flags.deps ? ctx.flags.deps.split(",") : [],
|
|
397
398
|
metadata: {},
|
|
398
399
|
progress: 0,
|
|
399
400
|
createdAt: Date.now()
|
|
@@ -407,13 +408,13 @@ export function setupCommands(cli) {
|
|
|
407
408
|
}
|
|
408
409
|
break;
|
|
409
410
|
}
|
|
410
|
-
case
|
|
411
|
+
case "list":
|
|
411
412
|
{
|
|
412
413
|
try {
|
|
413
414
|
const persist = await getPersistence();
|
|
414
415
|
const tasks = await persist.getActiveTasks();
|
|
415
416
|
if (tasks.length === 0) {
|
|
416
|
-
info(
|
|
417
|
+
info("No active tasks");
|
|
417
418
|
} else {
|
|
418
419
|
success(`Active tasks (${tasks.length}):`);
|
|
419
420
|
for (const task of tasks){
|
|
@@ -428,12 +429,12 @@ export function setupCommands(cli) {
|
|
|
428
429
|
}
|
|
429
430
|
break;
|
|
430
431
|
}
|
|
431
|
-
case
|
|
432
|
+
case "assign":
|
|
432
433
|
{
|
|
433
434
|
const taskId = ctx.args[1];
|
|
434
435
|
const agentId = ctx.args[2];
|
|
435
436
|
if (!taskId || !agentId) {
|
|
436
|
-
error(
|
|
437
|
+
error("Usage: task assign <task-id> <agent-id>");
|
|
437
438
|
break;
|
|
438
439
|
}
|
|
439
440
|
try {
|
|
@@ -452,7 +453,7 @@ export function setupCommands(cli) {
|
|
|
452
453
|
}
|
|
453
454
|
// Update task with assigned agent
|
|
454
455
|
task.assignedAgent = agentId;
|
|
455
|
-
task.status =
|
|
456
|
+
task.status = "assigned";
|
|
456
457
|
await persist.saveTask(task);
|
|
457
458
|
success(`Task ${taskId} assigned to agent ${agentId}`);
|
|
458
459
|
console.log(`📝 Task: ${task.description}`);
|
|
@@ -462,27 +463,27 @@ export function setupCommands(cli) {
|
|
|
462
463
|
}
|
|
463
464
|
break;
|
|
464
465
|
}
|
|
465
|
-
case
|
|
466
|
+
case "workflow":
|
|
466
467
|
{
|
|
467
468
|
const workflowFile = ctx.args[1];
|
|
468
469
|
if (!workflowFile) {
|
|
469
|
-
error(
|
|
470
|
+
error("Usage: task workflow <workflow-file>");
|
|
470
471
|
break;
|
|
471
472
|
}
|
|
472
473
|
try {
|
|
473
|
-
const { readFile } = await import(
|
|
474
|
-
const content = await readFile(workflowFile,
|
|
474
|
+
const { readFile } = await import("fs/promises");
|
|
475
|
+
const content = await readFile(workflowFile, "utf-8");
|
|
475
476
|
const workflow = JSON.parse(content);
|
|
476
|
-
success(
|
|
477
|
-
console.log(`📋 Name: ${workflow.name ||
|
|
478
|
-
console.log(`📝 Description: ${workflow.description ||
|
|
477
|
+
success("Workflow loaded:");
|
|
478
|
+
console.log(`📋 Name: ${workflow.name || "Unnamed"}`);
|
|
479
|
+
console.log(`📝 Description: ${workflow.description || "No description"}`);
|
|
479
480
|
console.log(`🤖 Agents: ${workflow.agents?.length || 0}`);
|
|
480
481
|
console.log(`📌 Tasks: ${workflow.tasks?.length || 0}`);
|
|
481
482
|
if (ctx.flags.execute) {
|
|
482
|
-
warning(
|
|
483
|
+
warning("Workflow execution would start here (not yet implemented)");
|
|
483
484
|
// TODO: Implement workflow execution
|
|
484
485
|
} else {
|
|
485
|
-
info(
|
|
486
|
+
info("To execute this workflow, ensure Claude-Flow is running");
|
|
486
487
|
}
|
|
487
488
|
} catch (err) {
|
|
488
489
|
error(`Failed to load workflow: ${err.message}`);
|
|
@@ -491,7 +492,7 @@ export function setupCommands(cli) {
|
|
|
491
492
|
}
|
|
492
493
|
default:
|
|
493
494
|
{
|
|
494
|
-
console.log(
|
|
495
|
+
console.log("Available subcommands: create, list, assign, workflow");
|
|
495
496
|
break;
|
|
496
497
|
}
|
|
497
498
|
}
|
|
@@ -499,15 +500,15 @@ export function setupCommands(cli) {
|
|
|
499
500
|
});
|
|
500
501
|
// Enhanced Agent command with comprehensive management
|
|
501
502
|
cli.command({
|
|
502
|
-
name:
|
|
503
|
-
description:
|
|
503
|
+
name: "agent",
|
|
504
|
+
description: "Comprehensive agent management with advanced features",
|
|
504
505
|
aliases: [
|
|
505
|
-
|
|
506
|
+
"agents"
|
|
506
507
|
],
|
|
507
508
|
action: async (ctx)=>{
|
|
508
509
|
const subcommand = ctx.args[0];
|
|
509
510
|
// Import enhanced agent command dynamically
|
|
510
|
-
const { agentCommand } = await import(
|
|
511
|
+
const { agentCommand } = await import("./agent.js");
|
|
511
512
|
// Create a mock context for the enhanced command
|
|
512
513
|
const enhancedCtx = {
|
|
513
514
|
args: ctx.args.slice(1),
|
|
@@ -517,49 +518,49 @@ export function setupCommands(cli) {
|
|
|
517
518
|
try {
|
|
518
519
|
// Map simple commands to enhanced command structure
|
|
519
520
|
switch(subcommand){
|
|
520
|
-
case
|
|
521
|
-
case
|
|
522
|
-
case
|
|
523
|
-
case
|
|
524
|
-
case
|
|
525
|
-
case
|
|
526
|
-
case
|
|
527
|
-
case
|
|
521
|
+
case "spawn":
|
|
522
|
+
case "list":
|
|
523
|
+
case "info":
|
|
524
|
+
case "terminate":
|
|
525
|
+
case "start":
|
|
526
|
+
case "restart":
|
|
527
|
+
case "pool":
|
|
528
|
+
case "health":
|
|
528
529
|
// Use the enhanced agent command system
|
|
529
|
-
console.log(chalk.cyan(
|
|
530
|
+
console.log(chalk.cyan("🚀 Using enhanced agent management system..."));
|
|
530
531
|
// Create a simplified wrapper around the enhanced command
|
|
531
|
-
const agentManager = await import(
|
|
532
|
-
const { MemoryManager } = await import(
|
|
533
|
-
const { EventBus } = await import(
|
|
534
|
-
const { Logger } = await import(
|
|
535
|
-
const { DistributedMemorySystem } = await import(
|
|
536
|
-
warning(
|
|
537
|
-
console.log(
|
|
538
|
-
console.log(` - claude-flow-novice agent ${subcommand} ${ctx.args.slice(1).join(
|
|
539
|
-
console.log(
|
|
540
|
-
console.log(
|
|
532
|
+
const agentManager = await import("../../agents/agent-manager.js");
|
|
533
|
+
const { MemoryManager } = await import("../../memory/manager.js");
|
|
534
|
+
const { EventBus } = await import("../../core/event-bus.js");
|
|
535
|
+
const { Logger } = await import("../../core/logger.js");
|
|
536
|
+
const { DistributedMemorySystem } = await import("../../memory/distributed-memory.js");
|
|
537
|
+
warning("Enhanced agent management is available!");
|
|
538
|
+
console.log("For full functionality, use the comprehensive agent commands:");
|
|
539
|
+
console.log(` - claude-flow-novice agent ${subcommand} ${ctx.args.slice(1).join(" ")}`);
|
|
540
|
+
console.log(" - Enhanced features: pools, health monitoring, resource management");
|
|
541
|
+
console.log(" - Interactive configuration and detailed metrics");
|
|
541
542
|
break;
|
|
542
543
|
default:
|
|
543
544
|
{
|
|
544
|
-
console.log(chalk.cyan(
|
|
545
|
-
console.log(
|
|
546
|
-
console.log(
|
|
547
|
-
console.log(
|
|
548
|
-
console.log(
|
|
549
|
-
console.log(
|
|
550
|
-
console.log(
|
|
551
|
-
console.log(
|
|
552
|
-
console.log(
|
|
553
|
-
console.log(
|
|
554
|
-
console.log(
|
|
555
|
-
console.log(
|
|
556
|
-
console.log(
|
|
557
|
-
console.log(
|
|
558
|
-
console.log(
|
|
559
|
-
console.log(
|
|
560
|
-
console.log(
|
|
561
|
-
console.log(
|
|
562
|
-
console.log(
|
|
545
|
+
console.log(chalk.cyan("📋 Agent Management Commands:"));
|
|
546
|
+
console.log("Available subcommands:");
|
|
547
|
+
console.log(" spawn - Create and start new agents");
|
|
548
|
+
console.log(" list - Display all agents with status");
|
|
549
|
+
console.log(" info - Get detailed agent information");
|
|
550
|
+
console.log(" terminate - Safely terminate agents");
|
|
551
|
+
console.log(" start - Start a created agent");
|
|
552
|
+
console.log(" restart - Restart an agent");
|
|
553
|
+
console.log(" pool - Manage agent pools");
|
|
554
|
+
console.log(" health - Monitor agent health");
|
|
555
|
+
console.log("");
|
|
556
|
+
console.log("Enhanced Features:");
|
|
557
|
+
console.log(" ✨ Resource allocation and monitoring");
|
|
558
|
+
console.log(" ✨ Agent pools for scaling");
|
|
559
|
+
console.log(" ✨ Health diagnostics and auto-recovery");
|
|
560
|
+
console.log(" ✨ Interactive configuration");
|
|
561
|
+
console.log(" ✨ Memory integration for coordination");
|
|
562
|
+
console.log("");
|
|
563
|
+
console.log("For detailed help, use: claude-flow-novice agent <command> --help");
|
|
563
564
|
break;
|
|
564
565
|
}
|
|
565
566
|
}
|
|
@@ -567,9 +568,9 @@ export function setupCommands(cli) {
|
|
|
567
568
|
error(`Enhanced agent management unavailable: ${err.message}`);
|
|
568
569
|
// Fallback to basic implementation
|
|
569
570
|
switch(subcommand){
|
|
570
|
-
case
|
|
571
|
+
case "spawn":
|
|
571
572
|
{
|
|
572
|
-
const type = ctx.args[1] ||
|
|
573
|
+
const type = ctx.args[1] || "researcher";
|
|
573
574
|
const name = ctx.flags.name || `${type}-${Date.now()}`;
|
|
574
575
|
try {
|
|
575
576
|
const persist = await getPersistence();
|
|
@@ -578,7 +579,7 @@ export function setupCommands(cli) {
|
|
|
578
579
|
id: agentId,
|
|
579
580
|
type,
|
|
580
581
|
name,
|
|
581
|
-
status:
|
|
582
|
+
status: "active",
|
|
582
583
|
capabilities: getCapabilitiesForType(type),
|
|
583
584
|
systemPrompt: ctx.flags.prompt || getDefaultPromptForType(type),
|
|
584
585
|
maxConcurrentTasks: ctx.flags.maxTasks || 5,
|
|
@@ -595,13 +596,13 @@ export function setupCommands(cli) {
|
|
|
595
596
|
}
|
|
596
597
|
break;
|
|
597
598
|
}
|
|
598
|
-
case
|
|
599
|
+
case "list":
|
|
599
600
|
{
|
|
600
601
|
try {
|
|
601
602
|
const persist = await getPersistence();
|
|
602
603
|
const agents = await persist.getActiveAgents();
|
|
603
604
|
if (agents.length === 0) {
|
|
604
|
-
info(
|
|
605
|
+
info("No active agents");
|
|
605
606
|
} else {
|
|
606
607
|
success(`Active agents (${agents.length}):`);
|
|
607
608
|
for (const agent of agents){
|
|
@@ -615,8 +616,8 @@ export function setupCommands(cli) {
|
|
|
615
616
|
}
|
|
616
617
|
default:
|
|
617
618
|
{
|
|
618
|
-
console.log(
|
|
619
|
-
console.log(
|
|
619
|
+
console.log("Available subcommands (basic): spawn, list");
|
|
620
|
+
console.log("For enhanced features, ensure all dependencies are installed.");
|
|
620
621
|
break;
|
|
621
622
|
}
|
|
622
623
|
}
|
|
@@ -634,29 +635,29 @@ export function setupCommands(cli) {
|
|
|
634
635
|
component: ctx.flags.component || ctx.flags.c,
|
|
635
636
|
json: ctx.flags.json,
|
|
636
637
|
detailed: ctx.flags.detailed,
|
|
637
|
-
healthCheck: ctx.flags.healthCheck || ctx.flags[
|
|
638
|
+
healthCheck: ctx.flags.healthCheck || ctx.flags["health-check"],
|
|
638
639
|
history: ctx.flags.history
|
|
639
640
|
};
|
|
640
641
|
// Mock the enhanced status command action
|
|
641
|
-
console.log(chalk.cyan(
|
|
642
|
-
console.log(
|
|
643
|
-
console.log(
|
|
642
|
+
console.log(chalk.cyan("🔍 Enhanced Status Command"));
|
|
643
|
+
console.log("For full enhanced functionality, use: claude-flow-novice status [options]");
|
|
644
|
+
console.log("Available options: --watch, --interval, --component, --json, --detailed, --health-check, --history");
|
|
644
645
|
// Fallback to basic status
|
|
645
646
|
try {
|
|
646
647
|
const persist = await getPersistence();
|
|
647
648
|
const stats = await persist.getStats();
|
|
648
649
|
// Check if orchestrator is running by looking for the log file
|
|
649
|
-
const { access } = await import(
|
|
650
|
-
const isRunning = await access(
|
|
651
|
-
success(
|
|
652
|
-
console.log(`🟢 Status: ${isRunning ?
|
|
650
|
+
const { access } = await import("fs/promises");
|
|
651
|
+
const isRunning = await access("orchestrator.log").then(()=>true).catch(()=>false);
|
|
652
|
+
success("Claude-Flow System Status:");
|
|
653
|
+
console.log(`🟢 Status: ${isRunning ? "Running" : "Stopped"}`);
|
|
653
654
|
console.log(`🤖 Agents: ${stats.activeAgents} active (${stats.totalAgents} total)`);
|
|
654
655
|
console.log(`📋 Tasks: ${stats.pendingTasks} in queue (${stats.totalTasks} total)`);
|
|
655
656
|
console.log(`💾 Memory: Ready`);
|
|
656
657
|
console.log(`🖥️ Terminal Pool: Ready`);
|
|
657
|
-
console.log(`🌐 MCP Server: ${isRunning ?
|
|
658
|
+
console.log(`🌐 MCP Server: ${isRunning ? "Running" : "Stopped"}`);
|
|
658
659
|
if (ctx.flags.verbose || options.detailed) {
|
|
659
|
-
console.log(
|
|
660
|
+
console.log("\nDetailed Statistics:");
|
|
660
661
|
console.log(` Total Agents: ${stats.totalAgents}`);
|
|
661
662
|
console.log(` Active Agents: ${stats.activeAgents}`);
|
|
662
663
|
console.log(` Total Tasks: ${stats.totalTasks}`);
|
|
@@ -664,86 +665,86 @@ export function setupCommands(cli) {
|
|
|
664
665
|
console.log(` Completed Tasks: ${stats.completedTasks}`);
|
|
665
666
|
}
|
|
666
667
|
if (options.watch) {
|
|
667
|
-
warning(
|
|
668
|
-
console.log(
|
|
668
|
+
warning("Watch mode available in enhanced status command");
|
|
669
|
+
console.log("Use: claude-flow-novice status --watch");
|
|
669
670
|
}
|
|
670
671
|
} catch (err) {
|
|
671
672
|
error(`Failed to get status: ${err.message}`);
|
|
672
673
|
}
|
|
673
674
|
};
|
|
674
675
|
cli.command({
|
|
675
|
-
name:
|
|
676
|
-
description:
|
|
676
|
+
name: "status",
|
|
677
|
+
description: "Show enhanced system status with comprehensive reporting",
|
|
677
678
|
options: [
|
|
678
679
|
{
|
|
679
|
-
name:
|
|
680
|
-
short:
|
|
681
|
-
description:
|
|
682
|
-
type:
|
|
680
|
+
name: "watch",
|
|
681
|
+
short: "w",
|
|
682
|
+
description: "Watch mode - continuously update status",
|
|
683
|
+
type: "boolean"
|
|
683
684
|
},
|
|
684
685
|
{
|
|
685
|
-
name:
|
|
686
|
-
short:
|
|
687
|
-
description:
|
|
688
|
-
type:
|
|
686
|
+
name: "interval",
|
|
687
|
+
short: "i",
|
|
688
|
+
description: "Update interval in seconds",
|
|
689
|
+
type: "number",
|
|
689
690
|
default: 5
|
|
690
691
|
},
|
|
691
692
|
{
|
|
692
|
-
name:
|
|
693
|
-
short:
|
|
694
|
-
description:
|
|
695
|
-
type:
|
|
693
|
+
name: "component",
|
|
694
|
+
short: "c",
|
|
695
|
+
description: "Show status for specific component",
|
|
696
|
+
type: "string"
|
|
696
697
|
},
|
|
697
698
|
{
|
|
698
|
-
name:
|
|
699
|
-
description:
|
|
700
|
-
type:
|
|
699
|
+
name: "json",
|
|
700
|
+
description: "Output in JSON format",
|
|
701
|
+
type: "boolean"
|
|
701
702
|
},
|
|
702
703
|
{
|
|
703
|
-
name:
|
|
704
|
-
description:
|
|
705
|
-
type:
|
|
704
|
+
name: "detailed",
|
|
705
|
+
description: "Show detailed component information",
|
|
706
|
+
type: "boolean"
|
|
706
707
|
},
|
|
707
708
|
{
|
|
708
|
-
name:
|
|
709
|
-
description:
|
|
710
|
-
type:
|
|
709
|
+
name: "health-check",
|
|
710
|
+
description: "Perform comprehensive health checks",
|
|
711
|
+
type: "boolean"
|
|
711
712
|
},
|
|
712
713
|
{
|
|
713
|
-
name:
|
|
714
|
-
description:
|
|
715
|
-
type:
|
|
714
|
+
name: "history",
|
|
715
|
+
description: "Show status history from logs",
|
|
716
|
+
type: "boolean"
|
|
716
717
|
},
|
|
717
718
|
{
|
|
718
|
-
name:
|
|
719
|
-
short:
|
|
720
|
-
description:
|
|
721
|
-
type:
|
|
719
|
+
name: "verbose",
|
|
720
|
+
short: "v",
|
|
721
|
+
description: "Enable verbose output",
|
|
722
|
+
type: "boolean"
|
|
722
723
|
}
|
|
723
724
|
],
|
|
724
725
|
action: enhancedStatusAction
|
|
725
726
|
});
|
|
726
727
|
} catch (err) {
|
|
727
|
-
warning(
|
|
728
|
+
warning("Enhanced status command not available, using basic version");
|
|
728
729
|
// Fallback basic status command
|
|
729
730
|
cli.command({
|
|
730
|
-
name:
|
|
731
|
-
description:
|
|
731
|
+
name: "status",
|
|
732
|
+
description: "Show system status",
|
|
732
733
|
action: async (ctx)=>{
|
|
733
734
|
try {
|
|
734
735
|
const persist = await getPersistence();
|
|
735
736
|
const stats = await persist.getStats();
|
|
736
|
-
const { access } = await import(
|
|
737
|
-
const isRunning = await access(
|
|
738
|
-
success(
|
|
739
|
-
console.log(`🟢 Status: ${isRunning ?
|
|
737
|
+
const { access } = await import("fs/promises");
|
|
738
|
+
const isRunning = await access("orchestrator.log").then(()=>true).catch(()=>false);
|
|
739
|
+
success("Claude-Flow System Status:");
|
|
740
|
+
console.log(`🟢 Status: ${isRunning ? "Running" : "Stopped"}`);
|
|
740
741
|
console.log(`🤖 Agents: ${stats.activeAgents} active (${stats.totalAgents} total)`);
|
|
741
742
|
console.log(`📋 Tasks: ${stats.pendingTasks} in queue (${stats.totalTasks} total)`);
|
|
742
743
|
console.log(`💾 Memory: Ready`);
|
|
743
744
|
console.log(`🖥️ Terminal Pool: Ready`);
|
|
744
|
-
console.log(`🌐 MCP Server: ${isRunning ?
|
|
745
|
+
console.log(`🌐 MCP Server: ${isRunning ? "Running" : "Stopped"}`);
|
|
745
746
|
if (ctx.flags.verbose) {
|
|
746
|
-
console.log(
|
|
747
|
+
console.log("\nDetailed Statistics:");
|
|
747
748
|
console.log(` Total Agents: ${stats.totalAgents}`);
|
|
748
749
|
console.log(` Active Agents: ${stats.activeAgents}`);
|
|
749
750
|
console.log(` Total Tasks: ${stats.totalTasks}`);
|
|
@@ -758,15 +759,15 @@ export function setupCommands(cli) {
|
|
|
758
759
|
}
|
|
759
760
|
// MCP command
|
|
760
761
|
cli.command({
|
|
761
|
-
name:
|
|
762
|
-
description:
|
|
762
|
+
name: "mcp",
|
|
763
|
+
description: "Manage MCP server and tools",
|
|
763
764
|
action: async (ctx)=>{
|
|
764
765
|
const subcommand = ctx.args[0];
|
|
765
766
|
switch(subcommand){
|
|
766
|
-
case
|
|
767
|
+
case "start":
|
|
767
768
|
{
|
|
768
769
|
const port = ctx.flags.port || 3000;
|
|
769
|
-
const host = ctx.flags.host ||
|
|
770
|
+
const host = ctx.flags.host || "localhost";
|
|
770
771
|
try {
|
|
771
772
|
// MCP server is part of the orchestrator start process
|
|
772
773
|
const orch = await getOrchestrator();
|
|
@@ -784,13 +785,13 @@ export function setupCommands(cli) {
|
|
|
784
785
|
}
|
|
785
786
|
break;
|
|
786
787
|
}
|
|
787
|
-
case
|
|
788
|
+
case "stop":
|
|
788
789
|
{
|
|
789
790
|
try {
|
|
790
791
|
const orch = await getOrchestrator();
|
|
791
792
|
const health = await orch.healthCheck();
|
|
792
793
|
if (!health.healthy) {
|
|
793
|
-
info(
|
|
794
|
+
info("MCP server is not running");
|
|
794
795
|
} else {
|
|
795
796
|
warning("MCP server runs as part of the orchestrator. Use 'claude-flow-novice stop' to stop the entire system");
|
|
796
797
|
}
|
|
@@ -799,18 +800,18 @@ export function setupCommands(cli) {
|
|
|
799
800
|
}
|
|
800
801
|
break;
|
|
801
802
|
}
|
|
802
|
-
case
|
|
803
|
+
case "status":
|
|
803
804
|
{
|
|
804
805
|
try {
|
|
805
806
|
const orch = await getOrchestrator();
|
|
806
807
|
const health = await orch.healthCheck();
|
|
807
|
-
success(
|
|
808
|
-
console.log(`🌐 Status: ${health.mcp ?
|
|
808
|
+
success("MCP Server Status:");
|
|
809
|
+
console.log(`🌐 Status: ${health.mcp ? "Running" : "Stopped"}`);
|
|
809
810
|
if (health.mcp) {
|
|
810
811
|
const config = await getConfigManager();
|
|
811
812
|
const mcpConfig = config.get().mcp;
|
|
812
813
|
console.log(`📍 Address: ${mcpConfig.host}:${mcpConfig.port}`);
|
|
813
|
-
console.log(`🔐 Authentication: ${mcpConfig.auth ?
|
|
814
|
+
console.log(`🔐 Authentication: ${mcpConfig.auth ? "Enabled" : "Disabled"}`);
|
|
814
815
|
console.log(`🔧 Tools: Available`);
|
|
815
816
|
console.log(`📊 Metrics: Collecting`);
|
|
816
817
|
}
|
|
@@ -819,44 +820,44 @@ export function setupCommands(cli) {
|
|
|
819
820
|
}
|
|
820
821
|
break;
|
|
821
822
|
}
|
|
822
|
-
case
|
|
823
|
+
case "tools":
|
|
823
824
|
{
|
|
824
825
|
try {
|
|
825
|
-
success(
|
|
826
|
-
console.log(
|
|
827
|
-
console.log(
|
|
828
|
-
console.log(
|
|
829
|
-
console.log(
|
|
830
|
-
console.log(
|
|
831
|
-
console.log(
|
|
832
|
-
console.log(
|
|
833
|
-
console.log(
|
|
834
|
-
console.log(
|
|
835
|
-
console.log(
|
|
836
|
-
console.log(
|
|
837
|
-
console.log(
|
|
838
|
-
console.log(
|
|
839
|
-
console.log(
|
|
840
|
-
console.log(
|
|
841
|
-
console.log(
|
|
826
|
+
success("Available MCP Tools:");
|
|
827
|
+
console.log(" 📊 Research Tools:");
|
|
828
|
+
console.log(" • web_search - Search the web for information");
|
|
829
|
+
console.log(" • web_fetch - Fetch content from URLs");
|
|
830
|
+
console.log(" • knowledge_query - Query knowledge base");
|
|
831
|
+
console.log(" 💻 Code Tools:");
|
|
832
|
+
console.log(" • code_edit - Edit code files");
|
|
833
|
+
console.log(" • code_search - Search through codebase");
|
|
834
|
+
console.log(" • code_analyze - Analyze code quality");
|
|
835
|
+
console.log(" 🖥️ Terminal Tools:");
|
|
836
|
+
console.log(" • terminal_execute - Execute shell commands");
|
|
837
|
+
console.log(" • terminal_session - Manage terminal sessions");
|
|
838
|
+
console.log(" • file_operations - File system operations");
|
|
839
|
+
console.log(" 💾 Memory Tools:");
|
|
840
|
+
console.log(" • memory_store - Store information");
|
|
841
|
+
console.log(" • memory_query - Query stored information");
|
|
842
|
+
console.log(" • memory_index - Index and search content");
|
|
842
843
|
} catch (err) {
|
|
843
844
|
error(`Failed to list tools: ${err.message}`);
|
|
844
845
|
}
|
|
845
846
|
break;
|
|
846
847
|
}
|
|
847
|
-
case
|
|
848
|
+
case "config":
|
|
848
849
|
{
|
|
849
850
|
try {
|
|
850
851
|
const config = await getConfigManager();
|
|
851
852
|
const mcpConfig = config.get().mcp;
|
|
852
|
-
success(
|
|
853
|
+
success("MCP Configuration:");
|
|
853
854
|
console.log(JSON.stringify(mcpConfig, null, 2));
|
|
854
855
|
} catch (err) {
|
|
855
856
|
error(`Failed to show MCP config: ${err.message}`);
|
|
856
857
|
}
|
|
857
858
|
break;
|
|
858
859
|
}
|
|
859
|
-
case
|
|
860
|
+
case "restart":
|
|
860
861
|
{
|
|
861
862
|
try {
|
|
862
863
|
warning("MCP server runs as part of the orchestrator. Use 'claude-flow-novice stop' then 'claude-flow-novice start' to restart the entire system");
|
|
@@ -865,18 +866,18 @@ export function setupCommands(cli) {
|
|
|
865
866
|
}
|
|
866
867
|
break;
|
|
867
868
|
}
|
|
868
|
-
case
|
|
869
|
+
case "logs":
|
|
869
870
|
{
|
|
870
871
|
const lines = ctx.flags.lines || 50;
|
|
871
872
|
try {
|
|
872
873
|
// Mock logs since logging system might not be fully implemented
|
|
873
874
|
success(`MCP Server Logs (last ${lines} lines):`);
|
|
874
|
-
console.log(
|
|
875
|
-
console.log(
|
|
876
|
-
console.log(
|
|
877
|
-
console.log(
|
|
878
|
-
console.log(
|
|
879
|
-
console.log(
|
|
875
|
+
console.log("2024-01-10 10:00:00 [INFO] MCP server started on localhost:3000");
|
|
876
|
+
console.log("2024-01-10 10:00:01 [INFO] Tools registered: 12");
|
|
877
|
+
console.log("2024-01-10 10:00:02 [INFO] Authentication disabled");
|
|
878
|
+
console.log("2024-01-10 10:01:00 [INFO] Client connected: claude-desktop");
|
|
879
|
+
console.log("2024-01-10 10:01:05 [INFO] Tool called: web_search");
|
|
880
|
+
console.log("2024-01-10 10:01:10 [INFO] Tool response sent successfully");
|
|
880
881
|
} catch (err) {
|
|
881
882
|
error(`Failed to get logs: ${err.message}`);
|
|
882
883
|
}
|
|
@@ -885,7 +886,7 @@ export function setupCommands(cli) {
|
|
|
885
886
|
default:
|
|
886
887
|
{
|
|
887
888
|
error(`Unknown mcp subcommand: ${subcommand}`);
|
|
888
|
-
console.log(
|
|
889
|
+
console.log("Available subcommands: start, stop, status, tools, config, restart, logs");
|
|
889
890
|
break;
|
|
890
891
|
}
|
|
891
892
|
}
|
|
@@ -893,27 +894,27 @@ export function setupCommands(cli) {
|
|
|
893
894
|
});
|
|
894
895
|
// Memory command
|
|
895
896
|
cli.command({
|
|
896
|
-
name:
|
|
897
|
-
description:
|
|
897
|
+
name: "memory",
|
|
898
|
+
description: "Manage memory bank",
|
|
898
899
|
aliases: [
|
|
899
|
-
|
|
900
|
+
"mem"
|
|
900
901
|
],
|
|
901
902
|
action: async (ctx)=>{
|
|
902
903
|
const subcommand = ctx.args[0];
|
|
903
904
|
const memory = new SimpleMemoryManager();
|
|
904
905
|
switch(subcommand){
|
|
905
|
-
case
|
|
906
|
+
case "store":
|
|
906
907
|
{
|
|
907
908
|
const key = ctx.args[1];
|
|
908
|
-
const value = ctx.args.slice(2).join(
|
|
909
|
+
const value = ctx.args.slice(2).join(" "); // Join all remaining args as value
|
|
909
910
|
if (!key || !value) {
|
|
910
|
-
error(
|
|
911
|
+
error("Usage: memory store <key> <value>");
|
|
911
912
|
break;
|
|
912
913
|
}
|
|
913
914
|
try {
|
|
914
|
-
const namespace = ctx.flags.namespace || ctx.flags.n ||
|
|
915
|
+
const namespace = ctx.flags.namespace || ctx.flags.n || "default";
|
|
915
916
|
await memory.store(key, value, namespace);
|
|
916
|
-
success(
|
|
917
|
+
success("Stored successfully");
|
|
917
918
|
console.log(`📝 Key: ${key}`);
|
|
918
919
|
console.log(`📦 Namespace: ${namespace}`);
|
|
919
920
|
console.log(`💾 Size: ${new TextEncoder().encode(value).length} bytes`);
|
|
@@ -922,11 +923,11 @@ export function setupCommands(cli) {
|
|
|
922
923
|
}
|
|
923
924
|
break;
|
|
924
925
|
}
|
|
925
|
-
case
|
|
926
|
+
case "query":
|
|
926
927
|
{
|
|
927
|
-
const search = ctx.args.slice(1).join(
|
|
928
|
+
const search = ctx.args.slice(1).join(" "); // Join all remaining args as search
|
|
928
929
|
if (!search) {
|
|
929
|
-
error(
|
|
930
|
+
error("Usage: memory query <search>");
|
|
930
931
|
break;
|
|
931
932
|
}
|
|
932
933
|
try {
|
|
@@ -934,7 +935,7 @@ export function setupCommands(cli) {
|
|
|
934
935
|
const limit = ctx.flags.limit || ctx.flags.l || 10;
|
|
935
936
|
const results = await memory.query(search, namespace);
|
|
936
937
|
if (results.length === 0) {
|
|
937
|
-
warning(
|
|
938
|
+
warning("No results found");
|
|
938
939
|
return;
|
|
939
940
|
}
|
|
940
941
|
success(`Found ${results.length} results:`);
|
|
@@ -942,7 +943,7 @@ export function setupCommands(cli) {
|
|
|
942
943
|
for (const entry of limited){
|
|
943
944
|
console.log(blue(`\n📌 ${entry.key}`));
|
|
944
945
|
console.log(` Namespace: ${entry.namespace}`);
|
|
945
|
-
console.log(` Value: ${entry.value.substring(0, 100)}${entry.value.length > 100 ?
|
|
946
|
+
console.log(` Value: ${entry.value.substring(0, 100)}${entry.value.length > 100 ? "..." : ""}`);
|
|
946
947
|
console.log(` Stored: ${new Date(entry.timestamp).toLocaleString()}`);
|
|
947
948
|
}
|
|
948
949
|
if (results.length > limit) {
|
|
@@ -953,17 +954,17 @@ export function setupCommands(cli) {
|
|
|
953
954
|
}
|
|
954
955
|
break;
|
|
955
956
|
}
|
|
956
|
-
case
|
|
957
|
+
case "export":
|
|
957
958
|
{
|
|
958
959
|
const file = ctx.args[1];
|
|
959
960
|
if (!file) {
|
|
960
|
-
error(
|
|
961
|
+
error("Usage: memory export <file>");
|
|
961
962
|
break;
|
|
962
963
|
}
|
|
963
964
|
try {
|
|
964
965
|
await memory.exportData(file);
|
|
965
966
|
const stats = await memory.getStats();
|
|
966
|
-
success(
|
|
967
|
+
success("Memory exported successfully");
|
|
967
968
|
console.log(`📁 File: ${file}`);
|
|
968
969
|
console.log(`📊 Entries: ${stats.totalEntries}`);
|
|
969
970
|
console.log(`💾 Size: ${(stats.sizeBytes / 1024).toFixed(2)} KB`);
|
|
@@ -972,17 +973,17 @@ export function setupCommands(cli) {
|
|
|
972
973
|
}
|
|
973
974
|
break;
|
|
974
975
|
}
|
|
975
|
-
case
|
|
976
|
+
case "import":
|
|
976
977
|
{
|
|
977
978
|
const file = ctx.args[1];
|
|
978
979
|
if (!file) {
|
|
979
|
-
error(
|
|
980
|
+
error("Usage: memory import <file>");
|
|
980
981
|
break;
|
|
981
982
|
}
|
|
982
983
|
try {
|
|
983
984
|
await memory.importData(file);
|
|
984
985
|
const stats = await memory.getStats();
|
|
985
|
-
success(
|
|
986
|
+
success("Memory imported successfully");
|
|
986
987
|
console.log(`📁 File: ${file}`);
|
|
987
988
|
console.log(`📊 Entries: ${stats.totalEntries}`);
|
|
988
989
|
console.log(`🗂️ Namespaces: ${stats.namespaces}`);
|
|
@@ -991,16 +992,16 @@ export function setupCommands(cli) {
|
|
|
991
992
|
}
|
|
992
993
|
break;
|
|
993
994
|
}
|
|
994
|
-
case
|
|
995
|
+
case "stats":
|
|
995
996
|
{
|
|
996
997
|
try {
|
|
997
998
|
const stats = await memory.getStats();
|
|
998
|
-
success(
|
|
999
|
+
success("Memory Bank Statistics:");
|
|
999
1000
|
console.log(` Total Entries: ${stats.totalEntries}`);
|
|
1000
1001
|
console.log(` Namespaces: ${stats.namespaces}`);
|
|
1001
1002
|
console.log(` Size: ${(stats.sizeBytes / 1024).toFixed(2)} KB`);
|
|
1002
1003
|
if (stats.namespaces > 0) {
|
|
1003
|
-
console.log(blue(
|
|
1004
|
+
console.log(blue("\n📁 Namespace Breakdown:"));
|
|
1004
1005
|
for (const [namespace, count] of Object.entries(stats.namespaceStats)){
|
|
1005
1006
|
console.log(` ${namespace}: ${count} entries`);
|
|
1006
1007
|
}
|
|
@@ -1010,12 +1011,12 @@ export function setupCommands(cli) {
|
|
|
1010
1011
|
}
|
|
1011
1012
|
break;
|
|
1012
1013
|
}
|
|
1013
|
-
case
|
|
1014
|
+
case "cleanup":
|
|
1014
1015
|
{
|
|
1015
1016
|
try {
|
|
1016
1017
|
const days = ctx.flags.days || ctx.flags.d || 30;
|
|
1017
1018
|
const removed = await memory.cleanup(days);
|
|
1018
|
-
success(
|
|
1019
|
+
success("Cleanup completed");
|
|
1019
1020
|
console.log(`🗑️ Removed: ${removed} entries older than ${days} days`);
|
|
1020
1021
|
} catch (err) {
|
|
1021
1022
|
error(`Failed to cleanup: ${err.message}`);
|
|
@@ -1024,12 +1025,12 @@ export function setupCommands(cli) {
|
|
|
1024
1025
|
}
|
|
1025
1026
|
default:
|
|
1026
1027
|
{
|
|
1027
|
-
console.log(
|
|
1028
|
-
console.log(
|
|
1029
|
-
console.log(` ${blue(
|
|
1030
|
-
console.log(` ${blue(
|
|
1031
|
-
console.log(` ${blue(
|
|
1032
|
-
console.log(` ${blue(
|
|
1028
|
+
console.log("Available subcommands: store, query, export, import, stats, cleanup");
|
|
1029
|
+
console.log("\nExamples:");
|
|
1030
|
+
console.log(` ${blue("memory store")} previous_work "Research findings from yesterday"`);
|
|
1031
|
+
console.log(` ${blue("memory query")} research`);
|
|
1032
|
+
console.log(` ${blue("memory export")} backup.json`);
|
|
1033
|
+
console.log(` ${blue("memory stats")}`);
|
|
1033
1034
|
break;
|
|
1034
1035
|
}
|
|
1035
1036
|
}
|
|
@@ -1037,98 +1038,98 @@ export function setupCommands(cli) {
|
|
|
1037
1038
|
});
|
|
1038
1039
|
// Claude command
|
|
1039
1040
|
cli.command({
|
|
1040
|
-
name:
|
|
1041
|
-
description:
|
|
1041
|
+
name: "claude",
|
|
1042
|
+
description: "Spawn Claude instances with specific configurations",
|
|
1042
1043
|
aliases: [
|
|
1043
|
-
|
|
1044
|
+
"cl"
|
|
1044
1045
|
],
|
|
1045
1046
|
options: [
|
|
1046
1047
|
{
|
|
1047
|
-
name:
|
|
1048
|
-
short:
|
|
1049
|
-
description:
|
|
1050
|
-
type:
|
|
1051
|
-
default:
|
|
1048
|
+
name: "tools",
|
|
1049
|
+
short: "t",
|
|
1050
|
+
description: "Allowed tools (comma-separated)",
|
|
1051
|
+
type: "string",
|
|
1052
|
+
default: "View,Edit,Replace,GlobTool,GrepTool,LS,Bash"
|
|
1052
1053
|
},
|
|
1053
1054
|
{
|
|
1054
|
-
name:
|
|
1055
|
-
description:
|
|
1056
|
-
type:
|
|
1055
|
+
name: "no-permissions",
|
|
1056
|
+
description: "Use --dangerously-skip-permissions flag",
|
|
1057
|
+
type: "boolean"
|
|
1057
1058
|
},
|
|
1058
1059
|
{
|
|
1059
|
-
name:
|
|
1060
|
-
short:
|
|
1061
|
-
description:
|
|
1062
|
-
type:
|
|
1060
|
+
name: "config",
|
|
1061
|
+
short: "c",
|
|
1062
|
+
description: "MCP config file path",
|
|
1063
|
+
type: "string"
|
|
1063
1064
|
},
|
|
1064
1065
|
{
|
|
1065
|
-
name:
|
|
1066
|
-
short:
|
|
1067
|
-
description:
|
|
1068
|
-
type:
|
|
1069
|
-
default:
|
|
1066
|
+
name: "mode",
|
|
1067
|
+
short: "m",
|
|
1068
|
+
description: "Development mode (full, backend-only, frontend-only, api-only)",
|
|
1069
|
+
type: "string",
|
|
1070
|
+
default: "full"
|
|
1070
1071
|
},
|
|
1071
1072
|
{
|
|
1072
|
-
name:
|
|
1073
|
-
description:
|
|
1074
|
-
type:
|
|
1073
|
+
name: "parallel",
|
|
1074
|
+
description: "Enable parallel execution with BatchTool",
|
|
1075
|
+
type: "boolean"
|
|
1075
1076
|
},
|
|
1076
1077
|
{
|
|
1077
|
-
name:
|
|
1078
|
-
description:
|
|
1079
|
-
type:
|
|
1078
|
+
name: "research",
|
|
1079
|
+
description: "Enable web research with WebFetchTool",
|
|
1080
|
+
type: "boolean"
|
|
1080
1081
|
},
|
|
1081
1082
|
{
|
|
1082
|
-
name:
|
|
1083
|
-
description:
|
|
1084
|
-
type:
|
|
1083
|
+
name: "coverage",
|
|
1084
|
+
description: "Test coverage target percentage",
|
|
1085
|
+
type: "number",
|
|
1085
1086
|
default: 80
|
|
1086
1087
|
},
|
|
1087
1088
|
{
|
|
1088
|
-
name:
|
|
1089
|
-
description:
|
|
1090
|
-
type:
|
|
1091
|
-
default:
|
|
1089
|
+
name: "commit",
|
|
1090
|
+
description: "Commit frequency (phase, feature, manual)",
|
|
1091
|
+
type: "string",
|
|
1092
|
+
default: "phase"
|
|
1092
1093
|
},
|
|
1093
1094
|
{
|
|
1094
|
-
name:
|
|
1095
|
-
short:
|
|
1096
|
-
description:
|
|
1097
|
-
type:
|
|
1095
|
+
name: "verbose",
|
|
1096
|
+
short: "v",
|
|
1097
|
+
description: "Enable verbose output",
|
|
1098
|
+
type: "boolean"
|
|
1098
1099
|
},
|
|
1099
1100
|
{
|
|
1100
|
-
name:
|
|
1101
|
-
short:
|
|
1102
|
-
description:
|
|
1103
|
-
type:
|
|
1101
|
+
name: "dry-run",
|
|
1102
|
+
short: "d",
|
|
1103
|
+
description: "Show what would be executed without running",
|
|
1104
|
+
type: "boolean"
|
|
1104
1105
|
}
|
|
1105
1106
|
],
|
|
1106
1107
|
action: async (ctx)=>{
|
|
1107
1108
|
const subcommand = ctx.args[0];
|
|
1108
1109
|
switch(subcommand){
|
|
1109
|
-
case
|
|
1110
|
+
case "spawn":
|
|
1110
1111
|
{
|
|
1111
1112
|
// Find where flags start (arguments starting with -)
|
|
1112
1113
|
let taskEndIndex = ctx.args.length;
|
|
1113
1114
|
for(let i = 1; i < ctx.args.length; i++){
|
|
1114
|
-
if (ctx.args[i].startsWith(
|
|
1115
|
+
if (ctx.args[i].startsWith("-")) {
|
|
1115
1116
|
taskEndIndex = i;
|
|
1116
1117
|
break;
|
|
1117
1118
|
}
|
|
1118
1119
|
}
|
|
1119
|
-
const task = ctx.args.slice(1, taskEndIndex).join(
|
|
1120
|
+
const task = ctx.args.slice(1, taskEndIndex).join(" ");
|
|
1120
1121
|
if (!task) {
|
|
1121
|
-
error(
|
|
1122
|
+
error("Usage: claude spawn <task description>");
|
|
1122
1123
|
break;
|
|
1123
1124
|
}
|
|
1124
1125
|
try {
|
|
1125
1126
|
// Build allowed tools list
|
|
1126
|
-
let tools = ctx.flags.tools ||
|
|
1127
|
+
let tools = ctx.flags.tools || "View,Edit,Replace,GlobTool,GrepTool,LS,Bash";
|
|
1127
1128
|
if (ctx.flags.parallel) {
|
|
1128
|
-
tools +=
|
|
1129
|
+
tools += ",BatchTool,dispatch_agent";
|
|
1129
1130
|
}
|
|
1130
1131
|
if (ctx.flags.research) {
|
|
1131
|
-
tools +=
|
|
1132
|
+
tools += ",WebFetchTool";
|
|
1132
1133
|
}
|
|
1133
1134
|
const instanceId = `claude-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
1134
1135
|
// Build enhanced task with Claude-Flow guidance
|
|
@@ -1175,23 +1176,23 @@ You are running within the Claude-Flow orchestration system, which provides powe
|
|
|
1175
1176
|
|
|
1176
1177
|
2. **During Execution**:
|
|
1177
1178
|
- Store findings: \`npx claude-flow-novice memory store findings "your data here"\`
|
|
1178
|
-
- Save checkpoints: \`npx claude-flow-novice memory store progress_${task.replace(/\s+/g,
|
|
1179
|
-
${ctx.flags.parallel ? '- Spawn agents: `npx claude-flow-novice agent spawn researcher --name "research-agent"`' :
|
|
1180
|
-
${ctx.flags.parallel ? '- Create tasks: `npx claude-flow-novice task create implementation "implement feature X"`' :
|
|
1179
|
+
- Save checkpoints: \`npx claude-flow-novice memory store progress_${task.replace(/\s+/g, "_")} "current status"\`
|
|
1180
|
+
${ctx.flags.parallel ? '- Spawn agents: `npx claude-flow-novice agent spawn researcher --name "research-agent"`' : ""}
|
|
1181
|
+
${ctx.flags.parallel ? '- Create tasks: `npx claude-flow-novice task create implementation "implement feature X"`' : ""}
|
|
1181
1182
|
|
|
1182
1183
|
3. **Best Practices**:
|
|
1183
1184
|
- Use the Bash tool to run \`npx claude-flow\` commands
|
|
1184
1185
|
- Store data as JSON strings for complex structures
|
|
1185
1186
|
- Query memory before starting to check for existing work
|
|
1186
1187
|
- Use descriptive keys for memory storage
|
|
1187
|
-
${ctx.flags.parallel ?
|
|
1188
|
-
${ctx.flags.research ? '- Store research findings: `npx claude-flow-novice memory store research_findings "data"`' :
|
|
1188
|
+
${ctx.flags.parallel ? "- Coordinate with other agents through shared memory" : ""}
|
|
1189
|
+
${ctx.flags.research ? '- Store research findings: `npx claude-flow-novice memory store research_findings "data"`' : ""}
|
|
1189
1190
|
|
|
1190
1191
|
## Configuration
|
|
1191
1192
|
- Instance ID: ${instanceId}
|
|
1192
|
-
- Mode: ${ctx.flags.mode ||
|
|
1193
|
+
- Mode: ${ctx.flags.mode || "full"}
|
|
1193
1194
|
- Coverage Target: ${ctx.flags.coverage || 80}%
|
|
1194
|
-
- Commit Strategy: ${ctx.flags.commit ||
|
|
1195
|
+
- Commit Strategy: ${ctx.flags.commit || "phase"}
|
|
1195
1196
|
|
|
1196
1197
|
## Example Commands
|
|
1197
1198
|
|
|
@@ -1215,66 +1216,66 @@ Bash("npx claude-flow-novice agent spawn researcher --name auth-researcher")
|
|
|
1215
1216
|
Now, please proceed with the task: ${task}`;
|
|
1216
1217
|
// Build Claude command with enhanced task
|
|
1217
1218
|
const claudeCmd = [
|
|
1218
|
-
|
|
1219
|
+
"claude",
|
|
1219
1220
|
enhancedTask
|
|
1220
1221
|
];
|
|
1221
|
-
claudeCmd.push(
|
|
1222
|
-
if (ctx.flags.noPermissions || ctx.flags[
|
|
1223
|
-
claudeCmd.push(
|
|
1222
|
+
claudeCmd.push("--allowedTools", tools);
|
|
1223
|
+
if (ctx.flags.noPermissions || ctx.flags["skip-permissions"]) {
|
|
1224
|
+
claudeCmd.push("--dangerously-skip-permissions");
|
|
1224
1225
|
}
|
|
1225
1226
|
if (ctx.flags.config) {
|
|
1226
|
-
claudeCmd.push(
|
|
1227
|
+
claudeCmd.push("--mcp-config", ctx.flags.config);
|
|
1227
1228
|
}
|
|
1228
1229
|
if (ctx.flags.verbose) {
|
|
1229
|
-
claudeCmd.push(
|
|
1230
|
+
claudeCmd.push("--verbose");
|
|
1230
1231
|
}
|
|
1231
|
-
if (ctx.flags.dryRun || ctx.flags[
|
|
1232
|
-
warning(
|
|
1232
|
+
if (ctx.flags.dryRun || ctx.flags["dry-run"] || ctx.flags.d) {
|
|
1233
|
+
warning("DRY RUN - Would execute:");
|
|
1233
1234
|
console.log(`Command: claude "<enhanced task with guidance>" --allowedTools ${tools}`);
|
|
1234
1235
|
console.log(`Instance ID: ${instanceId}`);
|
|
1235
1236
|
console.log(`Original Task: ${task}`);
|
|
1236
1237
|
console.log(`Tools: ${tools}`);
|
|
1237
|
-
console.log(`Mode: ${ctx.flags.mode ||
|
|
1238
|
+
console.log(`Mode: ${ctx.flags.mode || "full"}`);
|
|
1238
1239
|
console.log(`Coverage: ${ctx.flags.coverage || 80}%`);
|
|
1239
|
-
console.log(`Commit: ${ctx.flags.commit ||
|
|
1240
|
+
console.log(`Commit: ${ctx.flags.commit || "phase"}`);
|
|
1240
1241
|
console.log(`\nEnhanced Features:`);
|
|
1241
1242
|
console.log(` - Memory Bank enabled via: npx claude-flow-novice memory commands`);
|
|
1242
|
-
console.log(` - Coordination ${ctx.flags.parallel ?
|
|
1243
|
+
console.log(` - Coordination ${ctx.flags.parallel ? "enabled" : "disabled"}`);
|
|
1243
1244
|
console.log(` - Access Claude-Flow features through Bash tool`);
|
|
1244
1245
|
return;
|
|
1245
1246
|
}
|
|
1246
1247
|
success(`Spawning Claude instance: ${instanceId}`);
|
|
1247
1248
|
console.log(`📝 Original Task: ${task}`);
|
|
1248
1249
|
console.log(`🔧 Tools: ${tools}`);
|
|
1249
|
-
console.log(`⚙️ Mode: ${ctx.flags.mode ||
|
|
1250
|
+
console.log(`⚙️ Mode: ${ctx.flags.mode || "full"}`);
|
|
1250
1251
|
console.log(`📊 Coverage: ${ctx.flags.coverage || 80}%`);
|
|
1251
|
-
console.log(`💾 Commit: ${ctx.flags.commit ||
|
|
1252
|
+
console.log(`💾 Commit: ${ctx.flags.commit || "phase"}`);
|
|
1252
1253
|
console.log(`✨ Enhanced with Claude-Flow guidance for memory and coordination`);
|
|
1253
|
-
console.log(
|
|
1254
|
-
console.log(
|
|
1255
|
-
console.log(
|
|
1256
|
-
console.log(
|
|
1257
|
-
console.log(
|
|
1258
|
-
console.log(
|
|
1254
|
+
console.log("");
|
|
1255
|
+
console.log("📋 Task will be enhanced with:");
|
|
1256
|
+
console.log(" - Memory Bank instructions (store/retrieve)");
|
|
1257
|
+
console.log(" - Coordination capabilities (swarm management)");
|
|
1258
|
+
console.log(" - Best practices for multi-agent workflows");
|
|
1259
|
+
console.log("");
|
|
1259
1260
|
// Execute Claude command
|
|
1260
|
-
const { spawn } = await import(
|
|
1261
|
-
const child = spawn(
|
|
1261
|
+
const { spawn } = await import("child_process");
|
|
1262
|
+
const child = spawn("claude", claudeCmd.slice(1).map((arg)=>arg.replace(/^"|"$/g, "")), {
|
|
1262
1263
|
env: {
|
|
1263
1264
|
...process.env,
|
|
1264
1265
|
CLAUDE_INSTANCE_ID: instanceId,
|
|
1265
|
-
CLAUDE_FLOW_MODE: ctx.flags.mode ||
|
|
1266
|
+
CLAUDE_FLOW_MODE: ctx.flags.mode || "full",
|
|
1266
1267
|
CLAUDE_FLOW_COVERAGE: (ctx.flags.coverage || 80).toString(),
|
|
1267
|
-
CLAUDE_FLOW_COMMIT: ctx.flags.commit ||
|
|
1268
|
+
CLAUDE_FLOW_COMMIT: ctx.flags.commit || "phase",
|
|
1268
1269
|
// Add Claude-Flow specific features
|
|
1269
|
-
CLAUDE_FLOW_MEMORY_ENABLED:
|
|
1270
|
-
CLAUDE_FLOW_MEMORY_NAMESPACE:
|
|
1271
|
-
CLAUDE_FLOW_COORDINATION_ENABLED: ctx.flags.parallel ?
|
|
1272
|
-
CLAUDE_FLOW_FEATURES:
|
|
1270
|
+
CLAUDE_FLOW_MEMORY_ENABLED: "true",
|
|
1271
|
+
CLAUDE_FLOW_MEMORY_NAMESPACE: "default",
|
|
1272
|
+
CLAUDE_FLOW_COORDINATION_ENABLED: ctx.flags.parallel ? "true" : "false",
|
|
1273
|
+
CLAUDE_FLOW_FEATURES: "memory,coordination,swarm"
|
|
1273
1274
|
},
|
|
1274
|
-
stdio:
|
|
1275
|
+
stdio: "inherit"
|
|
1275
1276
|
});
|
|
1276
1277
|
const status = await new Promise((resolve)=>{
|
|
1277
|
-
child.on(
|
|
1278
|
+
child.on("close", (code)=>{
|
|
1278
1279
|
resolve({
|
|
1279
1280
|
success: code === 0,
|
|
1280
1281
|
code
|
|
@@ -1291,60 +1292,60 @@ Now, please proceed with the task: ${task}`;
|
|
|
1291
1292
|
}
|
|
1292
1293
|
break;
|
|
1293
1294
|
}
|
|
1294
|
-
case
|
|
1295
|
+
case "batch":
|
|
1295
1296
|
{
|
|
1296
1297
|
const workflowFile = ctx.args[1];
|
|
1297
1298
|
if (!workflowFile) {
|
|
1298
|
-
error(
|
|
1299
|
+
error("Usage: claude batch <workflow-file>");
|
|
1299
1300
|
break;
|
|
1300
1301
|
}
|
|
1301
1302
|
try {
|
|
1302
|
-
const { readFile } = await import(
|
|
1303
|
-
const content = await readFile(workflowFile,
|
|
1303
|
+
const { readFile } = await import("fs/promises");
|
|
1304
|
+
const content = await readFile(workflowFile, "utf-8");
|
|
1304
1305
|
const workflow = JSON.parse(content);
|
|
1305
|
-
success(`Loading workflow: ${workflow.name ||
|
|
1306
|
+
success(`Loading workflow: ${workflow.name || "Unnamed"}`);
|
|
1306
1307
|
console.log(`📋 Tasks: ${workflow.tasks?.length || 0}`);
|
|
1307
1308
|
if (!workflow.tasks || workflow.tasks.length === 0) {
|
|
1308
|
-
warning(
|
|
1309
|
+
warning("No tasks found in workflow");
|
|
1309
1310
|
return;
|
|
1310
1311
|
}
|
|
1311
1312
|
const promises = [];
|
|
1312
1313
|
for (const task of workflow.tasks){
|
|
1313
1314
|
const claudeCmd = [
|
|
1314
|
-
|
|
1315
|
+
"claude",
|
|
1315
1316
|
`"${task.description || task.name}"`
|
|
1316
1317
|
];
|
|
1317
1318
|
// Add tools
|
|
1318
1319
|
if (task.tools) {
|
|
1319
|
-
const toolsList = Array.isArray(task.tools) ? task.tools.join(
|
|
1320
|
-
claudeCmd.push(
|
|
1320
|
+
const toolsList = Array.isArray(task.tools) ? task.tools.join(",") : task.tools;
|
|
1321
|
+
claudeCmd.push("--allowedTools", toolsList);
|
|
1321
1322
|
}
|
|
1322
1323
|
// Add flags
|
|
1323
1324
|
if (task.skipPermissions || task.dangerouslySkipPermissions) {
|
|
1324
|
-
claudeCmd.push(
|
|
1325
|
+
claudeCmd.push("--dangerously-skip-permissions");
|
|
1325
1326
|
}
|
|
1326
1327
|
if (task.config) {
|
|
1327
|
-
claudeCmd.push(
|
|
1328
|
+
claudeCmd.push("--mcp-config", task.config);
|
|
1328
1329
|
}
|
|
1329
1330
|
const taskId = task.id || `task-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
1330
|
-
if (ctx.flags.dryRun || ctx.flags[
|
|
1331
|
-
console.log(`\n${yellow(
|
|
1332
|
-
console.log(`Command: ${claudeCmd.join(
|
|
1331
|
+
if (ctx.flags.dryRun || ctx.flags["dry-run"]) {
|
|
1332
|
+
console.log(`\n${yellow("DRY RUN")} - Task: ${task.name || taskId}`);
|
|
1333
|
+
console.log(`Command: ${claudeCmd.join(" ")}`);
|
|
1333
1334
|
continue;
|
|
1334
1335
|
}
|
|
1335
1336
|
console.log(`\n🚀 Spawning Claude for task: ${task.name || taskId}`);
|
|
1336
|
-
const { spawn } = await import(
|
|
1337
|
-
const child = spawn(
|
|
1337
|
+
const { spawn } = await import("child_process");
|
|
1338
|
+
const child = spawn("claude", claudeCmd.slice(1).map((arg)=>arg.replace(/^"|"$/g, "")), {
|
|
1338
1339
|
env: {
|
|
1339
1340
|
...process.env,
|
|
1340
1341
|
CLAUDE_TASK_ID: taskId,
|
|
1341
|
-
CLAUDE_TASK_TYPE: task.type ||
|
|
1342
|
+
CLAUDE_TASK_TYPE: task.type || "general"
|
|
1342
1343
|
},
|
|
1343
|
-
stdio:
|
|
1344
|
+
stdio: "inherit"
|
|
1344
1345
|
});
|
|
1345
1346
|
if (workflow.parallel) {
|
|
1346
1347
|
promises.push(new Promise((resolve)=>{
|
|
1347
|
-
child.on(
|
|
1348
|
+
child.on("close", (code)=>{
|
|
1348
1349
|
resolve({
|
|
1349
1350
|
success: code === 0,
|
|
1350
1351
|
code
|
|
@@ -1354,7 +1355,7 @@ Now, please proceed with the task: ${task}`;
|
|
|
1354
1355
|
} else {
|
|
1355
1356
|
// Wait for completion if sequential
|
|
1356
1357
|
const status = await new Promise((resolve)=>{
|
|
1357
|
-
child.on(
|
|
1358
|
+
child.on("close", (code)=>{
|
|
1358
1359
|
resolve({
|
|
1359
1360
|
success: code === 0,
|
|
1360
1361
|
code
|
|
@@ -1367,13 +1368,13 @@ Now, please proceed with the task: ${task}`;
|
|
|
1367
1368
|
}
|
|
1368
1369
|
}
|
|
1369
1370
|
if (workflow.parallel && promises.length > 0) {
|
|
1370
|
-
success(
|
|
1371
|
+
success("All Claude instances spawned in parallel mode");
|
|
1371
1372
|
const results = await Promise.all(promises);
|
|
1372
1373
|
const failed = results.filter((s)=>!s.success).length;
|
|
1373
1374
|
if (failed > 0) {
|
|
1374
1375
|
warning(`${failed} tasks failed`);
|
|
1375
1376
|
} else {
|
|
1376
|
-
success(
|
|
1377
|
+
success("All tasks completed successfully");
|
|
1377
1378
|
}
|
|
1378
1379
|
}
|
|
1379
1380
|
} catch (err) {
|
|
@@ -1383,11 +1384,11 @@ Now, please proceed with the task: ${task}`;
|
|
|
1383
1384
|
}
|
|
1384
1385
|
default:
|
|
1385
1386
|
{
|
|
1386
|
-
console.log(
|
|
1387
|
-
console.log(
|
|
1387
|
+
console.log("Available subcommands: spawn, batch");
|
|
1388
|
+
console.log("\nExamples:");
|
|
1388
1389
|
console.log(' claude-flow-novice claude spawn "implement user authentication" --research --parallel');
|
|
1389
1390
|
console.log(' claude-flow-novice claude spawn "fix bug in payment system" --no-permissions');
|
|
1390
|
-
console.log(
|
|
1391
|
+
console.log(" claude-flow-novice claude batch workflow.json --dry-run");
|
|
1391
1392
|
break;
|
|
1392
1393
|
}
|
|
1393
1394
|
}
|
|
@@ -1404,34 +1405,34 @@ Now, please proceed with the task: ${task}`;
|
|
|
1404
1405
|
alerts: ctx.flags.alerts,
|
|
1405
1406
|
export: ctx.flags.export,
|
|
1406
1407
|
threshold: ctx.flags.threshold || 80,
|
|
1407
|
-
logLevel: ctx.flags.logLevel || ctx.flags[
|
|
1408
|
-
noGraphs: ctx.flags.noGraphs || ctx.flags[
|
|
1408
|
+
logLevel: ctx.flags.logLevel || ctx.flags["log-level"] || "info",
|
|
1409
|
+
noGraphs: ctx.flags.noGraphs || ctx.flags["no-graphs"]
|
|
1409
1410
|
};
|
|
1410
|
-
console.log(chalk.cyan(
|
|
1411
|
-
console.log(
|
|
1412
|
-
console.log(
|
|
1411
|
+
console.log(chalk.cyan("📊 Enhanced Monitor Command"));
|
|
1412
|
+
console.log("For full enhanced functionality, use: claude-flow-novice monitor [options]");
|
|
1413
|
+
console.log("Available options: --interval, --compact, --focus, --alerts, --export, --threshold, --log-level, --no-graphs");
|
|
1413
1414
|
// Fallback to basic monitoring
|
|
1414
1415
|
try {
|
|
1415
1416
|
const persist = await getPersistence();
|
|
1416
1417
|
const stats = await persist.getStats();
|
|
1417
|
-
const { access } = await import(
|
|
1418
|
-
const isRunning = await access(
|
|
1418
|
+
const { access } = await import("fs/promises");
|
|
1419
|
+
const isRunning = await access("orchestrator.log").then(()=>true).catch(()=>false);
|
|
1419
1420
|
if (!isRunning) {
|
|
1420
1421
|
warning("Orchestrator is not running. Start it first with 'claude-flow-novice start'");
|
|
1421
1422
|
return;
|
|
1422
1423
|
}
|
|
1423
|
-
info(
|
|
1424
|
-
console.log(
|
|
1424
|
+
info("Starting enhanced monitoring dashboard...");
|
|
1425
|
+
console.log("Press Ctrl+C to exit");
|
|
1425
1426
|
const interval = Number(options.interval) * 1000;
|
|
1426
1427
|
let running = true;
|
|
1427
1428
|
const cleanup = ()=>{
|
|
1428
1429
|
running = false;
|
|
1429
|
-
console.log(
|
|
1430
|
+
console.log("\nMonitor stopped");
|
|
1430
1431
|
process.exit(0);
|
|
1431
1432
|
};
|
|
1432
|
-
process.on(
|
|
1433
|
-
process.on(
|
|
1434
|
-
process.stdout.write(
|
|
1433
|
+
process.on("SIGINT", cleanup);
|
|
1434
|
+
process.on("SIGTERM", cleanup);
|
|
1435
|
+
process.stdout.write("\x1b[?25l");
|
|
1435
1436
|
let cycles = 0;
|
|
1436
1437
|
while(running){
|
|
1437
1438
|
try {
|
|
@@ -1440,8 +1441,8 @@ Now, please proceed with the task: ${task}`;
|
|
|
1440
1441
|
const agents = await persist.getActiveAgents();
|
|
1441
1442
|
const tasks = await persist.getActiveTasks();
|
|
1442
1443
|
// Enhanced header
|
|
1443
|
-
success(
|
|
1444
|
-
console.log(
|
|
1444
|
+
success("Claude-Flow Enhanced Live Monitor");
|
|
1445
|
+
console.log("═".repeat(60));
|
|
1445
1446
|
console.log(`Update #${++cycles} • ${new Date().toLocaleTimeString()} • Interval: ${options.interval}s`);
|
|
1446
1447
|
if (options.focus) {
|
|
1447
1448
|
console.log(`🎯 Focus: ${options.focus}`);
|
|
@@ -1450,12 +1451,12 @@ Now, please proceed with the task: ${task}`;
|
|
|
1450
1451
|
console.log(`🚨 Alerts: Enabled (threshold: ${options.threshold}%)`);
|
|
1451
1452
|
}
|
|
1452
1453
|
// System overview with thresholds
|
|
1453
|
-
console.log(
|
|
1454
|
+
console.log("\n📊 System Overview:");
|
|
1454
1455
|
const cpuUsage = Math.random() * 100;
|
|
1455
1456
|
const memoryUsage = Math.random() * 1000;
|
|
1456
1457
|
const threshold = Number(options.threshold || 80);
|
|
1457
|
-
const cpuColor = cpuUsage > threshold ?
|
|
1458
|
-
const memoryColor = memoryUsage > 800 ?
|
|
1458
|
+
const cpuColor = cpuUsage > threshold ? "🔴" : cpuUsage > threshold * 0.8 ? "🟡" : "🟢";
|
|
1459
|
+
const memoryColor = memoryUsage > 800 ? "🔴" : memoryUsage > 600 ? "🟡" : "🟢";
|
|
1459
1460
|
console.log(` ${cpuColor} CPU: ${cpuUsage.toFixed(1)}%`);
|
|
1460
1461
|
console.log(` ${memoryColor} Memory: ${memoryUsage.toFixed(0)}MB`);
|
|
1461
1462
|
console.log(` 🤖 Agents: ${currentStats.activeAgents} active (${currentStats.totalAgents} total)`);
|
|
@@ -1463,27 +1464,27 @@ Now, please proceed with the task: ${task}`;
|
|
|
1463
1464
|
console.log(` ✅ Completed: ${currentStats.completedTasks} tasks`);
|
|
1464
1465
|
// Performance metrics
|
|
1465
1466
|
if (!options.compact) {
|
|
1466
|
-
console.log(
|
|
1467
|
+
console.log("\n📈 Performance Metrics:");
|
|
1467
1468
|
console.log(` Response Time: ${(800 + Math.random() * 400).toFixed(0)}ms`);
|
|
1468
1469
|
console.log(` Throughput: ${(40 + Math.random() * 20).toFixed(1)} req/min`);
|
|
1469
1470
|
console.log(` Error Rate: ${(Math.random() * 2).toFixed(2)}%`);
|
|
1470
1471
|
// Simple ASCII graph simulation
|
|
1471
1472
|
if (!options.noGraphs) {
|
|
1472
|
-
console.log(
|
|
1473
|
+
console.log("\n📊 CPU Trend (last 10 updates):");
|
|
1473
1474
|
const trend = Array.from({
|
|
1474
1475
|
length: 10
|
|
1475
1476
|
}, ()=>Math.floor(Math.random() * 8));
|
|
1476
1477
|
const chars = [
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1478
|
+
"▁",
|
|
1479
|
+
"▂",
|
|
1480
|
+
"▃",
|
|
1481
|
+
"▄",
|
|
1482
|
+
"▅",
|
|
1483
|
+
"▆",
|
|
1484
|
+
"▇",
|
|
1485
|
+
"█"
|
|
1485
1486
|
];
|
|
1486
|
-
console.log(` ${trend.map((i)=>chars[i]).join(
|
|
1487
|
+
console.log(` ${trend.map((i)=>chars[i]).join("")}`);
|
|
1487
1488
|
}
|
|
1488
1489
|
}
|
|
1489
1490
|
// Active components (if focused)
|
|
@@ -1496,18 +1497,18 @@ Now, please proceed with the task: ${task}`;
|
|
|
1496
1497
|
}
|
|
1497
1498
|
// Alerts simulation
|
|
1498
1499
|
if (options.alerts && Math.random() > 0.8) {
|
|
1499
|
-
console.log(
|
|
1500
|
+
console.log("\n🚨 Active Alerts:");
|
|
1500
1501
|
console.log(` ⚠️ High CPU usage detected`);
|
|
1501
1502
|
console.log(` 📊 Memory usage approaching threshold`);
|
|
1502
1503
|
}
|
|
1503
1504
|
// Export status
|
|
1504
1505
|
if (options.export) {
|
|
1505
|
-
console.log(
|
|
1506
|
+
console.log("\n💾 Export Status:");
|
|
1506
1507
|
console.log(` Exporting to: ${options.export}`);
|
|
1507
1508
|
console.log(` Data points: ${cycles}`);
|
|
1508
1509
|
}
|
|
1509
1510
|
// Footer
|
|
1510
|
-
console.log(
|
|
1511
|
+
console.log("\n" + "─".repeat(60));
|
|
1511
1512
|
console.log(`Log Level: ${options.logLevel} • Threshold: ${options.threshold}% • Press Ctrl+C to exit`);
|
|
1512
1513
|
await new Promise((resolve)=>setTimeout(resolve, interval));
|
|
1513
1514
|
} catch (err) {
|
|
@@ -1515,115 +1516,115 @@ Now, please proceed with the task: ${task}`;
|
|
|
1515
1516
|
await new Promise((resolve)=>setTimeout(resolve, interval));
|
|
1516
1517
|
}
|
|
1517
1518
|
}
|
|
1518
|
-
process.stdout.write(
|
|
1519
|
+
process.stdout.write("\x1b[?25h");
|
|
1519
1520
|
} catch (err) {
|
|
1520
1521
|
error(`Failed to start enhanced monitor: ${err.message}`);
|
|
1521
1522
|
}
|
|
1522
1523
|
};
|
|
1523
1524
|
cli.command({
|
|
1524
|
-
name:
|
|
1525
|
-
description:
|
|
1525
|
+
name: "monitor",
|
|
1526
|
+
description: "Enhanced live monitoring dashboard with comprehensive metrics",
|
|
1526
1527
|
options: [
|
|
1527
1528
|
{
|
|
1528
|
-
name:
|
|
1529
|
-
short:
|
|
1530
|
-
description:
|
|
1531
|
-
type:
|
|
1529
|
+
name: "interval",
|
|
1530
|
+
short: "i",
|
|
1531
|
+
description: "Update interval in seconds",
|
|
1532
|
+
type: "number",
|
|
1532
1533
|
default: 2
|
|
1533
1534
|
},
|
|
1534
1535
|
{
|
|
1535
|
-
name:
|
|
1536
|
-
short:
|
|
1537
|
-
description:
|
|
1538
|
-
type:
|
|
1536
|
+
name: "compact",
|
|
1537
|
+
short: "c",
|
|
1538
|
+
description: "Compact view mode",
|
|
1539
|
+
type: "boolean"
|
|
1539
1540
|
},
|
|
1540
1541
|
{
|
|
1541
|
-
name:
|
|
1542
|
-
short:
|
|
1543
|
-
description:
|
|
1544
|
-
type:
|
|
1542
|
+
name: "focus",
|
|
1543
|
+
short: "f",
|
|
1544
|
+
description: "Focus on specific component",
|
|
1545
|
+
type: "string"
|
|
1545
1546
|
},
|
|
1546
1547
|
{
|
|
1547
|
-
name:
|
|
1548
|
-
description:
|
|
1549
|
-
type:
|
|
1548
|
+
name: "alerts",
|
|
1549
|
+
description: "Enable alert notifications",
|
|
1550
|
+
type: "boolean"
|
|
1550
1551
|
},
|
|
1551
1552
|
{
|
|
1552
|
-
name:
|
|
1553
|
-
description:
|
|
1554
|
-
type:
|
|
1553
|
+
name: "export",
|
|
1554
|
+
description: "Export monitoring data to file",
|
|
1555
|
+
type: "string"
|
|
1555
1556
|
},
|
|
1556
1557
|
{
|
|
1557
|
-
name:
|
|
1558
|
-
description:
|
|
1559
|
-
type:
|
|
1558
|
+
name: "threshold",
|
|
1559
|
+
description: "Alert threshold percentage",
|
|
1560
|
+
type: "number",
|
|
1560
1561
|
default: 80
|
|
1561
1562
|
},
|
|
1562
1563
|
{
|
|
1563
|
-
name:
|
|
1564
|
-
description:
|
|
1565
|
-
type:
|
|
1566
|
-
default:
|
|
1564
|
+
name: "log-level",
|
|
1565
|
+
description: "Log level filter (error, warn, info, debug)",
|
|
1566
|
+
type: "string",
|
|
1567
|
+
default: "info"
|
|
1567
1568
|
},
|
|
1568
1569
|
{
|
|
1569
|
-
name:
|
|
1570
|
-
description:
|
|
1571
|
-
type:
|
|
1570
|
+
name: "no-graphs",
|
|
1571
|
+
description: "Disable ASCII graphs",
|
|
1572
|
+
type: "boolean"
|
|
1572
1573
|
}
|
|
1573
1574
|
],
|
|
1574
1575
|
action: enhancedMonitorAction
|
|
1575
1576
|
});
|
|
1576
1577
|
} catch (err) {
|
|
1577
|
-
warning(
|
|
1578
|
+
warning("Enhanced monitor command not available, using basic version");
|
|
1578
1579
|
// Fallback basic monitor command (original implementation)
|
|
1579
1580
|
cli.command({
|
|
1580
|
-
name:
|
|
1581
|
-
description:
|
|
1581
|
+
name: "monitor",
|
|
1582
|
+
description: "Live monitoring dashboard",
|
|
1582
1583
|
options: [
|
|
1583
1584
|
{
|
|
1584
|
-
name:
|
|
1585
|
-
short:
|
|
1586
|
-
description:
|
|
1587
|
-
type:
|
|
1585
|
+
name: "interval",
|
|
1586
|
+
short: "i",
|
|
1587
|
+
description: "Update interval in seconds",
|
|
1588
|
+
type: "number",
|
|
1588
1589
|
default: 2
|
|
1589
1590
|
},
|
|
1590
1591
|
{
|
|
1591
|
-
name:
|
|
1592
|
-
short:
|
|
1593
|
-
description:
|
|
1594
|
-
type:
|
|
1592
|
+
name: "compact",
|
|
1593
|
+
short: "c",
|
|
1594
|
+
description: "Compact view mode",
|
|
1595
|
+
type: "boolean"
|
|
1595
1596
|
},
|
|
1596
1597
|
{
|
|
1597
|
-
name:
|
|
1598
|
-
short:
|
|
1599
|
-
description:
|
|
1600
|
-
type:
|
|
1598
|
+
name: "focus",
|
|
1599
|
+
short: "f",
|
|
1600
|
+
description: "Focus on specific component",
|
|
1601
|
+
type: "string"
|
|
1601
1602
|
}
|
|
1602
1603
|
],
|
|
1603
1604
|
action: async (ctx)=>{
|
|
1604
1605
|
// Original basic monitor implementation
|
|
1605
1606
|
try {
|
|
1606
1607
|
const persist = await getPersistence();
|
|
1607
|
-
const { access } = await import(
|
|
1608
|
-
const isRunning = await access(
|
|
1608
|
+
const { access } = await import("fs/promises");
|
|
1609
|
+
const isRunning = await access("orchestrator.log").then(()=>true).catch(()=>false);
|
|
1609
1610
|
if (!isRunning) {
|
|
1610
1611
|
warning("Orchestrator is not running. Start it first with 'claude-flow-novice start'");
|
|
1611
1612
|
return;
|
|
1612
1613
|
}
|
|
1613
|
-
info(
|
|
1614
|
-
console.log(
|
|
1614
|
+
info("Starting basic monitoring dashboard...");
|
|
1615
|
+
console.log("Press Ctrl+C to exit");
|
|
1615
1616
|
const interval = (ctx.flags.interval || 2) * 1000;
|
|
1616
1617
|
let running = true;
|
|
1617
1618
|
const cleanup = ()=>{
|
|
1618
1619
|
running = false;
|
|
1619
|
-
console.log(
|
|
1620
|
+
console.log("\nMonitor stopped");
|
|
1620
1621
|
process.exit(0);
|
|
1621
1622
|
};
|
|
1622
|
-
process.on(
|
|
1623
|
+
process.on("SIGINT", cleanup);
|
|
1623
1624
|
while(running){
|
|
1624
1625
|
console.clear();
|
|
1625
1626
|
const stats = await persist.getStats();
|
|
1626
|
-
success(
|
|
1627
|
+
success("Claude-Flow Live Monitor");
|
|
1627
1628
|
console.log(`🟢 Status: Running`);
|
|
1628
1629
|
console.log(`🤖 Agents: ${stats.activeAgents} active`);
|
|
1629
1630
|
console.log(`📋 Tasks: ${stats.pendingTasks} pending`);
|
|
@@ -1638,183 +1639,183 @@ Now, please proceed with the task: ${task}`;
|
|
|
1638
1639
|
}
|
|
1639
1640
|
// Swarm command
|
|
1640
1641
|
cli.command({
|
|
1641
|
-
name:
|
|
1642
|
-
description:
|
|
1642
|
+
name: "swarm",
|
|
1643
|
+
description: "Create self-orchestrating Claude agent swarms",
|
|
1643
1644
|
options: [
|
|
1644
1645
|
{
|
|
1645
|
-
name:
|
|
1646
|
-
short:
|
|
1647
|
-
description:
|
|
1648
|
-
type:
|
|
1649
|
-
default:
|
|
1646
|
+
name: "strategy",
|
|
1647
|
+
short: "s",
|
|
1648
|
+
description: "Orchestration strategy (auto, research, development, analysis, testing, optimization, maintenance)",
|
|
1649
|
+
type: "string",
|
|
1650
|
+
default: "auto"
|
|
1650
1651
|
},
|
|
1651
1652
|
{
|
|
1652
|
-
name:
|
|
1653
|
-
short:
|
|
1654
|
-
description:
|
|
1655
|
-
type:
|
|
1656
|
-
default:
|
|
1653
|
+
name: "mode",
|
|
1654
|
+
short: "m",
|
|
1655
|
+
description: "Coordination mode (centralized, distributed, hierarchical, mesh, hybrid)",
|
|
1656
|
+
type: "string",
|
|
1657
|
+
default: "centralized"
|
|
1657
1658
|
},
|
|
1658
1659
|
{
|
|
1659
|
-
name:
|
|
1660
|
-
description:
|
|
1661
|
-
type:
|
|
1660
|
+
name: "max-agents",
|
|
1661
|
+
description: "Maximum number of agents to spawn",
|
|
1662
|
+
type: "number",
|
|
1662
1663
|
default: 5
|
|
1663
1664
|
},
|
|
1664
1665
|
{
|
|
1665
|
-
name:
|
|
1666
|
-
description:
|
|
1667
|
-
type:
|
|
1666
|
+
name: "max-depth",
|
|
1667
|
+
description: "Maximum delegation depth",
|
|
1668
|
+
type: "number",
|
|
1668
1669
|
default: 3
|
|
1669
1670
|
},
|
|
1670
1671
|
{
|
|
1671
|
-
name:
|
|
1672
|
-
description:
|
|
1673
|
-
type:
|
|
1672
|
+
name: "research",
|
|
1673
|
+
description: "Enable research capabilities for all agents",
|
|
1674
|
+
type: "boolean"
|
|
1674
1675
|
},
|
|
1675
1676
|
{
|
|
1676
|
-
name:
|
|
1677
|
-
description:
|
|
1678
|
-
type:
|
|
1677
|
+
name: "parallel",
|
|
1678
|
+
description: "Enable parallel execution",
|
|
1679
|
+
type: "boolean"
|
|
1679
1680
|
},
|
|
1680
1681
|
{
|
|
1681
|
-
name:
|
|
1682
|
-
description:
|
|
1683
|
-
type:
|
|
1684
|
-
default:
|
|
1682
|
+
name: "memory-namespace",
|
|
1683
|
+
description: "Shared memory namespace",
|
|
1684
|
+
type: "string",
|
|
1685
|
+
default: "swarm"
|
|
1685
1686
|
},
|
|
1686
1687
|
{
|
|
1687
|
-
name:
|
|
1688
|
-
description:
|
|
1689
|
-
type:
|
|
1688
|
+
name: "timeout",
|
|
1689
|
+
description: "Swarm timeout in minutes",
|
|
1690
|
+
type: "number",
|
|
1690
1691
|
default: 60
|
|
1691
1692
|
},
|
|
1692
1693
|
{
|
|
1693
|
-
name:
|
|
1694
|
-
description:
|
|
1695
|
-
type:
|
|
1694
|
+
name: "review",
|
|
1695
|
+
description: "Enable peer review between agents",
|
|
1696
|
+
type: "boolean"
|
|
1696
1697
|
},
|
|
1697
1698
|
{
|
|
1698
|
-
name:
|
|
1699
|
-
description:
|
|
1700
|
-
type:
|
|
1699
|
+
name: "coordinator",
|
|
1700
|
+
description: "Spawn dedicated coordinator agent",
|
|
1701
|
+
type: "boolean"
|
|
1701
1702
|
},
|
|
1702
1703
|
{
|
|
1703
|
-
name:
|
|
1704
|
-
short:
|
|
1705
|
-
description:
|
|
1706
|
-
type:
|
|
1704
|
+
name: "config",
|
|
1705
|
+
short: "c",
|
|
1706
|
+
description: "MCP config file",
|
|
1707
|
+
type: "string"
|
|
1707
1708
|
},
|
|
1708
1709
|
{
|
|
1709
|
-
name:
|
|
1710
|
-
short:
|
|
1711
|
-
description:
|
|
1712
|
-
type:
|
|
1710
|
+
name: "verbose",
|
|
1711
|
+
short: "v",
|
|
1712
|
+
description: "Enable verbose output",
|
|
1713
|
+
type: "boolean"
|
|
1713
1714
|
},
|
|
1714
1715
|
{
|
|
1715
|
-
name:
|
|
1716
|
-
short:
|
|
1717
|
-
description:
|
|
1718
|
-
type:
|
|
1716
|
+
name: "dry-run",
|
|
1717
|
+
short: "d",
|
|
1718
|
+
description: "Preview swarm configuration",
|
|
1719
|
+
type: "boolean"
|
|
1719
1720
|
},
|
|
1720
1721
|
{
|
|
1721
|
-
name:
|
|
1722
|
-
description:
|
|
1723
|
-
type:
|
|
1722
|
+
name: "vscode",
|
|
1723
|
+
description: "Use VS Code terminal integration",
|
|
1724
|
+
type: "boolean"
|
|
1724
1725
|
},
|
|
1725
1726
|
{
|
|
1726
|
-
name:
|
|
1727
|
-
description:
|
|
1728
|
-
type:
|
|
1727
|
+
name: "monitor",
|
|
1728
|
+
description: "Enable real-time monitoring",
|
|
1729
|
+
type: "boolean"
|
|
1729
1730
|
},
|
|
1730
1731
|
{
|
|
1731
|
-
name:
|
|
1732
|
-
description:
|
|
1733
|
-
type:
|
|
1732
|
+
name: "ui",
|
|
1733
|
+
description: "Use blessed terminal UI (avoids TTY issues)",
|
|
1734
|
+
type: "boolean"
|
|
1734
1735
|
},
|
|
1735
1736
|
{
|
|
1736
|
-
name:
|
|
1737
|
-
description:
|
|
1738
|
-
type:
|
|
1737
|
+
name: "claude",
|
|
1738
|
+
description: "Launch Claude Code with swarm coordination prompt",
|
|
1739
|
+
type: "boolean"
|
|
1739
1740
|
},
|
|
1740
1741
|
{
|
|
1741
|
-
name:
|
|
1742
|
-
description:
|
|
1743
|
-
type:
|
|
1742
|
+
name: "executor",
|
|
1743
|
+
description: "Use built-in executor instead of Claude Code",
|
|
1744
|
+
type: "boolean"
|
|
1744
1745
|
}
|
|
1745
1746
|
],
|
|
1746
1747
|
action: swarmAction
|
|
1747
1748
|
});
|
|
1748
1749
|
// Enhanced SPARC command
|
|
1749
1750
|
cli.command({
|
|
1750
|
-
name:
|
|
1751
|
-
description:
|
|
1751
|
+
name: "sparc",
|
|
1752
|
+
description: "Enhanced SPARC-based TDD development with specialized modes and orchestration",
|
|
1752
1753
|
options: [
|
|
1753
1754
|
{
|
|
1754
|
-
name:
|
|
1755
|
-
short:
|
|
1756
|
-
description:
|
|
1757
|
-
type:
|
|
1758
|
-
default:
|
|
1755
|
+
name: "namespace",
|
|
1756
|
+
short: "n",
|
|
1757
|
+
description: "Memory namespace for this session",
|
|
1758
|
+
type: "string",
|
|
1759
|
+
default: "sparc"
|
|
1759
1760
|
},
|
|
1760
1761
|
{
|
|
1761
|
-
name:
|
|
1762
|
-
description:
|
|
1763
|
-
type:
|
|
1762
|
+
name: "no-permissions",
|
|
1763
|
+
description: "Skip permission prompts",
|
|
1764
|
+
type: "boolean"
|
|
1764
1765
|
},
|
|
1765
1766
|
{
|
|
1766
|
-
name:
|
|
1767
|
-
short:
|
|
1768
|
-
description:
|
|
1769
|
-
type:
|
|
1767
|
+
name: "config",
|
|
1768
|
+
short: "c",
|
|
1769
|
+
description: "MCP configuration file",
|
|
1770
|
+
type: "string"
|
|
1770
1771
|
},
|
|
1771
1772
|
{
|
|
1772
|
-
name:
|
|
1773
|
-
short:
|
|
1774
|
-
description:
|
|
1775
|
-
type:
|
|
1773
|
+
name: "verbose",
|
|
1774
|
+
short: "v",
|
|
1775
|
+
description: "Enable verbose output",
|
|
1776
|
+
type: "boolean"
|
|
1776
1777
|
},
|
|
1777
1778
|
{
|
|
1778
|
-
name:
|
|
1779
|
-
short:
|
|
1780
|
-
description:
|
|
1781
|
-
type:
|
|
1779
|
+
name: "dry-run",
|
|
1780
|
+
short: "d",
|
|
1781
|
+
description: "Preview what would be executed",
|
|
1782
|
+
type: "boolean"
|
|
1782
1783
|
},
|
|
1783
1784
|
{
|
|
1784
|
-
name:
|
|
1785
|
-
description:
|
|
1786
|
-
type:
|
|
1785
|
+
name: "sequential",
|
|
1786
|
+
description: "Wait between workflow steps",
|
|
1787
|
+
type: "boolean",
|
|
1787
1788
|
default: true
|
|
1788
1789
|
},
|
|
1789
1790
|
{
|
|
1790
|
-
name:
|
|
1791
|
-
description:
|
|
1792
|
-
type:
|
|
1791
|
+
name: "batch",
|
|
1792
|
+
description: "Enable batch operations for efficiency",
|
|
1793
|
+
type: "boolean"
|
|
1793
1794
|
},
|
|
1794
1795
|
{
|
|
1795
|
-
name:
|
|
1796
|
-
description:
|
|
1797
|
-
type:
|
|
1796
|
+
name: "parallel",
|
|
1797
|
+
description: "Enable parallel agent execution",
|
|
1798
|
+
type: "boolean"
|
|
1798
1799
|
},
|
|
1799
1800
|
{
|
|
1800
|
-
name:
|
|
1801
|
-
description:
|
|
1802
|
-
type:
|
|
1801
|
+
name: "orchestration",
|
|
1802
|
+
description: "Enable orchestration features",
|
|
1803
|
+
type: "boolean",
|
|
1803
1804
|
default: true
|
|
1804
1805
|
}
|
|
1805
1806
|
],
|
|
1806
1807
|
action: async (ctx)=>{
|
|
1807
1808
|
try {
|
|
1808
|
-
console.log(chalk.cyan(
|
|
1809
|
-
console.log(
|
|
1809
|
+
console.log(chalk.cyan("🚀 Enhanced SPARC Development Mode"));
|
|
1810
|
+
console.log("Features: TDD + Orchestration + Batch Operations + Memory Management");
|
|
1810
1811
|
if (ctx.flags.batch) {
|
|
1811
|
-
console.log(
|
|
1812
|
+
console.log("✨ Batch operations enabled for efficient file handling");
|
|
1812
1813
|
}
|
|
1813
1814
|
if (ctx.flags.parallel) {
|
|
1814
|
-
console.log(
|
|
1815
|
+
console.log("⚡ Parallel agent execution enabled");
|
|
1815
1816
|
}
|
|
1816
1817
|
if (ctx.flags.orchestration) {
|
|
1817
|
-
console.log(
|
|
1818
|
+
console.log("🎼 Orchestration features enabled");
|
|
1818
1819
|
}
|
|
1819
1820
|
// Call the original SPARC action with enhanced features
|
|
1820
1821
|
await sparcAction(ctx);
|
|
@@ -1828,77 +1829,77 @@ Now, please proceed with the task: ${task}`;
|
|
|
1828
1829
|
cli.command(migrateCmd);
|
|
1829
1830
|
// Swarm UI command (convenience wrapper)
|
|
1830
1831
|
cli.command({
|
|
1831
|
-
name:
|
|
1832
|
-
description:
|
|
1832
|
+
name: "swarm-ui",
|
|
1833
|
+
description: "Create self-orchestrating Claude agent swarms with blessed UI",
|
|
1833
1834
|
options: [
|
|
1834
1835
|
{
|
|
1835
|
-
name:
|
|
1836
|
-
short:
|
|
1837
|
-
description:
|
|
1838
|
-
type:
|
|
1839
|
-
default:
|
|
1836
|
+
name: "strategy",
|
|
1837
|
+
short: "s",
|
|
1838
|
+
description: "Orchestration strategy (auto, research, development, analysis)",
|
|
1839
|
+
type: "string",
|
|
1840
|
+
default: "auto"
|
|
1840
1841
|
},
|
|
1841
1842
|
{
|
|
1842
|
-
name:
|
|
1843
|
-
description:
|
|
1844
|
-
type:
|
|
1843
|
+
name: "max-agents",
|
|
1844
|
+
description: "Maximum number of agents to spawn",
|
|
1845
|
+
type: "number",
|
|
1845
1846
|
default: 5
|
|
1846
1847
|
},
|
|
1847
1848
|
{
|
|
1848
|
-
name:
|
|
1849
|
-
description:
|
|
1850
|
-
type:
|
|
1849
|
+
name: "max-depth",
|
|
1850
|
+
description: "Maximum delegation depth",
|
|
1851
|
+
type: "number",
|
|
1851
1852
|
default: 3
|
|
1852
1853
|
},
|
|
1853
1854
|
{
|
|
1854
|
-
name:
|
|
1855
|
-
description:
|
|
1856
|
-
type:
|
|
1855
|
+
name: "research",
|
|
1856
|
+
description: "Enable research capabilities for all agents",
|
|
1857
|
+
type: "boolean"
|
|
1857
1858
|
},
|
|
1858
1859
|
{
|
|
1859
|
-
name:
|
|
1860
|
-
description:
|
|
1861
|
-
type:
|
|
1860
|
+
name: "parallel",
|
|
1861
|
+
description: "Enable parallel execution",
|
|
1862
|
+
type: "boolean"
|
|
1862
1863
|
},
|
|
1863
1864
|
{
|
|
1864
|
-
name:
|
|
1865
|
-
description:
|
|
1866
|
-
type:
|
|
1867
|
-
default:
|
|
1865
|
+
name: "memory-namespace",
|
|
1866
|
+
description: "Shared memory namespace",
|
|
1867
|
+
type: "string",
|
|
1868
|
+
default: "swarm"
|
|
1868
1869
|
},
|
|
1869
1870
|
{
|
|
1870
|
-
name:
|
|
1871
|
-
description:
|
|
1872
|
-
type:
|
|
1871
|
+
name: "timeout",
|
|
1872
|
+
description: "Swarm timeout in minutes",
|
|
1873
|
+
type: "number",
|
|
1873
1874
|
default: 60
|
|
1874
1875
|
},
|
|
1875
1876
|
{
|
|
1876
|
-
name:
|
|
1877
|
-
description:
|
|
1878
|
-
type:
|
|
1877
|
+
name: "review",
|
|
1878
|
+
description: "Enable peer review between agents",
|
|
1879
|
+
type: "boolean"
|
|
1879
1880
|
},
|
|
1880
1881
|
{
|
|
1881
|
-
name:
|
|
1882
|
-
description:
|
|
1883
|
-
type:
|
|
1882
|
+
name: "coordinator",
|
|
1883
|
+
description: "Spawn dedicated coordinator agent",
|
|
1884
|
+
type: "boolean"
|
|
1884
1885
|
},
|
|
1885
1886
|
{
|
|
1886
|
-
name:
|
|
1887
|
-
short:
|
|
1888
|
-
description:
|
|
1889
|
-
type:
|
|
1887
|
+
name: "config",
|
|
1888
|
+
short: "c",
|
|
1889
|
+
description: "MCP config file",
|
|
1890
|
+
type: "string"
|
|
1890
1891
|
},
|
|
1891
1892
|
{
|
|
1892
|
-
name:
|
|
1893
|
-
short:
|
|
1894
|
-
description:
|
|
1895
|
-
type:
|
|
1893
|
+
name: "verbose",
|
|
1894
|
+
short: "v",
|
|
1895
|
+
description: "Enable verbose output",
|
|
1896
|
+
type: "boolean"
|
|
1896
1897
|
},
|
|
1897
1898
|
{
|
|
1898
|
-
name:
|
|
1899
|
-
short:
|
|
1900
|
-
description:
|
|
1901
|
-
type:
|
|
1899
|
+
name: "dry-run",
|
|
1900
|
+
short: "d",
|
|
1901
|
+
description: "Preview swarm configuration",
|
|
1902
|
+
type: "boolean"
|
|
1902
1903
|
}
|
|
1903
1904
|
],
|
|
1904
1905
|
action: async (ctx)=>{
|
|
@@ -1910,30 +1911,30 @@ Now, please proceed with the task: ${task}`;
|
|
|
1910
1911
|
// Enhanced session command integration
|
|
1911
1912
|
try {
|
|
1912
1913
|
const enhancedSessionAction = async (ctx)=>{
|
|
1913
|
-
console.log(chalk.cyan(
|
|
1914
|
-
console.log(
|
|
1914
|
+
console.log(chalk.cyan("💾 Enhanced Session Management"));
|
|
1915
|
+
console.log("For full enhanced functionality, use: claude-flow-novice session <command> [options]");
|
|
1915
1916
|
console.log();
|
|
1916
|
-
console.log(
|
|
1917
|
-
console.log(
|
|
1918
|
-
console.log(
|
|
1919
|
-
console.log(
|
|
1920
|
-
console.log(
|
|
1921
|
-
console.log(
|
|
1922
|
-
console.log(
|
|
1923
|
-
console.log(
|
|
1924
|
-
console.log(
|
|
1925
|
-
console.log(
|
|
1926
|
-
console.log(
|
|
1927
|
-
console.log(
|
|
1928
|
-
console.log(
|
|
1917
|
+
console.log("Available commands:");
|
|
1918
|
+
console.log(" list - List all saved sessions with status");
|
|
1919
|
+
console.log(" save - Save current session state");
|
|
1920
|
+
console.log(" restore - Restore a saved session");
|
|
1921
|
+
console.log(" delete - Delete a saved session");
|
|
1922
|
+
console.log(" export - Export session to file");
|
|
1923
|
+
console.log(" import - Import session from file");
|
|
1924
|
+
console.log(" info - Show detailed session information");
|
|
1925
|
+
console.log(" clean - Clean up old or orphaned sessions");
|
|
1926
|
+
console.log(" backup - Backup sessions to archive");
|
|
1927
|
+
console.log(" restore-backup - Restore sessions from backup");
|
|
1928
|
+
console.log(" validate - Validate session integrity");
|
|
1929
|
+
console.log(" monitor - Monitor active sessions in real-time");
|
|
1929
1930
|
console.log();
|
|
1930
|
-
console.log(
|
|
1931
|
-
console.log(
|
|
1932
|
-
console.log(
|
|
1933
|
-
console.log(
|
|
1934
|
-
console.log(
|
|
1935
|
-
console.log(
|
|
1936
|
-
console.log(
|
|
1931
|
+
console.log("Enhanced features:");
|
|
1932
|
+
console.log(" ✨ Comprehensive lifecycle management");
|
|
1933
|
+
console.log(" ✨ Terminal session state preservation");
|
|
1934
|
+
console.log(" ✨ Workflow and agent state tracking");
|
|
1935
|
+
console.log(" ✨ Integrity validation and repair");
|
|
1936
|
+
console.log(" ✨ Real-time session monitoring");
|
|
1937
|
+
console.log(" ✨ Backup and restore capabilities");
|
|
1937
1938
|
const subcommand = ctx.args[0];
|
|
1938
1939
|
if (subcommand) {
|
|
1939
1940
|
console.log();
|
|
@@ -1941,66 +1942,66 @@ Now, please proceed with the task: ${task}`;
|
|
|
1941
1942
|
}
|
|
1942
1943
|
};
|
|
1943
1944
|
cli.command({
|
|
1944
|
-
name:
|
|
1945
|
-
description:
|
|
1945
|
+
name: "session",
|
|
1946
|
+
description: "Enhanced session management with comprehensive lifecycle support",
|
|
1946
1947
|
action: enhancedSessionAction
|
|
1947
1948
|
});
|
|
1948
1949
|
} catch (err) {
|
|
1949
|
-
warning(
|
|
1950
|
+
warning("Enhanced session command not available");
|
|
1950
1951
|
}
|
|
1951
1952
|
// Enhanced orchestration start command integration
|
|
1952
1953
|
try {
|
|
1953
1954
|
const enhancedStartAction = async (ctx)=>{
|
|
1954
|
-
console.log(chalk.cyan(
|
|
1955
|
-
console.log(
|
|
1955
|
+
console.log(chalk.cyan("🧠 Enhanced Claude-Flow Orchestration System"));
|
|
1956
|
+
console.log("Features: Service Management + Health Checks + Auto-Recovery + Process UI");
|
|
1956
1957
|
console.log();
|
|
1957
1958
|
const options = {
|
|
1958
1959
|
daemon: ctx.flags.daemon || ctx.flags.d,
|
|
1959
1960
|
port: ctx.flags.port || ctx.flags.p || 3000,
|
|
1960
|
-
mcpTransport: ctx.flags.mcpTransport || ctx.flags[
|
|
1961
|
+
mcpTransport: ctx.flags.mcpTransport || ctx.flags["mcp-transport"] || "stdio",
|
|
1961
1962
|
ui: ctx.flags.ui || ctx.flags.u,
|
|
1962
1963
|
verbose: ctx.flags.verbose || ctx.flags.v,
|
|
1963
|
-
autoStart: ctx.flags.autoStart || ctx.flags[
|
|
1964
|
+
autoStart: ctx.flags.autoStart || ctx.flags["auto-start"],
|
|
1964
1965
|
config: ctx.flags.config,
|
|
1965
1966
|
force: ctx.flags.force,
|
|
1966
|
-
healthCheck: ctx.flags.healthCheck || ctx.flags[
|
|
1967
|
+
healthCheck: ctx.flags.healthCheck || ctx.flags["health-check"],
|
|
1967
1968
|
timeout: ctx.flags.timeout || 60
|
|
1968
1969
|
};
|
|
1969
1970
|
if (options.ui) {
|
|
1970
|
-
console.log(
|
|
1971
|
+
console.log("🎮 Launching interactive process management UI...");
|
|
1971
1972
|
}
|
|
1972
1973
|
if (options.daemon) {
|
|
1973
|
-
console.log(
|
|
1974
|
+
console.log("🔧 Starting in daemon mode with enhanced service management...");
|
|
1974
1975
|
}
|
|
1975
1976
|
if (options.healthCheck) {
|
|
1976
|
-
console.log(
|
|
1977
|
+
console.log("🏥 Performing pre-flight health checks...");
|
|
1977
1978
|
}
|
|
1978
1979
|
console.log();
|
|
1979
|
-
console.log(
|
|
1980
|
-
console.log(
|
|
1980
|
+
console.log("For full enhanced functionality, use: claude-flow-novice start [options]");
|
|
1981
|
+
console.log("Available options: --daemon, --port, --mcp-transport, --ui, --verbose, --auto-start, --force, --health-check, --timeout");
|
|
1981
1982
|
// Fallback to basic start functionality
|
|
1982
1983
|
try {
|
|
1983
1984
|
const orch = await getOrchestrator();
|
|
1984
1985
|
await orch.start();
|
|
1985
|
-
success(
|
|
1986
|
-
info(
|
|
1987
|
-
console.log(
|
|
1988
|
-
console.log(
|
|
1989
|
-
console.log(
|
|
1990
|
-
console.log(
|
|
1991
|
-
console.log(
|
|
1992
|
-
console.log(
|
|
1986
|
+
success("Enhanced orchestration system started!");
|
|
1987
|
+
info("Components initialized with enhanced features:");
|
|
1988
|
+
console.log(" ✓ Event Bus with advanced routing");
|
|
1989
|
+
console.log(" ✓ Orchestrator Engine with service management");
|
|
1990
|
+
console.log(" ✓ Memory Manager with integrity checking");
|
|
1991
|
+
console.log(" ✓ Terminal Pool with session recovery");
|
|
1992
|
+
console.log(" ✓ MCP Server with enhanced transport");
|
|
1993
|
+
console.log(" ✓ Coordination Manager with load balancing");
|
|
1993
1994
|
if (!options.daemon) {
|
|
1994
|
-
info(
|
|
1995
|
+
info("Press Ctrl+C to stop the enhanced system");
|
|
1995
1996
|
const controller = new AbortController();
|
|
1996
1997
|
const shutdown = ()=>{
|
|
1997
|
-
console.log(
|
|
1998
|
+
console.log("\nShutting down enhanced system...");
|
|
1998
1999
|
controller.abort();
|
|
1999
2000
|
};
|
|
2000
|
-
process.on(
|
|
2001
|
-
process.on(
|
|
2001
|
+
process.on("SIGINT", shutdown);
|
|
2002
|
+
process.on("SIGTERM", shutdown);
|
|
2002
2003
|
await new Promise((resolve)=>{
|
|
2003
|
-
controller.signal.addEventListener(
|
|
2004
|
+
controller.signal.addEventListener("abort", ()=>resolve());
|
|
2004
2005
|
});
|
|
2005
2006
|
}
|
|
2006
2007
|
} catch (err) {
|
|
@@ -2010,399 +2011,399 @@ Now, please proceed with the task: ${task}`;
|
|
|
2010
2011
|
};
|
|
2011
2012
|
// Override the existing start command with enhanced version
|
|
2012
2013
|
cli.command({
|
|
2013
|
-
name:
|
|
2014
|
-
description:
|
|
2014
|
+
name: "start",
|
|
2015
|
+
description: "Start the enhanced orchestration system with comprehensive service management",
|
|
2015
2016
|
options: [
|
|
2016
2017
|
{
|
|
2017
|
-
name:
|
|
2018
|
-
short:
|
|
2019
|
-
description:
|
|
2020
|
-
type:
|
|
2018
|
+
name: "daemon",
|
|
2019
|
+
short: "d",
|
|
2020
|
+
description: "Run as daemon in background",
|
|
2021
|
+
type: "boolean"
|
|
2021
2022
|
},
|
|
2022
2023
|
{
|
|
2023
|
-
name:
|
|
2024
|
-
short:
|
|
2025
|
-
description:
|
|
2026
|
-
type:
|
|
2024
|
+
name: "port",
|
|
2025
|
+
short: "p",
|
|
2026
|
+
description: "MCP server port",
|
|
2027
|
+
type: "number",
|
|
2027
2028
|
default: 3000
|
|
2028
2029
|
},
|
|
2029
2030
|
{
|
|
2030
|
-
name:
|
|
2031
|
-
description:
|
|
2032
|
-
type:
|
|
2033
|
-
default:
|
|
2031
|
+
name: "mcp-transport",
|
|
2032
|
+
description: "MCP transport type (stdio, http)",
|
|
2033
|
+
type: "string",
|
|
2034
|
+
default: "stdio"
|
|
2034
2035
|
},
|
|
2035
2036
|
{
|
|
2036
|
-
name:
|
|
2037
|
-
short:
|
|
2038
|
-
description:
|
|
2039
|
-
type:
|
|
2037
|
+
name: "ui",
|
|
2038
|
+
short: "u",
|
|
2039
|
+
description: "Launch interactive process management UI",
|
|
2040
|
+
type: "boolean"
|
|
2040
2041
|
},
|
|
2041
2042
|
{
|
|
2042
|
-
name:
|
|
2043
|
-
short:
|
|
2044
|
-
description:
|
|
2045
|
-
type:
|
|
2043
|
+
name: "verbose",
|
|
2044
|
+
short: "v",
|
|
2045
|
+
description: "Enable verbose logging",
|
|
2046
|
+
type: "boolean"
|
|
2046
2047
|
},
|
|
2047
2048
|
{
|
|
2048
|
-
name:
|
|
2049
|
-
description:
|
|
2050
|
-
type:
|
|
2049
|
+
name: "auto-start",
|
|
2050
|
+
description: "Automatically start all processes",
|
|
2051
|
+
type: "boolean"
|
|
2051
2052
|
},
|
|
2052
2053
|
{
|
|
2053
|
-
name:
|
|
2054
|
-
description:
|
|
2055
|
-
type:
|
|
2054
|
+
name: "config",
|
|
2055
|
+
description: "Configuration file path",
|
|
2056
|
+
type: "string"
|
|
2056
2057
|
},
|
|
2057
2058
|
{
|
|
2058
|
-
name:
|
|
2059
|
-
description:
|
|
2060
|
-
type:
|
|
2059
|
+
name: "force",
|
|
2060
|
+
description: "Force start even if already running",
|
|
2061
|
+
type: "boolean"
|
|
2061
2062
|
},
|
|
2062
2063
|
{
|
|
2063
|
-
name:
|
|
2064
|
-
description:
|
|
2065
|
-
type:
|
|
2064
|
+
name: "health-check",
|
|
2065
|
+
description: "Perform health checks before starting",
|
|
2066
|
+
type: "boolean"
|
|
2066
2067
|
},
|
|
2067
2068
|
{
|
|
2068
|
-
name:
|
|
2069
|
-
description:
|
|
2070
|
-
type:
|
|
2069
|
+
name: "timeout",
|
|
2070
|
+
description: "Startup timeout in seconds",
|
|
2071
|
+
type: "number",
|
|
2071
2072
|
default: 60
|
|
2072
2073
|
}
|
|
2073
2074
|
],
|
|
2074
2075
|
action: enhancedStartAction
|
|
2075
2076
|
});
|
|
2076
2077
|
} catch (err) {
|
|
2077
|
-
warning(
|
|
2078
|
+
warning("Enhanced start command not available, using basic version");
|
|
2078
2079
|
}
|
|
2079
2080
|
// Help command
|
|
2080
2081
|
cli.command({
|
|
2081
|
-
name:
|
|
2082
|
-
description:
|
|
2082
|
+
name: "help",
|
|
2083
|
+
description: "Show help information",
|
|
2083
2084
|
action: (ctx)=>{
|
|
2084
2085
|
const command = ctx.args[0];
|
|
2085
|
-
if (command ===
|
|
2086
|
-
console.log(bold(blue(
|
|
2086
|
+
if (command === "claude") {
|
|
2087
|
+
console.log(bold(blue("Claude Instance Management")));
|
|
2087
2088
|
console.log();
|
|
2088
|
-
console.log(
|
|
2089
|
+
console.log("Spawn and manage Claude Code instances with specific configurations.");
|
|
2089
2090
|
console.log();
|
|
2090
|
-
console.log(bold(
|
|
2091
|
-
console.log(
|
|
2092
|
-
console.log(
|
|
2091
|
+
console.log(bold("Subcommands:"));
|
|
2092
|
+
console.log(" spawn <task> Spawn Claude with specific configuration");
|
|
2093
|
+
console.log(" batch <file> Execute multiple Claude instances from workflow");
|
|
2093
2094
|
console.log();
|
|
2094
|
-
console.log(bold(
|
|
2095
|
-
console.log(
|
|
2096
|
-
console.log(
|
|
2097
|
-
console.log(
|
|
2098
|
-
console.log(
|
|
2099
|
-
console.log(
|
|
2100
|
-
console.log(
|
|
2101
|
-
console.log(
|
|
2102
|
-
console.log(
|
|
2103
|
-
console.log(
|
|
2104
|
-
console.log(
|
|
2095
|
+
console.log(bold("Spawn Options:"));
|
|
2096
|
+
console.log(" -t, --tools <tools> Allowed tools (comma-separated)");
|
|
2097
|
+
console.log(" --no-permissions Use --dangerously-skip-permissions flag");
|
|
2098
|
+
console.log(" -c, --config <file> MCP config file path");
|
|
2099
|
+
console.log(" -m, --mode <mode> Development mode (full/backend-only/frontend-only/api-only)");
|
|
2100
|
+
console.log(" --parallel Enable parallel execution with BatchTool");
|
|
2101
|
+
console.log(" --research Enable web research with WebFetchTool");
|
|
2102
|
+
console.log(" --coverage <n> Test coverage target percentage (default: 80)");
|
|
2103
|
+
console.log(" --commit <freq> Commit frequency (phase/feature/manual)");
|
|
2104
|
+
console.log(" -v, --verbose Enable verbose output");
|
|
2105
|
+
console.log(" -d, --dry-run Show what would be executed without running");
|
|
2105
2106
|
console.log();
|
|
2106
|
-
console.log(bold(
|
|
2107
|
-
console.log(` ${blue(
|
|
2108
|
-
console.log(` ${blue(
|
|
2109
|
-
console.log(` ${blue(
|
|
2107
|
+
console.log(bold("Examples:"));
|
|
2108
|
+
console.log(` ${blue("claude-flow-novice claude spawn")} "implement user authentication" --research --parallel`);
|
|
2109
|
+
console.log(` ${blue("claude-flow-novice claude spawn")} "fix payment bug" --tools "View,Edit,Bash" --no-permissions`);
|
|
2110
|
+
console.log(` ${blue("claude-flow-novice claude batch")} workflow.json --dry-run`);
|
|
2110
2111
|
console.log();
|
|
2111
|
-
console.log(
|
|
2112
|
-
} else if (command ===
|
|
2113
|
-
console.log(bold(blue(
|
|
2112
|
+
console.log("For more information, see: https://github.com/ruvnet/claude-code-flow/docs/11-claude-spawning.md");
|
|
2113
|
+
} else if (command === "swarm" || command === "swarm-ui") {
|
|
2114
|
+
console.log(bold(blue("Claude Swarm Mode")));
|
|
2114
2115
|
console.log();
|
|
2115
|
-
console.log(
|
|
2116
|
+
console.log("Create self-orchestrating Claude agent swarms to tackle complex objectives.");
|
|
2116
2117
|
console.log();
|
|
2117
|
-
console.log(bold(
|
|
2118
|
-
console.log(
|
|
2119
|
-
console.log(
|
|
2118
|
+
console.log(bold("Usage:"));
|
|
2119
|
+
console.log(" claude-flow-novice swarm <objective> [options]");
|
|
2120
|
+
console.log(" claude-flow-novice swarm-ui <objective> [options] # Uses blessed UI (avoids TTY issues)");
|
|
2120
2121
|
console.log();
|
|
2121
|
-
console.log(bold(
|
|
2122
|
-
console.log(
|
|
2123
|
-
console.log(
|
|
2124
|
-
console.log(
|
|
2125
|
-
console.log(
|
|
2126
|
-
console.log(
|
|
2127
|
-
console.log(
|
|
2128
|
-
console.log(
|
|
2129
|
-
console.log(
|
|
2130
|
-
console.log(
|
|
2131
|
-
console.log(
|
|
2132
|
-
console.log(
|
|
2133
|
-
console.log(
|
|
2134
|
-
console.log(
|
|
2135
|
-
console.log(
|
|
2136
|
-
console.log(
|
|
2122
|
+
console.log(bold("Options:"));
|
|
2123
|
+
console.log(" -s, --strategy <s> Orchestration strategy (auto, research, development, analysis)");
|
|
2124
|
+
console.log(" --max-agents <n> Maximum number of agents (default: 5)");
|
|
2125
|
+
console.log(" --max-depth <n> Maximum delegation depth (default: 3)");
|
|
2126
|
+
console.log(" --research Enable research capabilities for all agents");
|
|
2127
|
+
console.log(" --parallel Enable parallel execution");
|
|
2128
|
+
console.log(" --memory-namespace <ns> Shared memory namespace (default: swarm)");
|
|
2129
|
+
console.log(" --timeout <minutes> Swarm timeout in minutes (default: 60)");
|
|
2130
|
+
console.log(" --review Enable peer review between agents");
|
|
2131
|
+
console.log(" --coordinator Spawn dedicated coordinator agent");
|
|
2132
|
+
console.log(" -c, --config <file> MCP config file");
|
|
2133
|
+
console.log(" -v, --verbose Enable verbose output");
|
|
2134
|
+
console.log(" -d, --dry-run Preview swarm configuration");
|
|
2135
|
+
console.log(" --vscode Use VS Code terminal integration");
|
|
2136
|
+
console.log(" --monitor Enable real-time monitoring");
|
|
2137
|
+
console.log(" --ui Use blessed terminal UI (avoids TTY issues)");
|
|
2137
2138
|
console.log();
|
|
2138
|
-
console.log(bold(
|
|
2139
|
-
console.log(` ${blue(
|
|
2140
|
-
console.log(` ${blue(
|
|
2141
|
-
console.log(` ${blue(
|
|
2142
|
-
console.log(` ${blue(
|
|
2139
|
+
console.log(bold("Examples:"));
|
|
2140
|
+
console.log(` ${blue("claude-flow-novice swarm")} "Build a REST API"`);
|
|
2141
|
+
console.log(` ${blue("claude-flow-novice swarm-ui")} "Build a REST API" # Avoids TTY issues`);
|
|
2142
|
+
console.log(` ${blue("claude-flow-novice swarm")} "Research cloud architecture" --strategy research --research`);
|
|
2143
|
+
console.log(` ${blue("claude-flow-novice swarm")} "Migrate app to microservices" --coordinator --review --ui`);
|
|
2143
2144
|
console.log();
|
|
2144
|
-
console.log(bold(
|
|
2145
|
+
console.log(bold("TTY Issues?"));
|
|
2145
2146
|
console.log("If you encounter 'Raw mode is not supported' errors, use:");
|
|
2146
|
-
console.log(` - ${blue(
|
|
2147
|
-
console.log(` - ${blue(
|
|
2147
|
+
console.log(` - ${blue("claude-flow-novice swarm-ui")} <objective> # Recommended`);
|
|
2148
|
+
console.log(` - ${blue("claude-flow-novice swarm")} <objective> --ui`);
|
|
2148
2149
|
console.log();
|
|
2149
|
-
console.log(
|
|
2150
|
-
console.log(
|
|
2151
|
-
console.log(
|
|
2152
|
-
} else if (command ===
|
|
2153
|
-
console.log(bold(blue(
|
|
2150
|
+
console.log("For more information, see:");
|
|
2151
|
+
console.log(" - https://github.com/ruvnet/claude-code-flow/docs/12-swarm.md");
|
|
2152
|
+
console.log(" - https://github.com/ruvnet/claude-code-flow/SWARM_TTY_SOLUTION.md");
|
|
2153
|
+
} else if (command === "sparc") {
|
|
2154
|
+
console.log(bold(blue("SPARC Development Mode")));
|
|
2154
2155
|
console.log();
|
|
2155
|
-
console.log(
|
|
2156
|
-
console.log(
|
|
2156
|
+
console.log("SPARC (Specification, Pseudocode, Architecture, Refinement, Completion)");
|
|
2157
|
+
console.log("TDD-based development with specialized AI modes from .roomodes configuration.");
|
|
2157
2158
|
console.log();
|
|
2158
|
-
console.log(bold(
|
|
2159
|
-
console.log(
|
|
2160
|
-
console.log(
|
|
2161
|
-
console.log(
|
|
2162
|
-
console.log(
|
|
2163
|
-
console.log(
|
|
2159
|
+
console.log(bold("Subcommands:"));
|
|
2160
|
+
console.log(" modes List all available SPARC modes");
|
|
2161
|
+
console.log(" info <mode> Show detailed information about a mode");
|
|
2162
|
+
console.log(" run <mode> <task> Execute a task using a specific SPARC mode");
|
|
2163
|
+
console.log(" tdd <task> Run full TDD workflow using SPARC methodology");
|
|
2164
|
+
console.log(" workflow <file> Execute a custom SPARC workflow from JSON file");
|
|
2164
2165
|
console.log();
|
|
2165
|
-
console.log(bold(
|
|
2166
|
-
console.log(
|
|
2167
|
-
console.log(
|
|
2168
|
-
console.log(
|
|
2169
|
-
console.log(
|
|
2170
|
-
console.log(
|
|
2171
|
-
console.log(
|
|
2172
|
-
console.log(
|
|
2173
|
-
console.log(
|
|
2166
|
+
console.log(bold("Common Modes:"));
|
|
2167
|
+
console.log(" spec-pseudocode Create specifications and pseudocode");
|
|
2168
|
+
console.log(" architect Design system architecture");
|
|
2169
|
+
console.log(" code Implement code solutions");
|
|
2170
|
+
console.log(" tdd Test-driven development");
|
|
2171
|
+
console.log(" debug Debug and troubleshoot issues");
|
|
2172
|
+
console.log(" security-review Security analysis and review");
|
|
2173
|
+
console.log(" docs-writer Documentation creation");
|
|
2174
|
+
console.log(" integration System integration and testing");
|
|
2174
2175
|
console.log();
|
|
2175
|
-
console.log(bold(
|
|
2176
|
-
console.log(
|
|
2177
|
-
console.log(
|
|
2178
|
-
console.log(
|
|
2179
|
-
console.log(
|
|
2180
|
-
console.log(
|
|
2181
|
-
console.log(
|
|
2176
|
+
console.log(bold("Options:"));
|
|
2177
|
+
console.log(" -n, --namespace <ns> Memory namespace for this session");
|
|
2178
|
+
console.log(" --no-permissions Skip permission prompts");
|
|
2179
|
+
console.log(" -c, --config <file> MCP configuration file");
|
|
2180
|
+
console.log(" -v, --verbose Enable verbose output");
|
|
2181
|
+
console.log(" -d, --dry-run Preview what would be executed");
|
|
2182
|
+
console.log(" --sequential Wait between workflow steps (default: true)");
|
|
2182
2183
|
console.log();
|
|
2183
|
-
console.log(bold(
|
|
2184
|
-
console.log(` ${blue(
|
|
2185
|
-
console.log(` ${blue(
|
|
2186
|
-
console.log(` ${blue(
|
|
2187
|
-
console.log(` ${blue(
|
|
2184
|
+
console.log(bold("Examples:"));
|
|
2185
|
+
console.log(` ${blue("claude-flow-novice sparc modes")} # List all modes`);
|
|
2186
|
+
console.log(` ${blue("claude-flow-novice sparc run code")} "implement user auth" # Run specific mode`);
|
|
2187
|
+
console.log(` ${blue("claude-flow-novice sparc tdd")} "payment processing system" # Full TDD workflow`);
|
|
2188
|
+
console.log(` ${blue("claude-flow-novice sparc workflow")} project-workflow.json # Custom workflow`);
|
|
2188
2189
|
console.log();
|
|
2189
|
-
console.log(
|
|
2190
|
-
} else if (command ===
|
|
2191
|
-
console.log(bold(blue(
|
|
2190
|
+
console.log("For more information, see: https://github.com/ruvnet/claude-code-flow/docs/sparc.md");
|
|
2191
|
+
} else if (command === "start") {
|
|
2192
|
+
console.log(bold(blue("Enhanced Start Command")));
|
|
2192
2193
|
console.log();
|
|
2193
|
-
console.log(
|
|
2194
|
+
console.log("Start the Claude-Flow orchestration system with comprehensive service management.");
|
|
2194
2195
|
console.log();
|
|
2195
|
-
console.log(bold(
|
|
2196
|
-
console.log(
|
|
2196
|
+
console.log(bold("Usage:"));
|
|
2197
|
+
console.log(" claude-flow-novice start [options]");
|
|
2197
2198
|
console.log();
|
|
2198
|
-
console.log(bold(
|
|
2199
|
-
console.log(
|
|
2200
|
-
console.log(
|
|
2201
|
-
console.log(
|
|
2202
|
-
console.log(
|
|
2203
|
-
console.log(
|
|
2204
|
-
console.log(
|
|
2205
|
-
console.log(
|
|
2206
|
-
console.log(
|
|
2207
|
-
console.log(
|
|
2208
|
-
console.log(
|
|
2199
|
+
console.log(bold("Options:"));
|
|
2200
|
+
console.log(" -d, --daemon Run as daemon in background");
|
|
2201
|
+
console.log(" -p, --port <port> MCP server port (default: 3000)");
|
|
2202
|
+
console.log(" --mcp-transport <type> MCP transport type (stdio, http)");
|
|
2203
|
+
console.log(" -u, --ui Launch interactive process management UI");
|
|
2204
|
+
console.log(" -v, --verbose Enable verbose logging");
|
|
2205
|
+
console.log(" --auto-start Automatically start all processes");
|
|
2206
|
+
console.log(" --config <path> Configuration file path");
|
|
2207
|
+
console.log(" --force Force start even if already running");
|
|
2208
|
+
console.log(" --health-check Perform health checks before starting");
|
|
2209
|
+
console.log(" --timeout <seconds> Startup timeout in seconds (default: 60)");
|
|
2209
2210
|
console.log();
|
|
2210
|
-
console.log(bold(
|
|
2211
|
-
console.log(` ${blue(
|
|
2212
|
-
console.log(` ${blue(
|
|
2213
|
-
console.log(` ${blue(
|
|
2214
|
-
console.log(` ${blue(
|
|
2215
|
-
} else if (command ===
|
|
2216
|
-
console.log(bold(blue(
|
|
2211
|
+
console.log(bold("Examples:"));
|
|
2212
|
+
console.log(` ${blue("claude-flow-novice start")} # Interactive mode`);
|
|
2213
|
+
console.log(` ${blue("claude-flow-novice start --daemon")} # Background daemon`);
|
|
2214
|
+
console.log(` ${blue("claude-flow-novice start --ui")} # Process management UI`);
|
|
2215
|
+
console.log(` ${blue("claude-flow-novice start --health-check")} # With pre-flight checks`);
|
|
2216
|
+
} else if (command === "status") {
|
|
2217
|
+
console.log(bold(blue("Enhanced Status Command")));
|
|
2217
2218
|
console.log();
|
|
2218
|
-
console.log(
|
|
2219
|
+
console.log("Show comprehensive Claude-Flow system status with detailed reporting.");
|
|
2219
2220
|
console.log();
|
|
2220
|
-
console.log(bold(
|
|
2221
|
-
console.log(
|
|
2221
|
+
console.log(bold("Usage:"));
|
|
2222
|
+
console.log(" claude-flow-novice status [options]");
|
|
2222
2223
|
console.log();
|
|
2223
|
-
console.log(bold(
|
|
2224
|
-
console.log(
|
|
2225
|
-
console.log(
|
|
2226
|
-
console.log(
|
|
2227
|
-
console.log(
|
|
2228
|
-
console.log(
|
|
2229
|
-
console.log(
|
|
2230
|
-
console.log(
|
|
2224
|
+
console.log(bold("Options:"));
|
|
2225
|
+
console.log(" -w, --watch Watch mode - continuously update status");
|
|
2226
|
+
console.log(" -i, --interval <seconds> Update interval in seconds (default: 5)");
|
|
2227
|
+
console.log(" -c, --component <name> Show status for specific component");
|
|
2228
|
+
console.log(" --json Output in JSON format");
|
|
2229
|
+
console.log(" --detailed Show detailed component information");
|
|
2230
|
+
console.log(" --health-check Perform comprehensive health checks");
|
|
2231
|
+
console.log(" --history Show status history from logs");
|
|
2231
2232
|
console.log();
|
|
2232
|
-
console.log(bold(
|
|
2233
|
-
console.log(` ${blue(
|
|
2234
|
-
console.log(` ${blue(
|
|
2235
|
-
console.log(` ${blue(
|
|
2236
|
-
console.log(` ${blue(
|
|
2237
|
-
} else if (command ===
|
|
2238
|
-
console.log(bold(blue(
|
|
2233
|
+
console.log(bold("Examples:"));
|
|
2234
|
+
console.log(` ${blue("claude-flow-novice status")} # Basic status`);
|
|
2235
|
+
console.log(` ${blue("claude-flow-novice status --watch")} # Live updates`);
|
|
2236
|
+
console.log(` ${blue("claude-flow-novice status --detailed")} # Comprehensive info`);
|
|
2237
|
+
console.log(` ${blue("claude-flow-novice status --component mcp")} # Specific component`);
|
|
2238
|
+
} else if (command === "monitor") {
|
|
2239
|
+
console.log(bold(blue("Enhanced Monitor Command")));
|
|
2239
2240
|
console.log();
|
|
2240
|
-
console.log(
|
|
2241
|
+
console.log("Real-time monitoring dashboard with comprehensive metrics and alerting.");
|
|
2241
2242
|
console.log();
|
|
2242
|
-
console.log(bold(
|
|
2243
|
-
console.log(
|
|
2243
|
+
console.log(bold("Usage:"));
|
|
2244
|
+
console.log(" claude-flow-novice monitor [options]");
|
|
2244
2245
|
console.log();
|
|
2245
|
-
console.log(bold(
|
|
2246
|
-
console.log(
|
|
2247
|
-
console.log(
|
|
2248
|
-
console.log(
|
|
2249
|
-
console.log(
|
|
2250
|
-
console.log(
|
|
2251
|
-
console.log(
|
|
2252
|
-
console.log(
|
|
2253
|
-
console.log(
|
|
2246
|
+
console.log(bold("Options:"));
|
|
2247
|
+
console.log(" -i, --interval <seconds> Update interval in seconds (default: 2)");
|
|
2248
|
+
console.log(" -c, --compact Compact view mode");
|
|
2249
|
+
console.log(" --focus <component> Focus on specific component");
|
|
2250
|
+
console.log(" --alerts Enable alert notifications");
|
|
2251
|
+
console.log(" --export <file> Export monitoring data to file");
|
|
2252
|
+
console.log(" --threshold <percent> Alert threshold percentage (default: 80)");
|
|
2253
|
+
console.log(" --log-level <level> Log level filter (error, warn, info, debug)");
|
|
2254
|
+
console.log(" --no-graphs Disable ASCII graphs");
|
|
2254
2255
|
console.log();
|
|
2255
|
-
console.log(bold(
|
|
2256
|
-
console.log(` ${blue(
|
|
2257
|
-
console.log(` ${blue(
|
|
2258
|
-
console.log(` ${blue(
|
|
2259
|
-
console.log(` ${blue(
|
|
2260
|
-
} else if (command ===
|
|
2261
|
-
console.log(bold(blue(
|
|
2256
|
+
console.log(bold("Examples:"));
|
|
2257
|
+
console.log(` ${blue("claude-flow-novice monitor")} # Basic monitoring`);
|
|
2258
|
+
console.log(` ${blue("claude-flow-novice monitor --alerts")} # With alerting`);
|
|
2259
|
+
console.log(` ${blue("claude-flow-novice monitor --focus mcp")} # Component focus`);
|
|
2260
|
+
console.log(` ${blue("claude-flow-novice monitor --export data.json")} # Data export`);
|
|
2261
|
+
} else if (command === "session") {
|
|
2262
|
+
console.log(bold(blue("Enhanced Session Management")));
|
|
2262
2263
|
console.log();
|
|
2263
|
-
console.log(
|
|
2264
|
+
console.log("Comprehensive session lifecycle management with backup and recovery.");
|
|
2264
2265
|
console.log();
|
|
2265
|
-
console.log(bold(
|
|
2266
|
-
console.log(
|
|
2267
|
-
console.log(
|
|
2268
|
-
console.log(
|
|
2269
|
-
console.log(
|
|
2270
|
-
console.log(
|
|
2271
|
-
console.log(
|
|
2272
|
-
console.log(
|
|
2273
|
-
console.log(
|
|
2274
|
-
console.log(
|
|
2275
|
-
console.log(
|
|
2276
|
-
console.log(
|
|
2277
|
-
console.log(
|
|
2266
|
+
console.log(bold("Commands:"));
|
|
2267
|
+
console.log(" list List all saved sessions");
|
|
2268
|
+
console.log(" save [name] Save current session state");
|
|
2269
|
+
console.log(" restore <session-id> Restore a saved session");
|
|
2270
|
+
console.log(" delete <session-id> Delete a saved session");
|
|
2271
|
+
console.log(" export <session-id> <file> Export session to file");
|
|
2272
|
+
console.log(" import <file> Import session from file");
|
|
2273
|
+
console.log(" info <session-id> Show detailed session information");
|
|
2274
|
+
console.log(" clean Clean up old or orphaned sessions");
|
|
2275
|
+
console.log(" backup [session-id] Backup sessions to archive");
|
|
2276
|
+
console.log(" restore-backup <file> Restore sessions from backup");
|
|
2277
|
+
console.log(" validate [session-id] Validate session integrity");
|
|
2278
|
+
console.log(" monitor Monitor active sessions");
|
|
2278
2279
|
console.log();
|
|
2279
|
-
console.log(bold(
|
|
2280
|
-
console.log(` ${blue(
|
|
2281
|
-
console.log(` ${blue(
|
|
2282
|
-
console.log(` ${blue(
|
|
2283
|
-
console.log(` ${blue(
|
|
2280
|
+
console.log(bold("Examples:"));
|
|
2281
|
+
console.log(` ${blue("claude-flow-novice session list")} # List sessions`);
|
|
2282
|
+
console.log(` ${blue("claude-flow-novice session save mywork")} # Save session`);
|
|
2283
|
+
console.log(` ${blue("claude-flow-novice session restore abc123")} # Restore session`);
|
|
2284
|
+
console.log(` ${blue("claude-flow-novice session validate --fix")} # Validate and fix`);
|
|
2284
2285
|
} else {
|
|
2285
2286
|
// Show general help with enhanced commands
|
|
2286
|
-
console.log(bold(blue(
|
|
2287
|
+
console.log(bold(blue("Claude-Flow Enhanced Orchestration System")));
|
|
2287
2288
|
console.log();
|
|
2288
|
-
console.log(
|
|
2289
|
-
console.log(
|
|
2290
|
-
console.log(
|
|
2291
|
-
console.log(
|
|
2292
|
-
console.log(
|
|
2293
|
-
console.log(
|
|
2294
|
-
console.log(
|
|
2295
|
-
console.log(
|
|
2296
|
-
console.log(
|
|
2297
|
-
console.log(
|
|
2298
|
-
console.log(
|
|
2299
|
-
console.log(
|
|
2289
|
+
console.log("Available commands:");
|
|
2290
|
+
console.log(" start Enhanced orchestration system startup");
|
|
2291
|
+
console.log(" status Comprehensive system status reporting");
|
|
2292
|
+
console.log(" monitor Real-time monitoring dashboard");
|
|
2293
|
+
console.log(" session Advanced session management");
|
|
2294
|
+
console.log(" swarm Self-orchestrating agent swarms");
|
|
2295
|
+
console.log(" sparc Enhanced TDD development modes");
|
|
2296
|
+
console.log(" agent Agent management and coordination");
|
|
2297
|
+
console.log(" task Task creation and management");
|
|
2298
|
+
console.log(" memory Memory bank operations");
|
|
2299
|
+
console.log(" mcp MCP server management");
|
|
2300
|
+
console.log(" claude Claude instance spawning");
|
|
2300
2301
|
console.log();
|
|
2301
|
-
console.log(
|
|
2302
|
-
console.log(` ${blue(
|
|
2302
|
+
console.log("For detailed help on any command, use:");
|
|
2303
|
+
console.log(` ${blue("claude-flow-novice help <command>")}`);
|
|
2303
2304
|
console.log();
|
|
2304
|
-
console.log(
|
|
2305
|
-
console.log(
|
|
2306
|
-
console.log(
|
|
2307
|
-
console.log(
|
|
2308
|
-
console.log(
|
|
2309
|
-
console.log(
|
|
2310
|
-
console.log(
|
|
2305
|
+
console.log("Enhanced features:");
|
|
2306
|
+
console.log(" ✨ Comprehensive service management");
|
|
2307
|
+
console.log(" ✨ Real-time monitoring and alerting");
|
|
2308
|
+
console.log(" ✨ Advanced session lifecycle management");
|
|
2309
|
+
console.log(" ✨ Batch operations and parallel execution");
|
|
2310
|
+
console.log(" ✨ Health checks and auto-recovery");
|
|
2311
|
+
console.log(" ✨ Process management UI");
|
|
2311
2312
|
}
|
|
2312
2313
|
}
|
|
2313
2314
|
});
|
|
2314
2315
|
// Add enhanced command documentation
|
|
2315
|
-
console.log(chalk.cyan(
|
|
2316
|
-
console.log(
|
|
2317
|
-
console.log(
|
|
2318
|
-
console.log(
|
|
2319
|
-
console.log(
|
|
2320
|
-
console.log(
|
|
2316
|
+
console.log(chalk.cyan("\n🚀 Enhanced Commands Loaded:"));
|
|
2317
|
+
console.log(" ✓ start - Enhanced orchestration with service management");
|
|
2318
|
+
console.log(" ✓ status - Comprehensive system status reporting");
|
|
2319
|
+
console.log(" ✓ monitor - Real-time monitoring with metrics and alerts");
|
|
2320
|
+
console.log(" ✓ session - Advanced session lifecycle management");
|
|
2321
|
+
console.log(" ✓ sparc - Enhanced TDD with orchestration features");
|
|
2321
2322
|
console.log();
|
|
2322
|
-
console.log(
|
|
2323
|
+
console.log("For detailed help on enhanced commands: claude-flow-novice help <command>");
|
|
2323
2324
|
// Hive Mind command
|
|
2324
2325
|
cli.command({
|
|
2325
|
-
name:
|
|
2326
|
-
description:
|
|
2326
|
+
name: "hive-mind",
|
|
2327
|
+
description: "Collective intelligence swarm management",
|
|
2327
2328
|
aliases: [
|
|
2328
|
-
|
|
2329
|
-
|
|
2329
|
+
"hive",
|
|
2330
|
+
"swarm"
|
|
2330
2331
|
],
|
|
2331
2332
|
options: [
|
|
2332
2333
|
{
|
|
2333
|
-
name:
|
|
2334
|
-
description:
|
|
2335
|
-
type:
|
|
2334
|
+
name: "command",
|
|
2335
|
+
description: "Hive Mind command (init, spawn, status, task, wizard)",
|
|
2336
|
+
type: "string"
|
|
2336
2337
|
},
|
|
2337
2338
|
{
|
|
2338
|
-
name:
|
|
2339
|
-
short:
|
|
2340
|
-
description:
|
|
2341
|
-
type:
|
|
2339
|
+
name: "swarm-id",
|
|
2340
|
+
short: "s",
|
|
2341
|
+
description: "Swarm ID to operate on",
|
|
2342
|
+
type: "string"
|
|
2342
2343
|
},
|
|
2343
2344
|
{
|
|
2344
|
-
name:
|
|
2345
|
-
short:
|
|
2346
|
-
description:
|
|
2347
|
-
type:
|
|
2348
|
-
default:
|
|
2345
|
+
name: "topology",
|
|
2346
|
+
short: "t",
|
|
2347
|
+
description: "Swarm topology (mesh, hierarchical, ring, star)",
|
|
2348
|
+
type: "string",
|
|
2349
|
+
default: "hierarchical"
|
|
2349
2350
|
},
|
|
2350
2351
|
{
|
|
2351
|
-
name:
|
|
2352
|
-
short:
|
|
2353
|
-
description:
|
|
2354
|
-
type:
|
|
2352
|
+
name: "max-agents",
|
|
2353
|
+
short: "m",
|
|
2354
|
+
description: "Maximum number of agents",
|
|
2355
|
+
type: "number",
|
|
2355
2356
|
default: 8
|
|
2356
2357
|
},
|
|
2357
2358
|
{
|
|
2358
|
-
name:
|
|
2359
|
-
short:
|
|
2360
|
-
description:
|
|
2361
|
-
type:
|
|
2359
|
+
name: "interactive",
|
|
2360
|
+
short: "i",
|
|
2361
|
+
description: "Run in interactive mode",
|
|
2362
|
+
type: "boolean"
|
|
2362
2363
|
}
|
|
2363
2364
|
],
|
|
2364
2365
|
action: async (ctx)=>{
|
|
2365
2366
|
try {
|
|
2366
|
-
const subcommand = ctx.args[0] ||
|
|
2367
|
+
const subcommand = ctx.args[0] || "wizard";
|
|
2367
2368
|
// Import hive-mind commands dynamically
|
|
2368
|
-
const { hiveMindCommand } = await import(
|
|
2369
|
+
const { hiveMindCommand } = await import("./hive-mind/index.js");
|
|
2369
2370
|
// Execute the appropriate subcommand
|
|
2370
2371
|
switch(subcommand){
|
|
2371
|
-
case
|
|
2372
|
-
const { initCommand } = await import(
|
|
2372
|
+
case "init":
|
|
2373
|
+
const { initCommand } = await import("./hive-mind/init.js");
|
|
2373
2374
|
await initCommand.parseAsync(process.argv.slice(3));
|
|
2374
2375
|
break;
|
|
2375
|
-
case
|
|
2376
|
-
const { spawnCommand } = await import(
|
|
2376
|
+
case "spawn":
|
|
2377
|
+
const { spawnCommand } = await import("./hive-mind/spawn.js");
|
|
2377
2378
|
await spawnCommand.parseAsync(process.argv.slice(3));
|
|
2378
2379
|
break;
|
|
2379
|
-
case
|
|
2380
|
-
const { statusCommand } = await import(
|
|
2380
|
+
case "status":
|
|
2381
|
+
const { statusCommand } = await import("./hive-mind/status.js");
|
|
2381
2382
|
await statusCommand.parseAsync(process.argv.slice(3));
|
|
2382
2383
|
break;
|
|
2383
|
-
case
|
|
2384
|
-
const { taskCommand } = await import(
|
|
2384
|
+
case "task":
|
|
2385
|
+
const { taskCommand } = await import("./hive-mind/task.js");
|
|
2385
2386
|
await taskCommand.parseAsync(process.argv.slice(3));
|
|
2386
2387
|
break;
|
|
2387
|
-
case
|
|
2388
|
-
const { stopCommand } = await import(
|
|
2388
|
+
case "stop":
|
|
2389
|
+
const { stopCommand } = await import("./hive-mind/stop.js");
|
|
2389
2390
|
await stopCommand.parseAsync(process.argv.slice(3));
|
|
2390
2391
|
break;
|
|
2391
|
-
case
|
|
2392
|
-
const { pauseCommand } = await import(
|
|
2392
|
+
case "pause":
|
|
2393
|
+
const { pauseCommand } = await import("./hive-mind/pause.js");
|
|
2393
2394
|
await pauseCommand.parseAsync(process.argv.slice(3));
|
|
2394
2395
|
break;
|
|
2395
|
-
case
|
|
2396
|
-
const { resumeCommand } = await import(
|
|
2396
|
+
case "resume":
|
|
2397
|
+
const { resumeCommand } = await import("./hive-mind/resume.js");
|
|
2397
2398
|
await resumeCommand.parseAsync(process.argv.slice(3));
|
|
2398
2399
|
break;
|
|
2399
|
-
case
|
|
2400
|
-
const { psCommand } = await import(
|
|
2400
|
+
case "ps":
|
|
2401
|
+
const { psCommand } = await import("./hive-mind/ps.js");
|
|
2401
2402
|
await psCommand.parseAsync(process.argv.slice(3));
|
|
2402
2403
|
break;
|
|
2403
|
-
case
|
|
2404
|
+
case "wizard":
|
|
2404
2405
|
default:
|
|
2405
|
-
const { wizardCommand } = await import(
|
|
2406
|
+
const { wizardCommand } = await import("./hive-mind/wizard.js");
|
|
2406
2407
|
await wizardCommand.parseAsync(process.argv.slice(3));
|
|
2407
2408
|
break;
|
|
2408
2409
|
}
|
|
@@ -2413,25 +2414,25 @@ Now, please proceed with the task: ${task}`;
|
|
|
2413
2414
|
});
|
|
2414
2415
|
// Hook command for ruv-swarm integration
|
|
2415
2416
|
cli.command({
|
|
2416
|
-
name:
|
|
2417
|
-
description:
|
|
2417
|
+
name: "hook",
|
|
2418
|
+
description: "Execute ruv-swarm hooks for agent coordination",
|
|
2418
2419
|
action: async (ctx)=>{
|
|
2419
2420
|
try {
|
|
2420
|
-
const { spawn } = await import(
|
|
2421
|
+
const { spawn } = await import("child_process");
|
|
2421
2422
|
// Pass all arguments to ruv-swarm hook command
|
|
2422
2423
|
const args = ctx.args.length > 0 ? ctx.args : [
|
|
2423
|
-
|
|
2424
|
+
"--help"
|
|
2424
2425
|
];
|
|
2425
|
-
const child = spawn(
|
|
2426
|
-
|
|
2427
|
-
|
|
2426
|
+
const child = spawn("npx", [
|
|
2427
|
+
"ruv-swarm",
|
|
2428
|
+
"hook",
|
|
2428
2429
|
...args
|
|
2429
2430
|
], {
|
|
2430
|
-
stdio:
|
|
2431
|
+
stdio: "inherit",
|
|
2431
2432
|
shell: true
|
|
2432
2433
|
});
|
|
2433
2434
|
await new Promise((resolve, reject)=>{
|
|
2434
|
-
child.on(
|
|
2435
|
+
child.on("exit", (code)=>{
|
|
2435
2436
|
if (code === 0) {
|
|
2436
2437
|
resolve();
|
|
2437
2438
|
} else {
|
|
@@ -2439,7 +2440,7 @@ Now, please proceed with the task: ${task}`;
|
|
|
2439
2440
|
resolve();
|
|
2440
2441
|
}
|
|
2441
2442
|
});
|
|
2442
|
-
child.on(
|
|
2443
|
+
child.on("error", (err)=>{
|
|
2443
2444
|
error(`Failed to execute hook command: ${getErrorMessage(err)}`);
|
|
2444
2445
|
resolve();
|
|
2445
2446
|
});
|
|
@@ -2457,37 +2458,37 @@ Now, please proceed with the task: ${task}`;
|
|
|
2457
2458
|
function getCapabilitiesForType(type) {
|
|
2458
2459
|
const capabilities = {
|
|
2459
2460
|
coordinator: [
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2461
|
+
"task-assignment",
|
|
2462
|
+
"planning",
|
|
2463
|
+
"delegation"
|
|
2463
2464
|
],
|
|
2464
2465
|
researcher: [
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2466
|
+
"web-search",
|
|
2467
|
+
"information-gathering",
|
|
2468
|
+
"analysis"
|
|
2468
2469
|
],
|
|
2469
2470
|
implementer: [
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2471
|
+
"code-generation",
|
|
2472
|
+
"file-manipulation",
|
|
2473
|
+
"testing"
|
|
2473
2474
|
],
|
|
2474
2475
|
analyst: [
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2476
|
+
"data-analysis",
|
|
2477
|
+
"pattern-recognition",
|
|
2478
|
+
"reporting"
|
|
2478
2479
|
],
|
|
2479
2480
|
custom: [
|
|
2480
|
-
|
|
2481
|
+
"user-defined"
|
|
2481
2482
|
]
|
|
2482
2483
|
};
|
|
2483
2484
|
return capabilities[type] || capabilities.custom;
|
|
2484
2485
|
}
|
|
2485
2486
|
function getDefaultPromptForType(type) {
|
|
2486
2487
|
const prompts = {
|
|
2487
|
-
coordinator:
|
|
2488
|
-
researcher:
|
|
2489
|
-
implementer:
|
|
2490
|
-
analyst:
|
|
2488
|
+
coordinator: "You are a coordination agent responsible for planning and delegating tasks.",
|
|
2489
|
+
researcher: "You are a research agent specialized in gathering and analyzing information.",
|
|
2490
|
+
implementer: "You are an implementation agent focused on writing code and creating solutions.",
|
|
2491
|
+
analyst: "You are an analysis agent that identifies patterns and generates insights.",
|
|
2491
2492
|
custom: "You are a custom agent. Follow the user's instructions."
|
|
2492
2493
|
};
|
|
2493
2494
|
return prompts[type] || prompts.custom;
|
|
@@ -2511,53 +2512,14 @@ This is a Claude-Flow AI agent orchestration system.
|
|
|
2511
2512
|
`;
|
|
2512
2513
|
}
|
|
2513
2514
|
function createFullClaudeMd() {
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
- \`npx claude-flow-novice --help\`: Show all available commands
|
|
2523
|
-
|
|
2524
|
-
## Code Style Preferences
|
|
2525
|
-
- Use ES modules (import/export) syntax, not CommonJS (require)
|
|
2526
|
-
- Destructure imports when possible (e.g., \`import { foo } from 'bar'\`)
|
|
2527
|
-
- Use TypeScript for all new code
|
|
2528
|
-
- Follow existing naming conventions (camelCase for variables, PascalCase for classes)
|
|
2529
|
-
- Add JSDoc comments for public APIs
|
|
2530
|
-
- Use async/await instead of Promise chains
|
|
2531
|
-
- Prefer const/let over var
|
|
2532
|
-
|
|
2533
|
-
## Workflow Guidelines
|
|
2534
|
-
- Always run typecheck after making code changes
|
|
2535
|
-
- Run tests before committing changes
|
|
2536
|
-
- Use meaningful commit messages following conventional commits
|
|
2537
|
-
- Create feature branches for new functionality
|
|
2538
|
-
- Ensure all tests pass before merging
|
|
2539
|
-
|
|
2540
|
-
## Project Architecture
|
|
2541
|
-
This is a Claude-Flow AI agent orchestration system with the following components:
|
|
2542
|
-
- **CLI Interface**: Command-line tools for managing the system
|
|
2543
|
-
- **Orchestrator**: Core engine for coordinating agents and tasks
|
|
2544
|
-
- **Memory System**: Persistent storage and retrieval of information
|
|
2545
|
-
- **Terminal Management**: Automated terminal session handling
|
|
2546
|
-
- **MCP Integration**: Model Context Protocol server for Claude integration
|
|
2547
|
-
- **Agent Coordination**: Multi-agent task distribution and management
|
|
2548
|
-
|
|
2549
|
-
## Important Notes
|
|
2550
|
-
- Use \`claude --dangerously-skip-permissions\` for unattended operation
|
|
2551
|
-
- The system supports both daemon and interactive modes
|
|
2552
|
-
- Memory persistence is handled automatically
|
|
2553
|
-
- All components are event-driven for scalability
|
|
2554
|
-
|
|
2555
|
-
## Debugging
|
|
2556
|
-
- Check logs in \`./claude-flow.log\`
|
|
2557
|
-
- Use \`npx claude-flow-novice status\` to check system health
|
|
2558
|
-
- Monitor with \`npx claude-flow-novice monitor\` for real-time updates
|
|
2559
|
-
- Verbose output available with \`--verbose\` flag on most commands
|
|
2560
|
-
`;
|
|
2515
|
+
// Use the template-based approach instead of hardcoded content
|
|
2516
|
+
try {
|
|
2517
|
+
return createEnhancedClaudeMd();
|
|
2518
|
+
} catch (error) {
|
|
2519
|
+
// Fallback to minimal template if enhanced template fails
|
|
2520
|
+
console.warn("Warning: Enhanced CLAUDE.md template not found, using minimal version");
|
|
2521
|
+
return createMinimalClaudeMd();
|
|
2522
|
+
}
|
|
2561
2523
|
}
|
|
2562
2524
|
function createMinimalMemoryBankMd() {
|
|
2563
2525
|
return `# Memory Bank
|