snow-flow 3.0.9 → 3.0.10

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 (294) hide show
  1. package/claude-flow.bat +0 -0
  2. package/claude-flow.ps1 +0 -0
  3. package/dist/mcp/servicenow-automation-mcp.js +0 -0
  4. package/dist/mcp/servicenow-deployment-mcp.js +0 -0
  5. package/dist/mcp/servicenow-integration-mcp.js +0 -0
  6. package/dist/mcp/servicenow-mcp-server.js +0 -0
  7. package/dist/mcp/servicenow-operations-mcp.js +0 -0
  8. package/dist/mcp/servicenow-platform-development-mcp.js +0 -0
  9. package/dist/mcp/servicenow-progressive-indexer.js +0 -0
  10. package/dist/mcp/servicenow-reporting-analytics-mcp.js +133 -19
  11. package/dist/mcp/servicenow-security-compliance-mcp.js +0 -0
  12. package/dist/mcp/servicenow-update-set-mcp.js +0 -0
  13. package/dist/mcp/start-all-mcp-servers.js +0 -0
  14. package/dist/mcp/start-servicenow-mcp.js +0 -0
  15. package/memory/agents/README.md +1 -1
  16. package/memory/claude-flow-data.json +1 -1
  17. package/memory/sessions/README.md +1 -1
  18. package/package.json +2 -2
  19. package/.mcp.json +0 -22
  20. package/claude-flow.config.json +0 -20
  21. package/dist/agents/app-creator.agent.d.ts +0 -55
  22. package/dist/agents/app-creator.agent.js +0 -1292
  23. package/dist/agents/base/base-snow-agent.d.ts +0 -75
  24. package/dist/agents/base/base-snow-agent.js +0 -169
  25. package/dist/agents/base-snow-agent.d.ts +0 -63
  26. package/dist/agents/base-snow-agent.js +0 -296
  27. package/dist/agents/coordinator.d.ts +0 -200
  28. package/dist/agents/coordinator.js +0 -777
  29. package/dist/agents/flow-builder-agent.d.ts +0 -18
  30. package/dist/agents/flow-builder-agent.js +0 -197
  31. package/dist/agents/queen-403-handler.d.ts +0 -47
  32. package/dist/agents/queen-403-handler.js +0 -175
  33. package/dist/agents/queen-agent-example.d.ts +0 -23
  34. package/dist/agents/queen-agent-example.js +0 -240
  35. package/dist/agents/queen-agent.test.d.ts +0 -6
  36. package/dist/agents/script-generator.agent.d.ts +0 -32
  37. package/dist/agents/script-generator.agent.js +0 -772
  38. package/dist/agents/script-writer-agent.d.ts +0 -22
  39. package/dist/agents/script-writer-agent.js +0 -695
  40. package/dist/agents/security-agent.d.ts +0 -23
  41. package/dist/agents/security-agent.js +0 -619
  42. package/dist/agents/specialists/automation-specialist.agent.d.ts +0 -44
  43. package/dist/agents/specialists/automation-specialist.agent.js +0 -204
  44. package/dist/agents/specialists/data-specialist.agent.d.ts +0 -165
  45. package/dist/agents/specialists/data-specialist.agent.js +0 -484
  46. package/dist/agents/specialists/integration-specialist.agent.d.ts +0 -227
  47. package/dist/agents/specialists/integration-specialist.agent.js +0 -725
  48. package/dist/agents/specialists/reporting-specialist.agent.d.ts +0 -54
  49. package/dist/agents/specialists/reporting-specialist.agent.js +0 -193
  50. package/dist/agents/specialists/security-specialist.agent.d.ts +0 -85
  51. package/dist/agents/specialists/security-specialist.agent.js +0 -309
  52. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.d.ts +0 -111
  53. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.js +0 -383
  54. package/dist/agents/teams/base-team.d.ts +0 -72
  55. package/dist/agents/teams/base-team.js +0 -253
  56. package/dist/agents/teams/team-types.d.ts +0 -265
  57. package/dist/agents/teams/team-types.js +0 -3
  58. package/dist/agents/teams/widget/widget-architect.agent.d.ts +0 -61
  59. package/dist/agents/teams/widget/widget-architect.agent.js +0 -436
  60. package/dist/agents/teams/widget/widget-backend.agent.d.ts +0 -74
  61. package/dist/agents/teams/widget/widget-backend.agent.js +0 -1531
  62. package/dist/agents/teams/widget/widget-frontend.agent.d.ts +0 -67
  63. package/dist/agents/teams/widget/widget-frontend.agent.js +0 -1014
  64. package/dist/agents/teams/widget/widget-platform.agent.d.ts +0 -90
  65. package/dist/agents/teams/widget/widget-platform.agent.js +0 -1190
  66. package/dist/agents/teams/widget/widget-uiux.agent.d.ts +0 -107
  67. package/dist/agents/teams/widget/widget-uiux.agent.js +0 -1033
  68. package/dist/agents/test-agent.d.ts +0 -26
  69. package/dist/agents/test-agent.js +0 -734
  70. package/dist/agents/test-agents.d.ts +0 -7
  71. package/dist/agents/test-agents.js +0 -64
  72. package/dist/agents/ui-builder.agent.d.ts +0 -50
  73. package/dist/agents/ui-builder.agent.js +0 -1539
  74. package/dist/agents/widget-builder.agent.d.ts +0 -32
  75. package/dist/agents/widget-builder.agent.js +0 -439
  76. package/dist/agents/widget-creator-agent.d.ts +0 -18
  77. package/dist/agents/widget-creator-agent.js +0 -498
  78. package/dist/agents/workflow-designer.agent.d.ts +0 -31
  79. package/dist/agents/workflow-designer.agent.js +0 -583
  80. package/dist/api/error-handling.d.ts +0 -325
  81. package/dist/api/error-handling.js +0 -1488
  82. package/dist/api/flow-designer-api.d.ts +0 -167
  83. package/dist/api/flow-designer-api.js +0 -554
  84. package/dist/api/natural-language-mapper.d.ts +0 -124
  85. package/dist/api/natural-language-mapper.js +0 -501
  86. package/dist/api/performance-optimizer.d.ts +0 -240
  87. package/dist/api/performance-optimizer.js +0 -706
  88. package/dist/api/transaction-manager.d.ts +0 -189
  89. package/dist/api/transaction-manager.js +0 -576
  90. package/dist/assembly/team-assembler.d.ts +0 -140
  91. package/dist/assembly/team-assembler.js +0 -502
  92. package/dist/benchmark-performance.d.ts +0 -41
  93. package/dist/benchmark-performance.js +0 -230
  94. package/dist/cli/snow-flow-cli-integration.d.ts +0 -30
  95. package/dist/cli/snow-flow-cli-integration.js +0 -396
  96. package/dist/coordination/coordination-engine.d.ts +0 -41
  97. package/dist/coordination/coordination-engine.js +0 -324
  98. package/dist/coordination/coordination.test.d.ts +0 -6
  99. package/dist/coordination/example.d.ts +0 -31
  100. package/dist/coordination/example.js +0 -394
  101. package/dist/coordination/execution-patterns.d.ts +0 -43
  102. package/dist/coordination/execution-patterns.js +0 -507
  103. package/dist/coordination/factory.d.ts +0 -94
  104. package/dist/coordination/factory.js +0 -433
  105. package/dist/coordination/index.d.ts +0 -71
  106. package/dist/coordination/index.js +0 -135
  107. package/dist/coordination/progress-monitor.d.ts +0 -71
  108. package/dist/coordination/progress-monitor.js +0 -505
  109. package/dist/coordination/quality-gates.d.ts +0 -124
  110. package/dist/coordination/quality-gates.js +0 -577
  111. package/dist/coordination/shared-memory.d.ts +0 -39
  112. package/dist/coordination/shared-memory.js +0 -289
  113. package/dist/coordination/task-dependencies.d.ts +0 -50
  114. package/dist/coordination/task-dependencies.js +0 -407
  115. package/dist/coordination/team-coordinator.d.ts +0 -59
  116. package/dist/coordination/team-coordinator.js +0 -550
  117. package/dist/coordination/types.d.ts +0 -152
  118. package/dist/coordination/types.js +0 -3
  119. package/dist/mcp/mcp-wrapper.d.ts +0 -8
  120. package/dist/mcp/mcp-wrapper.js +0 -77
  121. package/dist/mcp/servicenow-flow-composer-enhanced.js +0 -396
  122. package/dist/mcp/servicenow-flow-composer-mcp.d.ts +0 -7
  123. package/dist/mcp/servicenow-flow-composer-mcp.js +0 -3103
  124. package/dist/mcp/servicenow-graph-memory-mcp.d.ts +0 -7
  125. package/dist/mcp/servicenow-intelligent-mcp.d.ts +0 -143
  126. package/dist/mcp/servicenow-intelligent-mcp.js +0 -4156
  127. package/dist/mcp/servicenow-xml-flow-mcp.d.ts +0 -53
  128. package/dist/mcp/servicenow-xml-flow-mcp.js +0 -1704
  129. package/dist/mcp/singleton-check.js +0 -31
  130. package/dist/mcp/test-simple-mcp.d.ts +0 -6
  131. package/dist/mcp/test-simple-mcp.js +0 -63
  132. package/dist/memory/hierarchical-memory-system.d.ts +0 -90
  133. package/dist/memory/hierarchical-memory-system.js +0 -400
  134. package/dist/memory/index.d.ts +0 -9
  135. package/dist/memory/index.js +0 -20
  136. package/dist/memory/mcp-integration-example.d.ts +0 -6
  137. package/dist/memory/mcp-integration-example.js +0 -281
  138. package/dist/memory/memory-client.d.ts +0 -199
  139. package/dist/memory/memory-client.js +0 -364
  140. package/dist/memory/memory-manager.d.ts +0 -29
  141. package/dist/memory/memory-manager.js +0 -280
  142. package/dist/memory/memory-operations.d.ts +0 -179
  143. package/dist/memory/memory-operations.js +0 -691
  144. package/dist/memory/memory-system.d.ts +0 -153
  145. package/dist/memory/memory-system.js +0 -651
  146. package/dist/memory/memory-test.d.ts +0 -6
  147. package/dist/memory/memory-test.js +0 -161
  148. package/dist/memory/snow-flow-memory-patterns.d.ts +0 -213
  149. package/dist/memory/snow-flow-memory-patterns.js +0 -200
  150. package/dist/memory/snow-memory.d.ts +0 -54
  151. package/dist/memory/snow-memory.js +0 -301
  152. package/dist/memory/swarm-memory.d.ts +0 -135
  153. package/dist/memory/swarm-memory.js +0 -378
  154. package/dist/optimization/flow-performance-optimizer.js +0 -723
  155. package/dist/orchestration/discovery/service-discovery.d.ts +0 -81
  156. package/dist/orchestration/discovery/service-discovery.js +0 -808
  157. package/dist/orchestration/distributed-orchestrator.d.ts +0 -131
  158. package/dist/orchestration/distributed-orchestrator.js +0 -712
  159. package/dist/orchestration/distribution/task-distribution-engine.d.ts +0 -53
  160. package/dist/orchestration/distribution/task-distribution-engine.js +0 -586
  161. package/dist/orchestration/flow-update-orchestrator.js +0 -648
  162. package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +0 -606
  163. package/dist/orchestration/interfaces/distributed-orchestration.interface.js +0 -65
  164. package/dist/orchestration/protocols/mcpx-protocol.d.ts +0 -71
  165. package/dist/orchestration/protocols/mcpx-protocol.js +0 -668
  166. package/dist/orchestration/state/distributed-state-manager.d.ts +0 -89
  167. package/dist/orchestration/state/distributed-state-manager.js +0 -716
  168. package/dist/orchestrator/flow-composer.d.ts +0 -105
  169. package/dist/orchestrator/flow-composer.js +0 -404
  170. package/dist/orchestrator/flow-pattern-templates.d.ts +0 -260
  171. package/dist/orchestrator/flow-pattern-templates.js +0 -908
  172. package/dist/orchestrator/flow-subflow-decision-engine.d.ts +0 -202
  173. package/dist/orchestrator/flow-subflow-decision-engine.js +0 -769
  174. package/dist/orchestrator/flow-validation-engine.d.ts +0 -169
  175. package/dist/orchestrator/flow-validation-engine.js +0 -913
  176. package/dist/orchestrator/snow-orchestrator.d.ts +0 -49
  177. package/dist/orchestrator/snow-orchestrator.js +0 -235
  178. package/dist/orchestrator/subflow-creation-handler.d.ts +0 -230
  179. package/dist/orchestrator/subflow-creation-handler.js +0 -791
  180. package/dist/patterns/adaptive-patterns.d.ts +0 -140
  181. package/dist/patterns/adaptive-patterns.js +0 -549
  182. package/dist/queen/advanced-integration-test.d.ts +0 -48
  183. package/dist/queen/advanced-integration-test.js +0 -473
  184. package/dist/queen/integration-example.d.ts +0 -82
  185. package/dist/queen/integration-example.js +0 -219
  186. package/dist/queen/integration-test.d.ts +0 -72
  187. package/dist/queen/integration-test.js +0 -563
  188. package/dist/queen/mock-mcp-client.d.ts +0 -71
  189. package/dist/queen/mock-mcp-client.js +0 -317
  190. package/dist/queen/run-integration-tests.d.ts +0 -9
  191. package/dist/queen/run-integration-tests.js +0 -27
  192. package/dist/sparc/coordinators/adaptive-coordinator.d.ts +0 -54
  193. package/dist/sparc/coordinators/adaptive-coordinator.js +0 -367
  194. package/dist/sparc/coordinators/team-coordinator.d.ts +0 -66
  195. package/dist/sparc/coordinators/team-coordinator.js +0 -402
  196. package/dist/sparc/modes/team-modes.d.ts +0 -33
  197. package/dist/sparc/modes/team-modes.js +0 -399
  198. package/dist/sparc/teams/application-team.d.ts +0 -73
  199. package/dist/sparc/teams/application-team.js +0 -463
  200. package/dist/sparc/teams/flow-team.d.ts +0 -67
  201. package/dist/sparc/teams/flow-team.js +0 -373
  202. package/dist/sparc/teams/widget-team.d.ts +0 -61
  203. package/dist/sparc/teams/widget-team.js +0 -280
  204. package/dist/specialists/app-specialists.d.ts +0 -93
  205. package/dist/specialists/app-specialists.js +0 -1639
  206. package/dist/specialists/base-specialist.d.ts +0 -19
  207. package/dist/specialists/base-specialist.js +0 -54
  208. package/dist/specialists/flow-specialists.d.ts +0 -113
  209. package/dist/specialists/flow-specialists.js +0 -1787
  210. package/dist/specialists/individual-specialists.d.ts +0 -67
  211. package/dist/specialists/individual-specialists.js +0 -632
  212. package/dist/specialists/widget-specialists.d.ts +0 -70
  213. package/dist/specialists/widget-specialists.js +0 -1264
  214. package/dist/src/utils/agent-detector.js +0 -655
  215. package/dist/teams/adaptive-team.d.ts +0 -81
  216. package/dist/teams/adaptive-team.js +0 -1153
  217. package/dist/teams/application-team.d.ts +0 -30
  218. package/dist/teams/application-team.js +0 -547
  219. package/dist/teams/base-team.d.ts +0 -55
  220. package/dist/teams/base-team.js +0 -243
  221. package/dist/teams/flow-team.d.ts +0 -28
  222. package/dist/teams/flow-team.js +0 -525
  223. package/dist/teams/widget-team.d.ts +0 -26
  224. package/dist/teams/widget-team.js +0 -459
  225. package/dist/templates/flow-template-system.js +0 -625
  226. package/dist/test-fetch-incidents.d.ts +0 -2
  227. package/dist/test-fetch-incidents.js +0 -84
  228. package/dist/test-incident-access.d.ts +0 -2
  229. package/dist/test-incident-access.js +0 -72
  230. package/dist/test-iphone-flow.js +0 -189
  231. package/dist/test-limit-problem.d.ts +0 -2
  232. package/dist/test-limit-problem.js +0 -60
  233. package/dist/test-ml-batch-fix.d.ts +0 -2
  234. package/dist/test-ml-batch-fix.js +0 -104
  235. package/dist/test-ml-batch.d.ts +0 -2
  236. package/dist/test-ml-batch.js +0 -87
  237. package/dist/test-ml-query.d.ts +0 -2
  238. package/dist/test-ml-query.js +0 -100
  239. package/dist/test-ml-training-fix.d.ts +0 -12
  240. package/dist/test-ml-training-fix.js +0 -113
  241. package/dist/test-ml-training.d.ts +0 -2
  242. package/dist/test-ml-training.js +0 -32
  243. package/dist/test-operations-query.d.ts +0 -2
  244. package/dist/test-operations-query.js +0 -84
  245. package/dist/test-performance-query.d.ts +0 -2
  246. package/dist/test-performance-query.js +0 -52
  247. package/dist/test-singleton-protection.d.ts +0 -8
  248. package/dist/test-singleton-protection.js +0 -110
  249. package/dist/test-smart-limits.d.ts +0 -13
  250. package/dist/test-smart-limits.js +0 -100
  251. package/dist/test-snow-query-incidents.d.ts +0 -2
  252. package/dist/test-snow-query-incidents.js +0 -66
  253. package/dist/test-universal-query.d.ts +0 -2
  254. package/dist/test-universal-query.js +0 -106
  255. package/dist/testing/flow-testing-automation.js +0 -641
  256. package/dist/utils/complete-flow-xml-generator.js +0 -1285
  257. package/dist/utils/file-storage-fallback.d.ts +0 -62
  258. package/dist/utils/file-storage-fallback.js +0 -289
  259. package/dist/utils/flow-api-discovery.d.ts +0 -151
  260. package/dist/utils/flow-api-discovery.js +0 -439
  261. package/dist/utils/flow-examples.js +0 -720
  262. package/dist/utils/flow-structure-builder.js +0 -677
  263. package/dist/utils/flow-xml-generator.d.ts +0 -41
  264. package/dist/utils/flow-xml-generator.js +0 -258
  265. package/dist/utils/improved-flow-xml-generator.js +0 -820
  266. package/dist/utils/mcp-process-manager.backup.d.ts +0 -58
  267. package/dist/utils/mcp-process-manager.backup.js +0 -220
  268. package/dist/utils/mcp-singleton-enforcer.d.ts +0 -36
  269. package/dist/utils/mcp-singleton-enforcer.js +0 -201
  270. package/dist/utils/mcp-timeout-fix.d.ts +0 -53
  271. package/dist/utils/mcp-timeout-fix.js +0 -221
  272. package/dist/utils/migrate-claude-flow.d.ts +0 -22
  273. package/dist/utils/migrate-claude-flow.js +0 -120
  274. package/dist/utils/scope-utils.d.ts +0 -72
  275. package/dist/utils/scope-utils.js +0 -386
  276. package/dist/utils/snow-oauth-old.d.ts +0 -65
  277. package/dist/utils/snow-oauth-old.js +0 -345
  278. package/dist/utils/xml-first-flow-generator.js +0 -513
  279. package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +0 -30
  280. package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +0 -36
  281. package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +0 -30
  282. package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +0 -30
  283. package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +0 -55
  284. package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +0 -55
  285. package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +0 -9
  286. package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +0 -9
  287. package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +0 -8
  288. package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +0 -9
  289. package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +0 -9
  290. package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +0 -9
  291. package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +0 -58
  292. package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +0 -9
  293. package/reports/swarm-auto-centralized-1752649029776.json +0 -13
  294. package/src/memory/README.md +0 -240
