snow-flow 1.1.74 → 1.1.76

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 (161) hide show
  1. package/.claude-flow/queen/queen-memory.db +0 -0
  2. package/.claude-flow/queen-test/test-memory.db +0 -0
  3. package/.claude-flow/queen-test/test-memory.db-agents +0 -0
  4. package/.claude-flow/queen-test/test-memory.db-import +0 -0
  5. package/.claude-flow/queen-test/test-memory.db-memory +0 -0
  6. package/.claude-flow/queen-test/test-memory.db-neural +0 -0
  7. package/CLAUDE.md +111 -8
  8. package/README.md +117 -50
  9. package/deploy.sh +366 -0
  10. package/dist/cli.js +226 -0
  11. package/dist/cli.js.map +1 -1
  12. package/dist/mcp/http-transport-wrapper.d.ts +29 -0
  13. package/dist/mcp/http-transport-wrapper.d.ts.map +1 -0
  14. package/dist/mcp/http-transport-wrapper.js +318 -0
  15. package/dist/mcp/http-transport-wrapper.js.map +1 -0
  16. package/dist/mcp/service-discovery-client.d.ts +83 -0
  17. package/dist/mcp/service-discovery-client.d.ts.map +1 -0
  18. package/dist/mcp/service-discovery-client.js +211 -0
  19. package/dist/mcp/service-discovery-client.js.map +1 -0
  20. package/dist/mcp/servicenow-deployment-mcp.js +262 -29
  21. package/dist/mcp/servicenow-deployment-mcp.js.map +1 -1
  22. package/dist/mcp/servicenow-intelligent-mcp.js +252 -18
  23. package/dist/mcp/servicenow-intelligent-mcp.js.map +1 -1
  24. package/dist/mcp/servicenow-operations-mcp.js +274 -46
  25. package/dist/mcp/servicenow-operations-mcp.js.map +1 -1
  26. package/dist/orchestration/discovery/service-discovery.d.ts +81 -0
  27. package/dist/orchestration/discovery/service-discovery.d.ts.map +1 -0
  28. package/dist/orchestration/discovery/service-discovery.js +808 -0
  29. package/dist/orchestration/discovery/service-discovery.js.map +1 -0
  30. package/dist/orchestration/distributed-orchestrator.d.ts +131 -0
  31. package/dist/orchestration/distributed-orchestrator.d.ts.map +1 -0
  32. package/dist/orchestration/distributed-orchestrator.js +712 -0
  33. package/dist/orchestration/distributed-orchestrator.js.map +1 -0
  34. package/dist/orchestration/distribution/task-distribution-engine.d.ts +53 -0
  35. package/dist/orchestration/distribution/task-distribution-engine.d.ts.map +1 -0
  36. package/dist/orchestration/distribution/task-distribution-engine.js +586 -0
  37. package/dist/orchestration/distribution/task-distribution-engine.js.map +1 -0
  38. package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +606 -0
  39. package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts.map +1 -0
  40. package/dist/orchestration/interfaces/distributed-orchestration.interface.js +65 -0
  41. package/dist/orchestration/interfaces/distributed-orchestration.interface.js.map +1 -0
  42. package/dist/orchestration/protocols/mcpx-protocol.d.ts +71 -0
  43. package/dist/orchestration/protocols/mcpx-protocol.d.ts.map +1 -0
  44. package/dist/orchestration/protocols/mcpx-protocol.js +668 -0
  45. package/dist/orchestration/protocols/mcpx-protocol.js.map +1 -0
  46. package/dist/orchestration/state/distributed-state-manager.d.ts +89 -0
  47. package/dist/orchestration/state/distributed-state-manager.d.ts.map +1 -0
  48. package/dist/orchestration/state/distributed-state-manager.js +716 -0
  49. package/dist/orchestration/state/distributed-state-manager.js.map +1 -0
  50. package/dist/queen/advanced-integration-test.d.ts +48 -0
  51. package/dist/queen/advanced-integration-test.d.ts.map +1 -0
  52. package/dist/queen/advanced-integration-test.js +474 -0
  53. package/dist/queen/advanced-integration-test.js.map +1 -0
  54. package/dist/queen/agent-factory.d.ts +40 -0
  55. package/dist/queen/agent-factory.d.ts.map +1 -0
  56. package/dist/queen/agent-factory.js +433 -0
  57. package/dist/queen/agent-factory.js.map +1 -0
  58. package/dist/queen/index.d.ts +58 -0
  59. package/dist/queen/index.d.ts.map +1 -0
  60. package/dist/queen/index.js +79 -0
  61. package/dist/queen/index.js.map +1 -0
  62. package/dist/queen/integration-example.d.ts +82 -0
  63. package/dist/queen/integration-example.d.ts.map +1 -0
  64. package/dist/queen/integration-example.js +220 -0
  65. package/dist/queen/integration-example.js.map +1 -0
  66. package/dist/queen/integration-test.d.ts +72 -0
  67. package/dist/queen/integration-test.d.ts.map +1 -0
  68. package/dist/queen/integration-test.js +564 -0
  69. package/dist/queen/integration-test.js.map +1 -0
  70. package/dist/queen/mock-mcp-client.d.ts +66 -0
  71. package/dist/queen/mock-mcp-client.d.ts.map +1 -0
  72. package/dist/queen/mock-mcp-client.js +297 -0
  73. package/dist/queen/mock-mcp-client.js.map +1 -0
  74. package/dist/queen/neural-learning.d.ts +28 -0
  75. package/dist/queen/neural-learning.d.ts.map +1 -0
  76. package/dist/queen/neural-learning.js +244 -0
  77. package/dist/queen/neural-learning.js.map +1 -0
  78. package/dist/queen/queen-memory.d.ts +25 -0
  79. package/dist/queen/queen-memory.d.ts.map +1 -0
  80. package/dist/queen/queen-memory.js +273 -0
  81. package/dist/queen/queen-memory.js.map +1 -0
  82. package/dist/queen/run-integration-tests.d.ts +9 -0
  83. package/dist/queen/run-integration-tests.d.ts.map +1 -0
  84. package/dist/queen/run-integration-tests.js +28 -0
  85. package/dist/queen/run-integration-tests.js.map +1 -0
  86. package/dist/queen/servicenow-queen.d.ts +56 -0
  87. package/dist/queen/servicenow-queen.d.ts.map +1 -0
  88. package/dist/queen/servicenow-queen.js +659 -0
  89. package/dist/queen/servicenow-queen.js.map +1 -0
  90. package/dist/queen/types.d.ts +58 -0
  91. package/dist/queen/types.d.ts.map +1 -0
  92. package/dist/queen/types.js +7 -0
  93. package/dist/queen/types.js.map +1 -0
  94. package/dist/version.d.ts +3 -1
  95. package/dist/version.d.ts.map +1 -1
  96. package/dist/version.js +27 -2
  97. package/dist/version.js.map +1 -1
  98. package/docker/base/Dockerfile.base +45 -0
  99. package/docker/generate-services.js +244 -0
  100. package/docker/nginx/Dockerfile +71 -0
  101. package/docker/nginx/consul-template.hcl +64 -0
  102. package/docker/nginx/healthcheck.sh +178 -0
  103. package/docker/nginx/nginx.conf +210 -0
  104. package/docker/nginx/supervisord.conf +57 -0
  105. package/docker/nginx/templates/upstreams.conf.tpl +48 -0
  106. package/docker/services/automation-mcp/Dockerfile +32 -0
  107. package/docker/services/automation-mcp/config/service.json +28 -0
  108. package/docker/services/automation-mcp/entrypoint.js +51 -0
  109. package/docker/services/deployment-mcp/Dockerfile +32 -0
  110. package/docker/services/deployment-mcp/entrypoint.js +51 -0
  111. package/docker/services/flow-composer-mcp/Dockerfile +32 -0
  112. package/docker/services/flow-composer-mcp/config/service.json +28 -0
  113. package/docker/services/flow-composer-mcp/entrypoint.js +51 -0
  114. package/docker/services/graph-memory-mcp/Dockerfile +32 -0
  115. package/docker/services/graph-memory-mcp/config/service.json +28 -0
  116. package/docker/services/graph-memory-mcp/entrypoint.js +51 -0
  117. package/docker/services/integration-mcp/Dockerfile +32 -0
  118. package/docker/services/integration-mcp/config/service.json +28 -0
  119. package/docker/services/integration-mcp/entrypoint.js +51 -0
  120. package/docker/services/intelligent-mcp/Dockerfile +32 -0
  121. package/docker/services/intelligent-mcp/config/service.json +28 -0
  122. package/docker/services/intelligent-mcp/entrypoint.js +51 -0
  123. package/docker/services/operations-mcp/Dockerfile +32 -0
  124. package/docker/services/operations-mcp/config/service.json +28 -0
  125. package/docker/services/operations-mcp/entrypoint.js +51 -0
  126. package/docker/services/platform-development-mcp/Dockerfile +32 -0
  127. package/docker/services/platform-development-mcp/config/service.json +28 -0
  128. package/docker/services/platform-development-mcp/entrypoint.js +51 -0
  129. package/docker/services/reporting-analytics-mcp/Dockerfile +32 -0
  130. package/docker/services/reporting-analytics-mcp/config/service.json +28 -0
  131. package/docker/services/reporting-analytics-mcp/entrypoint.js +51 -0
  132. package/docker/services/security-compliance-mcp/Dockerfile +32 -0
  133. package/docker/services/security-compliance-mcp/config/service.json +28 -0
  134. package/docker/services/security-compliance-mcp/entrypoint.js +51 -0
  135. package/docker/services/update-set-mcp/Dockerfile +32 -0
  136. package/docker/services/update-set-mcp/config/service.json +28 -0
  137. package/docker/services/update-set-mcp/entrypoint.js +51 -0
  138. package/docker-compose.override.yml +132 -0
  139. package/docker-compose.prod.yml +340 -0
  140. package/docker-compose.yml +579 -0
  141. package/k8s/automation-mcp.yaml +232 -0
  142. package/k8s/configmap.yaml +237 -0
  143. package/k8s/deployment-mcp.yaml +232 -0
  144. package/k8s/flow-composer-mcp.yaml +232 -0
  145. package/k8s/generate-k8s-manifests.js +453 -0
  146. package/k8s/graph-memory-mcp.yaml +232 -0
  147. package/k8s/infrastructure.yaml +456 -0
  148. package/k8s/ingress.yaml +361 -0
  149. package/k8s/integration-mcp.yaml +232 -0
  150. package/k8s/intelligent-mcp.yaml +232 -0
  151. package/k8s/kustomization.yaml +111 -0
  152. package/k8s/mcp-services.yaml +2552 -0
  153. package/k8s/monitoring.yaml +515 -0
  154. package/k8s/namespace.yaml +80 -0
  155. package/k8s/operations-mcp.yaml +232 -0
  156. package/k8s/platform-development-mcp.yaml +232 -0
  157. package/k8s/rbac.yaml +140 -0
  158. package/k8s/reporting-analytics-mcp.yaml +232 -0
  159. package/k8s/security-compliance-mcp.yaml +232 -0
  160. package/k8s/update-set-mcp.yaml +232 -0
  161. package/package.json +2 -2
