snow-flow 1.2.0 → 1.2.1

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
@@ -3323,6 +3323,31 @@ SNOW_FLOW_TIMEOUT_MINUTES=0
3323
3323
  await fs_1.promises.writeFile(envFilePath, envContent);
3324
3324
  }
3325
3325
  }
3326
+ async function appendToEnvFile(targetDir, content) {
3327
+ const envFilePath = (0, path_1.join)(targetDir, '.env');
3328
+ await fs_1.promises.appendFile(envFilePath, content);
3329
+ }
3330
+ async function checkNeo4jAvailability() {
3331
+ const { execSync } = require('child_process');
3332
+ try {
3333
+ // Check if Neo4j is installed
3334
+ execSync('which neo4j', { stdio: 'pipe' });
3335
+ // Check if Neo4j is running
3336
+ try {
3337
+ execSync('neo4j status', { stdio: 'pipe' });
3338
+ return true;
3339
+ }
3340
+ catch {
3341
+ // Neo4j is installed but not running
3342
+ console.log('ℹ️ Neo4j is installed but not running. Start with: neo4j start');
3343
+ return false;
3344
+ }
3345
+ }
3346
+ catch {
3347
+ // Neo4j is not installed
3348
+ return false;
3349
+ }
3350
+ }
3326
3351
  async function createMCPConfig(targetDir) {
3327
3352
  // Create the correct .mcp.json file for Claude Code discovery
3328
3353
  const mcpConfig = {
@@ -4020,6 +4045,42 @@ program
4020
4045
  console.log('🔐 Creating environment configuration...');
4021
4046
  await createEnvFile(targetDir);
4022
4047
  console.log('✅ Environment file created\n');
4048
+ // Phase 4.5: Check for Neo4j and offer graph memory setup
4049
+ console.log('🧠 Checking for Neo4j Graph Memory support...');
4050
+ const neo4jAvailable = await checkNeo4jAvailability();
4051
+ let enableGraphMemory = false;
4052
+ if (neo4jAvailable) {
4053
+ console.log('✅ Neo4j detected! Graph memory features available.');
4054
+ console.log('\n📊 Graph Memory provides:');
4055
+ console.log(' - Intelligent artifact relationship tracking');
4056
+ console.log(' - Impact analysis for changes');
4057
+ console.log(' - Dependency visualization');
4058
+ console.log(' - Pattern recognition across projects\n');
4059
+ const readline = require('readline');
4060
+ const rl = readline.createInterface({
4061
+ input: process.stdin,
4062
+ output: process.stdout
4063
+ });
4064
+ const answer = await new Promise((resolve) => {
4065
+ rl.question('Enable graph memory features? (Y/n): ', resolve);
4066
+ });
4067
+ rl.close();
4068
+ enableGraphMemory = answer.toLowerCase() !== 'n';
4069
+ if (enableGraphMemory) {
4070
+ console.log('✅ Graph memory enabled\n');
4071
+ // Add Neo4j config to .env
4072
+ await appendToEnvFile(targetDir, `
4073
+ # Neo4j Graph Memory Configuration
4074
+ NEO4J_URI=bolt://localhost:7687
4075
+ NEO4J_USER=neo4j
4076
+ NEO4J_PASSWORD=password
4077
+ `);
4078
+ }
4079
+ }
4080
+ else {
4081
+ console.log('ℹ️ Neo4j not detected. Graph memory features will be disabled.');
4082
+ console.log(' To enable later: brew install neo4j && neo4j start\n');
4083
+ }
4023
4084
  // Phase 5: Create MCP configuration and Claude Code settings
4024
4085
  console.log('🌐 MCP server configuration will be generated after build...');
4025
4086
  console.log('⚙️ Claude Code settings configured with:\n');
@@ -4084,122 +4145,139 @@ program
4084
4145
  });
4085
4146
  }
4086
4147
  // Generate .mcp.json with correct paths