@@ -1,725 +0,0 @@
1
- "use strict";
2
- /**
3
- * Integration Specialist Agent - Handles system integrations, APIs, and data synchronization
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.IntegrationSpecialistAgent = void 0;
7
- const base_snow_agent_js_1 = require("../base/base-snow-agent.js");
8
- class IntegrationSpecialistAgent extends base_snow_agent_js_1.BaseSnowAgent {
9
- constructor() {
10
- const capabilities = {
11
- primarySkills: [
12
- 'api_integration',
13
- 'data_synchronization',
14
- 'system_connectivity',
15
- 'authentication_setup',
16
- 'error_handling',
17
- 'monitoring_setup'
18
- ],
19
- secondarySkills: [
20
- 'performance_optimization',
21
- 'security_configuration',
22
- 'testing_automation',
23
- 'documentation',
24
- 'troubleshooting'
25
- ],
26
- complexity: 'high',
27
- autonomy: 'semi-autonomous'
28
- };
29
- super('integration-specialist', 'IntegrationSpecialist', capabilities);
30
- }
31
- /**
32
- * Execute integration-related tasks
33
- */
34
- async execute(task, input) {
35
- await this.startTask(task);
36
- try {
37
- const taskType = task.metadata?.type || 'integration_analysis';
38
- let result;
39
- switch (taskType) {
40
- case 'integration_analysis':
41
- result = await this.analyzeIntegrationNeeds(task.description, input);
42
- break;
43
- case 'integration_design':
44
- result = await this.createIntegration(input?.requirements || {});
45
- break;
46
- case 'api_setup':
47
- result = await this.setupAPIIntegration(input?.config || {});
48
- break;
49
- case 'data_sync':
50
- result = await this.setupDataSynchronization(input?.mapping || {});
51
- break;
52
- case 'monitoring_setup':
53
- result = await this.setupMonitoring(input?.requirements || {});
54
- break;
55
- case 'testing_setup':
56
- result = await this.setupIntegrationTesting(input?.config || {});
57
- break;
58
- default:
59
- result = await this.analyzeIntegrationNeeds(task.description, input);
60
- }
61
- await this.completeTask(result);
62
- return result;
63
- }
64
- catch (error) {
65
- await this.handleError(error);
66
- throw error;
67
- }
68
- }
69
- /**
70
- * Analyze integration needs from description
71
- */
72
- async analyzeIntegrationNeeds(description, context) {
73
- this.logger.info('Analyzing integration needs', { description });
74
- try {
75
- const normalizedDesc = description.toLowerCase();
76
- // Identify source and target systems
77
- const sourceSystem = this.identifySourceSystem(normalizedDesc);
78
- const targetSystem = this.identifyTargetSystem(normalizedDesc);
79
- // Determine synchronization type
80
- const synchronizationType = this.determineSyncType(normalizedDesc);
81
- // Plan data mapping
82
- const dataMapping = await this.planDataMapping(normalizedDesc, context);
83
- // Configure authentication
84
- const authentication = this.configureAuthentication(normalizedDesc);
85
- // Setup error handling
86
- const errorHandling = this.setupErrorHandling(normalizedDesc);
87
- // Configure monitoring
88
- const monitoring = this.configureMonitoring(normalizedDesc);
89
- const requirements = {
90
- sourceSystem,
91
- targetSystem,
92
- dataMapping,
93
- synchronizationType,
94
- authentication,
95
- errorHandling,
96
- monitoring
97
- };
98
- this.logger.info('Integration needs analysis completed', {
99
- sourceType: sourceSystem.type,
100
- targetType: targetSystem.type,
101
- syncType: synchronizationType,
102
- mappingCount: dataMapping.length
103
- });
104
- return requirements;
105
- }
106
- catch (error) {
107
- this.logger.error('Integration needs analysis failed', error);
108
- throw error;
109
- }
110
- }
111
- /**
112
- * Create comprehensive integration solution
113
- */
114
- async createIntegration(requirements) {
115
- this.logger.info('Creating integration solution', { requirements });
116
- try {
117
- // Generate unique integration ID
118
- const integrationId = `integration_${Date.now()}`;
119
- // Create integration components
120
- const components = await this.createIntegrationComponents(requirements);
121
- // Setup deployment configuration
122
- const deployment = this.createDeploymentConfig(requirements);
123
- // Setup testing configuration
124
- const testing = this.createTestingConfig(requirements);
125
- // Setup documentation
126
- const documentation = this.createDocumentationConfig(requirements);
127
- const integration = {
128
- id: integrationId,
129
- name: `${requirements.sourceSystem.name} to ${requirements.targetSystem.name} Integration`,
130
- description: `Integration between ${requirements.sourceSystem.name} and ${requirements.targetSystem.name}`,
131
- requirements,
132
- components,
133
- deployment,
134
- testing,
135
- documentation
136
- };
137
- // Validate integration design
138
- await this.validateIntegrationDesign(integration);
139
- this.logger.info('Integration solution created successfully', {
140
- integrationId,
141
- componentCount: components.length
142
- });
143
- return integration;
144
- }
145
- catch (error) {
146
- this.logger.error('Integration creation failed', error);
147
- throw error;
148
- }
149
- }
150
- /**
151
- * Setup API integration
152
- */
153
- async setupAPIIntegration(config) {
154
- this.logger.info('Setting up API integration', { config });
155
- const apiComponents = {
156
- restMessage: {
157
- name: `${config.name}_rest_message`,
158
- endpoint: config.endpoint || 'https://api.example.com',
159
- authentication: config.authentication || { type: 'api-key' },
160
- methods: [
161
- {
162
- name: 'GET',
163
- httpMethod: 'GET',
164
- endpoint: '/data',
165
- headers: { 'Content-Type': 'application/json' }
166
- },
167
- {
168
- name: 'POST',
169
- httpMethod: 'POST',
170
- endpoint: '/data',
171
- headers: { 'Content-Type': 'application/json' }
172
- }
173
- ]
174
- },
175
- transformMap: {
176
- name: `${config.name}_transform_map`,
177
- sourceTable: 'import_set_table',
178
- targetTable: config.targetTable || 'custom_table',
179
- fieldMappings: config.fieldMappings || []
180
- },
181
- scheduledJob: {
182
- name: `${config.name}_sync_job`,
183
- schedule: config.schedule || 'daily',
184
- script: this.generateSyncScript(config)
185
- }
186
- };
187
- return {
188
- success: true,
189
- components: apiComponents,
190
- recommendations: [
191
- 'Test API connectivity before full deployment',
192
- 'Setup monitoring for API health',
193
- 'Implement proper error handling and retries'
194
- ]
195
- };
196
- }
197
- /**
198
- * Setup data synchronization
199
- */
200
- async setupDataSynchronization(mapping) {
201
- this.logger.info('Setting up data synchronization', { mapping });
202
- const syncConfig = {
203
- schedule: mapping.schedule || 'hourly',
204
- direction: mapping.direction || 'bidirectional',
205
- conflictResolution: mapping.conflictResolution || 'last_write_wins',
206
- batchSize: mapping.batchSize || 100,
207
- incrementalSync: mapping.incrementalSync !== false,
208
- validation: {
209
- enabled: true,
210
- rules: [
211
- 'required_fields_check',
212
- 'data_type_validation',
213
- 'business_rule_validation'
214
- ]
215
- },
216
- monitoring: {
217
- successMetrics: true,
218
- errorTracking: true,
219
- performanceMonitoring: true
220
- }
221
- };
222
- return {
223
- success: true,
224
- configuration: syncConfig,
225
- estimatedSetupTime: '2-4 hours',
226
- requirements: [
227
- 'Source system API access',
228
- 'Target system write permissions',
229
- 'Monitoring dashboard setup'
230
- ]
231
- };
232
- }
233
- /**
234
- * Setup monitoring for integration
235
- */
236
- async setupMonitoring(requirements) {
237
- this.logger.info('Setting up integration monitoring', { requirements });
238
- const monitoringSetup = {
239
- healthChecks: [
240
- {
241
- name: 'API Connectivity',
242
- endpoint: '/health',
243
- interval: 300, // 5 minutes
244
- timeout: 30000, // 30 seconds
245
- alerts: ['email', 'slack']
246
- },
247
- {
248
- name: 'Data Sync Status',
249
- check: 'last_sync_timestamp',
250
- threshold: 3600000, // 1 hour
251
- alerts: ['email']
252
- }
253
- ],
254
- metrics: [
255
- 'request_count',
256
- 'response_time',
257
- 'error_rate',
258
- 'sync_success_rate',
259
- 'data_throughput'
260
- ],
261
- dashboards: [
262
- {
263
- name: 'Integration Overview',
264
- widgets: ['status', 'metrics', 'recent_errors']
265
- },
266
- {
267
- name: 'Performance Dashboard',
268
- widgets: ['response_times', 'throughput', 'error_trends']
269
- }
270
- ],
271
- alerting: {
272
- thresholds: {
273
- error_rate: { warning: 0.05, critical: 0.1 },
274
- response_time: { warning: 5000, critical: 10000 },
275
- sync_delay: { warning: 3600, critical: 7200 }
276
- },
277
- channels: requirements.alertChannels || ['email']
278
- }
279
- };
280
- return {
281
- success: true,
282
- monitoring: monitoringSetup,
283
- implementation: {
284
- effort: 'medium',
285
- duration: '1-2 days',
286
- dependencies: ['monitoring tools', 'alert channels']
287
- }
288
- };
289
- }
290
- /**
291
- * Setup integration testing
292
- */
293
- async setupIntegrationTesting(config) {
294
- this.logger.info('Setting up integration testing', { config });
295
- const testingFramework = {
296
- unitTests: [
297
- {
298
- name: 'Data Transformation Test',
299
- description: 'Verify data mapping and transformation',
300
- testData: 'sample_input.json',
301
- assertions: ['field_mapping', 'data_types', 'validation_rules']
302
- },
303
- {
304
- name: 'Authentication Test',
305
- description: 'Verify authentication mechanisms',
306
- testData: 'auth_credentials.json',
307
- assertions: ['token_generation', 'token_validation', 'refresh_flow']
308
- }
309
- ],
310
- integrationTests: [
311
- {
312
- name: 'End-to-End Sync Test',
313
- description: 'Full integration workflow test',
314
- scenario: 'create_update_sync_verify',
315
- dataSet: 'integration_test_data.json'
316
- },
317
- {
318
- name: 'Error Handling Test',
319
- description: 'Test error scenarios and recovery',
320
- scenarios: ['network_timeout', 'auth_failure', 'data_validation_error']
321
- }
322
- ],
323
- performanceTests: [
324
- {
325
- name: 'Load Test',
326
- load: 100, // requests per second
327
- duration: 300, // 5 minutes
328
- expectedResponseTime: 2000 // 2 seconds
329
- },
330
- {
331
- name: 'Stress Test',
332
- load: 500,
333
- duration: 600,
334
- expectedResponseTime: 5000
335
- }
336
- ],
337
- mockServices: {
338
- enabled: true,
339
- scenarios: [
340
- 'success_responses',
341
- 'error_responses',
342
- 'timeout_scenarios',
343
- 'partial_failures'
344
- ]
345
- }
346
- };
347
- return {
348
- success: true,
349
- testing: testingFramework,
350
- automation: {
351
- cicdIntegration: true,
352
- continuousTesting: true,
353
- reportGeneration: true
354
- }
355
- };
356
- }
357
- /**
358
- * Identify source system from description
359
- */
360
- identifySourceSystem(description) {
361
- // Common system patterns
362
- if (description.includes('salesforce') || description.includes('sfdc')) {
363
- return {
364
- name: 'Salesforce',
365
- type: 'REST',
366
- baseUrl: 'https://instance.salesforce.com',
367
- protocol: 'HTTPS',
368
- port: 443
369
- };
370
- }
371
- if (description.includes('sap') || description.includes('erp')) {
372
- return {
373
- name: 'SAP',
374
- type: 'SOAP',
375
- protocol: 'HTTPS',
376
- port: 443
377
- };
378
- }
379
- if (description.includes('database') || description.includes('sql')) {
380
- return {
381
- name: 'Database',
382
- type: 'Database',
383
- port: 1433
384
- };
385
- }
386
- // Default REST API
387
- return {
388
- name: 'External System',
389
- type: 'REST',
390
- protocol: 'HTTPS',
391
- port: 443
392
- };
393
- }
394
- /**
395
- * Identify target system (usually ServiceNow)
396
- */
397
- identifyTargetSystem(description) {
398
- return {
399
- name: 'ServiceNow',
400
- type: 'REST',
401
- baseUrl: `https://${process.env.SNOW_INSTANCE || 'instance'}.service-now.com`,
402
- protocol: 'HTTPS',
403
- port: 443
404
- };
405
- }
406
- /**
407
- * Determine synchronization type
408
- */
409
- determineSyncType(description) {
410
- if (description.includes('real-time') || description.includes('immediate')) {
411
- return 'real-time';
412
- }
413
- if (description.includes('batch') || description.includes('scheduled')) {
414
- return 'batch';
415
- }
416
- if (description.includes('on-demand') || description.includes('manual')) {
417
- return 'on-demand';
418
- }
419
- // Default to batch for most integrations
420
- return 'batch';
421
- }
422
- /**
423
- * Plan data mapping between systems
424
- */
425
- async planDataMapping(description, context) {
426
- const mappings = [];
427
- // Common field mappings
428
- const commonMappings = [
429
- {
430
- sourceField: 'id',
431
- targetField: 'external_id',
432
- required: true
433
- },
434
- {
435
- sourceField: 'name',
436
- targetField: 'short_description',
437
- required: true
438
- },
439
- {
440
- sourceField: 'description',
441
- targetField: 'description',
442
- required: false
443
- },
444
- {
445
- sourceField: 'status',
446
- targetField: 'state',
447
- transformation: {
448
- type: 'lookup',
449
- expression: 'status_mapping_table',
450
- parameters: { table: 'status_mapping' }
451
- },
452
- required: true
453
- },
454
- {
455
- sourceField: 'created_date',
456
- targetField: 'sys_created_on',
457
- transformation: {
458
- type: 'format',
459
- expression: 'ISO8601_to_ServiceNow_datetime',
460
- parameters: { format: 'yyyy-MM-dd HH:mm:ss' }
461
- },
462
- required: false
463
- }
464
- ];
465
- mappings.push(...commonMappings);
466
- // Add custom mappings based on context
467
- if (context?.customFields) {
468
- Object.entries(context.customFields).forEach(([source, target]) => {
469
- mappings.push({
470
- sourceField: source,
471
- targetField: target,
472
- required: false
473
- });
474
- });
475
- }
476
- return mappings;
477
- }
478
- /**
479
- * Configure authentication for integration
480
- */
481
- configureAuthentication(description) {
482
- if (description.includes('oauth') || description.includes('token')) {
483
- return {
484
- type: 'oauth',
485
- tokenEndpoint: '/oauth/token',
486
- refreshToken: true
487
- };
488
- }
489
- if (description.includes('api key') || description.includes('api-key')) {
490
- return {
491
- type: 'api-key'
492
- };
493
- }
494
- if (description.includes('certificate') || description.includes('cert')) {
495
- return {
496
- type: 'certificate'
497
- };
498
- }
499
- // Default to basic auth
500
- return {
501
- type: 'basic'
502
- };
503
- }
504
- /**
505
- * Setup error handling configuration
506
- */
507
- setupErrorHandling(description) {
508
- return {
509
- retryAttempts: 3,
510
- retryDelay: 5000, // 5 seconds
511
- failureActions: [
512
- {
513
- condition: 'network_timeout',
514
- action: 'retry',
515
- parameters: { maxRetries: 3, backoffDelay: 2000 }
516
- },
517
- {
518
- condition: 'authentication_failure',
519
- action: 'notify',
520
- parameters: { severity: 'high', channels: ['email'] }
521
- },
522
- {
523
- condition: 'data_validation_error',
524
- action: 'skip',
525
- parameters: { logError: true, continueProcessing: true }
526
- }
527
- ],
528
- alerting: {
529
- channels: ['email'],
530
- recipients: ['admin@company.com'],
531
- severity: 'medium'
532
- }
533
- };
534
- }
535
- /**
536
- * Configure monitoring setup
537
- */
538
- configureMonitoring(description) {
539
- return {
540
- metrics: [
541
- 'request_count',
542
- 'response_time',
543
- 'error_rate',
544
- 'data_throughput',
545
- 'sync_lag'
546
- ],
547
- healthChecks: [
548
- {
549
- name: 'API Health',
550
- endpoint: '/health',
551
- interval: 300000, // 5 minutes
552
- timeout: 30000 // 30 seconds
553
- }
554
- ],
555
- logging: {
556
- level: 'info',
557
- retention: 30, // 30 days
558
- structured: true
559
- },
560
- dashboard: true
561
- };
562
- }
563
- /**
564
- * Create integration components
565
- */
566
- async createIntegrationComponents(requirements) {
567
- const components = [];
568
- // REST Message component
569
- if (requirements.sourceSystem.type === 'REST') {
570
- components.push({
571
- type: 'rest_message',
572
- name: `${requirements.sourceSystem.name}_rest_message`,
573
- configuration: {
574
- endpoint: requirements.sourceSystem.baseUrl,
575
- authentication: requirements.authentication,
576
- timeout: requirements.sourceSystem.timeout || 30000
577
- },
578
- dependencies: []
579
- });
580
- }
581
- // Transform Map component
582
- components.push({
583
- type: 'transform_map',
584
- name: `${requirements.sourceSystem.name}_transform_map`,
585
- configuration: {
586
- sourceTable: 'import_set_table',
587
- targetTable: 'target_table',
588
- fieldMappings: requirements.dataMapping
589
- },
590
- dependencies: ['import_set']
591
- });
592
- // Import Set component
593
- components.push({
594
- type: 'import_set',
595
- name: `${requirements.sourceSystem.name}_import_set`,
596
- configuration: {
597
- label: `${requirements.sourceSystem.name} Import Set`,
598
- fields: requirements.dataMapping.map(mapping => mapping.sourceField)
599
- },
600
- dependencies: []
601
- });
602
- // Scheduled Job for batch sync
603
- if (requirements.synchronizationType === 'batch') {
604
- components.push({
605
- type: 'scheduled_job',
606
- name: `${requirements.sourceSystem.name}_sync_job`,
607
- configuration: {
608
- schedule: 'daily',
609
- script: this.generateSyncScript(requirements)
610
- },
611
- dependencies: ['rest_message', 'transform_map']
612
- });
613
- }
614
- return components;
615
- }
616
- /**
617
- * Create deployment configuration
618
- */
619
- createDeploymentConfig(requirements) {
620
- return {
621
- environment: 'development',
622
- rollbackPlan: 'Disable scheduled jobs and revert component changes',
623
- notifications: ['integration-team@company.com']
624
- };
625
- }
626
- /**
627
- * Create testing configuration
628
- */
629
- createTestingConfig(requirements) {
630
- return {
631
- unitTests: [
632
- {
633
- name: 'Data Mapping Test',
634
- description: 'Test data transformation logic',
635
- input: { sample: 'data' },
636
- expectedOutput: { transformed: 'data' },
637
- assertions: ['field_presence', 'data_types']
638
- }
639
- ],
640
- integrationTests: [
641
- {
642
- name: 'End-to-End Test',
643
- description: 'Full integration flow test',
644
- input: { test: 'scenario' },
645
- expectedOutput: { success: true },
646
- assertions: ['data_sync', 'error_handling']
647
- }
648
- ],
649
- performanceTests: [
650
- {
651
- name: 'Load Test',
652
- load: 10,
653
- duration: 60,
654
- expectedResponseTime: 5000
655
- }
656
- ],
657
- mockData: [
658
- {
659
- endpoint: '/test-data',
660
- responses: [
661
- {
662
- condition: 'success',
663
- response: { data: 'sample' },
664
- status: 200
665
- }
666
- ]
667
- }
668
- ]
669
- };
670
- }
671
- /**
672
- * Create documentation configuration
673
- */
674
- createDocumentationConfig(requirements) {
675
- return {
676
- apiDocumentation: true,
677
- userGuide: true,
678
- troubleshooting: true,
679
- examples: true
680
- };
681
- }
682
- /**
683
- * Validate integration design
684
- */
685
- async validateIntegrationDesign(integration) {
686
- // Validate component dependencies
687
- integration.components.forEach(component => {
688
- component.dependencies.forEach(dep => {
689
- const dependencyExists = integration.components.some(c => c.name.includes(dep));
690
- if (!dependencyExists) {
691
- this.logger.warn(`Component ${component.name} depends on ${dep} which is not found`);
692
- }
693
- });
694
- });
695
- // Validate authentication configuration
696
- if (!integration.requirements.authentication.type) {
697
- throw new Error('Authentication type is required');
698
- }
699
- // Validate data mappings
700
- if (integration.requirements.dataMapping.length === 0) {
701
- this.logger.warn('No data mappings defined - manual mapping may be required');
702
- }
703
- }
704
- /**
705
- * Generate synchronization script
706
- */
707
- generateSyncScript(config) {
708
- return `
709
- // Generated sync script for ${config.name || 'integration'}
710
- var syncManager = new SyncManager();
711
- try {
712
- var data = syncManager.fetchData('${config.endpoint || 'external_api'}');
713
- var transformedData = syncManager.transformData(data);
714
- var result = syncManager.loadData(transformedData);
715
- gs.info('Sync completed successfully: ' + result.recordsProcessed + ' records');
716
- } catch (error) {
717
- gs.error('Sync failed: ' + error.message);
718
- // Send notification to admin
719
- gs.eventQueue('sync.failed', null, error.message);
720
- }
721
- `.trim();
722
- }
723
- }
724
- exports.IntegrationSpecialistAgent = IntegrationSpecialistAgent;
725
- //# sourceMappingURL=integration-specialist.agent.js.map