snow-flow 3.0.9 → 3.0.13

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 (302) hide show
  1. package/claude-flow.bat +0 -0
  2. package/claude-flow.ps1 +0 -0
  3. package/dist/mcp/intelligent-reporting-mcp.d.ts +7 -0
  4. package/dist/mcp/intelligent-reporting-mcp.js +379 -0
  5. package/dist/mcp/servicenow-automation-mcp.js +0 -0
  6. package/dist/mcp/servicenow-deployment-mcp.js +0 -0
  7. package/dist/mcp/servicenow-integration-mcp.js +0 -0
  8. package/dist/mcp/servicenow-mcp-server.js +0 -0
  9. package/dist/mcp/servicenow-operations-mcp.js +0 -0
  10. package/dist/mcp/servicenow-platform-development-mcp.js +0 -0
  11. package/dist/mcp/servicenow-progressive-indexer.js +0 -0
  12. package/dist/mcp/servicenow-reporting-analytics-mcp.js +280 -29
  13. package/dist/mcp/servicenow-security-compliance-mcp.js +0 -0
  14. package/dist/mcp/servicenow-update-set-mcp.js +0 -0
  15. package/dist/mcp/start-all-mcp-servers.js +0 -0
  16. package/dist/mcp/start-servicenow-mcp.js +0 -0
  17. package/dist/services/widget-deployment-service.d.ts +2 -1
  18. package/dist/services/widget-deployment-service.js +17 -16
  19. package/dist/utils/anti-mock-data-validator.d.ts +66 -0
  20. package/dist/utils/anti-mock-data-validator.js +316 -0
  21. package/dist/utils/servicenow-eventual-consistency.d.ts +120 -0
  22. package/dist/utils/servicenow-eventual-consistency.js +220 -0
  23. package/memory/agents/README.md +1 -1
  24. package/memory/claude-flow-data.json +1 -1
  25. package/memory/sessions/README.md +1 -1
  26. package/package.json +4 -3
  27. package/.mcp.json +0 -22
  28. package/claude-flow.config.json +0 -20
  29. package/dist/agents/app-creator.agent.d.ts +0 -55
  30. package/dist/agents/app-creator.agent.js +0 -1292
  31. package/dist/agents/base/base-snow-agent.d.ts +0 -75
  32. package/dist/agents/base/base-snow-agent.js +0 -169
  33. package/dist/agents/base-snow-agent.d.ts +0 -63
  34. package/dist/agents/base-snow-agent.js +0 -296
  35. package/dist/agents/coordinator.d.ts +0 -200
  36. package/dist/agents/coordinator.js +0 -777
  37. package/dist/agents/flow-builder-agent.d.ts +0 -18
  38. package/dist/agents/flow-builder-agent.js +0 -197
  39. package/dist/agents/queen-403-handler.d.ts +0 -47
  40. package/dist/agents/queen-403-handler.js +0 -175
  41. package/dist/agents/queen-agent-example.d.ts +0 -23
  42. package/dist/agents/queen-agent-example.js +0 -240
  43. package/dist/agents/queen-agent.test.d.ts +0 -6
  44. package/dist/agents/script-generator.agent.d.ts +0 -32
  45. package/dist/agents/script-generator.agent.js +0 -772
  46. package/dist/agents/script-writer-agent.d.ts +0 -22
  47. package/dist/agents/script-writer-agent.js +0 -695
  48. package/dist/agents/security-agent.d.ts +0 -23
  49. package/dist/agents/security-agent.js +0 -619
  50. package/dist/agents/specialists/automation-specialist.agent.d.ts +0 -44
  51. package/dist/agents/specialists/automation-specialist.agent.js +0 -204
  52. package/dist/agents/specialists/data-specialist.agent.d.ts +0 -165
  53. package/dist/agents/specialists/data-specialist.agent.js +0 -484
  54. package/dist/agents/specialists/integration-specialist.agent.d.ts +0 -227
  55. package/dist/agents/specialists/integration-specialist.agent.js +0 -725
  56. package/dist/agents/specialists/reporting-specialist.agent.d.ts +0 -54
  57. package/dist/agents/specialists/reporting-specialist.agent.js +0 -193
  58. package/dist/agents/specialists/security-specialist.agent.d.ts +0 -85
  59. package/dist/agents/specialists/security-specialist.agent.js +0 -309
  60. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.d.ts +0 -111
  61. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.js +0 -383
  62. package/dist/agents/teams/base-team.d.ts +0 -72
  63. package/dist/agents/teams/base-team.js +0 -253
  64. package/dist/agents/teams/team-types.d.ts +0 -265
  65. package/dist/agents/teams/team-types.js +0 -3
  66. package/dist/agents/teams/widget/widget-architect.agent.d.ts +0 -61
  67. package/dist/agents/teams/widget/widget-architect.agent.js +0 -436
  68. package/dist/agents/teams/widget/widget-backend.agent.d.ts +0 -74
  69. package/dist/agents/teams/widget/widget-backend.agent.js +0 -1531
  70. package/dist/agents/teams/widget/widget-frontend.agent.d.ts +0 -67
  71. package/dist/agents/teams/widget/widget-frontend.agent.js +0 -1014
  72. package/dist/agents/teams/widget/widget-platform.agent.d.ts +0 -90
  73. package/dist/agents/teams/widget/widget-platform.agent.js +0 -1190
  74. package/dist/agents/teams/widget/widget-uiux.agent.d.ts +0 -107
  75. package/dist/agents/teams/widget/widget-uiux.agent.js +0 -1033
  76. package/dist/agents/test-agent.d.ts +0 -26
  77. package/dist/agents/test-agent.js +0 -734
  78. package/dist/agents/test-agents.d.ts +0 -7
  79. package/dist/agents/test-agents.js +0 -64
  80. package/dist/agents/ui-builder.agent.d.ts +0 -50
  81. package/dist/agents/ui-builder.agent.js +0 -1539
  82. package/dist/agents/widget-builder.agent.d.ts +0 -32
  83. package/dist/agents/widget-builder.agent.js +0 -439
  84. package/dist/agents/widget-creator-agent.d.ts +0 -18
  85. package/dist/agents/widget-creator-agent.js +0 -498
  86. package/dist/agents/workflow-designer.agent.d.ts +0 -31
  87. package/dist/agents/workflow-designer.agent.js +0 -583
  88. package/dist/api/error-handling.d.ts +0 -325
  89. package/dist/api/error-handling.js +0 -1488
  90. package/dist/api/flow-designer-api.d.ts +0 -167
  91. package/dist/api/flow-designer-api.js +0 -554
  92. package/dist/api/natural-language-mapper.d.ts +0 -124
  93. package/dist/api/natural-language-mapper.js +0 -501
  94. package/dist/api/performance-optimizer.d.ts +0 -240
  95. package/dist/api/performance-optimizer.js +0 -706
  96. package/dist/api/transaction-manager.d.ts +0 -189
  97. package/dist/api/transaction-manager.js +0 -576
  98. package/dist/assembly/team-assembler.d.ts +0 -140
  99. package/dist/assembly/team-assembler.js +0 -502
  100. package/dist/benchmark-performance.d.ts +0 -41
  101. package/dist/benchmark-performance.js +0 -230
  102. package/dist/cli/snow-flow-cli-integration.d.ts +0 -30
  103. package/dist/cli/snow-flow-cli-integration.js +0 -396
  104. package/dist/coordination/coordination-engine.d.ts +0 -41
  105. package/dist/coordination/coordination-engine.js +0 -324
  106. package/dist/coordination/coordination.test.d.ts +0 -6
  107. package/dist/coordination/example.d.ts +0 -31
  108. package/dist/coordination/example.js +0 -394
  109. package/dist/coordination/execution-patterns.d.ts +0 -43
  110. package/dist/coordination/execution-patterns.js +0 -507
  111. package/dist/coordination/factory.d.ts +0 -94
  112. package/dist/coordination/factory.js +0 -433
  113. package/dist/coordination/index.d.ts +0 -71
  114. package/dist/coordination/index.js +0 -135
  115. package/dist/coordination/progress-monitor.d.ts +0 -71
  116. package/dist/coordination/progress-monitor.js +0 -505
  117. package/dist/coordination/quality-gates.d.ts +0 -124
  118. package/dist/coordination/quality-gates.js +0 -577
  119. package/dist/coordination/shared-memory.d.ts +0 -39
  120. package/dist/coordination/shared-memory.js +0 -289
  121. package/dist/coordination/task-dependencies.d.ts +0 -50
  122. package/dist/coordination/task-dependencies.js +0 -407
  123. package/dist/coordination/team-coordinator.d.ts +0 -59
  124. package/dist/coordination/team-coordinator.js +0 -550
  125. package/dist/coordination/types.d.ts +0 -152
  126. package/dist/coordination/types.js +0 -3
  127. package/dist/mcp/mcp-wrapper.d.ts +0 -8
  128. package/dist/mcp/mcp-wrapper.js +0 -77
  129. package/dist/mcp/servicenow-flow-composer-enhanced.js +0 -396
  130. package/dist/mcp/servicenow-flow-composer-mcp.d.ts +0 -7
  131. package/dist/mcp/servicenow-flow-composer-mcp.js +0 -3103
  132. package/dist/mcp/servicenow-graph-memory-mcp.d.ts +0 -7
  133. package/dist/mcp/servicenow-intelligent-mcp.d.ts +0 -143
  134. package/dist/mcp/servicenow-intelligent-mcp.js +0 -4156
  135. package/dist/mcp/servicenow-xml-flow-mcp.d.ts +0 -53
  136. package/dist/mcp/servicenow-xml-flow-mcp.js +0 -1704
  137. package/dist/mcp/singleton-check.js +0 -31
  138. package/dist/mcp/test-simple-mcp.d.ts +0 -6
  139. package/dist/mcp/test-simple-mcp.js +0 -63
  140. package/dist/memory/hierarchical-memory-system.d.ts +0 -90
  141. package/dist/memory/hierarchical-memory-system.js +0 -400
  142. package/dist/memory/index.d.ts +0 -9
  143. package/dist/memory/index.js +0 -20
  144. package/dist/memory/mcp-integration-example.d.ts +0 -6
  145. package/dist/memory/mcp-integration-example.js +0 -281
  146. package/dist/memory/memory-client.d.ts +0 -199
  147. package/dist/memory/memory-client.js +0 -364
  148. package/dist/memory/memory-manager.d.ts +0 -29
  149. package/dist/memory/memory-manager.js +0 -280
  150. package/dist/memory/memory-operations.d.ts +0 -179
  151. package/dist/memory/memory-operations.js +0 -691
  152. package/dist/memory/memory-system.d.ts +0 -153
  153. package/dist/memory/memory-system.js +0 -651
  154. package/dist/memory/memory-test.d.ts +0 -6
  155. package/dist/memory/memory-test.js +0 -161
  156. package/dist/memory/snow-flow-memory-patterns.d.ts +0 -213
  157. package/dist/memory/snow-flow-memory-patterns.js +0 -200
  158. package/dist/memory/snow-memory.d.ts +0 -54
  159. package/dist/memory/snow-memory.js +0 -301
  160. package/dist/memory/swarm-memory.d.ts +0 -135
  161. package/dist/memory/swarm-memory.js +0 -378
  162. package/dist/optimization/flow-performance-optimizer.js +0 -723
  163. package/dist/orchestration/discovery/service-discovery.d.ts +0 -81
  164. package/dist/orchestration/discovery/service-discovery.js +0 -808
  165. package/dist/orchestration/distributed-orchestrator.d.ts +0 -131
  166. package/dist/orchestration/distributed-orchestrator.js +0 -712
  167. package/dist/orchestration/distribution/task-distribution-engine.d.ts +0 -53
  168. package/dist/orchestration/distribution/task-distribution-engine.js +0 -586
  169. package/dist/orchestration/flow-update-orchestrator.js +0 -648
  170. package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +0 -606
  171. package/dist/orchestration/interfaces/distributed-orchestration.interface.js +0 -65
  172. package/dist/orchestration/protocols/mcpx-protocol.d.ts +0 -71
  173. package/dist/orchestration/protocols/mcpx-protocol.js +0 -668
  174. package/dist/orchestration/state/distributed-state-manager.d.ts +0 -89
  175. package/dist/orchestration/state/distributed-state-manager.js +0 -716
  176. package/dist/orchestrator/flow-composer.d.ts +0 -105
  177. package/dist/orchestrator/flow-composer.js +0 -404
  178. package/dist/orchestrator/flow-pattern-templates.d.ts +0 -260
  179. package/dist/orchestrator/flow-pattern-templates.js +0 -908
  180. package/dist/orchestrator/flow-subflow-decision-engine.d.ts +0 -202
  181. package/dist/orchestrator/flow-subflow-decision-engine.js +0 -769
  182. package/dist/orchestrator/flow-validation-engine.d.ts +0 -169
  183. package/dist/orchestrator/flow-validation-engine.js +0 -913
  184. package/dist/orchestrator/snow-orchestrator.d.ts +0 -49
  185. package/dist/orchestrator/snow-orchestrator.js +0 -235
  186. package/dist/orchestrator/subflow-creation-handler.d.ts +0 -230
  187. package/dist/orchestrator/subflow-creation-handler.js +0 -791
  188. package/dist/patterns/adaptive-patterns.d.ts +0 -140
  189. package/dist/patterns/adaptive-patterns.js +0 -549
  190. package/dist/queen/advanced-integration-test.d.ts +0 -48
  191. package/dist/queen/advanced-integration-test.js +0 -473
  192. package/dist/queen/integration-example.d.ts +0 -82
  193. package/dist/queen/integration-example.js +0 -219
  194. package/dist/queen/integration-test.d.ts +0 -72
  195. package/dist/queen/integration-test.js +0 -563
  196. package/dist/queen/mock-mcp-client.d.ts +0 -71
  197. package/dist/queen/mock-mcp-client.js +0 -317
  198. package/dist/queen/run-integration-tests.d.ts +0 -9
  199. package/dist/queen/run-integration-tests.js +0 -27
  200. package/dist/sparc/coordinators/adaptive-coordinator.d.ts +0 -54
  201. package/dist/sparc/coordinators/adaptive-coordinator.js +0 -367
  202. package/dist/sparc/coordinators/team-coordinator.d.ts +0 -66
  203. package/dist/sparc/coordinators/team-coordinator.js +0 -402
  204. package/dist/sparc/modes/team-modes.d.ts +0 -33
  205. package/dist/sparc/modes/team-modes.js +0 -399
  206. package/dist/sparc/teams/application-team.d.ts +0 -73
  207. package/dist/sparc/teams/application-team.js +0 -463
  208. package/dist/sparc/teams/flow-team.d.ts +0 -67
  209. package/dist/sparc/teams/flow-team.js +0 -373
  210. package/dist/sparc/teams/widget-team.d.ts +0 -61
  211. package/dist/sparc/teams/widget-team.js +0 -280
  212. package/dist/specialists/app-specialists.d.ts +0 -93
  213. package/dist/specialists/app-specialists.js +0 -1639
  214. package/dist/specialists/base-specialist.d.ts +0 -19
  215. package/dist/specialists/base-specialist.js +0 -54
  216. package/dist/specialists/flow-specialists.d.ts +0 -113
  217. package/dist/specialists/flow-specialists.js +0 -1787
  218. package/dist/specialists/individual-specialists.d.ts +0 -67
  219. package/dist/specialists/individual-specialists.js +0 -632
  220. package/dist/specialists/widget-specialists.d.ts +0 -70
  221. package/dist/specialists/widget-specialists.js +0 -1264
  222. package/dist/src/utils/agent-detector.js +0 -655
  223. package/dist/teams/adaptive-team.d.ts +0 -81
  224. package/dist/teams/adaptive-team.js +0 -1153
  225. package/dist/teams/application-team.d.ts +0 -30
  226. package/dist/teams/application-team.js +0 -547
  227. package/dist/teams/base-team.d.ts +0 -55
  228. package/dist/teams/base-team.js +0 -243
  229. package/dist/teams/flow-team.d.ts +0 -28
  230. package/dist/teams/flow-team.js +0 -525
  231. package/dist/teams/widget-team.d.ts +0 -26
  232. package/dist/teams/widget-team.js +0 -459
  233. package/dist/templates/flow-template-system.js +0 -625
  234. package/dist/test-fetch-incidents.d.ts +0 -2
  235. package/dist/test-fetch-incidents.js +0 -84
  236. package/dist/test-incident-access.d.ts +0 -2
  237. package/dist/test-incident-access.js +0 -72
  238. package/dist/test-iphone-flow.js +0 -189
  239. package/dist/test-limit-problem.d.ts +0 -2
  240. package/dist/test-limit-problem.js +0 -60
  241. package/dist/test-ml-batch-fix.d.ts +0 -2
  242. package/dist/test-ml-batch-fix.js +0 -104
  243. package/dist/test-ml-batch.d.ts +0 -2
  244. package/dist/test-ml-batch.js +0 -87
  245. package/dist/test-ml-query.d.ts +0 -2
  246. package/dist/test-ml-query.js +0 -100
  247. package/dist/test-ml-training-fix.d.ts +0 -12
  248. package/dist/test-ml-training-fix.js +0 -113
  249. package/dist/test-ml-training.d.ts +0 -2
  250. package/dist/test-ml-training.js +0 -32
  251. package/dist/test-operations-query.d.ts +0 -2
  252. package/dist/test-operations-query.js +0 -84
  253. package/dist/test-performance-query.d.ts +0 -2
  254. package/dist/test-performance-query.js +0 -52
  255. package/dist/test-singleton-protection.d.ts +0 -8
  256. package/dist/test-singleton-protection.js +0 -110
  257. package/dist/test-smart-limits.d.ts +0 -13
  258. package/dist/test-smart-limits.js +0 -100
  259. package/dist/test-snow-query-incidents.d.ts +0 -2
  260. package/dist/test-snow-query-incidents.js +0 -66
  261. package/dist/test-universal-query.d.ts +0 -2
  262. package/dist/test-universal-query.js +0 -106
  263. package/dist/testing/flow-testing-automation.js +0 -641
  264. package/dist/utils/complete-flow-xml-generator.js +0 -1285
  265. package/dist/utils/file-storage-fallback.d.ts +0 -62
  266. package/dist/utils/file-storage-fallback.js +0 -289
  267. package/dist/utils/flow-api-discovery.d.ts +0 -151
  268. package/dist/utils/flow-api-discovery.js +0 -439
  269. package/dist/utils/flow-examples.js +0 -720
  270. package/dist/utils/flow-structure-builder.js +0 -677
  271. package/dist/utils/flow-xml-generator.d.ts +0 -41
  272. package/dist/utils/flow-xml-generator.js +0 -258
  273. package/dist/utils/improved-flow-xml-generator.js +0 -820
  274. package/dist/utils/mcp-process-manager.backup.d.ts +0 -58
  275. package/dist/utils/mcp-process-manager.backup.js +0 -220
  276. package/dist/utils/mcp-singleton-enforcer.d.ts +0 -36
  277. package/dist/utils/mcp-singleton-enforcer.js +0 -201
  278. package/dist/utils/mcp-timeout-fix.d.ts +0 -53
  279. package/dist/utils/mcp-timeout-fix.js +0 -221
  280. package/dist/utils/migrate-claude-flow.d.ts +0 -22
  281. package/dist/utils/migrate-claude-flow.js +0 -120
  282. package/dist/utils/scope-utils.d.ts +0 -72
  283. package/dist/utils/scope-utils.js +0 -386
  284. package/dist/utils/snow-oauth-old.d.ts +0 -65
  285. package/dist/utils/snow-oauth-old.js +0 -345
  286. package/dist/utils/xml-first-flow-generator.js +0 -513
  287. package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +0 -30
  288. package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +0 -36
  289. package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +0 -30
  290. package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +0 -30
  291. package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +0 -55
  292. package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +0 -55
  293. package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +0 -9
  294. package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +0 -9
  295. package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +0 -8
  296. package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +0 -9
  297. package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +0 -9
  298. package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +0 -9
  299. package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +0 -58
  300. package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +0 -9
  301. package/reports/swarm-auto-centralized-1752649029776.json +0 -13
  302. package/src/memory/README.md +0 -240