@@ -1369,8 +1369,162 @@ class ServiceNowIntelligentMCP {
1369
1369
  if (results.length === 0) {
1370
1370
  throw new Error('No matching artifact found');
1371
1371
  }
1372
- // Return the best match (first result for now)
1373
- return results[0];
1372
+ // Return the best match based on relevance scoring
1373
+ return this.selectBestMatch(results, intent);
1374
+ }
1375
+ /**
1376
+ * Select the best matching artifact based on relevance scoring
1377
+ */
1378
+ selectBestMatch(results, intent) {
1379
+ if (results.length === 1) {
1380
+ return results[0];
1381
+ }
1382
+ // Score each result based on multiple factors
1383
+ const scoredResults = results.map(result => {
1384
+ let score = 0;
1385
+ // Name/title similarity
1386
+ const name = (result.name || result.title || '').toLowerCase();
1387
+ const identifier = intent.identifier.toLowerCase();
1388
+ if (name === identifier) {
1389
+ score += 100; // Exact match
1390
+ }
1391
+ else if (name.includes(identifier) || identifier.includes(name)) {
1392
+ score += 50; // Partial match
1393
+ }
1394
+ // Type match
1395
+ if (result.type === intent.artifactType) {
1396
+ score += 30;
1397
+ }
1398
+ // Recency (prefer more recently updated)
1399
+ if (result.sys_updated_on) {
1400
+ const daysSinceUpdate = (Date.now() - new Date(result.sys_updated_on).getTime()) / (1000 * 60 * 60 * 24);
1401
+ score += Math.max(0, 10 - daysSinceUpdate); // More points for recent updates
1402
+ }
1403
+ // Active/non-test artifacts preferred
1404
+ if (result.active !== false && !name.includes('test') && !name.includes('mock')) {
1405
+ score += 10;
1406
+ }
1407
+ return { result, score };
1408
+ });
1409
+ // Sort by score and return the best match
1410
+ scoredResults.sort((a, b) => b.score - a.score);
1411
+ this.logger.info('Selected best match', {
1412
+ selected: scoredResults[0].result.name,
1413
+ score: scoredResults[0].score,
1414
+ totalResults: results.length
1415
+ });
1416
+ return scoredResults[0].result;
1417
+ }
1418
+ /**
1419
+ * Perform comprehensive flow analysis and testing
1420
+ */
1421
+ async performFlowAnalysis(sysId, flowType, flowData) {
1422
+ const analysis = {
1423
+ structureValid: false,
1424
+ triggerAnalysis: null,
1425
+ recommendedTests: [],
1426
+ performanceScore: 0,
1427
+ securityIssues: [],
1428
+ integrationPoints: []
1429
+ };
1430
+ try {
1431
+ // Analyze flow structure
1432
+ if (flowType === 'flow_designer' && flowData.latest_snapshot) {
1433
+ const snapshot = JSON.parse(flowData.latest_snapshot);
1434
+ const activities = snapshot.activities || snapshot.steps || [];
1435
+ analysis.structureValid = activities.length > 0;
1436
+ analysis.performanceScore = this.calculateFlowPerformanceScore(activities);
1437
+ analysis.securityIssues = this.identifySecurityIssues(activities);
1438
+ analysis.integrationPoints = this.findIntegrationPoints(activities);
1439
+ }
1440
+ // Analyze trigger conditions
1441
+ if (flowData.table && flowData.condition) {
1442
+ analysis.triggerAnalysis = {
1443
+ table: flowData.table,
1444
+ condition: flowData.condition,
1445
+ active: flowData.active,
1446
+ validTrigger: true
1447
+ };
1448
+ // Recommend specific tests based on trigger
1449
+ analysis.recommendedTests = this.generateFlowTestRecommendations(flowData);
1450
+ }
1451
+ return analysis;
1452
+ }
1453
+ catch (error) {
1454
+ this.logger.error('Flow analysis failed', { sysId, error: error.message });
1455
+ return {
1456
+ ...analysis,
1457
+ error: error.message,
1458
+ recommendation: 'Use snow_test_flow_with_mock() for safer testing'
1459
+ };
1460
+ }
1461
+ }
1462
+ calculateFlowPerformanceScore(activities) {
1463
+ let score = 100;
1464
+ // Deduct points for potential performance issues
1465
+ activities.forEach(activity => {
1466
+ if (activity.type?.includes('wait') || activity.type?.includes('timer')) {
1467
+ score -= 5; // Wait activities can slow flows
1468
+ }
1469
+ if (activity.script && activity.script.length > 1000) {
1470
+ score -= 10; // Large scripts may impact performance
1471
+ }
1472
+ if (activity.type?.includes('loop')) {
1473
+ score -= 15; // Loops can be performance bottlenecks
1474
+ }
1475
+ });
1476
+ return Math.max(0, score);
1477
+ }
1478
+ identifySecurityIssues(activities) {
1479
+ const issues = [];
1480
+ activities.forEach((activity, index) => {
1481
+ if (activity.script) {
1482
+ // Check for potential security issues
1483
+ if (activity.script.includes('eval(')) {
1484
+ issues.push(`Activity ${index + 1}: Uses eval() which is a security risk`);
1485
+ }
1486
+ if (activity.script.includes('gs.getUser().getUserID()') && !activity.script.includes('canRead')) {
1487
+ issues.push(`Activity ${index + 1}: May have access control issues`);
1488
+ }
1489
+ if (activity.script.includes('XMLHttpRequest')) {
1490
+ issues.push(`Activity ${index + 1}: External HTTP calls may pose security risks`);
1491
+ }
1492
+ }
1493
+ });
1494
+ return issues;
1495
+ }
1496
+ findIntegrationPoints(activities) {
1497
+ const integrations = [];
1498
+ activities.forEach((activity, index) => {
1499
+ if (activity.type?.includes('rest') || activity.type?.includes('soap')) {
1500
+ integrations.push(`Activity ${index + 1}: External API integration (${activity.type})`);
1501
+ }
1502
+ if (activity.script && activity.script.includes('RESTMessage')) {
1503
+ integrations.push(`Activity ${index + 1}: REST Message integration`);
1504
+ }
1505
+ if (activity.script && activity.script.includes('SOAPMessage')) {
1506
+ integrations.push(`Activity ${index + 1}: SOAP Message integration`);
1507
+ }
1508
+ });
1509
+ return integrations;
1510
+ }
1511
+ generateFlowTestRecommendations(flowData) {
1512
+ const recommendations = [];
1513
+ if (flowData.table) {
1514
+ recommendations.push(`Create test record in ${flowData.table} table`);
1515
+ }
1516
+ if (flowData.condition) {
1517
+ recommendations.push(`Test with records that match condition: ${flowData.condition}`);
1518
+ recommendations.push(`Test with records that don't match condition (negative test)`);
1519
+ }
1520
+ if (flowData.trigger_type === 'record_updated') {
1521
+ recommendations.push('Test by updating existing records');
1522
+ }
1523
+ else if (flowData.trigger_type === 'record_created') {
1524
+ recommendations.push('Test by creating new records');
1525
+ }
1526
+ recommendations.push('Use snow_test_flow_with_mock() for isolated testing');
1527
+ return recommendations;
1374
1528
  }
