snow-flow 4.5.7 → 4.5.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.
Files changed (2) hide show
  1. package/dist/cli.js +26 -6
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -555,16 +555,36 @@ async function executeClaudeCode(prompt) {
555
555
  cliLogger.info(`šŸ” Working Directory: ${process.cwd()}`);
556
556
  cliLogger.info(`šŸ” MCP Config: ${mcpConfigPath}`);
557
557
  }
558
- // Start Claude Code process - inherit all stdio to prevent raw mode issues
558
+ // Detect if we're in an interactive environment (prevents raw mode errors)
559
+ const isInteractive = process.stdin.isTTY && process.stdout.isTTY && !process.env.CI && !process.env.CODESPACES;
560
+ if (!isInteractive) {
561
+ // Non-interactive environment (Codespaces, CI) - provide manual instructions
562
+ cliLogger.info('āš ļø Non-interactive environment detected (Codespaces/CI)');
563
+ cliLogger.info('šŸ“‹ Manual Claude Code instructions:');
564
+ cliLogger.info('1. Ensure Claude Code is running: ' + chalk_1.default.cyan('claude --dangerously-skip-permissions'));
565
+ cliLogger.info('2. In Claude Code conversation, tell it:');
566
+ cliLogger.info('\n' + chalk_1.default.green(`"${objective}"`));
567
+ cliLogger.info('\nšŸ› ļø All 20+ MCP servers with 235+ Snow-Flow tools are available!');
568
+ return true;
569
+ }
570
+ // Interactive environment - try to start Claude Code
559
571
  const claudeProcess = (0, child_process_1.spawn)('claude', claudeArgs, {
560
- stdio: 'inherit', // inherit all streams to prevent raw mode errors in Codespaces
572
+ stdio: ['pipe', 'inherit', 'inherit'], // pipe stdin to send prompt, inherit stdout/stderr
561
573
  cwd: process.cwd(),
562
- env: { ...process.env }
574
+ env: {
575
+ ...process.env,
576
+ FORCE_COLOR: '0',
577
+ NO_COLOR: '1'
578
+ }
563
579
  });
564
- // Claude Code will open with MCP servers ready
580
+ // Send the prompt via stdin
581
+ cliLogger.info('šŸ“ Sending orchestration prompt to Claude Code...');
565
582
  cliLogger.info('šŸš€ Claude Code interface opening with Snow-Flow MCP servers...\n');
566
- cliLogger.info('šŸ’” Tell Claude Code: ' + chalk_1.default.green(`"${prompt.slice(0, 100)}..."`));
567
- cliLogger.info('šŸ› ļø All 20+ MCP servers with 235+ tools are now available!');
583
+ // Write prompt to stdin
584
+ if (claudeProcess.stdin) {
585
+ claudeProcess.stdin.write(prompt);
586
+ claudeProcess.stdin.end();
587
+ }
568
588
  // Set up process monitoring
569
589
  return new Promise((resolve) => {
570
590
  claudeProcess.on('close', async (code) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.5.7",
3
+ "version": "4.5.9",
4
4
  "description": "Conversational ServiceNow development platform using Claude Code. Multi-agent orchestration with 20+ MCP servers providing 200+ ServiceNow tools for comprehensive platform development.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",