@@ -1,152 +0,0 @@
1
- import { SnowAgent, TaskStatus } from '../types/snow-flow.types';
2
- export interface CoordinationResult {
3
- success: boolean;
4
- results: Record<string, any>;
5
- metrics: ExecutionMetrics;
6
- errors: Error[];
7
- warnings: string[];
8
- }
9
- export interface ExecutionMetrics {
10
- totalTasks: number;
11
- completedTasks: number;
12
- failedTasks: number;
13
- totalExecutionTime: number;
14
- averageTaskTime: number;
15
- concurrentTasks: number;
16
- }
17
- export interface TaskSpecification {
18
- name: string;
19
- description: string;
20
- tasks: TaskDefinition[];
21
- sharedContext: Record<string, any>;
22
- qualityGates: QualityGateConfig[];
23
- executionPattern?: 'sequential' | 'parallel' | 'hybrid';
24
- }
25
- export interface TaskDefinition {
26
- id: string;
27
- name: string;
28
- description: string;
29
- agentType: string;
30
- requirements: TaskRequirements;
31
- dependencies: string[];
32
- outputs: string[];
33
- priority: 'low' | 'medium' | 'high' | 'critical';
34
- estimatedDuration?: number;
35
- maxRetries?: number;
36
- }
37
- export interface TaskRequirements {
38
- inputs: Record<string, any>;
39
- outputs: string[];
40
- capabilities: string[];
41
- resources?: ResourceRequirement[];
42
- constraints?: Constraint[];
43
- }
44
- export interface ResourceRequirement {
45
- type: 'memory' | 'compute' | 'servicenow_access' | 'external_api';
46
- amount?: number;
47
- metadata?: Record<string, any>;
48
- }
49
- export interface Constraint {
50
- type: 'time' | 'resource' | 'dependency' | 'quality';
51
- value: any;
52
- description: string;
53
- }
54
- export interface TaskNode {
55
- id: string;
56
- agent: SnowAgent;
57
- requirements: TaskRequirements;
58
- status: TaskStatus;
59
- result: any;
60
- error?: Error;
61
- startTime?: Date;
62
- endTime?: Date;
63
- retryCount: number;
64
- qualityGateResults?: QualityGateResult[];
65
- }
66
- export interface AgentSubscriber {
67
- agent: SnowAgent;
68
- callback: (key: string, value: any) => Promise<void>;
69
- }
70
- export interface QualityGateConfig {
71
- name: string;
72
- taskIds: string[];
73
- gates: QualityGate[];
74
- }
75
- export interface QualityGate {
76
- name: string;
77
- blocking: boolean;
78
- validate(result: any): Promise<ValidationResult>;
79
- }
80
- export interface ValidationResult {
81
- passed: boolean;
82
- score?: number;
83
- error?: string;
84
- warnings?: string[];
85
- suggestions?: string[];
86
- metadata?: Record<string, any>;
87
- }
88
- export interface QualityGateResult {
89
- gateName: string;
90
- passed: boolean;
91
- blocking: boolean;
92
- validations: ValidationResult[];
93
- overallScore?: number;
94
- executionTime: number;
95
- }
96
- export interface ProgressStatus {
97
- total: number;
98
- completed: number;
99
- failed: number;
100
- inProgress: number;
101
- percentage: number;
102
- estimated_completion?: Date;
103
- currentPhase?: string;
104
- bottlenecks?: string[];
105
- }
106
- export interface ProgressListener {
107
- onProgress(event: string, data: any): void;
108
- }
109
- export interface ExecutionPlan {
110
- phases: ExecutionPhase[];
111
- totalEstimatedTime: number;
112
- criticalPath: string[];
113
- parallelizationOpportunities: ParallelGroup[];
114
- }
115
- export interface ExecutionPhase {
116
- id: string;
117
- type: 'sequential' | 'parallel';
118
- tasks: string[];
119
- estimatedDuration: number;
120
- dependencies: string[];
121
- }
122
- export interface ParallelGroup {
123
- tasks: string[];
124
- estimatedSavings: number;
125
- riskLevel: 'low' | 'medium' | 'high';
126
- }
127
- export interface BaseTeam {
128
- agents: Map<string, SnowAgent>;
129
- getAgent(id: string): SnowAgent | undefined;
130
- addAgent(agent: SnowAgent): void;
131
- removeAgent(id: string): void;
132
- getAvailableAgents(): SnowAgent[];
133
- getAgentsByType(type: string): SnowAgent[];
134
- }
135
- export interface MemoryValue {
136
- value: any;
137
- timestamp: number;
138
- version: number;
139
- metadata?: Record<string, any>;
140
- }
141
- export interface CoordinationConfig {
142
- maxConcurrentTasks: number;
143
- taskTimeout: number;
144
- enableRetries: boolean;
145
- maxRetries: number;
146
- enableQualityGates: boolean;
147
- enableProgressMonitoring: boolean;
148
- executionPattern: 'sequential' | 'parallel' | 'hybrid' | 'auto';
149
- memoryTtl: number;
150
- errorRecoveryStrategy: 'abort' | 'continue' | 'retry';
151
- }
152
- //# sourceMappingURL=types.d.ts.map
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * MCP Server Wrapper for ES Module compatibility
4
- * This wrapper dynamically imports the ES module MCP SDK
5
- */
6
- export declare function createMCPServer(serverScript: string): Promise<import("child_process").ChildProcessByStdio<null, import("stream").Readable, import("stream").Readable>>;
7
- export declare function startMCPServerProcess(serverPath: string): Promise<any>;
8
- //# sourceMappingURL=mcp-wrapper.d.ts.map
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- /**
4
- * MCP Server Wrapper for ES Module compatibility
5
- * This wrapper dynamically imports the ES module MCP SDK
6
- */
7
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- var desc = Object.getOwnPropertyDescriptor(m, k);
10
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
- desc = { enumerable: true, get: function() { return m[k]; } };
12
- }
13
- Object.defineProperty(o, k2, desc);
14
- }) : (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- o[k2] = m[k];
17
- }));
18
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
- Object.defineProperty(o, "default", { enumerable: true, value: v });
20
- }) : function(o, v) {
21
- o["default"] = v;
22
- });
23
- var __importStar = (this && this.__importStar) || (function () {
24
- var ownKeys = function(o) {
25
- ownKeys = Object.getOwnPropertyNames || function (o) {
26
- var ar = [];
27
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
- return ar;
29
- };
30
- return ownKeys(o);
31
- };
32
- return function (mod) {
33
- if (mod && mod.__esModule) return mod;
34
- var result = {};
35
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
- __setModuleDefault(result, mod);
37
- return result;
38
- };
39
- })();
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.createMCPServer = createMCPServer;
42
- exports.startMCPServerProcess = startMCPServerProcess;
43
- async function createMCPServer(serverScript) {
44
- try {
45
- // Dynamically import the ES module
46
- const { spawn } = await Promise.resolve().then(() => __importStar(require('child_process')));
47
- // Use node --experimental-modules for ES module support
48
- const process = spawn('node', ['--experimental-modules', serverScript], {
49
- stdio: ['ignore', 'pipe', 'pipe'],
50
- detached: true
51
- });
52
- return process;
53
- }
54
- catch (error) {
55
- console.error('Failed to create MCP server:', error);
56
- throw error;
57
- }
58
- }
59
- // Alternative: Create a simple Node.js script that works with CommonJS
60
- async function startMCPServerProcess(serverPath) {
61
- const { spawn } = require('child_process');
62
- // Start with explicit ES module support
63
- const process = spawn('node', [
64
- '--experimental-json-modules',
65
- '--experimental-modules',
66
- serverPath
67
- ], {
68
- stdio: ['ignore', 'pipe', 'pipe'],
69
- detached: true,
70
- env: {
71
- ...process.env,
72
- NODE_OPTIONS: '--experimental-modules'
73
- }
74
- });
75
- return process;
76
- }
77
- //# sourceMappingURL=mcp-wrapper.js.map
@@ -1,396 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- /**
4
- * Enhanced ServiceNow Flow Composer MCP Server
5
- *
6
- * Uses the complete solution components to fix all critical issues:
7
- * ✅ CompleteFlowXMLGenerator for proper flow generation
8
- * ✅ MCPToolRegistry for tool name resolution
9
- * ✅ DeploymentMetadataHandler for proper metadata responses
10
- */
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
13
- const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
14
- const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
15
- const servicenow_client_js_1 = require("../utils/servicenow-client.js");
16
- const snow_oauth_js_1 = require("../utils/snow-oauth.js");
17
- const logger_js_1 = require("../utils/logger.js");
18
- const complete_flow_xml_generator_js_1 = require("../utils/complete-flow-xml-generator.js");
19
- const update_set_importer_js_1 = require("../utils/update-set-importer.js");
20
- const mcp_tool_registry_js_1 = require("../utils/mcp-tool-registry.js");
21
- const deployment_metadata_handler_js_1 = require("../utils/deployment-metadata-handler.js");
22
- const natural_language_mapper_js_1 = require("../api/natural-language-mapper.js");
23
- class ServiceNowFlowComposerEnhanced {
24
- constructor() {
25
- this.toolRegistry = (0, mcp_tool_registry_js_1.getToolRegistry)();
26
- this.server = new index_js_1.Server({
27
- name: 'servicenow-flow-composer-enhanced',
28
- version: '2.0.0',
29
- }, {
30
- capabilities: {
31
- tools: {},
32
- },
33
- });
34
- this.client = new servicenow_client_js_1.ServiceNowClient();
35
- this.oauth = new snow_oauth_js_1.ServiceNowOAuth();
36
- this.logger = new logger_js_1.Logger('ServiceNowFlowComposerEnhanced');
37
- this.nlMapper = new natural_language_mapper_js_1.NaturalLanguageMapper();
38
- this.setupHandlers();
39
- }
40
- setupHandlers() {
41
- this.server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
42
- tools: [
43
- {
44
- name: 'snow_create_flow_enhanced',
45
- description: '🚀 ENHANCED Flow Creation - Creates COMPLETE flows with ALL features using the fixed XML generator. Solves all deployment issues!',
46
- inputSchema: {
47
- type: 'object',
48
- properties: {
49
- instruction: {
50
- type: 'string',
51
- description: 'Natural language instruction for the flow'
52
- },
53
- deploy_immediately: {
54
- type: 'boolean',
55
- description: 'Deploy the flow immediately to ServiceNow',
56
- default: true
57
- },
58
- return_metadata: {
59
- type: 'boolean',
60
- description: 'Return complete deployment metadata',
61
- default: true
62
- }
63
- },
64
- required: ['instruction'],
65
- },
66
- },
67
- {
68
- name: 'snow_test_complete_solution',
69
- description: 'Test the complete solution for all three critical issues',
70
- inputSchema: {
71
- type: 'object',
72
- properties: {}
73
- }
74
- },
75
- {
76
- name: 'snow_resolve_tool_name',
77
- description: 'Resolve a tool name using the enhanced registry',
78
- inputSchema: {
79
- type: 'object',
80
- properties: {
81
- tool_name: {
82
- type: 'string',
83
- description: 'Tool name to resolve'
84
- }
85
- },
86
- required: ['tool_name']
87
- }
88
- }
89
- ],
90
- }));
91
- this.server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
92
- const { name, arguments: args } = request.params;
93
- try {
94
- switch (name) {
95
- case 'snow_create_flow_enhanced':
96
- return await this.createEnhancedFlow(args);
97
- case 'snow_test_complete_solution':
98
- return await this.testCompleteSolution();
99
- case 'snow_resolve_tool_name':
100
- return await this.resolveToolName(args);
101
- default:
102
- throw new types_js_1.McpError(types_js_1.ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
103
- }
104
- }
105
- catch (error) {
106
- if (error instanceof types_js_1.McpError)
107
- throw error;
108
- this.logger.error(`Tool ${name} error:`, error);
109
- throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, error instanceof Error ? error.message : 'Unknown error');
110
- }
111
- });
112
- }
113
- /**
114
- * Create enhanced flow with complete solution
115
- */
116
- async createEnhancedFlow(args) {
117
- try {
118
- const { instruction, deploy_immediately = true, return_metadata = true } = args;
119
- this.logger.info('Creating enhanced flow from instruction:', instruction);
120
- // Parse natural language to flow requirements
121
- const flowRequirements = await this.nlMapper.parseFlowRequirements(instruction);
122
- // Convert to CompleteFlowDefinition
123
- const flowDef = {
124
- name: flowRequirements.name || `Flow_${Date.now()}`,
125
- description: flowRequirements.description || instruction,
126
- table: flowRequirements.tables?.[0] || 'incident',
127
- trigger_type: this.mapTriggerType(flowRequirements.trigger_type || 'manual'),
128
- trigger_condition: flowRequirements.trigger_condition || '',
129
- run_as: 'user',
130
- accessible_from: 'package_private',
131
- category: 'custom',
132
- tags: ['auto-generated', 'enhanced'],
133
- activities: this.convertToCompleteActivities(flowRequirements)
134
- };
135
- // Generate COMPLETE flow XML
136
- const result = (0, complete_flow_xml_generator_js_1.generateCompleteFlowXML)(flowDef);
137
- let deploymentResult = null;
138
- let metadata = null;
139
- // Deploy if requested
140
- if (deploy_immediately) {
141
- this.logger.info('Deploying flow XML...');
142
- const importResult = await (0, update_set_importer_js_1.deployFlowXML)(result.filePath, true);
143
- if (importResult.success && return_metadata) {
144
- // Extract complete metadata
145
- const metadataResult = await (0, deployment_metadata_handler_js_1.ensureDeploymentMetadata)('flow', { success: true, flow: { sys_id: importResult.flowSysId } }, {
146
- flowSysId: importResult.flowSysId || result.flowSysId,
147
- name: flowDef.name,
148
- update_set_id: importResult.localUpdateSetId
149
- });
150
- if (metadataResult.success) {
151
- metadata = metadataResult.metadata;
152
- }
153
- }
154
- deploymentResult = importResult;
155
- }
156
- return {
157
- contents: [
158
- {
159
- type: 'text',
160
- text: JSON.stringify({
161
- success: true,
162
- message: `✅ Enhanced flow created successfully!`,
163
- flow: {
164
- name: flowDef.name,
165
- description: flowDef.description,
166
- sys_id: metadata?.sys_id || result.flowSysId,
167
- api_endpoint: metadata?.api_endpoint,
168
- ui_url: metadata?.ui_url,
169
- activities_count: flowDef.activities.length,
170
- features: [
171
- 'Complete XML structure with v2 tables',
172
- 'Base64+gzip encoded values',
173
- 'Full label_cache structure',
174
- 'All requested features included',
175
- 'Production-ready deployment'
176
- ]
177
- },
178
- deployment: deploymentResult ? {
179
- status: deploymentResult.success ? 'deployed' : 'failed',
180
- update_set_id: deploymentResult.localUpdateSetId,
181
- preview_status: deploymentResult.previewStatus,
182
- commit_status: deploymentResult.commitStatus
183
- } : null,
184
- file: {
185
- path: result.filePath,
186
- size: require('fs').statSync(result.filePath).size
187
- },
188
- instructions: result.instructions
189
- }, null, 2)
190
- }
191
- ]
192
- };
193
- }
194
- catch (error) {
195
- this.logger.error('Enhanced flow creation failed:', error);
196
- throw error;
197
- }
198
- }
199
- /**
200
- * Test complete solution
201
- */
202
- async testCompleteSolution() {
203
- const testResults = {
204
- tool_registry: {
205
- test: 'Resolving problematic tool name',
206
- input: 'mcp__servicenow-operations__snow_table_schema_discovery',
207
- resolved: this.toolRegistry.resolveTool('mcp__servicenow-operations__snow_table_schema_discovery'),
208
- success: true
209
- },
210
- flow_generation: {
211
- test: 'Generating complete flow XML',
212
- flow_name: 'Test Incident Management Flow',
213
- features_included: [
214
- 'Automated assignment',
215
- 'SLA tracking',
216
- 'Knowledge base integration',
217
- 'Auto-resolution',
218
- 'Smart routing',
219
- 'Escalation',
220
- 'Priority tasks'
221
- ],
222
- xml_features: [
223
- 'v2 tables (sys_hub_action_instance_v2)',
224
- 'Base64+gzip encoding',
225
- 'Complete label_cache',
226
- 'All metadata fields'
227
- ],
228
- success: true
229
- },
230
- metadata_extraction: {
231
- test: 'Extracting deployment metadata',
232
- extracted_fields: [
233
- 'sys_id',
234
- 'api_endpoint',
235
- 'ui_url',
236
- 'verification_status'
237
- ],
238
- success: true
239
- },
240
- overall_status: 'ALL ISSUES RESOLVED ✅'
241
- };
242
- return {
243
- contents: [
244
- {
245
- type: 'text',
246
- text: JSON.stringify(testResults, null, 2)
247
- }
248
- ]
249
- };
250
- }
251
- /**
252
- * Resolve tool name using registry
253
- */
254
- async resolveToolName(args) {
255
- const { tool_name } = args;
256
- const resolved = this.toolRegistry.resolveTool(tool_name);
257
- const info = this.toolRegistry.getToolInfo(tool_name);
258
- return {
259
- contents: [
260
- {
261
- type: 'text',
262
- text: JSON.stringify({
263
- input: tool_name,
264
- resolved: resolved,
265
- found: !!resolved,
266
- info: info ? {
267
- canonical_name: info.canonicalName,
268
- provider: info.provider,
269
- description: info.description,
270
- aliases: info.aliases
271
- } : null
272
- }, null, 2)
273
- }
274
- ]
275
- };
276
- }
277
- /**
278
- * Map trigger type
279
- */
280
- mapTriggerType(type) {
281
- const typeMap = {
282
- 'create': 'record_created',
283
- 'update': 'record_updated',
284
- 'manual': 'manual',
285
- 'scheduled': 'scheduled',
286
- 'sla': 'sla',
287
- 'inbound': 'inbound_action'
288
- };
289
- return typeMap[type.toLowerCase()] || 'manual';
290
- }
291
- /**
292
- * Convert requirements to complete activities
293
- */
294
- convertToCompleteActivities(requirements) {
295
- const activities = [];
296
- // Always add comprehensive analysis as first step
297
- activities.push({
298
- name: 'Analyze Request',
299
- type: 'script',
300
- order: 100,
301
- description: 'Comprehensive analysis and categorization',
302
- inputs: {
303
- script: `// Automated analysis
304
- var analysis = {
305
- category: '',
306
- priority_score: 0,
307
- auto_resolvable: false,
308
- knowledge_matches: 0
309
- };
310
-
311
- // Analyze request
312
- if (current.short_description) {
313
- var desc = current.short_description.toLowerCase();
314
- // Category detection
315
- if (desc.includes('password')) {
316
- analysis.category = 'access';
317
- analysis.auto_resolvable = true;
318
- } else if (desc.includes('email')) {
319
- analysis.category = 'email';
320
- } else if (desc.includes('network')) {
321
- analysis.category = 'network';
322
- }
323
- }
324
-
325
- // Priority scoring
326
- analysis.priority_score = current.priority == 1 ? 100 : 50;
327
-
328
- return analysis;`
329
- },
330
- outputs: {
331
- category: 'string',
332
- priority_score: 'integer',
333
- auto_resolvable: 'boolean'
334
- }
335
- });
336
- // Add requested activities from requirements
337
- if (requirements.actions && Array.isArray(requirements.actions)) {
338
- requirements.actions.forEach((action, index) => {
339
- activities.push({
340
- name: action.name || `Activity ${index + 2}`,
341
- type: this.mapActionType(action.type || 'script'),
342
- order: (index + 2) * 100,
343
- description: action.description || action.name,
344
- inputs: action.config || action.inputs || {},
345
- outputs: action.outputs,
346
- condition: action.condition
347
- });
348
- });
349
- }
350
- // Always add status update at end
351
- activities.push({
352
- name: 'Update Status',
353
- type: 'update_record',
354
- order: (activities.length + 1) * 100,
355
- description: 'Update record with processing results',
356
- inputs: {
357
- table: '{{trigger.table}}',
358
- sys_id: '{{trigger.current.sys_id}}',
359
- fields: [
360
- {
361
- field: 'work_notes',
362
- value: 'Flow processing completed successfully'
363
- }
364
- ]
365
- }
366
- });
367
- return activities;
368
- }
369
- /**
370
- * Map action type
371
- */
372
- mapActionType(type) {
373
- const typeMap = {
374
- 'email': 'notification',
375
- 'notify': 'notification',
376
- 'approve': 'approval',
377
- 'script': 'script',
378
- 'create': 'create_record',
379
- 'update': 'update_record',
380
- 'rest': 'rest_step',
381
- 'wait': 'wait_for_condition'
382
- };
383
- return typeMap[type.toLowerCase()] || 'script';
384
- }
385
- async start() {
386
- const transport = new stdio_js_1.StdioServerTransport();
387
- await this.server.connect(transport);
388
- this.logger.info('Enhanced Flow Composer MCP server started');
389
- }
390
- }
391
- // Start the server
392
- const server = new ServiceNowFlowComposerEnhanced();
393
- server.start().catch(error => {
394
- console.error('Failed to start enhanced server:', error);
395
- process.exit(1);
396
- });
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * ServiceNow Flow Composer MCP Server
4
- * Natural language flow creation with multi-artifact orchestration
5
- */
6
- export {};
7
- //# sourceMappingURL=servicenow-flow-composer-mcp.d.ts.map