4087
- mcpConfig = {
4088
- mcpServers: {
4089
- "servicenow-deployment": {
4090
- command: "node",
4091
- args: [(0, path_1.join)(mcpBasePath, "servicenow-deployment-mcp.js")],
4092
- env: {
4093
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4094
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4095
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4096
- }
4097
- },
4098
- "servicenow-flow-composer": {
4099
- command: "node",
4100
- args: [(0, path_1.join)(mcpBasePath, "servicenow-flow-composer-mcp.js")],
4101
- env: {
4102
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4103
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4104
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4105
- }
4106
- },
4107
- "servicenow-update-set": {
4108
- command: "node",
4109
- args: [(0, path_1.join)(mcpBasePath, "servicenow-update-set-mcp.js")],
4110
- env: {
4111
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4112
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4113
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4114
- }
4115
- },
4116
- "servicenow-intelligent": {
4117
- command: "node",
4118
- args: [(0, path_1.join)(mcpBasePath, "servicenow-intelligent-mcp.js")],
4119
- env: {
4120
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4121
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4122
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4123
- }
4124
- },
4125
- "servicenow-graph-memory": {
4126
- command: "node",
4127
- args: [(0, path_1.join)(mcpBasePath, "servicenow-graph-memory-mcp.js")],
4128
- env: {
4129
- NEO4J_URI: envVars.NEO4J_URI || "bolt://localhost:7687",
4130
- NEO4J_USER: envVars.NEO4J_USER || "neo4j",
4131
- NEO4J_PASSWORD: envVars.NEO4J_PASSWORD || "password",
4132
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4133
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4134
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4135
- }
4136
- },
4137
- "servicenow-operations": {
4138
- command: "node",
4139
- args: [(0, path_1.join)(mcpBasePath, "servicenow-operations-mcp.js")],
4140
- env: {
4141
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4142
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4143
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4144
- }
4145
- },
4146
- "servicenow-platform-development": {
4147
- command: "node",
4148
- args: [(0, path_1.join)(mcpBasePath, "servicenow-platform-development-mcp.js")],
4149
- env: {
4150
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4151
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4152
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4153
- }
4154
- },
4155
- "servicenow-integration": {
4156
- command: "node",
4157
- args: [(0, path_1.join)(mcpBasePath, "servicenow-integration-mcp.js")],
4158
- env: {
4159
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4160
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4161
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4162
- }
4163
- },
4164
- "servicenow-automation": {
4165
- command: "node",
4166
- args: [(0, path_1.join)(mcpBasePath, "servicenow-automation-mcp.js")],
4167
- env: {
4168
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4169
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4170
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4171
- }
4172
- },
4173
- "servicenow-security-compliance": {
4174
- command: "node",
4175
- args: [(0, path_1.join)(mcpBasePath, "servicenow-security-compliance-mcp.js")],
4176
- env: {
4177
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4178
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4179
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4180
- }
4181
- },
4182
- "servicenow-reporting-analytics": {
4183
- command: "node",
4184
- args: [(0, path_1.join)(mcpBasePath, "servicenow-reporting-analytics-mcp.js")],
4185
- env: {
4186
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4187
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4188
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4189
- }
4190
- },
4191
- "snow-flow": {
4192
- command: "npx",
4193
- args: ["claude-flow@alpha", "mcp"],
4194
- env: {}
4195
- },
4196
- "ruv-swarm": {
4197
- command: "npx",
4198
- args: ["claude-flow@alpha", "swarm", "--mode", "mcp"],
4199
- env: {}
4148
+ const mcpServers = {
4149
+ "servicenow-deployment": {
4150
+ command: "node",
4151
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-deployment-mcp.js")],
4152
+ env: {
4153
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4154
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4155
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4156
+ }
4157
+ },
4158
+ "servicenow-flow-composer": {
4159
+ command: "node",
4160
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-flow-composer-mcp.js")],
4161
+ env: {
4162
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4163
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4164
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4165
+ }
4166
+ },
4167
+ "servicenow-update-set": {
4168
+ command: "node",
4169
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-update-set-mcp.js")],
4170
+ env: {
4171
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4172
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4173
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4174
+ }
4175
+ },
4176
+ "servicenow-intelligent": {
4177
+ command: "node",
4178
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-intelligent-mcp.js")],
4179
+ env: {
4180
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4181
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4182
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4200
4183
  }
4201
4184
  }
4202
4185
  };
4186
+ // Only add graph memory if Neo4j is enabled
4187
+ if (enableGraphMemory) {
4188
+ mcpServers["servicenow-graph-memory"] = {
4189
+ command: "node",
4190
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-graph-memory-mcp.js")],
4191
+ env: {
4192
+ NEO4J_URI: envVars.NEO4J_URI || "bolt://localhost:7687",
4193
+ NEO4J_USER: envVars.NEO4J_USER || "neo4j",
4194
+ NEO4J_PASSWORD: envVars.NEO4J_PASSWORD || "password",
4195
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4196
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4197
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4198
+ }
4199
+ };
4200
+ }
4201
+ // Add remaining servers
4202
+ Object.assign(mcpServers, {
4203
+ "servicenow-operations": {
4204
+ command: "node",
4205
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-operations-mcp.js")],
4206
+ env: {
4207
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4208
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4209
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4210
+ }
4211
+ },
4212
+ "servicenow-platform-development": {
4213
+ command: "node",
4214
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-platform-development-mcp.js")],
4215
+ env: {
4216
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4217
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4218
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4219
+ }
4220
+ },
4221
+ "servicenow-integration": {
4222
+ command: "node",
4223
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-integration-mcp.js")],
4224
+ env: {
4225
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4226
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4227
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4228
+ }
4229
+ },
4230
+ "servicenow-automation": {
4231
+ command: "node",
4232
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-automation-mcp.js")],
4233
+ env: {
4234
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4235
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4236
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4237
+ }
4238
+ },
4239
+ "servicenow-security-compliance": {
4240
+ command: "node",
4241
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-security-compliance-mcp.js")],
4242
+ env: {
4243
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4244
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4245
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4246
+ }
4247
+ },
4248
+ "servicenow-reporting-analytics": {
4249
+ command: "node",
4250
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-reporting-analytics-mcp.js")],
4251
+ env: {
4252
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4253
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4254
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4255
+ }
4256
+ },
4257
+ "servicenow-memory": {
4258
+ command: "node",
4259
+ args: [(0, path_1.join)(mcpBasePath, "servicenow-memory-mcp.js")],
4260
+ env: {
4261
+ SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4262
+ SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4263
+ SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4264
+ }
4265
+ },
4266
+ "snow-flow": {
4267
+ command: "npx",
4268
+ args: ["claude-flow@alpha", "mcp"],
4269
+ env: {}
4270
+ },
4271
+ "ruv-swarm": {
4272
+ command: "npx",
4273
+ args: ["claude-flow@alpha", "swarm", "--mode", "mcp"],
4274
+ env: {}
4275
+ }
4276
+ });
4277
+ // Create the final mcpConfig
4278
+ mcpConfig = {
4279
+ mcpServers: mcpServers
4280
+ };
4203
4281
  // Now initialize and start MCP servers
4204
4282
  const { MCPServerManager } = await Promise.resolve().then(() => __importStar(require('./utils/mcp-server-manager.js')));
4205
4283
  const manager = new MCPServerManager();
@@ -83,6 +83,11 @@ class ServiceNowGraphMemoryMCP {
83
83
  }
84
84
  catch (error) {
85
85
  this.logger.error('Failed to connect to Neo4j', error);
86
+ this.neo4jAvailable = false;
87
+ if (this.driver) {
88
+ await this.driver.close();
89
+ this.driver = null;
90
+ }
86
91
  throw error;
87
92
  }
88
93
  }
@@ -679,9 +684,29 @@ ${JSON.stringify(exportData, null, 2).substring(0, 1000)}...
679
684
  }
680
685
  }