1375
1529
  async analyzeModification(intent, artifact) {
1376
1530
  // Analyze what modification is needed
@@ -1638,14 +1792,16 @@ class ServiceNowIntelligentMCP {
1638
1792
  async refreshCache(table) {
1639
1793
  const results = [];
1640
1794
  if (table) {
1641
- // Refresh cache for specific table
1642
- results.push(`Refreshed cache for table: ${table}`);
1643
- // TODO: Implement table-specific cache refresh
1795
+ // Clear any cached data for specific table
1796
+ this.memoryIndex.clear(); // Clear in-memory cache
1797
+ results.push(`Cache cleared for table: ${table}`);
1798
+ results.push(`Note: This MCP uses real-time queries, no persistent cache to refresh`);
1644
1799
  }
1645
1800
  else {
1646
- // Refresh all caches
1647
- results.push('Refreshed all internal caches');
1648
- // TODO: Implement global cache refresh
1801
+ // Clear all in-memory data
1802
+ this.memoryIndex.clear();
1803
+ results.push('All internal caches cleared');
1804
+ results.push(`Note: This MCP uses real-time ServiceNow queries for accuracy`);
1649
1805
  }
1650
1806
  return results;
1651
1807
  }
@@ -1655,7 +1811,7 @@ class ServiceNowIntelligentMCP {
1655
1811
  // Validate specific sys_id
1656
1812
  try {
1657
1813
  const record = await this.client.getRecord(table, sys_id);
1658
- if (record) {
1814
+ if (record && record.success && record.data) {
1659
1815
  results.push(`✅ sys_id ${sys_id} validated in table ${table}`);
1660
1816
  }
1661
1817
  else {
@@ -1667,24 +1823,102 @@ class ServiceNowIntelligentMCP {
1667
1823
  }
1668
1824
  }
1669
1825
  else {
1670
- // Validate all known sys_ids in memory
1671
- results.push('Validated all sys_ids in memory index');
1672
- // TODO: Implement comprehensive sys_id validation
1826
+ // Validate all known sys_ids in memory index
1827
+ const memoryEntries = Array.from(this.memoryIndex.entries());
1828
+ if (memoryEntries.length === 0) {
1829
+ results.push('📝 No sys_ids found in memory index to validate');
1830
+ return results;
1831
+ }
1832
+ results.push(`🔍 Validating ${memoryEntries.length} sys_ids from memory index...`);
1833
+ let validCount = 0;
1834
+ let invalidCount = 0;
1835
+ for (const [key, data] of memoryEntries) {
1836
+ // Extract sys_id and table from memory data if available
1837
+ try {
1838
+ if (data.sys_id && data.table) {
1839
+ const record = await this.client.getRecord(data.table, data.sys_id);
1840
+ if (record && record.success && record.data) {
1841
+ validCount++;
1842
+ }
1843
+ else {
1844
+ invalidCount++;
1845
+ results.push(`❌ Invalid: ${data.sys_id} in ${data.table}`);
1846
+ }
1847
+ }
1848
+ }
1849
+ catch (error) {
1850
+ invalidCount++;
1851
+ results.push(`❌ Validation error for ${key}: ${error}`);
1852
+ }
1853
+ }
1854
+ results.push(`✅ Validation complete: ${validCount} valid, ${invalidCount} invalid`);
1673
1855
  }
1674
1856
  return results;
1675
1857
  }
1676
1858
  async reindexArtifacts(table) {
1677
1859
  const results = [];
1678
1860
  if (table) {
1679
- results.push(`Re-indexed artifacts in table: ${table}`);
1680
- // TODO: Implement table-specific re-indexing
1861
+ // Re-index artifacts from specific table
1862
+ try {
1863
+ // Query the table to get current artifacts
1864
+ const searchResults = await this.client.searchRecords(table, 'sys_idISNOTEMPTY', 100);
1865
+ if (searchResults.success && searchResults.data) {
1866
+ const artifacts = Array.isArray(searchResults.data) ? searchResults.data : [searchResults.data];
1867
+ // Clear existing entries for this table
1868
+ for (const [key, data] of this.memoryIndex.entries()) {
1869
+ if (data.table === table) {
1870
+ this.memoryIndex.delete(key);
1871
+ }
1872
+ }
1873
+ // Re-index with fresh data
1874
+ let indexedCount = 0;
1875
+ for (const artifact of artifacts) {
1876
+ if (artifact.sys_id && artifact.name) {
1877
+ const indexKey = `${table}_${artifact.name.replace(/\s+/g, '_')}`;
1878
+ this.memoryIndex.set(indexKey, {
1879
+ sys_id: artifact.sys_id,
1880
+ table: table,
1881
+ name: artifact.name,
1882
+ type: this.getArtifactTypeFromTable(table),
1883
+ indexed_at: new Date().toISOString()
1884
+ });
1885
+ indexedCount++;
1886
+ }
1887
+ }
1888
+ results.push(`✅ Re-indexed ${indexedCount} artifacts from table: ${table}`);
1889
+ }
1890
+ else {
1891
+ results.push(`⚠️ Could not fetch artifacts from table: ${table}`);
1892
+ }
1893
+ }
1894
+ catch (error) {
1895
+ results.push(`❌ Re-indexing failed for table ${table}: ${error}`);
1896
+ }
1681
1897
  }
1682
1898
  else {
1683
- results.push('Re-indexed all artifacts in memory');
1684
- // TODO: Implement global re-indexing
1899
+ // Re-index all known artifact tables
1900
+ const artifactTables = ['sp_widget', 'wf_workflow', 'sys_script_include', 'sys_script'];
1901
+ results.push(`🔍 Re-indexing artifacts from ${artifactTables.length} tables...`);
1902
+ let totalIndexed = 0;
1903
+ for (const tableName of artifactTables) {
1904
+ const tableResults = await this.reindexArtifacts(tableName);
1905
+ totalIndexed += tableResults.filter(r => r.includes('✅')).length;
1906
+ }
1907
+ results.push(`✅ Global re-indexing complete: ${totalIndexed} artifacts indexed`);
1908
+ results.push(`💾 Memory index size: ${this.memoryIndex.size} entries`);
1685
1909
  }
1686
1910
  return results;
1687
1911
  }
1912
+ getArtifactTypeFromTable(table) {
1913
+ const tableTypeMap = {
1914
+ 'sp_widget': 'widget',
1915
+ 'wf_workflow': 'flow',
1916
+ 'sys_script_include': 'script',
1917
+ 'sys_script': 'business_rule',
1918
+ 'sys_db_object': 'table'
1919
+ };
1920
+ return tableTypeMap[table] || 'unknown';
1921
+ }
1688
1922
  async performFullSync() {
1689
1923
  const results = [];
1690
1924
  // Combine all sync operations
@@ -1864,8 +2098,8 @@ class ServiceNowIntelligentMCP {
1864
2098
  // For flows that can be triggered programmatically
1865
2099
  const startTime = Date.now();
1866
2100
  try {
1867
- // Attempt to trigger the flow (this depends on the flow type and trigger conditions)
1868
- // For now, we'll simulate testing by checking flow structure and providing recommendations
2101
+ // Attempt to analyze and test the flow based on its type and trigger conditions
2102
+ const testResult = await this.performFlowAnalysis(sys_id, flowType, flowDetails.result);
1869
2103
  let flowActivities;
1870
2104
  if (flowType === 'flow_designer') {
1871
2105
  // For modern flows, get activities from flow definition