snow-flow 8.4.21 → 8.4.24

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
@@ -326,13 +326,13 @@ program
326
326
  started_at: new Date().toISOString(),
327
327
  is_authenticated: isAuthenticated
328
328
  });
329
- // Start OpenCode multi-agent orchestration
329
+ // Start SnowCode multi-agent orchestration
330
330
  try {
331
331
  // Generate the orchestration prompt
332
332
  const orchestrationPrompt = buildQueenAgentPrompt(objective, taskAnalysis, options, isAuthenticated, sessionId);
333
333
  if (options.verbose) {
334
- cliLogger.info('\n👑 Initializing multi-agent orchestration with OpenCode...');
335
- cliLogger.info('🎯 OpenCode will coordinate the following:');
334
+ cliLogger.info('\n👑 Initializing multi-agent orchestration with SnowCode...');
335
+ cliLogger.info('🎯 SnowCode will coordinate the following:');
336
336
  cliLogger.info(` - Analyze objective: "${objective}"`);
337
337
  cliLogger.info(` - Spawn ${taskAnalysis.estimatedAgentCount} specialized agents via Task() system`);
338
338
  cliLogger.info(` - Coordinate through shared memory (session: ${sessionId})`);
@@ -344,7 +344,7 @@ program
344
344
  options.sharedMemory || options.progressMonitoring;
345
345
  if (options.verbose && hasIntelligentFeatures && isAuthenticated) {
346
346
  cliLogger.info('\n🧠 INTELLIGENT ORCHESTRATION MODE ENABLED!');
347
- cliLogger.info('✨ OpenCode will use advanced features:');
347
+ cliLogger.info('✨ SnowCode will use advanced features:');
348
348
  if (options.autoPermissions) {
349
349
  cliLogger.info(' 🔐 Automatic permission escalation');
350
350
  }
@@ -376,12 +376,12 @@ program
376
376
  cliLogger.info('\n🔗 Live ServiceNow integration: ❌ Disabled');
377
377
  }
378
378
  }
379
- // Try to execute OpenCode directly with the objective
380
- const success = await executeOpenCode(objective);
379
+ // Try to execute SnowCode directly with the objective
380
+ const success = await executeSnowCode(objective);
381
381
  if (success) {
382
382
  if (options.verbose) {
383
- cliLogger.info('✅ OpenCode launched successfully!');
384
- cliLogger.info('🤖 OpenCode is now executing your objective');
383
+ cliLogger.info('✅ SnowCode launched successfully!');
384
+ cliLogger.info('🤖 SnowCode is now executing your objective');
385
385
  cliLogger.info(`💾 Monitor progress with session ID: ${sessionId}`);
386
386
  if (isAuthenticated && options.autoDeploy) {
387
387
  cliLogger.info('🚀 Real artifacts will be created in ServiceNow');
@@ -397,11 +397,11 @@ program
397
397
  });
398
398
  }
399
399
  else {
400
- cliLogger.warn('⚠️ OpenCode CLI not found or failed to start');
401
- cliLogger.info('\n📋 Please ensure OpenCode is installed:');
402
- cliLogger.info(' npm install -g opencode-ai');
403
- cliLogger.info('\n💡 Or start OpenCode manually:');
404
- cliLogger.info(' 1. Run: opencode');
400
+ cliLogger.warn('⚠️ SnowCode CLI not found or failed to start');
401
+ cliLogger.info('\n📋 Please ensure SnowCode is installed:');
402
+ cliLogger.info(' npm install -g @groeimetai/snowcode');
403
+ cliLogger.info('\n💡 Or start SnowCode manually:');
404
+ cliLogger.info(' 1. Run: snowcode');
405
405
  cliLogger.info(` 2. Enter objective: ${objective}`);
406
406
  if (isAuthenticated && options.autoDeploy) {
407
407
  cliLogger.info('\n🚀 Deployment Mode: Artifacts will be created in ServiceNow');
@@ -421,26 +421,26 @@ program
421
421
  });
422
422
  }
423
423
  });
