snow-flow 1.3.8 ā 1.3.9
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/dist/cli.js +67 -7
- package/dist/version.js +7 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -382,15 +382,75 @@ program
|
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
|
-
// Helper function to execute Claude Code directly
|
|
385
|
+
// Helper function to execute Claude Code directly
|
|
386
386
|
async function executeClaudeCode(prompt) {
|
|
387
387
|
cliLogger.info('š¤ Preparing Claude Code agent orchestration...');
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
388
|
+
try {
|
|
389
|
+
// Check if Claude CLI is available
|
|
390
|
+
const { execSync } = require('child_process');
|
|
391
|
+
try {
|
|
392
|
+
execSync('which claude', { stdio: 'ignore' });
|
|
393
|
+
}
|
|
394
|
+
catch {
|
|
395
|
+
cliLogger.warn('ā ļø Claude Code CLI not found in PATH');
|
|
396
|
+
cliLogger.info('š Please install Claude Desktop or copy the prompt manually');
|
|
397
|
+
return false;
|
|
398
|
+
}
|
|
399
|
+
// Check for MCP config
|
|
400
|
+
const mcpConfigPath = (0, path_1.join)(process.cwd(), '.mcp.json');
|
|
401
|
+
const hasMcpConfig = (0, fs_2.existsSync)(mcpConfigPath);
|
|
402
|
+
// Launch Claude Code with MCP config
|
|
403
|
+
const claudeArgs = hasMcpConfig
|
|
404
|
+
? ['--mcp-config', '.mcp.json', '.']
|
|
405
|
+
: ['.'];
|
|
406
|
+
cliLogger.info('š Launching Claude Code automatically...');
|
|
407
|
+
if (hasMcpConfig) {
|
|
408
|
+
cliLogger.info('š§ Starting Claude Code with ServiceNow MCP servers...');
|
|
409
|
+
}
|
|
410
|
+
// Start Claude Code process in interactive mode
|
|
411
|
+
const claudeProcess = (0, child_process_1.spawn)('claude', claudeArgs, {
|
|
412
|
+
stdio: ['pipe', 'inherit', 'inherit'],
|
|
413
|
+
shell: true,
|
|
414
|
+
env: { ...process.env }
|
|
415
|
+
});
|
|
416
|
+
// Send the prompt to Claude Code
|
|
417
|
+
cliLogger.info('š Sending orchestration prompt to Claude Code...');
|
|
418
|
+
cliLogger.info('š Claude Code interface opening...\n');
|
|
419
|
+
// Write prompt and close stdin to trigger execution
|
|
420
|
+
claudeProcess.stdin.write(prompt);
|
|
421
|
+
claudeProcess.stdin.end();
|
|
422
|
+
// Set up process monitoring
|
|
423
|
+
return new Promise((resolve) => {
|
|
424
|
+
claudeProcess.on('close', (code) => {
|
|
425
|
+
if (code === 0) {
|
|
426
|
+
cliLogger.info('\nā
Claude Code session completed successfully!');
|
|
427
|
+
resolve(true);
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
cliLogger.warn(`\nā ļø Claude Code session ended with code: ${code}`);
|
|
431
|
+
resolve(false);
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
claudeProcess.on('error', (error) => {
|
|
435
|
+
cliLogger.error(`ā Failed to start Claude Code: ${error.message}`);
|
|
436
|
+
resolve(false);
|
|
437
|
+
});
|
|
438
|
+
// Set timeout (configurable via environment variable)
|
|
439
|
+
const timeoutMinutes = parseInt(process.env.SNOW_FLOW_TIMEOUT_MINUTES || '0');
|
|
440
|
+
if (timeoutMinutes > 0) {
|
|
441
|
+
setTimeout(() => {
|
|
442
|
+
cliLogger.warn(`ā±ļø Claude Code session timeout (${timeoutMinutes} minutes), terminating...`);
|
|
443
|
+
claudeProcess.kill('SIGTERM');
|
|
444
|
+
resolve(false);
|
|
445
|
+
}, timeoutMinutes * 60 * 1000);
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
catch (error) {
|
|
450
|
+
cliLogger.error('ā Error launching Claude Code:', error instanceof Error ? error.message : String(error));
|
|
451
|
+
cliLogger.info('š Claude Code prompt generated - please copy and paste manually');
|
|
452
|
+
return false;
|
|
453
|
+
}
|
|
394
454
|
}
|
|
395
455
|
// Real-time monitoring dashboard for Claude Code process
|
|
396
456
|
function startMonitoringDashboard(claudeProcess) {
|
package/dist/version.js
CHANGED
|
@@ -7,12 +7,18 @@ exports.VERSION_INFO = exports.VERSION = void 0;
|
|
|
7
7
|
exports.getVersionString = getVersionString;
|
|
8
8
|
exports.getLatestFeatures = getLatestFeatures;
|
|
9
9
|
exports.isLatestVersion = isLatestVersion;
|
|
10
|
-
exports.VERSION = '1.3.
|
|
10
|
+
exports.VERSION = '1.3.9';
|
|
11
11
|
exports.VERSION_INFO = {
|
|
12
12
|
version: exports.VERSION,
|
|
13
13
|
name: 'Snow-Flow',
|
|
14
14
|
description: 'ServiceNow Queen Agent - Hive-Mind Intelligence for ServiceNow Development',
|
|
15
15
|
features: {
|
|
16
|
+
'1.3.9': [
|
|
17
|
+
'š CLAUDE CODE AUTO-LAUNCH: Restored automatic Claude Code launching',
|
|
18
|
+
'š¤ PROCESS SPAWNING: Claude CLI detection and proper process spawning',
|
|
19
|
+
'š PROMPT INJECTION: Automatic prompt sending to Claude Code via stdin',
|
|
20
|
+
'š§ MCP INTEGRATION: Auto-loads MCP servers when .mcp.json exists'
|
|
21
|
+
],
|
|
16
22
|
'1.3.8': [
|
|
17
23
|
'š¤ CLAUDE CODE FIX: Restored proper Claude Code agent spawning',
|
|
18
24
|
'š SWARM ORCHESTRATION: Snow-flow is orchestrator, Claude Code agents are workhorses',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"description": "ServiceNow Queen Agent - Hive-Mind Intelligence for ServiceNow Development inspired by claude-flow. Transform complex workflows into elegant one-command orchestration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|