snow-flow 1.4.2 → 1.4.4

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 +45 -61
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2096,23 +2096,24 @@ program
2096
2096
  console.log(' ✓ CLAUDE.md - Development documentation');
2097
2097
  console.log(' ✓ README.md - Project documentation');
2098
2098
  if (!options.skipMcp) {
2099
- console.log(chalk_1.default.yellow.bold('\n🚀 Ready to activate MCP servers in Claude Code!'));
2100
- console.log('\nWould you like to start Claude Code with MCP servers automatically? (Y/n)');
2101
- const readline = await Promise.resolve().then(() => __importStar(require('readline')));
2102
- const rl = readline.createInterface({
2103
- input: process.stdin,
2104
- output: process.stdout
2105
- });
2106
- const answer = await new Promise(resolve => {
2107
- rl.question('> ', resolve);
2108
- });
2109
- rl.close();
2110
- if (!answer || answer.toLowerCase() === 'y') {
2111
- await activateMCPServers();
2099
+ // Start MCP servers automatically
2100
+ console.log(chalk_1.default.yellow.bold('\n🚀 Starting MCP servers in the background...'));
2101
+ try {
2102
+ const { MCPServerManager } = await Promise.resolve().then(() => __importStar(require('./utils/mcp-server-manager.js')));
2103
+ const manager = new MCPServerManager();
2104
+ await manager.initialize();
2105
+ console.log('📡 Starting all ServiceNow MCP servers...');
2106
+ await manager.startAllServers();
2107
+ const status = manager.getServerStatus();
2108
+ const running = status.filter((s) => s.status === 'running').length;
2109
+ const total = status.length;
2110
+ console.log(chalk_1.default.green(`✅ Started ${running}/${total} MCP servers successfully!`));
2111
+ console.log(chalk_1.default.blue('\n📋 MCP servers are now running in the background'));
2112
+ console.log('🎯 They will be available when you run swarm commands');
2112
2113
  }
2113
- else {
2114
- console.log('\n📝 To activate MCP servers manually later, run:');
2115
- console.log(chalk_1.default.cyan(' claude --mcp-config .mcp.json .'));
2114
+ catch (error) {
2115
+ console.log(chalk_1.default.yellow('\n⚠️ Could not start MCP servers automatically'));
2116
+ console.log('📝 You can start them manually with: ' + chalk_1.default.cyan('snow-flow mcp start'));
2116
2117
  }
2117
2118
  }
2118
2119
  }
@@ -4453,12 +4454,29 @@ async function checkNeo4jAvailability() {
4453
4454
  }
4454
4455
  }