424
- // Helper function to execute OpenCode directly with the objective
425
- async function executeOpenCode(objective) {
424
+ // Helper function to execute SnowCode directly with the objective
425
+ async function executeSnowCode(objective) {
426
426
  try {
427
- // Check if OpenCode CLI is available
427
+ // Check if SnowCode CLI is available
428
428
  const { execSync } = require('child_process');
429
429
  try {
430
- execSync('which opencode', { stdio: 'ignore' });
430
+ execSync('which snowcode', { stdio: 'ignore' });
431
431
  }
432
432
  catch {
433
- cliLogger.warn('⚠️ OpenCode CLI not found in PATH');
434
- cliLogger.info('📋 Please install OpenCode: npm install -g opencode-ai');
433
+ cliLogger.warn('⚠️ SnowCode CLI not found in PATH');
434
+ cliLogger.info('📋 Please install SnowCode: npm install -g @groeimetai/snowcode');
435
435
  return false;
436
436
  }
437
- // Check for OpenCode config (.opencode/opencode.json created by init)
438
- const opencodeConfigPath = (0, path_1.join)(process.cwd(), '.opencode', 'opencode.json');
439
- const hasOpencodeConfig = (0, fs_2.existsSync)(opencodeConfigPath);
440
- if (!hasOpencodeConfig) {
441
- cliLogger.warn('⚠️ OpenCode configuration not found');
437
+ // Check for SnowCode config (.snowcode/snowcode.json created by init)
438
+ const snowcodeConfigPath = (0, path_1.join)(process.cwd(), '.snowcode', 'snowcode.json');
439
+ const hasSnowcodeConfig = (0, fs_2.existsSync)(snowcodeConfigPath);
440
+ if (!hasSnowcodeConfig) {
441
+ cliLogger.warn('⚠️ SnowCode configuration not found');
442
442
  cliLogger.info('📋 Please run: snow-flow init');
443
- cliLogger.info(' This will create .opencode/opencode.json with MCP servers configured');
443
+ cliLogger.info(' This will create .snowcode/snowcode.json with MCP servers configured');
444
444
  return false;
445
445
  }
446
446
  // Check for .env file with required configuration
@@ -457,10 +457,10 @@ async function executeOpenCode(objective) {
457
457
  // Debug output if enabled
458
458
  if (process.env.SNOW_FLOW_DEBUG === 'true' || process.env.VERBOSE === 'true') {
459
459
  cliLogger.info(`🔍 Working Directory: ${process.cwd()}`);
460
- cliLogger.info(`🔍 OpenCode Config: ${opencodeConfigPath}`);
460
+ cliLogger.info(`🔍 SnowCode Config: ${snowcodeConfigPath}`);
461
461
  cliLogger.info(`🔍 Environment File: ${envPath}`);
462
462
  }
463
- // Write objective to temp file for OpenCode to read
463
+ // Write objective to temp file for SnowCode to read
464
464
  const { tmpdir } = await Promise.resolve().then(() => __importStar(require('os')));
465
465
  const { writeFileSync, unlinkSync } = await Promise.resolve().then(() => __importStar(require('fs')));
466
466
  const tmpFile = (0, path_1.join)(tmpdir(), `snow-flow-objective-${Date.now()}.txt`);
@@ -468,29 +468,29 @@ async function executeOpenCode(objective) {
468
468
  // Get default model from .env if available
469
469
  const defaultModel = process.env.DEFAULT_MODEL;
470
470
  const defaultProvider = process.env.DEFAULT_LLM_PROVIDER;
471
- // Start OpenCode with the objective and default model
472
- // OpenCode will be started interactively with stdin redirect
473
- let opencodeCommand = `opencode < "${tmpFile}"`;
474
- // If we have a default model, pass it to OpenCode
471
+ // Start SnowCode with the objective and default model
472
+ // SnowCode will be started interactively with stdin redirect
473
+ let snowcodeCommand = `snowcode < "${tmpFile}"`;
474
+ // If we have a default model, pass it to SnowCode
475
475
  if (defaultModel) {
476
- opencodeCommand = `opencode --model "${defaultModel}" < "${tmpFile}"`;
476
+ snowcodeCommand = `snowcode --model "${defaultModel}" < "${tmpFile}"`;
477
477
  }
478
- // Spawn OpenCode process - let it run fully interactively
479
- // OpenCode is a TUI (Terminal User Interface) application that needs full terminal control
480
- // We pass the objective via stdin redirect (shell: opencode < tmpfile)
481
- const opencodeProcess = (0, child_process_1.spawn)('sh', ['-c', opencodeCommand], {
482
- stdio: 'inherit', // All stdio inherited - OpenCode can use TTY
478
+ // Spawn SnowCode process - let it run fully interactively
479
+ // SnowCode is a TUI (Terminal User Interface) application that needs full terminal control
480
+ // We pass the objective via stdin redirect (shell: snowcode < tmpfile)
481
+ const snowcodeProcess = (0, child_process_1.spawn)('sh', ['-c', snowcodeCommand], {
482
+ stdio: 'inherit', // All stdio inherited - SnowCode can use TTY
483
483
  cwd: process.cwd(),
484
484
  env: {
485
485
  ...process.env,
486
- // Ensure DEFAULT_MODEL is available to OpenCode
486
+ // Ensure DEFAULT_MODEL is available to SnowCode
487
487
  DEFAULT_MODEL: defaultModel || '',
488
488
  DEFAULT_LLM_PROVIDER: defaultProvider || ''
489
489
  }
490
490
  });
491
491
  // Set up process monitoring
492
492
  return new Promise((resolve) => {
493
- opencodeProcess.on('close', async (code) => {
493
+ snowcodeProcess.on('close', async (code) => {
494
494
  // Clean up temp file
495
495
  try {
496
496
  unlinkSync(tmpFile);
@@ -500,7 +500,7 @@ async function executeOpenCode(objective) {
500
500
  }
501
501
  resolve(code === 0);
502
502
  });
503
- opencodeProcess.on('error', (error) => {
503
+ snowcodeProcess.on('error', (error) => {
504
504
  // Clean up temp file
505
505
  try {
506
506
  unlinkSync(tmpFile);
@@ -508,15 +508,15 @@ async function executeOpenCode(objective) {
508
508
  catch (e) {
509
509
  // Ignore cleanup errors
510
510
  }
511
- cliLogger.error(`❌ Failed to start OpenCode: ${error.message}`);
511
+ cliLogger.error(`❌ Failed to start SnowCode: ${error.message}`);
512
512
  resolve(false);
513
513
  });
514
514
  // Set timeout (configurable via environment variable)
515
515
  const timeoutMinutes = parseInt(process.env.SNOW_FLOW_TIMEOUT_MINUTES || '0');
516
516
  if (timeoutMinutes > 0) {
517
517
  setTimeout(() => {
518
- cliLogger.warn(`⏱️ OpenCode session timeout (${timeoutMinutes} minutes), terminating...`);
519
- opencodeProcess.kill('SIGTERM');
518
+ cliLogger.warn(`⏱️ SnowCode session timeout (${timeoutMinutes} minutes), terminating...`);
519
+ snowcodeProcess.kill('SIGTERM');
520
520
  // Clean up temp file
521
521
  try {
522
522
  unlinkSync(tmpFile);
@@ -530,25 +530,25 @@ async function executeOpenCode(objective) {
530
530
  });
531
531
  }
532
532
  catch (error) {
533
- cliLogger.error('❌ Error launching OpenCode:', error instanceof Error ? error.message : String(error));
534
- cliLogger.info('📋 Please start OpenCode manually: opencode');
533
+ cliLogger.error('❌ Error launching SnowCode:', error instanceof Error ? error.message : String(error));
534
+ cliLogger.info('📋 Please start SnowCode manually: snowcode');
535
535
  return false;
536
536
  }
537
537
  }
538
- // Real-time monitoring dashboard for OpenCode process
539
- function startMonitoringDashboard(opencodeProcess) {
538
+ // Real-time monitoring dashboard for SnowCode process
539
+ function startMonitoringDashboard(snowcodeProcess) {
540
540
  let iterations = 0;
541
541
  const startTime = Date.now();
542
542
  // Show initial dashboard only once
543
543
  cliLogger.info(`┌─────────────────────────────────────────────────────────────┐`);
544
544
  cliLogger.info(`│ 🚀 Snow-Flow Dashboard v${version_js_1.VERSION} │`);
545
545
  cliLogger.info(`├─────────────────────────────────────────────────────────────┤`);
546
- cliLogger.info(`│ 🤖 OpenCode Status: ✅ Starting │`);
547
- cliLogger.info(`│ 📊 Process ID: ${opencodeProcess.pid || 'N/A'} │`);
546
+ cliLogger.info(`│ 🤖 SnowCode Status: ✅ Starting │`);
547
+ cliLogger.info(`│ 📊 Process ID: ${snowcodeProcess.pid || 'N/A'} │`);
548
548
  cliLogger.info(`│ ⏱️ Session Time: 00:00 │`);
549
549
  cliLogger.info(`│ 🔄 Monitoring Cycles: 0 │`);
550
550
  cliLogger.info('└─────────────────────────────────────────────────────────────┘');
551
- // Silent monitoring - only log to file or memory, don't interfere with OpenCode UI
551
+ // Silent monitoring - only log to file or memory, don't interfere with SnowCode UI
552
552
  const monitoringInterval = setInterval(() => {
553
553
  iterations++;
554
554
  const uptime = Math.floor((Date.now() - startTime) / 1000);
@@ -1363,7 +1363,7 @@ program
1363
1363
  cliLogger.info(` - Primary: ${sessionData.taskAnalysis.primaryAgent}`);
1364
1364
  cliLogger.info(` - Supporting: ${sessionData.taskAnalysis.supportingAgents.join(', ')}`);
1365
1365
  if (launchData && launchData.success) {
1366
- cliLogger.info(`\n✅ Status: OpenCode (or Claude Code) launched successfully`);
1366
+ cliLogger.info(`\n✅ Status: SnowCode (or Claude Code) launched successfully`);
1367
1367
  cliLogger.info(`🚀 Launched at: ${launchData.launched_at}`);
1368
1368
  }
1369
1369
  else if (errorData) {
@@ -1372,11 +1372,11 @@ program
1372
1372
  cliLogger.error(`🕐 Failed at: ${errorData.failed_at}`);
1373
1373
  }
1374
1374
  else {
1375
- cliLogger.info(`\n⏳ Status: Awaiting manual OpenCode execution`);
1375
+ cliLogger.info(`\n⏳ Status: Awaiting manual SnowCode execution`);
1376
1376
  }
1377
1377
  cliLogger.info('\n💡 Tips:');
1378
- cliLogger.info(' - Check OpenCode for real-time agent progress');
1379
- cliLogger.info(' - Use Memory.get("swarm_session_' + sessionId + '") in OpenCode');
1378
+ cliLogger.info(' - Check SnowCode for real-time agent progress');
1379
+ cliLogger.info(' - Use Memory.get("swarm_session_' + sessionId + '") in SnowCode');
1380
1380
  cliLogger.info(' - Monitor TodoRead for task completion status');
1381
1381
  if (options.watch) {
1382
1382
  cliLogger.info(`\n👀 Watching for updates every ${options.interval} seconds...`);
@@ -1387,7 +1387,7 @@ program
1387
1387
  // Re-fetch session data to check for updates
1388
1388
  const updatedSession = memorySystem.getLearning(`session_${sessionId}`);
1389
1389
  if (updatedSession) {
1390
- cliLogger.info(' Status: Active - Check OpenCode for details');
1390
+ cliLogger.info(' Status: Active - Check SnowCode for details');
1391
1391
  }
1392
1392
  }, parseInt(options.interval) * 1000);
1393
1393
  // Handle graceful shutdown
@@ -1480,12 +1480,12 @@ program
1480
1480
  console.log('│ 📋 Recent Activity: │');
1481
1481
  console.log(`│ • ${new Date().toLocaleTimeString()} - System monitoring active │`);
1482
1482
  cliLogger.info('└─────────────────────────────────────────────────────────────┘');
1483
- // Check for active OpenCode/Claude Code processes
1483
+ // Check for active SnowCode/Claude Code processes
1484
1484
  try {
1485
1485
  const { execSync } = require('child_process');
1486
- const processes = execSync('ps aux | grep "claude\\|opencode" | grep -v grep', { encoding: 'utf8' }).toString();
1486
+ const processes = execSync('ps aux | grep "claude\\|opencode\\|snowcode" | grep -v grep', { encoding: 'utf8' }).toString();
1487
1487
  if (processes.trim()) {
1488
- cliLogger.info('\n🤖 Active OpenCode/Claude Code Processes:');
1488
+ cliLogger.info('\n🤖 Active SnowCode/Claude Code Processes:');
1489
1489
  const lines = processes.trim().split('\n');
1490
1490
  lines.forEach((line, index) => {
1491
1491
  if (index < 3) { // Show max 3 processes
@@ -1576,38 +1576,38 @@ program
1576
1576
  console.log('🔐 Creating environment configuration...');
1577
1577
  await createEnvFile(targetDir, options.force);
1578
1578
  // Create MCP configuration - always included now (SPARC is default)
1579
- console.log('🔧 Setting up MCP servers for OpenCode (also works with Claude Code)...');
1579
+ console.log('🔧 Setting up MCP servers for SnowCode (also works with Claude Code)...');
1580
1580
  await createMCPConfig(targetDir, options.force);
1581
1581
  // Copy CLAUDE.md file
1582
1582
  console.log('📚 Creating documentation files...');
1583
1583
  await copyCLAUDEmd(targetDir, options.force);
1584
1584
  // Create README files
1585
1585
  await createReadmeFiles(targetDir, options.force);
1586
- // Copy opencode-config.example.json
1587
- await copyOpenCodeConfig(targetDir, options.force);
1588
- // Copy OpenCode themes
1589
- await copyOpenCodeThemes(targetDir, options.force);
1590
- // Copy OpenCode package.json with snowcode-plugin
1591
- console.log('📦 Configuring OpenCode plugin (snowcode fork)...');
1592
- await copyOpenCodePackageJson(targetDir, options.force);
1586
+ // Copy snowcode-config.example.json
1587
+ await copySnowCodeConfig(targetDir, options.force);
1588
+ // Copy SnowCode themes
1589
+ await copySnowCodeThemes(targetDir, options.force);
1590
+ // Copy SnowCode package.json with snowcode-plugin
1591
+ console.log('📦 Configuring SnowCode plugin (snowcode fork)...');
1592
+ await copySnowCodePackageJson(targetDir, options.force);
1593
1593
  // Copy MCP server management scripts
1594
1594
  console.log('🔧 Setting up MCP server management scripts...');
1595
1595
  await copyMCPServerScripts(targetDir, options.force);
1596
1596
  console.log(chalk_1.default.green.bold('\n✅ Snow-Flow project initialized successfully!'));
1597
1597
  console.log('\n📋 Created Snow-Flow configuration:');
1598
- console.log(' ✓ .opencode/ - OpenCode configuration with both MCP servers');
1599
- console.log(' ✓ .opencode/themes/ - ServiceNow custom theme for OpenCode');
1598
+ console.log(' ✓ .snowcode/ - SnowCode configuration with both MCP servers');
1599
+ console.log(' ✓ .snowcode/themes/ - ServiceNow custom theme for SnowCode');
1600
1600
  console.log(' ✓ .claude/ - Claude Code MCP configuration (backward compatibility)');
1601
1601
  console.log(' ✓ .mcp.json - 2 unified MCP servers (370 tools total)');
1602
- console.log(' ✓ scripts/ - MCP server management and OpenCode launcher');
1603
- console.log(' ✓ AGENTS.md - OpenCode primary instructions');
1602
+ console.log(' ✓ scripts/ - MCP server management and SnowCode launcher');
1603
+ console.log(' ✓ AGENTS.md - SnowCode primary instructions');
1604
1604
  console.log(' ✓ CLAUDE.md - Claude Code compatibility');
1605
1605
  console.log(' ✓ README.md - Complete capabilities documentation');
1606
- console.log(' ✓ OPENCODE-TROUBLESHOOTING.md - Troubleshooting guide');
1606
+ console.log(' ✓ SNOWCODE-TROUBLESHOOTING.md - Troubleshooting guide');
1607
1607
  console.log(' ✓ .snow-flow/ - Project workspace and memory');
1608
1608
  if (!options.skipMcp) {
1609
- // NOTE: MCP servers work with OpenCode's native Task() system
1610
- console.log(chalk_1.default.blue('\nℹ️ MCP servers configured for OpenCode (also compatible with Claude Code)'));
1609
+ // NOTE: MCP servers work with SnowCode's native Task() system
1610
+ console.log(chalk_1.default.blue('\nℹ️ MCP servers configured for SnowCode (also compatible with Claude Code)'));
1611
1611
  console.log(chalk_1.default.green('✅ 411 ServiceNow tools automatically available via 2 unified servers'));
1612
1612
  console.log(chalk_1.default.blue('📋 SDK handles MCP server lifecycle automatically'));
1613
1613
  // Verify MCP servers can actually start
@@ -1653,15 +1653,15 @@ program
1653
1653
  }
1654
1654
  }
1655
1655
  catch (error) {
1656
- console.log(chalk_1.default.yellow('⚠️ MCP servers will start automatically when you launch OpenCode'));
1656
+ console.log(chalk_1.default.yellow('⚠️ MCP servers will start automatically when you launch SnowCode'));
1657
1657
  console.log(chalk_1.default.dim(' Or start manually: ./scripts/mcp-server-manager.sh start'));
1658
1658
  if (error.message.includes('No .env file found')) {
1659
1659
  console.log(chalk_1.default.dim(' 💡 Tip: Configure .env first, then run: ./scripts/mcp-server-manager.sh start'));
1660
1660
  }
1661
1661
  }
1662
1662
  }
1663
- // Check and optionally install OpenCode
1664
- const configImported = await checkAndInstallOpenCode();
1663
+ // Check and optionally install SnowCode
1664
+ const configImported = await checkAndInstallSnowCode();
1665
1665
  console.log(chalk_1.default.blue.bold('\n🎯 Next steps:'));
1666
1666
  console.log('1. Configure credentials: Edit ' + chalk_1.default.cyan('.env'));
1667
1667
  console.log(' - Add your ServiceNow instance URL, username/password or OAuth credentials');
@@ -1669,10 +1669,10 @@ program
1669
1669
  console.log(' - Authenticates with your LLM provider (Claude/OpenAI/Google/Ollama)');
1670
1670
  console.log(' - Then authenticates with ServiceNow OAuth');
1671
1671
  console.log(' - Your provider choice is automatically saved to .env');
1672
- console.log('3. Start developing with OpenCode: ' + chalk_1.default.cyan('./scripts/start-opencode.sh'));
1672
+ console.log('3. Start developing with SnowCode: ' + chalk_1.default.cyan('./scripts/start-snowcode.sh'));
1673
1673
  console.log(' - Smart launcher with pre-flight checks and MCP server management');
1674
1674
  console.log(' - Or use swarm: ' + chalk_1.default.cyan('snow-flow swarm "create incident dashboard"'));
1675
- console.log(' - Or launch OpenCode directly: ' + chalk_1.default.cyan('opencode'));
1675
+ console.log(' - Or launch SnowCode directly: ' + chalk_1.default.cyan('snowcode'));
1676
1676
  console.log('\n📚 Documentation: ' + chalk_1.default.blue('https://github.com/groeimetai/snow-flow'));
1677
1677
  console.log('💡 370+ ServiceNow tools • 2 MCP servers • Multi-LLM support');
1678
1678
  // Force exit to prevent hanging
@@ -1703,7 +1703,7 @@ program
1703
1703
  help Show this help
1704
1704
 
1705
1705
  🎯 Example Usage:
1706
- snow-flow init # Initialize project (auto-configures OpenCode)
1706
+ snow-flow init # Initialize project (auto-configures SnowCode)
1707
1707
  snow-flow auth login # Authenticate (handles LLM + ServiceNow)
1708
1708
  snow-flow auth status # Check authentication status
1709
1709
  snow-flow swarm "create a widget for incident management"
@@ -1744,63 +1744,63 @@ program
1744
1744
  `);
1745
1745
  });
1746
1746
  // Helper functions for init command
1747
- // Check if OpenCode is installed, and offer to install it
1748
- async function checkAndInstallOpenCode() {
1747
+ // Check if SnowCode is installed, and offer to install it
1748
+ async function checkAndInstallSnowCode() {
1749
1749
  const { execSync } = require('child_process');
1750
- let opencodeInstalled = false;
1750
+ let snowcodeInstalled = false;
1751
1751
  try {
1752
- // Check if opencode is already installed
1753
- execSync('which opencode', { stdio: 'ignore' });
1754
- console.log(chalk_1.default.green('\n✅ OpenCode is already installed!'));
1755
- opencodeInstalled = true;
1752
+ // Check if snowcode is already installed
1753
+ execSync('which snowcode', { stdio: 'ignore' });
1754
+ console.log(chalk_1.default.green('\n✅ SnowCode is already installed!'));
1755
+ snowcodeInstalled = true;
1756
1756
  }
1757
1757
  catch {
1758
- // OpenCode not installed
1759
- console.log(chalk_1.default.yellow('\n⚠️ OpenCode is not installed'));
1760
- console.log(chalk_1.default.blue('OpenCode is required to use Snow-Flow with any LLM provider'));
1758
+ // SnowCode not installed
1759
+ console.log(chalk_1.default.yellow('\n⚠️ SnowCode is not installed'));
1760
+ console.log(chalk_1.default.blue('SnowCode is required to use Snow-Flow with any LLM provider'));
1761
1761
  // Import inquirer dynamically
1762
1762
  const inquirer = (await Promise.resolve().then(() => __importStar(require('inquirer')))).default;
1763
1763
  const { shouldInstall } = await inquirer.prompt([
1764
1764
  {
1765
1765
  type: 'confirm',
1766
1766
  name: 'shouldInstall',
1767
- message: 'Would you like to install OpenCode now? (npm install -g opencode-ai)',
1767
+ message: 'Would you like to install SnowCode now? (npm install -g @groeimetai/snowcode)',
1768
1768
  default: true
1769
1769
  }
1770
1770
  ]);
1771
1771
  if (!shouldInstall) {
1772
- console.log(chalk_1.default.yellow('\n⏭️ Skipping OpenCode installation'));
1773
- console.log(chalk_1.default.blue('You can install it later with: ') + chalk_1.default.cyan('npm install -g opencode-ai'));
1772
+ console.log(chalk_1.default.yellow('\n⏭️ Skipping SnowCode installation'));
1773
+ console.log(chalk_1.default.blue('You can install it later with: ') + chalk_1.default.cyan('npm install -g @groeimetai/snowcode'));
1774
1774
  return false;
1775
1775
  }
1776
- // Install OpenCode
1777
- console.log(chalk_1.default.blue('\n📦 Installing OpenCode globally...'));
1776
+ // Install SnowCode
1777
+ console.log(chalk_1.default.blue('\n📦 Installing SnowCode globally...'));
1778
1778
  console.log(chalk_1.default.dim('This may take a minute...'));
1779
1779
  try {
1780
- execSync('npm install -g opencode-ai', { stdio: 'inherit' });
1781
- console.log(chalk_1.default.green('\n✅ OpenCode installed successfully!'));
1782
- opencodeInstalled = true;
1780
+ execSync('npm install -g @groeimetai/snowcode', { stdio: 'inherit' });
1781
+ console.log(chalk_1.default.green('\n✅ SnowCode installed successfully!'));
1782
+ snowcodeInstalled = true;
1783
1783
  }
1784
1784
  catch (error) {
1785
- console.log(chalk_1.default.red('\n❌ Failed to install OpenCode'));
1786
- console.log(chalk_1.default.yellow('Please install it manually: ') + chalk_1.default.cyan('npm install -g opencode-ai'));
1785
+ console.log(chalk_1.default.red('\n❌ Failed to install SnowCode'));
1786
+ console.log(chalk_1.default.yellow('Please install it manually: ') + chalk_1.default.cyan('npm install -g @groeimetai/snowcode'));
1787
1787
  return false;
1788
1788
  }
1789
1789
  }
1790
- // If OpenCode is installed, copy config to .opencode/ directory
1791
- // OpenCode automatically detects config files in project root and .opencode/ directory
1792
- if (opencodeInstalled) {
1793
- const exampleConfigPath = (0, path_1.join)(process.cwd(), 'opencode-config.example.json');
1794
- const opencodeConfigPath = (0, path_1.join)(process.cwd(), '.opencode', 'config.json');
1790
+ // If SnowCode is installed, copy config to .snowcode/ directory
1791
+ // SnowCode automatically detects config files in project root and .snowcode/ directory
1792
+ if (snowcodeInstalled) {
1793
+ const exampleConfigPath = (0, path_1.join)(process.cwd(), 'snowcode-config.example.json');
1794
+ const snowcodeConfigPath = (0, path_1.join)(process.cwd(), '.snowcode', 'config.json');
1795
1795
  // Check if example config file exists
1796
1796
  try {
1797
1797
  await fs_1.promises.access(exampleConfigPath);
1798
- console.log(chalk_1.default.blue('\n🔧 Setting up OpenCode configuration...'));
1798
+ console.log(chalk_1.default.blue('\n🔧 Setting up SnowCode configuration...'));
1799
1799
  try {
1800
- // Copy example config to .opencode/config.json for automatic detection
1800
+ // Copy example config to .snowcode/config.json for automatic detection
1801
1801
  let configContent = await fs_1.promises.readFile(exampleConfigPath, 'utf-8');
1802
1802
  // Ensure the config content has the correct cwd (in case it still has a placeholder)
1803
- // This is a safety check - the placeholder should already be replaced by copyOpenCodeConfig
1803
+ // This is a safety check - the placeholder should already be replaced by copySnowCodeConfig
1804
1804
  if (configContent.includes('"/path/to/your/snow-flow/installation"')) {
1805
1805
  console.log(chalk_1.default.yellow('⚠️ Config still contains placeholder, attempting to fix...'));
1806
1806
  // Determine the snow-flow installation directory
@@ -1833,19 +1833,19 @@ async function checkAndInstallOpenCode() {
1833
1833
  configContent = configContent.replace('"/path/to/your/snow-flow/installation"', `"${snowFlowRoot.replace(/\\/g, '/')}"`);
1834
1834
  }
1835
1835
  }
1836
- await fs_1.promises.writeFile(opencodeConfigPath, configContent);
1837
- console.log(chalk_1.default.green('✅ OpenCode configuration created at .opencode/config.json'));
1838
- console.log(chalk_1.default.blue('💡 OpenCode will automatically detect this configuration'));
1836
+ await fs_1.promises.writeFile(snowcodeConfigPath, configContent);
1837
+ console.log(chalk_1.default.green('✅ SnowCode configuration created at .snowcode/config.json'));
1838
+ console.log(chalk_1.default.blue('💡 SnowCode will automatically detect this configuration'));
1839
1839
  return true; // Successfully configured
1840
1840
  }
1841
1841
  catch (error) {
1842
- console.log(chalk_1.default.yellow('\n⚠️ Could not create OpenCode config'));
1843
- console.log(chalk_1.default.blue('You can copy it manually: ') + chalk_1.default.cyan(`cp opencode-config.example.json .opencode/config.json`));
1842
+ console.log(chalk_1.default.yellow('\n⚠️ Could not create SnowCode config'));
1843
+ console.log(chalk_1.default.blue('You can copy it manually: ') + chalk_1.default.cyan(`cp snowcode-config.example.json .snowcode/config.json`));
1844
1844
  return false;
1845
1845
  }
1846
1846
  }
1847
1847
  catch {
1848
- console.log(chalk_1.default.yellow('\n⚠️ opencode-config.example.json not found'));
1848
+ console.log(chalk_1.default.yellow('\n⚠️ snowcode-config.example.json not found'));
1849
1849
  console.log(chalk_1.default.blue('Config will be available after init completes'));
1850
1850
  return false;
1851
1851
  }
@@ -1906,7 +1906,7 @@ async function createReadmeFiles(targetDir, force = false) {
1906
1906
  await fs_1.promises.writeFile((0, path_1.join)(targetDir, 'servicenow/README.md'), '# ServiceNow Artifacts\n\nThis directory contains generated ServiceNow development artifacts.');
1907
1907
  }
1908
1908
  // Helper functions
1909
- async function copyOpenCodeConfig(targetDir, force = false) {
1909
+ async function copySnowCodeConfig(targetDir, force = false) {
1910
1910
  try {
1911
1911
  // Determine the snow-flow installation directory
1912
1912
  let snowFlowRoot;
@@ -1941,14 +1941,14 @@ async function copyOpenCodeConfig(targetDir, force = false) {
1941
1941
  throw new Error('Could not find snow-flow project root');
1942
1942
  }
1943
1943
  }
1944
- // Try to find the opencode-config.example.json
1944
+ // Try to find the snowcode-config.example.json
1945
1945
  const sourceFiles = [
1946
- (0, path_1.join)(snowFlowRoot, 'opencode-config.example.json'),
1947
- (0, path_1.join)(__dirname, '..', 'opencode-config.example.json'),
1948
- (0, path_1.join)(__dirname, 'opencode-config.example.json'),
1949
- (0, path_1.join)(__dirname, '..', '..', '..', 'opencode-config.example.json'),
1950
- (0, path_1.join)(__dirname, '..', '..', '..', '..', 'opencode-config.example.json'),
1951
- (0, path_1.join)(process.cwd(), 'opencode-config.example.json')
1946
+ (0, path_1.join)(snowFlowRoot, 'snowcode-config.example.json'),
1947
+ (0, path_1.join)(__dirname, '..', 'snowcode-config.example.json'),
1948
+ (0, path_1.join)(__dirname, 'snowcode-config.example.json'),
1949
+ (0, path_1.join)(__dirname, '..', '..', '..', 'snowcode-config.example.json'),
1950
+ (0, path_1.join)(__dirname, '..', '..', '..', '..', 'snowcode-config.example.json'),
1951
+ (0, path_1.join)(process.cwd(), 'snowcode-config.example.json')
1952
1952
  ];
1953
1953
  let foundSource = false;
1954
1954
  let configContent = '';
@@ -1956,7 +1956,7 @@ async function copyOpenCodeConfig(targetDir, force = false) {
1956
1956
  try {
1957
1957
  configContent = await fs_1.promises.readFile(sourcePath, 'utf8');
1958
1958
  foundSource = true;
1959
- console.log(`✅ Found opencode-config.example.json at: ${sourcePath}`);
1959
+ console.log(`✅ Found snowcode-config.example.json at: ${sourcePath}`);
1960
1960
  break;
1961
1961
  }
1962
1962
  catch {
@@ -1964,19 +1964,19 @@ async function copyOpenCodeConfig(targetDir, force = false) {
1964
1964
  }
1965
1965
  }
1966
1966
  if (!foundSource) {
1967
- console.log('⚠️ Could not find opencode-config.example.json source file');
1967
+ console.log('⚠️ Could not find snowcode-config.example.json source file');
1968
1968
  return;
1969
1969
  }
1970
1970
  // Replace placeholders with actual snow-flow installation path
1971
1971
  configContent = configContent.replace('"/path/to/your/snow-flow/installation"', `"${snowFlowRoot.replace(/\\/g, '/')}"`);
1972
- const targetPath = (0, path_1.join)(targetDir, 'opencode-config.example.json');
1972
+ const targetPath = (0, path_1.join)(targetDir, 'snowcode-config.example.json');
1973
1973
  try {
1974
1974
  await fs_1.promises.access(targetPath);
1975
1975
  if (force) {
1976
- console.log('⚠️ opencode-config.example.json already exists, overwriting with --force flag');
1976
+ console.log('⚠️ snowcode-config.example.json already exists, overwriting with --force flag');
1977
1977
  }
1978
1978
  else {
1979
- console.log('✅ opencode-config.example.json already exists');
1979
+ console.log('✅ snowcode-config.example.json already exists');
1980
1980
  return;
1981
1981
  }
1982
1982
  }
@@ -1984,15 +1984,15 @@ async function copyOpenCodeConfig(targetDir, force = false) {
1984
1984
  // File doesn't exist, continue with creation
1985
1985
  }
1986
1986
  await fs_1.promises.writeFile(targetPath, configContent);
1987
- console.log('✅ Created opencode-config.example.json with correct snow-flow path');
1987
+ console.log('✅ Created snowcode-config.example.json with correct snow-flow path');
1988
1988
  }
1989
1989
  catch (error) {
1990
- console.error('❌ Error copying opencode-config.example.json:', error);
1990
+ console.error('❌ Error copying snowcode-config.example.json:', error);
1991
1991
  }
1992
1992
  }
1993
- async function copyOpenCodeThemes(targetDir, force = false) {
1993
+ async function copySnowCodeThemes(targetDir, force = false) {
1994
1994
  try {
1995
- // Determine the snow-flow installation directory (same logic as copyOpenCodeConfig)
1995
+ // Determine the snow-flow installation directory (same logic as copySnowCodeConfig)
1996
1996
  let snowFlowRoot;
1997
1997
  const isGlobalInstall = __dirname.includes('node_modules/snow-flow') ||
1998
1998
  __dirname.includes('node_modules/.pnpm') ||
@@ -2026,8 +2026,8 @@ async function copyOpenCodeThemes(targetDir, force = false) {
2026
2026
  (0, path_1.join)(snowFlowRoot, 'themes'),
2027
2027
  (0, path_1.join)(__dirname, '..', 'themes'),
2028
2028
  (0, path_1.join)(__dirname, 'themes'),
2029
- (0, path_1.join)(snowFlowRoot, '.opencode', 'themes'),
2030
- (0, path_1.join)(__dirname, '..', '.opencode', 'themes')
2029
+ (0, path_1.join)(snowFlowRoot, '.snowcode', 'themes'),
2030
+ (0, path_1.join)(__dirname, '..', '.snowcode', 'themes')
2031
2031
  ];
2032
2032
  let themesSourceDir = null;
2033
2033
  for (const sourcePath of themesSourcePaths) {
@@ -2045,8 +2045,8 @@ async function copyOpenCodeThemes(targetDir, force = false) {
2045
2045
  console.log('⚠️ Could not find themes directory, skipping theme installation');
2046
2046
  return;
2047
2047
  }
2048
- // Create target .opencode/themes directory
2049
- const themesTargetDir = (0, path_1.join)(targetDir, '.opencode', 'themes');
2048
+ // Create target .snowcode/themes directory
2049
+ const themesTargetDir = (0, path_1.join)(targetDir, '.snowcode', 'themes');
2050
2050
  await fs_1.promises.mkdir(themesTargetDir, { recursive: true });
2051
2051
  // Copy all theme files
2052
2052
  const themeFiles = await fs_1.promises.readdir(themesSourceDir);
@@ -2078,14 +2078,14 @@ async function copyOpenCodeThemes(targetDir, force = false) {
2078
2078
  }
2079
2079
  }
2080
2080
  if (copiedCount > 0) {
2081
- console.log(`✅ Copied ${copiedCount} OpenCode theme file(s) to .opencode/themes/`);
2081
+ console.log(`✅ Copied ${copiedCount} SnowCode theme file(s) to .snowcode/themes/`);
2082
2082
  }
2083
2083
  }
2084
2084
  catch (error) {
2085
- console.error('❌ Error copying OpenCode themes:', error);
2085
+ console.error('❌ Error copying SnowCode themes:', error);
2086
2086
  }
2087
2087
  }
2088
- async function copyOpenCodePackageJson(targetDir, force = false) {
2088
+ async function copySnowCodePackageJson(targetDir, force = false) {
2089
2089
  try {
2090
2090
  // Determine the snow-flow installation directory
2091
2091
  let snowFlowRoot;
@@ -2116,11 +2116,11 @@ async function copyOpenCodePackageJson(targetDir, force = false) {
2116
2116
  throw new Error('Could not find snow-flow project root');
2117
2117
  }
2118
2118
  }
2119
- // Find opencode package.json template
2119
+ // Find snowcode package.json template
2120
2120
  const templateSourcePaths = [
2121
- (0, path_1.join)(snowFlowRoot, 'templates', 'opencode-package.json'),
2122
- (0, path_1.join)(__dirname, '..', 'templates', 'opencode-package.json'),
2123
- (0, path_1.join)(__dirname, 'templates', 'opencode-package.json')
2121
+ (0, path_1.join)(snowFlowRoot, 'templates', 'snowcode-package.json'),
2122
+ (0, path_1.join)(__dirname, '..', 'templates', 'snowcode-package.json'),
2123
+ (0, path_1.join)(__dirname, 'templates', 'snowcode-package.json')
2124
2124
  ];
2125
2125
  let templatePath = null;
2126
2126
  for (const sourcePath of templateSourcePaths) {
@@ -2134,19 +2134,19 @@ async function copyOpenCodePackageJson(targetDir, force = false) {
2134
2134
  }
2135
2135
  }
2136
2136
  if (!templatePath) {
2137
- console.log('⚠️ OpenCode package.json template not found, OpenCode will use default plugin');
2137
+ console.log('⚠️ SnowCode package.json template not found, SnowCode will use default plugin');
2138
2138
  return;
2139
2139
  }
2140
- // Create .opencode directory
2141
- const opencodeDir = (0, path_1.join)(targetDir, '.opencode');
2142
- await fs_1.promises.mkdir(opencodeDir, { recursive: true });
2140
+ // Create .snowcode directory
2141
+ const snowcodeDir = (0, path_1.join)(targetDir, '.snowcode');
2142
+ await fs_1.promises.mkdir(snowcodeDir, { recursive: true });
2143
2143
  // Copy package.json template
2144
- const targetPath = (0, path_1.join)(opencodeDir, 'package.json');
2144
+ const targetPath = (0, path_1.join)(snowcodeDir, 'package.json');
2145
2145
  // Check if file already exists
2146
2146
  try {
2147
2147
  await fs_1.promises.access(targetPath);
2148
2148
  if (!force) {
2149
- console.log('✅ .opencode/package.json already exists (snowcode-plugin configured)');
2149
+ console.log('✅ .snowcode/package.json already exists (snowcode-plugin configured)');
2150
2150
  return;
2151
2151
  }
2152
2152
  }
@@ -2154,10 +2154,10 @@ async function copyOpenCodePackageJson(targetDir, force = false) {
2154
2154
  // File doesn't exist, we can create it
2155
2155
  }
2156
2156
  await fs_1.promises.copyFile(templatePath, targetPath);
2157
- console.log('✅ Created .opencode/package.json with @groeimetai/snowcode-plugin');
2157
+ console.log('✅ Created .snowcode/package.json with @groeimetai/snowcode-plugin');
2158
2158
  }
2159
2159
  catch (error) {
2160
- console.error('❌ Error copying OpenCode package.json:', error);
2160
+ console.error('❌ Error copying SnowCode package.json:', error);
2161
2161
  }
2162
2162
  }
2163
2163
  /**
@@ -2168,8 +2168,8 @@ async function verifyMCPServers(targetDir) {
2168
2168
  const path = require('path');
2169
2169
  const fs = require('fs').promises;
2170
2170
  try {
2171
- // Read OpenCode configuration
2172
- const configPath = path.join(targetDir, '.opencode', 'opencode.json');
2171
+ // Read SnowCode configuration
2172
+ const configPath = path.join(targetDir, '.snowcode', 'snowcode.json');
2173
2173
  const configContent = await fs.readFile(configPath, 'utf-8');
2174
2174
  const config = JSON.parse(configContent);
2175
2175
  if (!config.mcp) {
@@ -2271,7 +2271,7 @@ async function verifyMCPServers(targetDir) {
2271
2271
  }
2272
2272
  catch (error) {
2273
2273
  console.log(chalk_1.default.yellow(` ⚠️ Could not verify MCP servers: ${error.message}`));
2274
- console.log(chalk_1.default.dim(' Servers will be tested when OpenCode starts'));
2274
+ console.log(chalk_1.default.dim(' Servers will be tested when SnowCode starts'));
2275
2275
  }
2276
2276
  }
2277
2277
  async function copyMCPServerScripts(targetDir, force = false) {
@@ -2333,7 +2333,7 @@ async function copyMCPServerScripts(targetDir, force = false) {
2333
2333
  // Copy specific scripts
2334
2334
  const scriptFiles = [
2335
2335
  'mcp-server-manager.sh',
2336
- 'start-opencode.sh'
2336
+ 'start-snowcode.sh'
2337
2337
  ];
2338
2338
  let copiedCount = 0;
2339
2339
  for (const scriptFile of scriptFiles) {
@@ -2363,11 +2363,11 @@ async function copyMCPServerScripts(targetDir, force = false) {
2363
2363
  console.log(`✅ Copied ${copiedCount} MCP server management script(s) to scripts/`);
2364
2364
  console.log(`✅ Scripts are executable and ready to use`);
2365
2365
  }
2366
- // Also copy OPENCODE-TROUBLESHOOTING.md to project root
2366
+ // Also copy SNOWCODE-TROUBLESHOOTING.md to project root
2367
2367
  const troubleshootingSourcePaths = [
2368
- (0, path_1.join)(snowFlowRoot, 'OPENCODE-TROUBLESHOOTING.md'),
2369
- (0, path_1.join)(__dirname, '..', 'OPENCODE-TROUBLESHOOTING.md'),
2370
- (0, path_1.join)(__dirname, 'OPENCODE-TROUBLESHOOTING.md')
2368
+ (0, path_1.join)(snowFlowRoot, 'SNOWCODE-TROUBLESHOOTING.md'),
2369
+ (0, path_1.join)(__dirname, '..', 'SNOWCODE-TROUBLESHOOTING.md'),
2370
+ (0, path_1.join)(__dirname, 'SNOWCODE-TROUBLESHOOTING.md')
2371
2371
  ];
2372
2372
  let troubleshootingSourcePath = null;
2373
2373
  for (const sourcePath of troubleshootingSourcePaths) {
@@ -2381,22 +2381,22 @@ async function copyMCPServerScripts(targetDir, force = false) {
2381
2381
  }
2382
2382
  }
2383
2383
  if (troubleshootingSourcePath) {
2384
- const targetPath = (0, path_1.join)(targetDir, 'OPENCODE-TROUBLESHOOTING.md');
2384
+ const targetPath = (0, path_1.join)(targetDir, 'SNOWCODE-TROUBLESHOOTING.md');
2385
2385
  try {
2386
2386
  await fs_1.promises.access(targetPath);
2387
2387
  if (!force) {
2388
- console.log(`✅ OPENCODE-TROUBLESHOOTING.md already exists`);
2388
+ console.log(`✅ SNOWCODE-TROUBLESHOOTING.md already exists`);
2389
2389
  }
2390
2390
  else {
2391
2391
  const content = await fs_1.promises.readFile(troubleshootingSourcePath, 'utf8');
2392
2392
  await fs_1.promises.writeFile(targetPath, content);
2393
- console.log(`✅ Created OPENCODE-TROUBLESHOOTING.md`);
2393
+ console.log(`✅ Created SNOWCODE-TROUBLESHOOTING.md`);
2394
2394
  }
2395
2395
  }
2396
2396
  catch {
2397
2397
  const content = await fs_1.promises.readFile(troubleshootingSourcePath, 'utf8');
2398
2398
  await fs_1.promises.writeFile(targetPath, content);
2399
- console.log(`✅ Created OPENCODE-TROUBLESHOOTING.md`);
2399
+ console.log(`✅ Created SNOWCODE-TROUBLESHOOTING.md`);
2400
2400
  }
2401
2401
  }
2402
2402
  }
@@ -2485,7 +2485,7 @@ async function copyCLAUDEmd(targetDir, force = false) {
2485
2485
  await fs_1.promises.writeFile(claudeMdPath, claudeMdContent);
2486
2486
  console.log('✅ Created CLAUDE.md (Primary instructions)');
2487
2487
  }
2488
- // Create AGENTS.md (identical copy for OpenCode compatibility)
2488
+ // Create AGENTS.md (identical copy for SnowCode compatibility)
2489
2489
  const agentsMdPath = (0, path_1.join)(targetDir, 'AGENTS.md');
2490
2490
  try {
2491
2491
  await fs_1.promises.access(agentsMdPath);
@@ -2499,18 +2499,18 @@ async function copyCLAUDEmd(targetDir, force = false) {
2499
2499
  }
2500
2500
  catch {
2501
2501
  await fs_1.promises.writeFile(agentsMdPath, agentsMdContent);
2502
- console.log('✅ Created AGENTS.md (Identical copy for OpenCode compatibility)');
2502
+ console.log('✅ Created AGENTS.md (Identical copy for SnowCode compatibility)');
2503
2503
  }
2504
- // Create .opencode/ directory structure
2505
- const opencodeDir = (0, path_1.join)(targetDir, '.opencode');
2506
- const agentsDir = (0, path_1.join)(opencodeDir, 'agent'); // Singular 'agent' as required by OpenCode
2507
- const modesDir = (0, path_1.join)(opencodeDir, 'modes');
2504
+ // Create .snowcode/ directory structure
2505
+ const snowcodeDir = (0, path_1.join)(targetDir, '.snowcode');
2506
+ const agentsDir = (0, path_1.join)(snowcodeDir, 'agent'); // Singular 'agent' as required by SnowCode
2507
+ const modesDir = (0, path_1.join)(snowcodeDir, 'modes');
2508
2508
  try {
2509
- await fs_1.promises.mkdir(opencodeDir, { recursive: true });
2509
+ await fs_1.promises.mkdir(snowcodeDir, { recursive: true });
2510
2510
  await fs_1.promises.mkdir(agentsDir, { recursive: true });
2511
2511
  await fs_1.promises.mkdir(modesDir, { recursive: true });
2512
- console.log('✅ Created .opencode/ directory structure');
2513
- // Copy agent files from .claude/ to .opencode/agent/ (if they exist)
2512
+ console.log('✅ Created .snowcode/ directory structure');
2513
+ // Copy agent files from .claude/ to .snowcode/agent/ (if they exist)
2514
2514
  const sourceAgentsDir = (0, path_1.join)(__dirname, '..', '.claude', 'agents');
2515
2515
  try {
2516
2516
  const agentFiles = await fs_1.promises.readdir(sourceAgentsDir);
@@ -2522,20 +2522,20 @@ async function copyCLAUDEmd(targetDir, force = false) {
2522
2522
  await fs_1.promises.writeFile(targetFile, content);
2523
2523
  }
2524
2524
  }
2525
- console.log('✅ Copied agent configurations to .opencode/agent/');
2525
+ console.log('✅ Copied agent configurations to .snowcode/agent/');
2526
2526
  }
2527
2527
  catch (err) {
2528
- // Silently continue - agent configs are in opencode.json, not separate files
2528
+ // Silently continue - agent configs are in snowcode.json, not separate files
2529
2529
  }
2530
- // Create .opencode/opencode.json with both MCP servers
2531
- // CRITICAL: Use ABSOLUTE paths so OpenCode can find the servers!
2530
+ // Create .snowcode/snowcode.json with both MCP servers
2531
+ // CRITICAL: Use ABSOLUTE paths so SnowCode can find the servers!
2532
2532
  const distPath = (0, path_1.join)(snowFlowRoot, 'dist');
2533
- // CRITICAL: OpenCode expects command as array with all parts
2534
- // Also: environment variables are inherited from parent process (OpenCode reads .env)
2535
- const opencodeConfig = {
2533
+ // CRITICAL: SnowCode expects command as array with all parts
2534
+ // Also: environment variables are inherited from parent process (SnowCode reads .env)
2535
+ const snowcodeConfig = {
2536
2536
  $schema: "https://opencode.ai/config.json",
2537
2537
  name: "snow-flow",
2538
- description: "ServiceNow development with OpenCode and multi-LLM support",
2538
+ description: "ServiceNow development with SnowCode and multi-LLM support",
2539
2539
  mcp: {
2540
2540
  "servicenow-unified": {
2541
2541
  type: "local",
@@ -2560,20 +2560,20 @@ async function copyCLAUDEmd(targetDir, force = false) {
2560
2560
  "../AGENTS.md"
2561
2561
  ]
2562
2562
  };
2563
- // Write both opencode.json AND config.json (Claude uses config.json)
2564
- const opencodeConfigPath = (0, path_1.join)(opencodeDir, 'opencode.json');
2565
- const configJsonPath = (0, path_1.join)(opencodeDir, 'config.json');
2566
- await fs_1.promises.writeFile(opencodeConfigPath, JSON.stringify(opencodeConfig, null, 2));
2567
- await fs_1.promises.writeFile(configJsonPath, JSON.stringify(opencodeConfig, null, 2));
2568
- console.log('✅ Created .opencode/opencode.json with both MCP servers');
2569
- console.log('✅ Created .opencode/config.json (for Claude compatibility)');
2570
- // Also create AGENTS.md in .opencode/
2571
- const opencodeAgentsMdPath = (0, path_1.join)(opencodeDir, 'AGENTS.md');
2572
- await fs_1.promises.writeFile(opencodeAgentsMdPath, agentsMdContent);
2573
- console.log('✅ Created .opencode/AGENTS.md');
2563
+ // Write both snowcode.json AND config.json (Claude uses config.json)
2564
+ const snowcodeConfigPath = (0, path_1.join)(snowcodeDir, 'snowcode.json');
2565
+ const configJsonPath = (0, path_1.join)(snowcodeDir, 'config.json');
2566
+ await fs_1.promises.writeFile(snowcodeConfigPath, JSON.stringify(snowcodeConfig, null, 2));
2567
+ await fs_1.promises.writeFile(configJsonPath, JSON.stringify(snowcodeConfig, null, 2));
2568
+ console.log('✅ Created .snowcode/snowcode.json with both MCP servers');
2569
+ console.log('✅ Created .snowcode/config.json (for Claude compatibility)');
2570
+ // Also create AGENTS.md in .snowcode/
2571
+ const snowcodeAgentsMdPath = (0, path_1.join)(snowcodeDir, 'AGENTS.md');
2572
+ await fs_1.promises.writeFile(snowcodeAgentsMdPath, agentsMdContent);
2573
+ console.log('✅ Created .snowcode/AGENTS.md');
2574
2574
  }
2575
2575
  catch (error) {
2576
- console.log('⚠️ Error creating .opencode/ directory:', error instanceof Error ? error.message : String(error));
2576
+ console.log('⚠️ Error creating .snowcode/ directory:', error instanceof Error ? error.message : String(error));
2577
2577
  }
2578
2578
  }
2579
2579
  catch (error) {
@@ -3105,8 +3105,8 @@ program
3105
3105
  console.log('\n📝 Updating MCP configuration...');
3106
3106
  await setupMCPConfig(process.cwd(), instanceUrl, clientId, clientSecret, options.force || false);
3107
3107
  console.log(chalk_1.default.green('\n✅ MCP configuration refreshed successfully!'));
3108
- console.log('\n📢 IMPORTANT: Restart OpenCode (or Claude Code) to use the new configuration:');
3109
- console.log(chalk_1.default.cyan(' OpenCode: opencode'));
3108
+ console.log('\n📢 IMPORTANT: Restart SnowCode (or Claude Code) to use the new configuration:');
3109
+ console.log(chalk_1.default.cyan(' SnowCode: snowcode'));
3110
3110
  console.log(chalk_1.default.cyan(' Claude Code: claude --mcp-config .mcp.json'));
3111
3111
  console.log('\n💡 The Local Development server now includes:');
3112
3112
  console.log(' • Universal artifact detection via sys_metadata');
@@ -3137,16 +3137,16 @@ program
3137
3137
  // MCP Server command with subcommands
3138
3138
  program
3139
3139
  .command('mcp <action>')
3140
- .description('Manage ServiceNow MCP servers for OpenCode integration')
3140
+ .description('Manage ServiceNow MCP servers for SnowCode integration')
3141
3141
  .option('--server <name>', 'Specific server name to manage')
3142
3142
  .option('--port <port>', 'Port for MCP server (default: auto)')
3143
3143
  .option('--host <host>', 'Host for MCP server (default: localhost)')
3144
3144
  .action(async (action, options) => {
3145
- // NOTE: MCP servers work with OpenCode's native Task() system
3146
- console.log(chalk_1.default.blue('ℹ️ MCP servers configured for OpenCode (also compatible with Claude Code)'));
3145
+ // NOTE: MCP servers work with SnowCode's native Task() system
3146
+ console.log(chalk_1.default.blue('ℹ️ MCP servers configured for SnowCode (also compatible with Claude Code)'));
3147
3147
  console.log(chalk_1.default.yellow('⚠️ Manual MCP commands are no longer needed'));
3148
- console.log(chalk_1.default.green('✅ OpenCode automatically handles all MCP server lifecycle'));
3149
- console.log(chalk_1.default.blue('\n💡 Simply run your swarm commands - OpenCode handles the rest!'));
3148
+ console.log(chalk_1.default.green('✅ SnowCode automatically handles all MCP server lifecycle'));
3149
+ console.log(chalk_1.default.blue('\n💡 Simply run your swarm commands - SnowCode handles the rest!'));
3150
3150
  return;
3151
3151
  });
3152
3152
  // MCP action handlers
@@ -3171,9 +3171,9 @@ async function handleMCPStart(manager, options) {
3171
3171
  const total = status.length;
3172
3172
  console.log(`\n✅ Started ${running}/${total} MCP servers`);
3173
3173
  if (running === total) {
3174
- console.log('🎉 All MCP servers are now running and available in OpenCode!');
3174
+ console.log('🎉 All MCP servers are now running and available in SnowCode!');
3175
3175
  console.log('\n📋 Next steps:');
3176
- console.log(' 1. Open OpenCode (or Claude Code)');
3176
+ console.log(' 1. Open SnowCode (or Claude Code)');
3177
3177
  console.log(' 2. MCP tools will be automatically available');
3178
3178
  console.log(' 3. Use snow_deploy_widget, snow_deploy_flow, etc.');
3179
3179
  }
@@ -3252,7 +3252,7 @@ async function handleMCPStatus(manager, options) {
3252
3252
  const total = servers.length;
3253
3253
  console.log(`📈 Summary: ${running}/${total} servers running`);
3254
3254
  if (running === total) {
3255
- console.log('🎉 All MCP servers are operational and available in OpenCode (or Claude Code)!');
3255
+ console.log('🎉 All MCP servers are operational and available in SnowCode (or Claude Code)!');
3256
3256
  }
3257
3257
  else if (running > 0) {
3258
3258
  console.log('⚠️ Some servers are not running. Use "snow-flow mcp start" to start them.');
@@ -3362,22 +3362,22 @@ async function handleMCPDebug(options) {
3362
3362
  console.log(` SNOW_INSTANCE: ${process.env.SNOW_INSTANCE ? '✅ Set' : '❌ Not set'}`);
3363
3363
  console.log(` SNOW_CLIENT_ID: ${process.env.SNOW_CLIENT_ID ? '✅ Set' : '❌ Not set'}`);
3364
3364
  console.log(` SNOW_CLIENT_SECRET: ${process.env.SNOW_CLIENT_SECRET ? '✅ Set' : '❌ Not set'}`);
3365
- // Check OpenCode
3366
- console.log('\n🤖 OpenCode:');
3365
+ // Check SnowCode
3366
+ console.log('\n🤖 SnowCode:');
3367
3367
  const { execSync } = require('child_process');
3368
3368
  try {
3369
- execSync('which opencode', { stdio: 'ignore' });
3370
- console.log(' ✅ OpenCode CLI found');
3369
+ execSync('which snowcode', { stdio: 'ignore' });
3370
+ console.log(' ✅ SnowCode CLI found');
3371
3371
  }
3372
3372
  catch {
3373
- console.log(' ❌ OpenCode CLI not found in PATH');
3374
- console.log(' 💡 Install with: npm install -g opencode-ai');
3373
+ console.log(' ❌ SnowCode CLI not found in PATH');
3374
+ console.log(' 💡 Install with: npm install -g @groeimetai/snowcode');
3375
3375
  }
3376
3376
  console.log('\n💡 Tips:');
3377
- console.log(' 1. Ensure OpenCode is configured: opencode config import opencode-config.example.json');
3377
+ console.log(' 1. Ensure SnowCode is configured: snowcode config import snowcode-config.example.json');
3378
3378
  console.log(' 2. Check .env file has valid ServiceNow credentials and LLM API keys');
3379
3379
  console.log(' 3. Start developing: snow-flow swarm "your objective"');
3380
- console.log(' 4. OpenCode will automatically connect to Snow-Flow\'s MCP servers');
3380
+ console.log(' 4. SnowCode will automatically connect to Snow-Flow\'s MCP servers');
3381
3381
  }
3382
3382
  // SPARC Detailed Help Command - DISABLED (sparc-help.js file missing)
3383
3383
  // program