snow-flow 1.3.8 → 1.3.10

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 CHANGED
@@ -382,15 +382,75 @@ program
382
382
  });
383
383
  }
384
384
  });
385
- // Helper function to execute Claude Code directly (FALLBACK ONLY)
385
+ // Helper function to execute Claude Code directly
386
386
  async function executeClaudeCode(prompt) {
387
387
  cliLogger.info('šŸ¤– Preparing Claude Code agent orchestration...');
388
- // Claude Code is not a CLI tool - it requires manual interaction
389
- // Snow-flow is the orchestrator, Claude Code agents are the workhorses
390
- cliLogger.info('šŸ“‹ Claude Code prompt generated successfully!');
391
- cliLogger.info('šŸš€ Snow-flow orchestration ready for Claude Code execution');
392
- // Always return false to show the prompt to the user
393
- return false;
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 and skip permissions to avoid raw mode issues
403
+ const claudeArgs = hasMcpConfig
404
+ ? ['--mcp-config', '.mcp.json', '.', '--dangerously-skip-permissions']
405
+ : ['--dangerously-skip-permissions'];
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 with stdin piping
411
+ const claudeProcess = (0, child_process_1.spawn)('claude', claudeArgs, {
412
+ stdio: ['pipe', 'inherit', 'inherit'], // pipe stdin, inherit stdout/stderr
413
+ cwd: process.cwd(),
414
+ env: { ...process.env }
415
+ });
416
+ // Send the prompt via stdin
417
+ cliLogger.info('šŸ“ Sending orchestration prompt to Claude Code...');
418
+ cliLogger.info('šŸš€ Claude Code interface opening...\n');
419
+ // Write prompt to stdin
420
+ claudeProcess.stdin.write(prompt);
421
+ claudeProcess.stdin.end();
422
+ // Set up process monitoring
423
+ return new Promise((resolve) => {
424
+ claudeProcess.on('close', async (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,24 @@ 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.8';
10
+ exports.VERSION = '1.3.10';
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.10': [
17
+ 'šŸ”„ RAW MODE FIX: Used --dangerously-skip-permissions flag',
18
+ 'šŸ“ STDIN RESTORED: Proper prompt injection via stdin',
19
+ 'āœ… FULLY AUTOMATIC: No manual input required anymore',
20
+ 'šŸš€ LIKE OLD VERSIONS: Works exactly like v1.0-1.2 did'
21
+ ],
22
+ '1.3.9': [
23
+ 'šŸš€ CLAUDE CODE AUTO-LAUNCH: Restored automatic Claude Code launching',
24
+ 'šŸ¤– PROCESS SPAWNING: Claude CLI detection and proper process spawning',
25
+ 'šŸ“ PROMPT INJECTION: Automatic prompt sending to Claude Code via stdin',
26
+ 'šŸ”§ MCP INTEGRATION: Auto-loads MCP servers when .mcp.json exists'
27
+ ],
16
28
  '1.3.8': [
17
29
  'šŸ¤– CLAUDE CODE FIX: Restored proper Claude Code agent spawning',
18
30
  'šŸš€ 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.8",
3
+ "version": "1.3.10",
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",