4455
4456
  async function createMCPConfig(targetDir) {
4457
+ // Determine the snow-flow installation directory
4458
+ let snowFlowRoot;
4459
+ // Check if we're in a global npm installation
4460
+ const isGlobalInstall = __dirname.includes('node_modules/snow-flow') ||
4461
+ __dirname.includes('node_modules/.pnpm') ||
4462
+ __dirname.includes('npm/snow-flow');
4463
+ if (isGlobalInstall) {
4464
+ // For global installs, find the snow-flow package root
4465
+ const parts = __dirname.split(/node_modules[\/\\]/);
4466
+ snowFlowRoot = parts[0] + 'node_modules/snow-flow';
4467
+ }
4468
+ else {
4469
+ // For local development or local install
4470
+ snowFlowRoot = process.cwd();
4471
+ }
4472
+ // Ensure we have the correct path to dist directory
4473
+ const distPath = (0, path_1.join)(snowFlowRoot, 'dist');
4456
4474
  // Create the correct .mcp.json file for Claude Code discovery
4457
4475
  const mcpConfig = {
4458
4476
  "mcpServers": {
4459
4477
  "servicenow-deployment": {
4460
4478
  "command": "node",
4461
- "args": ["dist/mcp/servicenow-deployment-mcp.js"],
4479
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-deployment-mcp.js")],
4462
4480
  "env": {
4463
4481
  "SNOW_INSTANCE": "${SNOW_INSTANCE}",
4464
4482
  "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
@@ -4467,7 +4485,7 @@ async function createMCPConfig(targetDir) {
4467
4485
  },
4468
4486
  "servicenow-flow-composer": {
4469
4487
  "command": "node",
4470
- "args": ["dist/mcp/servicenow-flow-composer-mcp.js"],
4488
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-flow-composer-mcp.js")],
4471
4489
  "env": {
4472
4490
  "SNOW_INSTANCE": "${SNOW_INSTANCE}",
4473
4491
  "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
@@ -4476,7 +4494,7 @@ async function createMCPConfig(targetDir) {
4476
4494
  },
4477
4495
  "servicenow-update-set": {
4478
4496
  "command": "node",
4479
- "args": ["dist/mcp/servicenow-update-set-mcp.js"],
4497
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-update-set-mcp.js")],
4480
4498
  "env": {
4481
4499
  "SNOW_INSTANCE": "${SNOW_INSTANCE}",
4482
4500
  "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
@@ -4485,7 +4503,7 @@ async function createMCPConfig(targetDir) {
4485
4503
  },
4486
4504
  "servicenow-intelligent": {
4487
4505
  "command": "node",
4488
- "args": ["dist/mcp/servicenow-intelligent-mcp.js"],
4506
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-intelligent-mcp.js")],
4489
4507
  "env": {
4490
4508
  "SNOW_INSTANCE": "${SNOW_INSTANCE}",
4491
4509
  "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
@@ -4494,7 +4512,7 @@ async function createMCPConfig(targetDir) {
4494
4512
  },
4495
4513
  "servicenow-graph-memory": {
4496
4514
  "command": "node",
4497
- "args": ["dist/mcp/servicenow-graph-memory-mcp.js"],
4515
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-graph-memory-mcp.js")],
4498
4516
  "env": {
4499
4517
  "NEO4J_URI": "${NEO4J_URI}",
4500
4518
  "NEO4J_USER": "${NEO4J_USER}",
@@ -4506,7 +4524,7 @@ async function createMCPConfig(targetDir) {
4506
4524
  },
4507
4525
  "servicenow-operations": {
4508
4526
  "command": "node",
4509
- "args": ["dist/mcp/servicenow-operations-mcp.js"],
4527
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-operations-mcp.js")],
4510
4528
  "env": {
4511
4529
  "SNOW_INSTANCE": "${SNOW_INSTANCE}",
4512
4530
  "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
@@ -4515,7 +4533,7 @@ async function createMCPConfig(targetDir) {
4515
4533
  },
4516
4534
  "servicenow-platform-development": {
4517
4535
  "command": "node",
4518
- "args": ["dist/mcp/servicenow-platform-development-mcp.js"],
4536
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-platform-development-mcp.js")],
4519
4537
  "env": {
4520
4538
  "SNOW_INSTANCE": "${SNOW_INSTANCE}",
4521
4539
  "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
@@ -4524,7 +4542,7 @@ async function createMCPConfig(targetDir) {
4524
4542
  },
4525
4543
  "servicenow-integration": {
4526
4544
  "command": "node",
4527
- "args": ["dist/mcp/servicenow-integration-mcp.js"],
4545
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-integration-mcp.js")],
4528
4546
  "env": {
4529
4547
  "SNOW_INSTANCE": "${SNOW_INSTANCE}",
4530
4548
  "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
@@ -4533,7 +4551,7 @@ async function createMCPConfig(targetDir) {
4533
4551
  },
4534
4552
  "servicenow-automation": {
4535
4553
  "command": "node",
4536
- "args": ["dist/mcp/servicenow-automation-mcp.js"],
4554
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-automation-mcp.js")],
4537
4555
  "env": {
4538
4556
  "SNOW_INSTANCE": "${SNOW_INSTANCE}",
4539
4557
  "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
@@ -4542,7 +4560,7 @@ async function createMCPConfig(targetDir) {
4542
4560
  },
4543
4561
  "servicenow-security-compliance": {
4544
4562
  "command": "node",
4545
- "args": ["dist/mcp/servicenow-security-compliance-mcp.js"],
4563
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-security-compliance-mcp.js")],
4546
4564
  "env": {
4547
4565
  "SNOW_INSTANCE": "${SNOW_INSTANCE}",
4548
4566
  "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
@@ -4551,7 +4569,7 @@ async function createMCPConfig(targetDir) {
4551
4569
  },
4552
4570
  "servicenow-reporting-analytics": {
4553
4571
  "command": "node",
4554
- "args": ["dist/mcp/servicenow-reporting-analytics-mcp.js"],
4572
+ "args": [(0, path_1.join)(distPath, "mcp/servicenow-reporting-analytics-mcp.js")],
4555
4573
  "env": {
4556
4574
  "SNOW_INSTANCE": "${SNOW_INSTANCE}",
4557
4575
  "SNOW_CLIENT_ID": "${SNOW_CLIENT_ID}",
@@ -5202,40 +5220,6 @@ program
5202
5220
  // ===================================================
5203
5221
  // 🎯 INTEGRATE SNOW-FLOW HIVE-MIND SYSTEM
5204
5222
  // ===================================================
5205
- async function activateMCPServers() {
5206
- console.log(chalk_1.default.blue.bold('\n🚀 Activating MCP servers in Claude Code...'));
5207
- try {
5208
- const { spawn } = await Promise.resolve().then(() => __importStar(require('child_process')));
5209
- const platform = process.platform;
5210
- // Check if claude command exists
5211
- const claudeCommand = platform === 'win32' ? 'claude.exe' : 'claude';
5212
- console.log('📡 Starting Claude Code with MCP configuration...');
5213
- // Launch Claude with MCP config
5214
- const claudeProcess = spawn(claudeCommand, ['--mcp-config', '.mcp.json', '.'], {
5215
- stdio: 'inherit',
5216
- shell: true
5217
- });
5218
- claudeProcess.on('error', (error) => {
5219
- if (error.message.includes('ENOENT')) {
5220
- console.error(chalk_1.default.red('\n❌ Claude Code not found. Please install it first:'));
5221
- console.log(' Visit: https://claude.ai/download');
5222
- }
5223
- else {
5224
- console.error(chalk_1.default.red('\n❌ Failed to start Claude Code:'), error.message);
5225
- }
5226
- });
5227
- claudeProcess.on('spawn', () => {
5228
- console.log(chalk_1.default.green('✅ Claude Code started with MCP servers!'));
5229
- console.log('\n📋 All 11 ServiceNow MCP servers are now available in Claude Code');
5230
- console.log('🎯 You can start using Snow-Flow commands immediately!');
5231
- });
5232
- }
5233
- catch (error) {
5234
- console.error(chalk_1.default.red('\n❌ Failed to activate MCP servers:'), error);
5235
- console.log('\n📝 To activate manually, run:');
5236
- console.log(chalk_1.default.cyan(' claude --mcp-config .mcp.json .'));
5237
- }
5238
- }
5239
5223
  // Note: The new integrated commands enhance the existing CLI with:
5240
5224
  // - Advanced system status monitoring
5241
5225
  // - Real-time monitoring dashboard
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
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",