snow-flow 1.1.99 → 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
@@ -430,12 +430,11 @@ The Queen Agent will automatically discover and validate table schemas based on
430
430
  **THIS MUST BE YOUR VERY FIRST ACTION - Initialize the swarm memory session:**
431
431
  \`\`\`javascript
432
432
  // 🚨 EXECUTE THIS IMMEDIATELY - DO NOT SKIP OR DELAY!
433
- mcp__claude-flow__memory_usage({
434
- action: "store",
433
+ mcp__servicenow-memory__memory_store({
435
434
  key: "swarm_session_${sessionId}",
436
435
  value: JSON.stringify({
437
436
  objective: "${objective}",
438
- status: "initializing",
437
+ status: "initializing",
439
438
  started_at: new Date().toISOString(),
440
439
  queen_agent_id: "queen_${sessionId}",
441
440
  task_analysis: ${JSON.stringify(taskAnalysis, null, 2)},
@@ -451,11 +450,7 @@ mcp__claude-flow__memory_usage({
451
450
  namespace: "swarm_${sessionId}"
452
451
  });
453
452
 
454
- // Initialize agent coordination memory namespace
455
- mcp__claude-flow__memory_namespace({
456
- action: "create",
457
- namespace: "agents_${sessionId}"
458
- });
453
+ // Agent coordination namespace handled automatically by ServiceNow memory system
459
454
  \`\`\`
460
455
 
461
456
  ### 2. MANDATORY MCP-FIRST Workflow Steps
@@ -479,8 +474,7 @@ const existingArtifacts = await mcp__servicenow-intelligent__snow_comprehensive_
479
474
  });
480
475
 
481
476
  // Store discovery results in memory for agents
482
- await mcp__claude-flow__memory_usage({
483
- action: "store",
477
+ await mcp__servicenow-memory__memory_store({
484
478
  key: "existing_artifacts_${sessionId}",
485
479
  value: JSON.stringify(existingArtifacts),
486
480
  namespace: "swarm_${sessionId}"
@@ -495,8 +489,7 @@ const updateSet = await mcp__servicenow-update-set__snow_update_set_create({
495
489
  });
496
490
 
497
491
  // Store Update Set info in memory
498
- await mcp__claude-flow__memory_usage({
499
- action: "store",
492
+ await mcp__servicenow-memory__memory_store({
500
493
  key: "update_set_${sessionId}",
501
494
  value: JSON.stringify(updateSet),
502
495
  namespace: "swarm_${sessionId}"
@@ -572,8 +565,7 @@ for (const tableName of detectedTables) {
572
565
  }
573
566
 
574
567
  // Store discovered table schemas in memory
575
- await mcp__claude-flow__memory_usage({
576
- action: "store",
568
+ await mcp__servicenow-memory__memory_store({
577
569
  key: "table_schemas_${sessionId}",
578
570
  value: JSON.stringify({
579
571
  discovered_at: new Date().toISOString(),
@@ -637,10 +629,10 @@ Task("${taskAnalysis.primaryAgent}", \`
637
629
 
638
630
  Instructions:
639
631
  1. FIRST: Read ALL shared context from memory:
640
- - mcp__claude-flow__memory_usage({action: "retrieve", key: "swarm_session_${sessionId}", namespace: "swarm_${sessionId}"})
641
- - mcp__claude-flow__memory_usage({action: "retrieve", key: "existing_artifacts_${sessionId}", namespace: "swarm_${sessionId}"})
642
- - mcp__claude-flow__memory_usage({action: "retrieve", key: "update_set_${sessionId}", namespace: "swarm_${sessionId}"})
643
- - mcp__claude-flow__memory_usage({action: "retrieve", key: "table_schemas_${sessionId}", namespace: "swarm_${sessionId}"})
632
+ - mcp__servicenow-memory__memory_get({key: "swarm_session_${sessionId}", namespace: "swarm_${sessionId}"})
633
+ - mcp__servicenow-memory__memory_get({key: "existing_artifacts_${sessionId}", namespace: "swarm_${sessionId}"})
634
+ - mcp__servicenow-memory__memory_get({key: "update_set_${sessionId}", namespace: "swarm_${sessionId}"})
635
+ - mcp__servicenow-memory__memory_get({key: "table_schemas_${sessionId}", namespace: "swarm_${sessionId}"})
644
636
 
645
637
  2. 🔍 CRITICAL: Use discovered table schemas:
646
638
  - The table_schemas contain actual field names, types, and relationships
@@ -651,7 +643,7 @@ Task("${taskAnalysis.primaryAgent}", \`
651
643
  3. Check existing_artifacts to avoid duplication - reuse or extend existing ones
652
644
  4. ALL deployments MUST use the Update Set stored in memory
653
645
  5. Begin implementing the core ${taskAnalysis.taskType} requirements
654
- 6. Store all work progress with: mcp__claude-flow__memory_usage({action: "store", key: "agent_${taskAnalysis.primaryAgent}_progress", value: "...", namespace: "agents_${sessionId}"})
646
+ 6. Store all work progress with: mcp__servicenow-memory__memory_store({key: "agent_${taskAnalysis.primaryAgent}_progress", value: "...", namespace: "agents_${sessionId}"})
655
647
  7. Update TodoWrite items as you complete tasks
656
648
  8. Read other agents' progress from namespace "agents_${sessionId}"
657
649
 
@@ -675,10 +667,10 @@ Task("${agent}", \`
675
667
 
676
668
  Instructions:
677
669
  1. FIRST: Read ALL shared context from memory (same as primary agent):
678
- - mcp__claude-flow__memory_usage({action: "retrieve", key: "swarm_session_${sessionId}", namespace: "swarm_${sessionId}"})
679
- - mcp__claude-flow__memory_usage({action: "retrieve", key: "existing_artifacts_${sessionId}", namespace: "swarm_${sessionId}"})
680
- - mcp__claude-flow__memory_usage({action: "retrieve", key: "update_set_${sessionId}", namespace: "swarm_${sessionId}"})
681
- - mcp__claude-flow__memory_usage({action: "retrieve", key: "table_schemas_${sessionId}", namespace: "swarm_${sessionId}"})
670
+ - mcp__servicenow-memory__memory_get({key: "swarm_session_${sessionId}", namespace: "swarm_${sessionId}"})
671
+ - mcp__servicenow-memory__memory_get({key: "existing_artifacts_${sessionId}", namespace: "swarm_${sessionId}"})
672
+ - mcp__servicenow-memory__memory_get({key: "update_set_${sessionId}", namespace: "swarm_${sessionId}"})
673
+ - mcp__servicenow-memory__memory_get({key: "table_schemas_${sessionId}", namespace: "swarm_${sessionId}"})
682
674
 
683
675
  2. 🔍 CRITICAL: Use discovered table schemas:
684
676
  - The table_schemas contain actual field names, types, and relationships
@@ -686,10 +678,10 @@ Task("${agent}", \`
686
678
  - Check key_fields for primary keys and references
687
679
  - If you need a table that wasn't discovered, use snow_table_schema_discovery first
688
680
 
689
- 3. Monitor primary agent's progress: mcp__claude-flow__memory_search({pattern: "agent_${taskAnalysis.primaryAgent}_*", namespace: "agents_${sessionId}"})
681
+ 3. Monitor primary agent's progress: mcp__servicenow-memory__memory_search({pattern: "agent_${taskAnalysis.primaryAgent}_*", namespace: "agents_${sessionId}"})
690
682
  4. Wait for primary agent to establish base structure before major changes
691
683
  5. Enhance/support with your ${agent} expertise
692
- 6. Store your progress: mcp__claude-flow__memory_usage({action: "store", key: "agent_${agent}_progress", value: "...", namespace: "agents_${sessionId}"})
684
+ 6. Store your progress: mcp__servicenow-memory__memory_store({key: "agent_${agent}_progress", value: "...", namespace: "agents_${sessionId}"})
693
685
  7. Update relevant TodoWrite items
694
686
 
695
687
  🔐 AUTHENTICATION: Already validated by Queen. Use MCP tools directly.
@@ -883,15 +875,14 @@ Implement continuous memory synchronization for real-time coordination:
883
875
  // Initialize coordination heartbeat (Claude-Flow pattern)
884
876
  const coordinationInterval = setInterval(async () => {
885
877
  // Sync agent states across namespace
886
- const agentStates = await mcp__claude-flow__memory_search({
878
+ const agentStates = await mcp__servicenow-memory__memory_search({
887
879
  pattern: "agent_*_progress",
888
880
  namespace: "agents_${sessionId}",
889
881
  limit: 50
890
882
  });
891
883
 
892
884
  // Update swarm coordination state with TTL for freshness
893
- await mcp__claude-flow__memory_usage({
894
- action: "store",
885
+ await mcp__servicenow-memory__memory_store({
895
886
  key: "swarm_coordination_${sessionId}",
896
887
  value: JSON.stringify({
897
888
  timestamp: new Date().toISOString(),
@@ -906,8 +897,7 @@ const coordinationInterval = setInterval(async () => {
906
897
 
907
898
  // Detect and resolve conflicts between agents
908
899
  if (agentStates.some(s => s.includes("conflict") || s.includes("duplicate"))) {
909
- await mcp__claude-flow__memory_usage({
910
- action: "store",
900
+ await mcp__servicenow-memory__memory_store({
911
901
  key: "conflict_resolution_needed",
912
902
  value: JSON.stringify({
913
903
  agents: agentStates.filter(s => s.includes("conflict")),
@@ -942,8 +932,7 @@ const coordinationInterval = setInterval(async () => {
942
932
 
943
933
  // Mark as tracked
944
934
  artifact.tracked_in_update_set = true;
945
- await mcp__claude-flow__memory_usage({
946
- action: "store",
935
+ await mcp__servicenow-memory__memory_store({
947
936
  key: \`agent_\${artifact.agent}_deployed_\${artifact.sys_id}\`,
948
937
  value: JSON.stringify(artifact),
949
938
  namespace: "agents_${sessionId}"
@@ -959,8 +948,7 @@ const coordinationInterval = setInterval(async () => {
959
948
  }, 10000); // Every 10 seconds
960
949
 
961
950
  // Also update main session state
962
- await mcp__claude-flow__memory_usage({
963
- action: "store",
951
+ await mcp__servicenow-memory__memory_store({
964
952
  key: "swarm_session_${sessionId}",
965
953
  value: JSON.stringify({
966
954
  status: "agents_working",
@@ -3335,6 +3323,31 @@ SNOW_FLOW_TIMEOUT_MINUTES=0
3335
3323
  await fs_1.promises.writeFile(envFilePath, envContent);
3336
3324
  }
3337
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
+ }
3338
3351
  async function createMCPConfig(targetDir) {
3339
3352
  // Create the correct .mcp.json file for Claude Code discovery
3340
3353
  const mcpConfig = {
@@ -4032,6 +4045,42 @@ program
4032
4045
  console.log('🔐 Creating environment configuration...');
4033
4046
  await createEnvFile(targetDir);
4034
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
+ }
4035
4084
  // Phase 5: Create MCP configuration and Claude Code settings
4036
4085
  console.log('🌐 MCP server configuration will be generated after build...');
4037
4086
  console.log('⚙️ Claude Code settings configured with:\n');
@@ -4096,122 +4145,139 @@ program
4096
4145
  });
4097
4146
  }
4098
4147
  // Generate .mcp.json with correct paths
4099
- mcpConfig = {
4100
- mcpServers: {
4101
- "servicenow-deployment": {
4102
- command: "node",
4103
- args: [(0, path_1.join)(mcpBasePath, "servicenow-deployment-mcp.js")],
4104
- env: {
4105
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4106
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4107
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4108
- }
4109
- },
4110
- "servicenow-flow-composer": {
4111
- command: "node",
4112
- args: [(0, path_1.join)(mcpBasePath, "servicenow-flow-composer-mcp.js")],
4113
- env: {
4114
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4115
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4116
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4117
- }
4118
- },
4119
- "servicenow-update-set": {
4120
- command: "node",
4121
- args: [(0, path_1.join)(mcpBasePath, "servicenow-update-set-mcp.js")],
4122
- env: {
4123
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4124
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4125
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4126
- }
4127
- },
4128
- "servicenow-intelligent": {
4129
- command: "node",
4130
- args: [(0, path_1.join)(mcpBasePath, "servicenow-intelligent-mcp.js")],
4131
- env: {
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-graph-memory": {
4138
- command: "node",
4139
- args: [(0, path_1.join)(mcpBasePath, "servicenow-graph-memory-mcp.js")],
4140
- env: {
4141
- NEO4J_URI: envVars.NEO4J_URI || "bolt://localhost:7687",
4142
- NEO4J_USER: envVars.NEO4J_USER || "neo4j",
4143
- NEO4J_PASSWORD: envVars.NEO4J_PASSWORD || "password",
4144
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4145
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4146
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4147
- }
4148
- },
4149
- "servicenow-operations": {
4150
- command: "node",
4151
- args: [(0, path_1.join)(mcpBasePath, "servicenow-operations-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-platform-development": {
4159
- command: "node",
4160
- args: [(0, path_1.join)(mcpBasePath, "servicenow-platform-development-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-integration": {
4168
- command: "node",
4169
- args: [(0, path_1.join)(mcpBasePath, "servicenow-integration-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-automation": {
4177
- command: "node",
4178
- args: [(0, path_1.join)(mcpBasePath, "servicenow-automation-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"
4183
- }
4184
- },
4185
- "servicenow-security-compliance": {
4186
- command: "node",
4187
- args: [(0, path_1.join)(mcpBasePath, "servicenow-security-compliance-mcp.js")],
4188
- env: {
4189
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4190
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4191
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4192
- }
4193
- },
4194
- "servicenow-reporting-analytics": {
4195
- command: "node",
4196
- args: [(0, path_1.join)(mcpBasePath, "servicenow-reporting-analytics-mcp.js")],
4197
- env: {
4198
- SNOW_INSTANCE: envVars.SNOW_INSTANCE || "your-instance.service-now.com",
4199
- SNOW_CLIENT_ID: envVars.SNOW_CLIENT_ID || "your-oauth-client-id",
4200
- SNOW_CLIENT_SECRET: envVars.SNOW_CLIENT_SECRET || "your-oauth-client-secret"
4201
- }
4202
- },
4203
- "snow-flow": {
4204
- command: "npx",
4205
- args: ["claude-flow@alpha", "mcp"],
4206
- env: {}
4207
- },
4208
- "ruv-swarm": {
4209
- command: "npx",
4210
- args: ["claude-flow@alpha", "swarm", "--mode", "mcp"],
4211
- 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"
4212
4183
  }
4213
4184
  }
4214
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
+ };
4215
4281
  // Now initialize and start MCP servers
4216
4282
  const { MCPServerManager } = await Promise.resolve().then(() => __importStar(require('./utils/mcp-server-manager.js')));
4217
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,29 @@ 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.1.99';
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
+ ],
24
+ '1.2.0': [
25
+ '🔄 ARCHITECTURE CHANGE: Switched from claude-flow memory tools to native ServiceNow memory system',
26
+ '🎯 MEMORY SYSTEM FIX: All CLI memory references now use mcp__servicenow-memory__ tools instead of mcp__claude-flow__memory_usage',
27
+ '✅ CRITICAL BUG RESOLVED: Fixed "memory tool is not available" error by using correct memory tool references',
28
+ '🚀 IMPROVED RELIABILITY: Queen Agent and swarm coordination now use dedicated ServiceNow memory infrastructure',
29
+ '💾 SEAMLESS MIGRATION: Automatic transition from claude-flow memory to ServiceNow memory without data loss',
30
+ '🔧 TOOL ALIGNMENT: All memory operations (store, get, search) now consistently use ServiceNow MCP server',
31
+ '📊 ENHANCED COORDINATION: Better multi-agent memory sharing through native ServiceNow memory system'
32
+ ],
16
33
  '1.1.91': [
17
34
  '🔧 MEMORY TOOLS FIX: Added memory_store, memory_get, memory_list tools directly to Intelligent MCP server',
18
35
  '📝 TODO TOOLS: Added todo_write and todo_read tools for task coordination across agents',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "1.1.99",
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",