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,49 +0,0 @@
1
- /**
2
- * ServiceNow Multi-Agent Orchestrator
3
- */
4
- import { ServiceNowConfig, AgentTask } from '../types/servicenow.types.js';
5
- export declare class ServiceNowOrchestrator {
6
- private agents;
7
- private config;
8
- private logger;
9
- private taskQueue;
10
- private activeAgents;
11
- constructor(config: ServiceNowConfig);
12
- /**
13
- * Initialize all ServiceNow agents
14
- */
15
- private initializeAgents;
16
- /**
17
- * Register an agent with the orchestrator
18
- */
19
- private registerAgent;
20
- /**
21
- * Submit a task to the orchestrator
22
- */
23
- submitTask(task: AgentTask): Promise<void>;
24
- /**
25
- * Process tasks from the queue
26
- */
27
- private processTasks;
28
- /**
29
- * Execute a single task
30
- */
31
- private executeTask;
32
- /**
33
- * Select the appropriate agent for a task
34
- */
35
- private selectAgent;
36
- /**
37
- * Process orchestration commands
38
- */
39
- private processCommands;
40
- /**
41
- * Get orchestrator status
42
- */
43
- getStatus(): any;
44
- /**
45
- * Create a complex ServiceNow application from requirements
46
- */
47
- createApplicationFromRequirements(requirements: string, options?: any): Promise<void>;
48
- }
49
- //# sourceMappingURL=snow-orchestrator.d.ts.map
@@ -1,235 +0,0 @@
1
- "use strict";
2
- /**
3
- * ServiceNow Multi-Agent Orchestrator
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ServiceNowOrchestrator = void 0;
7
- const widget_builder_agent_js_1 = require("../agents/widget-builder.agent.js");
8
- const workflow_designer_agent_js_1 = require("../agents/workflow-designer.agent.js");
9
- const script_generator_agent_js_1 = require("../agents/script-generator.agent.js");
10
- const ui_builder_agent_js_1 = require("../agents/ui-builder.agent.js");
11
- const app_creator_agent_js_1 = require("../agents/app-creator.agent.js");
12
- const logger_js_1 = require("../utils/logger.js");
13
- class ServiceNowOrchestrator {
14
- constructor(config) {
15
- this.config = config;
16
- this.agents = new Map();
17
- this.taskQueue = [];
18
- this.activeAgents = new Set();
19
- this.logger = new logger_js_1.Logger('orchestrator');
20
- this.initializeAgents();
21
- }
22
- /**
23
- * Initialize all ServiceNow agents
24
- */
25
- initializeAgents() {
26
- this.logger.info('Initializing ServiceNow agents...');
27
- // Create and register agents
28
- this.registerAgent(new widget_builder_agent_js_1.WidgetBuilderAgent(this.config));
29
- this.registerAgent(new workflow_designer_agent_js_1.WorkflowDesignerAgent(this.config));
30
- this.registerAgent(new script_generator_agent_js_1.ScriptGeneratorAgent(this.config));
31
- this.registerAgent(new ui_builder_agent_js_1.UIBuilderAgent(this.config));
32
- this.registerAgent(new app_creator_agent_js_1.AppCreatorAgent(this.config));
33
- this.logger.info(`Initialized ${this.agents.size} agents`);
34
- }
35
- /**
36
- * Register an agent with the orchestrator
37
- */
38
- registerAgent(agent) {
39
- this.agents.set(agent.type, agent);
40
- this.logger.info(`Registered agent: ${agent.name} (${agent.type})`);
41
- }
42
- /**
43
- * Submit a task to the orchestrator
44
- */
45
- async submitTask(task) {
46
- this.logger.info(`Task submitted: ${task.id} - ${task.description}`);
47
- this.taskQueue.push(task);
48
- // Process immediately if no other tasks are running
49
- if (this.activeAgents.size === 0) {
50
- await this.processTasks();
51
- }
52
- }
53
- /**
54
- * Process tasks from the queue
55
- */
56
- async processTasks() {
57
- while (this.taskQueue.length > 0) {
58
- const task = this.taskQueue.shift();
59
- await this.executeTask(task);
60
- }
61
- }
62
- /**
63
- * Execute a single task
64
- */
65
- async executeTask(task) {
66
- try {
67
- // Determine which agent should handle the task
68
- const agent = this.selectAgent(task);
69
- if (!agent) {
70
- throw new Error(`No agent available for task type: ${task.type}`);
71
- }
72
- this.activeAgents.add(agent.name);
73
- this.logger.info(`Assigning task ${task.id} to agent: ${agent.name}`);
74
- // Coordinate with other agents
75
- const otherAgents = Array.from(this.agents.values()).filter(a => a !== agent);
76
- await agent.coordinate(otherAgents);
77
- // Execute the task
78
- const result = await agent.execute(task);
79
- if (result.success) {
80
- this.logger.info(`Task ${task.id} completed successfully`);
81
- // Process any orchestration commands
82
- if (result.commands) {
83
- await this.processCommands(result.commands);
84
- }
85
- }
86
- else {
87
- this.logger.error(`Task ${task.id} failed: ${result.error}`);
88
- }
89
- }
90
- catch (error) {
91
- this.logger.error(`Task execution error: ${error.message}`);
92
- }
93
- finally {
94
- // Remove from active agents
95
- const agent = this.selectAgent(task);
96
- if (agent) {
97
- this.activeAgents.delete(agent.name);
98
- }
99
- }
100
- }
101
- /**
102
- * Select the appropriate agent for a task
103
- */
104
- selectAgent(task) {
105
- // Map task types to agent types
106
- const taskToAgentMap = {
107
- 'create_widget': servicenow_types_js_1.AgentType.WIDGET_BUILDER,
108
- 'update_widget': servicenow_types_js_1.AgentType.WIDGET_BUILDER,
109
- 'generate_template': servicenow_types_js_1.AgentType.WIDGET_BUILDER,
110
- 'widget_from_spec': servicenow_types_js_1.AgentType.WIDGET_BUILDER,
111
- 'create_workflow': servicenow_types_js_1.AgentType.WORKFLOW_DESIGNER,
112
- 'add_workflow_components': servicenow_types_js_1.AgentType.WORKFLOW_DESIGNER,
113
- 'generate_flow_from_requirements': servicenow_types_js_1.AgentType.WORKFLOW_DESIGNER,
114
- 'optimize_workflow': servicenow_types_js_1.AgentType.WORKFLOW_DESIGNER,
115
- 'generate_business_rule': servicenow_types_js_1.AgentType.SCRIPT_GENERATOR,
116
- 'generate_script_include': servicenow_types_js_1.AgentType.SCRIPT_GENERATOR,
117
- 'generate_client_script': servicenow_types_js_1.AgentType.SCRIPT_GENERATOR,
118
- 'generate_from_requirements': servicenow_types_js_1.AgentType.SCRIPT_GENERATOR,
119
- 'optimize_script': servicenow_types_js_1.AgentType.SCRIPT_GENERATOR,
120
- 'create_ui_page': servicenow_types_js_1.AgentType.UI_BUILDER,
121
- 'create_ui_action': servicenow_types_js_1.AgentType.UI_BUILDER,
122
- 'generate_ui_from_spec': servicenow_types_js_1.AgentType.UI_BUILDER,
123
- 'create_form_layout': servicenow_types_js_1.AgentType.UI_BUILDER,
124
- 'create_ui_components': servicenow_types_js_1.AgentType.UI_BUILDER,
125
- 'create_application': servicenow_types_js_1.AgentType.APP_CREATOR,
126
- 'generate_from_requirements': servicenow_types_js_1.AgentType.APP_CREATOR,
127
- 'add_app_components': servicenow_types_js_1.AgentType.APP_CREATOR,
128
- 'package_application': servicenow_types_js_1.AgentType.APP_CREATOR
129
- };
130
- const agentType = taskToAgentMap[task.type];
131
- return agentType ? this.agents.get(agentType) : undefined;
132
- }
133
- /**
134
- * Process orchestration commands
135
- */
136
- async processCommands(commands) {
137
- this.logger.info(`Processing ${commands.length} orchestration commands`);
138
- // In a real implementation, these commands would be executed
139
- // For now, we'll log them
140
- commands.forEach(cmd => {
141
- this.logger.debug(`Command: ${cmd.tool}.${cmd.action} - ${cmd.description}`);
142
- });
143
- }
144
- /**
145
- * Get orchestrator status
146
- */
147
- getStatus() {
148
- return {
149
- agents: Array.from(this.agents.entries()).map(([type, agent]) => ({
150
- type,
151
- name: agent.name,
152
- capabilities: agent.capabilities,
153
- active: this.activeAgents.has(agent.name)
154
- })),
155
- queueLength: this.taskQueue.length,
156
- activeAgents: Array.from(this.activeAgents)
157
- };
158
- }
159
- /**
160
- * Create a complex ServiceNow application from requirements
161
- */
162
- async createApplicationFromRequirements(requirements, options) {
163
- this.logger.info('Creating application from requirements...');
164
- // Break down into coordinated tasks
165
- const tasks = [
166
- {
167
- id: 'app-1',
168
- type: 'create_application',
169
- description: 'Create base application structure',
170
- payload: {
171
- name: options?.name || 'Custom Application',
172
- description: requirements,
173
- vendor: options?.vendor
174
- },
175
- priority: 'high'
176
- },
177
- {
178
- id: 'workflow-1',
179
- type: 'generate_flow_from_requirements',
180
- description: 'Generate workflows based on requirements',
181
- payload: {
182
- requirements,
183
- name: 'Main Process Flow'
184
- },
185
- priority: 'high',
186
- dependencies: ['app-1']
187
- },
188
- {
189
- id: 'script-1',
190
- type: 'generate_from_requirements',
191
- description: 'Generate necessary scripts',
192
- payload: {
193
- requirements,
194
- scriptType: 'business_rule'
195
- },
196
- priority: 'medium',
197
- dependencies: ['app-1']
198
- },
199
- {
200
- id: 'ui-1',
201
- type: 'generate_ui_from_spec',
202
- description: 'Generate UI components',
203
- payload: {
204
- spec: {
205
- name: 'Application Dashboard',
206
- type: 'dashboard'
207
- },
208
- type: 'dashboard'
209
- },
210
- priority: 'medium',
211
- dependencies: ['app-1']
212
- },
213
- {
214
- id: 'widget-1',
215
- type: 'widget_from_spec',
216
- description: 'Create dashboard widgets',
217
- payload: {
218
- name: 'Status Widget',
219
- components: [
220
- { type: 'metric', binding: 'total_count' },
221
- { type: 'list', binding: 'recent_items' }
222
- ]
223
- },
224
- priority: 'low',
225
- dependencies: ['ui-1']
226
- }
227
- ];
228
- // Submit all tasks
229
- for (const task of tasks) {
230
- await this.submitTask(task);
231
- }
232
- }
233
- }
234
- exports.ServiceNowOrchestrator = ServiceNowOrchestrator;
235
- //# sourceMappingURL=snow-orchestrator.js.map
@@ -1,230 +0,0 @@
1
- /**
2
- * ServiceNow Subflow Creation Handler
3
- *
4
- * This module handles the creation of subflows with proper input/output management,
5
- * validation, and integration with the main flow composer.
6
- */
7
- import { SubflowCandidate, SubflowInput, SubflowOutput, ComplexityLevel, ReusabilityLevel } from './flow-subflow-decision-engine.js';
8
- /**
9
- * Subflow definition structure
10
- */
11
- export interface SubflowDefinition {
12
- name: string;
13
- label: string;
14
- description: string;
15
- category: string;
16
- inputs: SubflowInputDefinition[];
17
- outputs: SubflowOutputDefinition[];
18
- activities: SubflowActivity[];
19
- connections: SubflowConnection[];
20
- errorHandling: SubflowErrorHandling[];
21
- metadata: SubflowMetadata;
22
- }
23
- /**
24
- * Enhanced subflow input definition
25
- */
26
- export interface SubflowInputDefinition extends SubflowInput {
27
- label: string;
28
- category: string;
29
- order: number;
30
- tooltip?: string;
31
- placeholder?: string;
32
- options?: string[];
33
- dependsOn?: string[];
34
- conditionalLogic?: string;
35
- }
36
- /**
37
- * Enhanced subflow output definition
38
- */
39
- export interface SubflowOutputDefinition extends SubflowOutput {
40
- label: string;
41
- category: string;
42
- order: number;
43
- tooltip?: string;
44
- format?: string;
45
- conditionalLogic?: string;
46
- }
47
- /**
48
- * Subflow activity definition
49
- */
50
- export interface SubflowActivity {
51
- id: string;
52
- name: string;
53
- type: string;
54
- label: string;
55
- description: string;
56
- inputs: Record<string, any>;
57
- outputs: Record<string, any>;
58
- position: {
59
- x: number;
60
- y: number;
61
- };
62
- configuration: Record<string, any>;
63
- errorHandling: ActivityErrorHandling[];
64
- }
65
- /**
66
- * Subflow connection definition
67
- */
68
- export interface SubflowConnection {
69
- id: string;
70
- from: string;
71
- to: string;
72
- label?: string;
73
- condition?: string;
74
- conditionLabel?: string;
75
- errorPath?: boolean;
76
- }
77
- /**
78
- * Subflow error handling
79
- */
80
- export interface SubflowErrorHandling {
81
- id: string;
82
- condition: string;
83
- action: 'retry' | 'skip' | 'stop' | 'notify' | 'fallback';
84
- parameters: Record<string, any>;
85
- description: string;
86
- }
87
- /**
88
- * Activity-specific error handling
89
- */
90
- export interface ActivityErrorHandling {
91
- condition: string;
92
- action: string;
93
- parameters: Record<string, any>;
94
- }
95
- /**
96
- * Subflow metadata
97
- */
98
- export interface SubflowMetadata {
99
- version: string;
100
- author: string;
101
- created: Date;
102
- updated: Date;
103
- tags: string[];
104
- complexity: ComplexityLevel;
105
- reusability: ReusabilityLevel;
106
- testCoverage: number;
107
- documentation: string;
108
- dependencies: string[];
109
- compatibleVersions: string[];
110
- }
111
- /**
112
- * Subflow creation result
113
- */
114
- export interface SubflowCreationResult {
115
- success: boolean;
116
- subflow?: SubflowDefinition;
117
- sys_id?: string;
118
- url?: string;
119
- validationErrors?: string[];
120
- warnings?: string[];
121
- recommendations?: string[];
122
- }
123
- /**
124
- * Subflow template
125
- */
126
- export interface SubflowTemplate {
127
- name: string;
128
- description: string;
129
- category: string;
130
- complexity: ComplexityLevel;
131
- baseInputs: SubflowInputDefinition[];
132
- baseOutputs: SubflowOutputDefinition[];
133
- baseActivities: SubflowActivity[];
134
- baseConnections: SubflowConnection[];
135
- customizationPoints: string[];
136
- }
137
- /**
138
- * Subflow Creation Handler
139
- */
140
- export declare class SubflowCreationHandler {
141
- private logger;
142
- private client;
143
- private templates;
144
- constructor();
145
- /**
146
- * Create a subflow from a candidate
147
- */
148
- createSubflow(candidate: SubflowCandidate): Promise<SubflowCreationResult>;
149
- /**
150
- * Create multiple subflows from candidates
151
- */
152
- createMultipleSubflows(candidates: SubflowCandidate[]): Promise<SubflowCreationResult[]>;
153
- /**
154
- * Build subflow definition from candidate
155
- */
156
- private buildSubflowDefinition;
157
- /**
158
- * Build input definitions with enhanced metadata
159
- */
160
- private buildInputDefinitions;
161
- /**
162
- * Build output definitions with enhanced metadata
163
- */
164
- private buildOutputDefinitions;
165
- /**
166
- * Build activities for the subflow
167
- */
168
- private buildActivities;
169
- /**
170
- * Build connections between activities
171
- */
172
- private buildConnections;
173
- /**
174
- * Build error handling for the subflow
175
- */
176
- private buildErrorHandling;
177
- /**
178
- * Create activity from action string
179
- */
180
- private createActivityFromAction;
181
- /**
182
- * Validate candidate before processing
183
- */
184
- private validateCandidate;
185
- /**
186
- * Validate complete subflow definition
187
- */
188
- private validateSubflowDefinition;
189
- /**
190
- * Deploy subflow to ServiceNow
191
- */
192
- private deploySubflow;
193
- /**
194
- * Convert subflow definition to ServiceNow format
195
- */
196
- private convertToServiceNowFormat;
197
- /**
198
- * Generate recommendations for the subflow
199
- */
200
- private generateRecommendations;
201
- /**
202
- * Initialize subflow templates
203
- */
204
- private initializeTemplates;
205
- private sanitizeName;
206
- private determineCategory;
207
- private findMatchingTemplate;
208
- private generateTags;
209
- private generateDocumentation;
210
- private generateInputLabel;
211
- private generateOutputLabel;
212
- private categorizeInput;
213
- private categorizeOutput;
214
- private generatePlaceholder;
215
- private generateInputOptions;
216
- private findInputDependencies;
217
- private generateOutputFormat;
218
- private buildEndOutputs;
219
- private generateConnectionLabel;
220
- private mapActionToActivityType;
221
- private generateActivityName;
222
- private generateActivityLabel;
223
- private generateActivityDescription;
224
- private generateActivityInputs;
225
- private generateActivityOutputs;
226
- private generateActivityConfiguration;
227
- private generateActivityErrorHandling;
228
- private delay;
229
- }
230
- //# sourceMappingURL=subflow-creation-handler.d.ts.map