681
686
  async start() {
682
- const transport = new stdio_js_1.StdioServerTransport();
683
- await this.server.connect(transport);
684
- this.logger.info('ServiceNow Graph Memory MCP Server started');
687
+ try {
688
+ // Try to connect to Neo4j if configured
689
+ if (this.neo4jAvailable && this.config) {
690
+ try {
691
+ await this.connectToNeo4j();
692
+ this.logger.info('Neo4j connection established');
693
+ }
694
+ catch (error) {
695
+ this.logger.warn('Neo4j connection failed - running in fallback mode', error);
696
+ this.neo4jAvailable = false;
697
+ }
698
+ }
699
+ const transport = new stdio_js_1.StdioServerTransport();
700
+ await this.server.connect(transport);
701
+ this.logger.info('ServiceNow Graph Memory MCP Server started');
702
+ if (!this.neo4jAvailable) {
703
+ this.logger.info('Running without Neo4j - all operations will return fallback responses');
704
+ }
705
+ }
706
+ catch (error) {
707
+ this.logger.error('Failed to start server', error);
708
+ throw error;
709
+ }
685
710
  }
686
711
  async stop() {
687
712
  if (this.driver) {
package/dist/version.js CHANGED
@@ -7,12 +7,20 @@ 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.2.0';
10
+ exports.VERSION = '1.2.1';
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.2.1': [
17
+ '🧠 NEO4J SMART INTEGRATION: Auto-detects Neo4j during init and offers optional graph memory setup',
18
+ '⚡ GRACEFUL FALLBACK: Graph memory server now starts without Neo4j, provides helpful fallback responses',
19
+ '🎯 CONDITIONAL CONFIGURATION: Graph memory only added to .mcp.json when Neo4j is enabled',
20
+ '🔧 IMPROVED ERROR HANDLING: No more crashes when Neo4j is unavailable - smooth degradation',
21
+ '📋 INIT ENHANCEMENT: Interactive prompt during init asks about graph memory features',
22
+ '💾 ADDED SERVICENOW-MEMORY: Memory MCP server now properly included in init configuration'
23
+ ],
16
24
  '1.2.0': [
17
25
  '🔄 ARCHITECTURE CHANGE: Switched from claude-flow memory tools to native ServiceNow memory system',
18
26
  '🎯 MEMORY SYSTEM FIX: All CLI memory references now use mcp__servicenow-memory__ tools instead of mcp__claude-flow__memory_usage',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
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",