claude-flow 2.0.0-alpha.76 ā 2.0.0-alpha.77
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/bin/claude-flow +1 -1
- package/bin/claude-flow.js +1 -1
- package/package.json +1 -1
- package/src/cli/help-text.js +2 -2
- package/src/cli/simple-commands/hooks.js +41 -25
package/bin/claude-flow
CHANGED
package/bin/claude-flow.js
CHANGED
|
@@ -11,7 +11,7 @@ import { existsSync } from 'fs';
|
|
|
11
11
|
import { spawn } from 'child_process';
|
|
12
12
|
import process from 'process';
|
|
13
13
|
|
|
14
|
-
const VERSION = "2.0.0-alpha.
|
|
14
|
+
const VERSION = "2.0.0-alpha.77";
|
|
15
15
|
|
|
16
16
|
// Get script directory and root directory
|
|
17
17
|
const __filename = fileURLToPath(import.meta.url);
|
package/package.json
CHANGED
package/src/cli/help-text.js
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
import { HelpFormatter } from './help-formatter.js';
|
|
7
7
|
|
|
8
|
-
export const VERSION = '2.0.0-alpha.
|
|
8
|
+
export const VERSION = '2.0.0-alpha.77';
|
|
9
9
|
|
|
10
10
|
export const MAIN_HELP = `
|
|
11
11
|
š Claude-Flow v${VERSION} - Enterprise-Grade AI Agent Orchestration Platform
|
|
12
12
|
|
|
13
13
|
šÆ ENTERPRISE FEATURES: Complete ruv-swarm integration with 87 MCP tools, neural networking, and production-ready infrastructure
|
|
14
14
|
š NEW: Advanced Hive Mind System with Queen-led coordination, collective intelligence, and unlimited scaling
|
|
15
|
-
ā” ALPHA
|
|
15
|
+
ā” ALPHA 77: Enhanced hooks pre-task exit handling with timeout protection
|
|
16
16
|
|
|
17
17
|
USAGE:
|
|
18
18
|
claude-flow <command> [options]
|
|
@@ -137,29 +137,40 @@ async function preTaskCommand(subArgs, flags) {
|
|
|
137
137
|
|
|
138
138
|
console.log(` š¾ Saved to .swarm/memory.db`);
|
|
139
139
|
|
|
140
|
-
// Execute ruv-swarm hook if available
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
140
|
+
// Execute ruv-swarm hook if available (with timeout for npx scenarios)
|
|
141
|
+
try {
|
|
142
|
+
const checkPromise = checkRuvSwarmAvailable();
|
|
143
|
+
const timeoutPromise = new Promise((_, reject) =>
|
|
144
|
+
setTimeout(() => reject(new Error('Timeout')), 3000)
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const isAvailable = await Promise.race([checkPromise, timeoutPromise]);
|
|
148
|
+
|
|
149
|
+
if (isAvailable) {
|
|
150
|
+
console.log(`\nš Executing ruv-swarm pre-task hook...`);
|
|
151
|
+
const hookResult = await execRuvSwarmHook('pre-task', {
|
|
152
|
+
description,
|
|
153
|
+
'task-id': taskId,
|
|
154
|
+
'auto-spawn-agents': autoSpawnAgents,
|
|
155
|
+
...(agentId ? { 'agent-id': agentId } : {}),
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
if (hookResult.success) {
|
|
159
|
+
await store.store(
|
|
160
|
+
`task:${taskId}:ruv-output`,
|
|
161
|
+
{
|
|
162
|
+
output: hookResult.output,
|
|
163
|
+
timestamp: new Date().toISOString(),
|
|
164
|
+
},
|
|
165
|
+
{ namespace: 'hooks:ruv-swarm' },
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
printSuccess(`ā
Pre-task hook completed successfully`);
|
|
169
|
+
}
|
|
162
170
|
}
|
|
171
|
+
} catch (err) {
|
|
172
|
+
// Skip ruv-swarm hook if it times out or fails
|
|
173
|
+
console.log(`\nā ļø Skipping ruv-swarm hook (${err.message})`);
|
|
163
174
|
}
|
|
164
175
|
|
|
165
176
|
console.log(`\nšÆ TASK PREPARATION COMPLETE`);
|
|
@@ -169,8 +180,10 @@ async function preTaskCommand(subArgs, flags) {
|
|
|
169
180
|
memoryStore.close();
|
|
170
181
|
}
|
|
171
182
|
|
|
172
|
-
//
|
|
173
|
-
|
|
183
|
+
// Force exit after a short delay to ensure cleanup
|
|
184
|
+
setTimeout(() => {
|
|
185
|
+
process.exit(0);
|
|
186
|
+
}, 100);
|
|
174
187
|
} catch (err) {
|
|
175
188
|
printError(`Pre-task hook failed: ${err.message}`);
|
|
176
189
|
|
|
@@ -179,7 +192,10 @@ async function preTaskCommand(subArgs, flags) {
|
|
|
179
192
|
memoryStore.close();
|
|
180
193
|
}
|
|
181
194
|
|
|
182
|
-
|
|
195
|
+
// Force exit after a short delay to ensure cleanup
|
|
196
|
+
setTimeout(() => {
|
|
197
|
+
process.exit(1);
|
|
198
|
+
}, 100);
|
|
183
199
|
}
|
|
184
200
|
}
|
|
185
201
|
|