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,394 +0,0 @@
1
- "use strict";
2
- /**
3
- * Comprehensive example of using the Team Coordination Framework
4
- * for ServiceNow development workflows
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.exampleWidgetDevelopment = exampleWidgetDevelopment;
8
- exports.exampleFlowDevelopment = exampleFlowDevelopment;
9
- exports.exampleAdvancedCoordination = exampleAdvancedCoordination;
10
- exports.exampleProgressMonitoring = exampleProgressMonitoring;
11
- exports.runAllExamples = runAllExamples;
12
- exports.createMockTeam = createMockTeam;
13
- const index_1 = require("./index");
14
- /**
15
- * Example: ServiceNow Widget Development with Team Coordination
16
- */
17
- async function exampleWidgetDevelopment() {
18
- console.log('🚀 Starting ServiceNow Widget Development Example');
19
- // 1. Create ServiceNow coordination setup
20
- const { engine, qualityGates, progressListener, taskBuilder } = (0, index_1.createServiceNowCoordinationSetup)({
21
- maxConcurrentTasks: 6,
22
- enableAdvancedQualityGates: true,
23
- progressLogging: true
24
- });
25
- // 2. Create mock team of specialized agents
26
- const team = createMockTeam();
27
- // 3. Add progress monitoring
28
- const monitor = engine.getSharedMemory();
29
- // Subscribe to progress events
30
- engine.on('coordination:started', (data) => {
31
- console.log('🎯 Coordination started:', data);
32
- });
33
- engine.on('task:completed', ({ taskId, result }) => {
34
- console.log(`✅ Task completed: ${taskId}`);
35
- });
36
- engine.on('task:failed', ({ taskId, error }) => {
37
- console.error(`❌ Task failed: ${taskId}`, error.message);
38
- });
39
- engine.on('phase:completed', ({ phase, type, progress }) => {
40
- console.log(`🏁 Phase ${phase} (${type}) completed - ${Math.round(progress * 100)}% done`);
41
- });
42
- engine.on('coordination:completed', ({ results, metrics }) => {
43
- console.log('🎉 Coordination completed!');
44
- console.log('📊 Metrics:', {
45
- totalTasks: metrics.totalTasks,
46
- completedTasks: metrics.completedTasks,
47
- totalTime: `${Math.round(metrics.totalExecutionTime / 1000)}s`,
48
- averageTaskTime: `${Math.round(metrics.averageTaskTime / 1000)}s`
49
- });
50
- });
51
- // 4. Build task specification for incident dashboard widget
52
- const specification = taskBuilder('incident-dashboard-widget', 'Create a comprehensive incident dashboard widget for ServiceNow')
53
- .addWidgetDevelopmentTasks('incident_dashboard')
54
- .addContext('servicenow_instance', 'dev123456')
55
- .addContext('update_set', 'incident_dashboard_us_001')
56
- .addContext('widget_requirements', {
57
- type: 'dashboard',
58
- data_source: 'incident',
59
- refresh_interval: 30,
60
- features: ['real-time updates', 'filtering', 'charts']
61
- })
62
- .setExecutionPattern('hybrid')
63
- .build();
64
- console.log('📋 Task Specification:', {
65
- name: specification.name,
66
- tasks: specification.tasks.length,
67
- executionPattern: specification.executionPattern
68
- });
69
- try {
70
- // 5. Execute coordination
71
- const result = await engine.coordinateTeamExecution(team, specification);
72
- if (result.success) {
73
- console.log('✅ Widget development completed successfully!');
74
- console.log('📦 Deliverables:');
75
- Object.entries(result.results).forEach(([taskId, taskResult]) => {
76
- console.log(` - ${taskId}: ${Object.keys(taskResult.outputs || {}).join(', ')}`);
77
- });
78
- }
79
- else {
80
- console.error('❌ Widget development failed:', result.errors);
81
- }
82
- }
83
- catch (error) {
84
- console.error('💥 Coordination failed:', error.message);
85
- }
86
- }
87
- /**
88
- * Example: ServiceNow Flow Development with Parallel Execution
89
- */
90
- async function exampleFlowDevelopment() {
91
- console.log('🚀 Starting ServiceNow Flow Development Example');
92
- // Create framework with parallel execution preference
93
- const framework = new index_1.CoordinationFramework({
94
- maxConcurrentTasks: 8,
95
- enableQualityGates: true,
96
- executionPattern: 'parallel'
97
- });
98
- const team = createMockTeam();
99
- // Build complex flow specification
100
- const specification = (0, index_1.createServiceNowTaskSpecification)('user-provisioning-flow', 'Create comprehensive user provisioning automation flow')
101
- .addFlowDevelopmentTasks('user_provisioning_flow')
102
- .addTask({
103
- id: 'create_approval_step',
104
- name: 'Create Approval Step',
105
- description: 'Design and implement approval workflow step',
106
- agentType: 'workflow-designer',
107
- requirements: {
108
- inputs: { approvalType: 'manager_approval' },
109
- outputs: ['approvalStep', 'approvalLogic'],
110
- capabilities: ['workflow', 'approval', 'servicenow']
111
- },
112
- dependencies: ['design_flow']
113
- })
114
- .addTask({
115
- id: 'integrate_ldap',
116
- name: 'Integrate LDAP',
117
- description: 'Configure LDAP integration for user data',
118
- agentType: 'integration-specialist',
119
- requirements: {
120
- inputs: { ldapConfig: 'corporate_ldap' },
121
- outputs: ['ldapIntegration'],
122
- capabilities: ['ldap', 'integration', 'servicenow']
123
- },
124
- dependencies: ['design_flow']
125
- })
126
- .addTask({
127
- id: 'setup_notifications',
128
- name: 'Setup Notifications',
129
- description: 'Configure email notifications for the flow',
130
- agentType: 'servicenow-specialist',
131
- requirements: {
132
- inputs: { notificationTemplates: 'standard' },
133
- outputs: ['notificationConfig'],
134
- capabilities: ['email', 'notifications', 'servicenow']
135
- },
136
- dependencies: ['implement_flow']
137
- })
138
- .addContext('servicenow_instance', 'prod12345')
139
- .addContext('integration_environment', 'production')
140
- .addContext('compliance_level', 'high')
141
- .setExecutionPattern('hybrid')
142
- .build();
143
- try {
144
- const result = await framework.coordinate(team, specification);
145
- if (result.success) {
146
- console.log('✅ Flow development completed successfully!');
147
- // Display execution metrics
148
- console.log('📊 Execution Metrics:', {
149
- parallelTasks: result.metrics.concurrentTasks,
150
- efficiency: `${Math.round((result.metrics.completedTasks / result.metrics.totalTasks) * 100)}%`,
151
- totalTime: `${Math.round(result.metrics.totalExecutionTime / 1000)}s`
152
- });
153
- }
154
- }
155
- catch (error) {
156
- console.error('💥 Flow development failed:', error.message);
157
- }
158
- }
159
- /**
160
- * Example: Advanced Coordination with Custom Quality Gates
161
- */
162
- async function exampleAdvancedCoordination() {
163
- console.log('🚀 Starting Advanced Coordination Example');
164
- const { engine, qualityGates } = (0, index_1.createServiceNowCoordinationSetup)({
165
- maxConcurrentTasks: 4,
166
- enableAdvancedQualityGates: true
167
- });
168
- // Add custom quality gate
169
- class ComplianceGate {
170
- constructor() {
171
- this.name = 'SOX Compliance';
172
- this.blocking = true;
173
- }
174
- async validate(result) {
175
- const issues = [];
176
- let score = 1.0;
177
- // Check SOX compliance requirements
178
- if (!result.auditTrail) {
179
- issues.push('Missing audit trail for SOX compliance');
180
- score -= 0.5;
181
- }
182
- if (!result.accessControls) {
183
- issues.push('Missing access controls documentation');
184
- score -= 0.3;
185
- }
186
- if (!result.changeApproval) {
187
- issues.push('Missing change approval documentation');
188
- score -= 0.4;
189
- }
190
- return {
191
- passed: issues.length === 0,
192
- score,
193
- error: issues.length > 0 ? issues.join('; ') : undefined,
194
- suggestions: [
195
- 'Document all changes for audit trail',
196
- 'Implement proper access controls',
197
- 'Get proper change approval'
198
- ]
199
- };
200
- }
201
- }
202
- // Add custom gate to quality manager
203
- qualityGates.addGate('deploy_production_flow', new ComplianceGate());
204
- const team = createMockTeam();
205
- const specification = (0, index_1.createServiceNowTaskSpecification)('production-deployment', 'Deploy flow to production with full compliance checks')
206
- .addTask({
207
- id: 'prepare_deployment',
208
- name: 'Prepare Deployment',
209
- description: 'Prepare all deployment artifacts',
210
- agentType: 'servicenow-specialist',
211
- requirements: {
212
- outputs: ['deploymentPackage', 'documentation'],
213
- capabilities: ['deployment', 'documentation']
214
- }
215
- })
216
- .addTask({
217
- id: 'compliance_review',
218
- name: 'Compliance Review',
219
- description: 'Conduct SOX compliance review',
220
- agentType: 'security-auditor',
221
- requirements: {
222
- outputs: ['complianceReport', 'auditTrail'],
223
- capabilities: ['compliance', 'audit', 'security']
224
- },
225
- dependencies: ['prepare_deployment']
226
- })
227
- .addTask({
228
- id: 'deploy_production_flow',
229
- name: 'Deploy to Production',
230
- description: 'Deploy flow to production environment',
231
- agentType: 'servicenow-specialist',
232
- requirements: {
233
- outputs: ['deploymentResult', 'accessControls', 'changeApproval'],
234
- capabilities: ['deployment', 'production']
235
- },
236
- dependencies: ['compliance_review']
237
- })
238
- .addContext('environment', 'production')
239
- .addContext('compliance_framework', 'SOX')
240
- .setExecutionPattern('sequential') // Sequential for production safety
241
- .build();
242
- try {
243
- const result = await engine.coordinateTeamExecution(team, specification);
244
- if (result.success) {
245
- console.log('✅ Production deployment completed with full compliance!');
246
- }
247
- else {
248
- console.error('❌ Deployment failed compliance checks:', result.errors);
249
- }
250
- }
251
- catch (error) {
252
- console.error('💥 Advanced coordination failed:', error.message);
253
- }
254
- }
255
- /**
256
- * Example: Real-time Progress Monitoring
257
- */
258
- async function exampleProgressMonitoring() {
259
- console.log('🚀 Starting Progress Monitoring Example');
260
- const framework = new index_1.CoordinationFramework({
261
- enableProgressMonitoring: true,
262
- maxConcurrentTasks: 5
263
- });
264
- // Create custom progress listener
265
- const progressListener = {
266
- onProgress(event, data) {
267
- switch (event) {
268
- case 'task_progress':
269
- console.log(`📊 Progress: ${data.percentage}% (${data.completed}/${data.total}) - Phase: ${data.currentPhase}`);
270
- if (data.bottlenecks && data.bottlenecks.length > 0) {
271
- console.warn('🚧 Bottlenecks detected:', data.bottlenecks);
272
- }
273
- break;
274
- case 'agent_health':
275
- const unhealthyCount = Object.values(data.agents)
276
- .filter((health) => health.status === 'error').length;
277
- if (unhealthyCount > 0) {
278
- console.warn(`⚠️ ${unhealthyCount} agents are unhealthy`);
279
- }
280
- break;
281
- case 'performance_metrics':
282
- console.log(`⚡ Performance: Efficiency ${Math.round(data.efficiency * 100)}%, Throughput ${data.throughput.toFixed(2)} tasks/sec`);
283
- break;
284
- case 'trend_analysis':
285
- console.log(`📈 Trend: ${data.trend} (${data.progressRate.toFixed(3)} progress/sec)`);
286
- break;
287
- }
288
- }
289
- };
290
- // Get framework's progress monitor
291
- const monitor = framework['engine'].progressMonitor;
292
- monitor.addListener(progressListener);
293
- const team = createMockTeam();
294
- // Create long-running task specification for monitoring demo
295
- const specification = (0, index_1.createServiceNowTaskSpecification)('monitoring-demo', 'Demonstrate progress monitoring capabilities')
296
- .addWidgetDevelopmentTasks('monitoring_widget')
297
- .addFlowDevelopmentTasks('monitoring_flow')
298
- .addContext('monitoring_demo', true)
299
- .setExecutionPattern('hybrid')
300
- .build();
301
- try {
302
- const result = await framework.coordinate(team, specification);
303
- if (result.success) {
304
- console.log('✅ Monitoring demo completed successfully!');
305
- // Get detailed progress report
306
- const report = await monitor.getDetailedReport();
307
- console.log('📋 Final Report:', {
308
- overview: report.overview,
309
- trends: report.trends,
310
- recommendations: report.recommendations
311
- });
312
- }
313
- }
314
- catch (error) {
315
- console.error('💥 Monitoring demo failed:', error.message);
316
- }
317
- }
318
- /**
319
- * Create a mock team of specialized agents for demonstration
320
- */
321
- function createMockTeam() {
322
- const agents = new Map();
323
- // Create different types of agents
324
- const agentConfigs = [
325
- { id: 'analyst-001', name: 'Sarah (Analyst)', type: 'analyst', capabilities: ['analysis', 'requirements', 'design'] },
326
- { id: 'ui-builder-001', name: 'Mike (UI Builder)', type: 'ui-builder', capabilities: ['html', 'css', 'javascript', 'ui-design'] },
327
- { id: 'coder-001', name: 'Alex (Developer)', type: 'coder', capabilities: ['javascript', 'servicenow', 'backend', 'frontend'] },
328
- { id: 'coder-002', name: 'Emma (Developer)', type: 'coder', capabilities: ['javascript', 'servicenow', 'integration'] },
329
- { id: 'snow-specialist-001', name: 'David (ServiceNow)', type: 'servicenow-specialist', capabilities: ['servicenow', 'deployment', 'configuration'] },
330
- { id: 'workflow-designer-001', name: 'Lisa (Workflow)', type: 'workflow-designer', capabilities: ['workflow', 'flow-designer', 'automation'] },
331
- { id: 'tester-001', name: 'James (Tester)', type: 'tester', capabilities: ['testing', 'qa', 'servicenow'] },
332
- { id: 'security-auditor-001', name: 'Rachel (Security)', type: 'security-auditor', capabilities: ['security', 'compliance', 'audit'] },
333
- { id: 'integration-specialist-001', name: 'Tom (Integration)', type: 'integration-specialist', capabilities: ['integration', 'api', 'ldap'] }
334
- ];
335
- agentConfigs.forEach(config => {
336
- const agent = {
337
- id: config.id,
338
- name: config.name,
339
- type: config.type,
340
- status: 'idle',
341
- capabilities: config.capabilities,
342
- metadata: { specialized: true },
343
- createdAt: new Date(),
344
- lastActivity: new Date()
345
- };
346
- agents.set(config.id, agent);
347
- });
348
- // Create team implementation
349
- const team = {
350
- agents,
351
- getAgent(id) {
352
- return agents.get(id);
353
- },
354
- addAgent(agent) {
355
- agents.set(agent.id, agent);
356
- },
357
- removeAgent(id) {
358
- agents.delete(id);
359
- },
360
- getAvailableAgents() {
361
- return Array.from(agents.values()).filter(agent => agent.status === 'idle');
362
- },
363
- getAgentsByType(type) {
364
- return Array.from(agents.values()).filter(agent => agent.type === type);
365
- }
366
- };
367
- console.log(`👥 Created mock team with ${agents.size} specialized agents`);
368
- return team;
369
- }
370
- /**
371
- * Run all examples
372
- */
373
- async function runAllExamples() {
374
- console.log('🎬 Starting Team Coordination Framework Examples\n');
375
- try {
376
- await exampleWidgetDevelopment();
377
- console.log('\n' + '='.repeat(80) + '\n');
378
- await exampleFlowDevelopment();
379
- console.log('\n' + '='.repeat(80) + '\n');
380
- await exampleAdvancedCoordination();
381
- console.log('\n' + '='.repeat(80) + '\n');
382
- await exampleProgressMonitoring();
383
- console.log('\n' + '='.repeat(80) + '\n');
384
- console.log('🎉 All examples completed successfully!');
385
- }
386
- catch (error) {
387
- console.error('💥 Example execution failed:', error.message);
388
- }
389
- }
390
- // Run examples if called directly
391
- if (require.main === module) {
392
- runAllExamples().catch(console.error);
393
- }
394
- //# sourceMappingURL=example.js.map
@@ -1,43 +0,0 @@
1
- import { EventEmitter } from 'eventemitter3';
2
- import { BaseTeam, CoordinationConfig } from './types';
3
- import { TaskDependencyGraph } from './task-dependencies';
4
- import { QualityGateManager } from './quality-gates';
5
- import { ProgressMonitor } from './progress-monitor';
6
- export declare abstract class ExecutionPattern extends EventEmitter {
7
- protected qualityGates: QualityGateManager;
8
- protected progressMonitor: ProgressMonitor;
9
- protected config: CoordinationConfig;
10
- constructor(qualityGates: QualityGateManager, progressMonitor: ProgressMonitor, config: CoordinationConfig);
11
- abstract execute(team: BaseTeam, taskGraph: TaskDependencyGraph): Promise<Record<string, any>>;
12
- protected executeTaskWithQualityGates(taskId: string, taskGraph: TaskDependencyGraph): Promise<any>;
13
- protected waitForAvailableSlot(currentTasks: Set<string>): Promise<void>;
14
- }
15
- export declare class SequentialExecutionPattern extends ExecutionPattern {
16
- execute(team: BaseTeam, taskGraph: TaskDependencyGraph): Promise<Record<string, any>>;
17
- private getSequentialOrder;
18
- }
19
- export declare class ParallelExecutionPattern extends ExecutionPattern {
20
- execute(team: BaseTeam, taskGraph: TaskDependencyGraph): Promise<Record<string, any>>;
21
- }
22
- export declare class HybridExecutionPattern extends ExecutionPattern {
23
- execute(team: BaseTeam, taskGraph: TaskDependencyGraph): Promise<Record<string, any>>;
24
- private optimizeExecutionPlan;
25
- private optimizeLargeLevel;
26
- private executeParallelPhase;
27
- private executeSequentialPhase;
28
- private estimateTaskDuration;
29
- private assessParallelRisk;
30
- }
31
- export declare class AdaptiveExecutionPattern extends ExecutionPattern {
32
- private performanceHistory;
33
- execute(team: BaseTeam, taskGraph: TaskDependencyGraph): Promise<Record<string, any>>;
34
- private adaptStrategy;
35
- private calculateLevelComplexity;
36
- private executeSequentialLevel;
37
- private executeParallelLevel;
38
- private executeHybridLevel;
39
- private recordPerformanceMetrics;
40
- private getHistoricalPerformance;
41
- private assessParallelRisk;
42
- }
43
- //# sourceMappingURL=execution-patterns.d.ts.map