snow-flow 3.0.8 → 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 (295) 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/dist/utils/snow-oauth.js +53 -16
  16. package/memory/agents/README.md +1 -1
  17. package/memory/claude-flow-data.json +1 -1
  18. package/memory/sessions/README.md +1 -1
  19. package/package.json +2 -2
  20. package/.mcp.json +0 -22
  21. package/claude-flow.config.json +0 -20
  22. package/dist/agents/app-creator.agent.d.ts +0 -55
  23. package/dist/agents/app-creator.agent.js +0 -1292
  24. package/dist/agents/base/base-snow-agent.d.ts +0 -75
  25. package/dist/agents/base/base-snow-agent.js +0 -169
  26. package/dist/agents/base-snow-agent.d.ts +0 -63
  27. package/dist/agents/base-snow-agent.js +0 -296
  28. package/dist/agents/coordinator.d.ts +0 -200
  29. package/dist/agents/coordinator.js +0 -777
  30. package/dist/agents/flow-builder-agent.d.ts +0 -18
  31. package/dist/agents/flow-builder-agent.js +0 -197
  32. package/dist/agents/queen-403-handler.d.ts +0 -47
  33. package/dist/agents/queen-403-handler.js +0 -175
  34. package/dist/agents/queen-agent-example.d.ts +0 -23
  35. package/dist/agents/queen-agent-example.js +0 -240
  36. package/dist/agents/queen-agent.test.d.ts +0 -6
  37. package/dist/agents/script-generator.agent.d.ts +0 -32
  38. package/dist/agents/script-generator.agent.js +0 -772
  39. package/dist/agents/script-writer-agent.d.ts +0 -22
  40. package/dist/agents/script-writer-agent.js +0 -695
  41. package/dist/agents/security-agent.d.ts +0 -23
  42. package/dist/agents/security-agent.js +0 -619
  43. package/dist/agents/specialists/automation-specialist.agent.d.ts +0 -44
  44. package/dist/agents/specialists/automation-specialist.agent.js +0 -204
  45. package/dist/agents/specialists/data-specialist.agent.d.ts +0 -165
  46. package/dist/agents/specialists/data-specialist.agent.js +0 -484
  47. package/dist/agents/specialists/integration-specialist.agent.d.ts +0 -227
  48. package/dist/agents/specialists/integration-specialist.agent.js +0 -725
  49. package/dist/agents/specialists/reporting-specialist.agent.d.ts +0 -54
  50. package/dist/agents/specialists/reporting-specialist.agent.js +0 -193
  51. package/dist/agents/specialists/security-specialist.agent.d.ts +0 -85
  52. package/dist/agents/specialists/security-specialist.agent.js +0 -309
  53. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.d.ts +0 -111
  54. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.js +0 -383
  55. package/dist/agents/teams/base-team.d.ts +0 -72
  56. package/dist/agents/teams/base-team.js +0 -253
  57. package/dist/agents/teams/team-types.d.ts +0 -265
  58. package/dist/agents/teams/team-types.js +0 -3
  59. package/dist/agents/teams/widget/widget-architect.agent.d.ts +0 -61
  60. package/dist/agents/teams/widget/widget-architect.agent.js +0 -436
  61. package/dist/agents/teams/widget/widget-backend.agent.d.ts +0 -74
  62. package/dist/agents/teams/widget/widget-backend.agent.js +0 -1531
  63. package/dist/agents/teams/widget/widget-frontend.agent.d.ts +0 -67
  64. package/dist/agents/teams/widget/widget-frontend.agent.js +0 -1014
  65. package/dist/agents/teams/widget/widget-platform.agent.d.ts +0 -90
  66. package/dist/agents/teams/widget/widget-platform.agent.js +0 -1190
  67. package/dist/agents/teams/widget/widget-uiux.agent.d.ts +0 -107
  68. package/dist/agents/teams/widget/widget-uiux.agent.js +0 -1033
  69. package/dist/agents/test-agent.d.ts +0 -26
  70. package/dist/agents/test-agent.js +0 -734
  71. package/dist/agents/test-agents.d.ts +0 -7
  72. package/dist/agents/test-agents.js +0 -64
  73. package/dist/agents/ui-builder.agent.d.ts +0 -50
  74. package/dist/agents/ui-builder.agent.js +0 -1539
  75. package/dist/agents/widget-builder.agent.d.ts +0 -32
  76. package/dist/agents/widget-builder.agent.js +0 -439
  77. package/dist/agents/widget-creator-agent.d.ts +0 -18
  78. package/dist/agents/widget-creator-agent.js +0 -498
  79. package/dist/agents/workflow-designer.agent.d.ts +0 -31
  80. package/dist/agents/workflow-designer.agent.js +0 -583
  81. package/dist/api/error-handling.d.ts +0 -325
  82. package/dist/api/error-handling.js +0 -1488
  83. package/dist/api/flow-designer-api.d.ts +0 -167
  84. package/dist/api/flow-designer-api.js +0 -554
  85. package/dist/api/natural-language-mapper.d.ts +0 -124
  86. package/dist/api/natural-language-mapper.js +0 -501
  87. package/dist/api/performance-optimizer.d.ts +0 -240
  88. package/dist/api/performance-optimizer.js +0 -706
  89. package/dist/api/transaction-manager.d.ts +0 -189
  90. package/dist/api/transaction-manager.js +0 -576
  91. package/dist/assembly/team-assembler.d.ts +0 -140
  92. package/dist/assembly/team-assembler.js +0 -502
  93. package/dist/benchmark-performance.d.ts +0 -41
  94. package/dist/benchmark-performance.js +0 -230
  95. package/dist/cli/snow-flow-cli-integration.d.ts +0 -30
  96. package/dist/cli/snow-flow-cli-integration.js +0 -396
  97. package/dist/coordination/coordination-engine.d.ts +0 -41
  98. package/dist/coordination/coordination-engine.js +0 -324
  99. package/dist/coordination/coordination.test.d.ts +0 -6
  100. package/dist/coordination/example.d.ts +0 -31
  101. package/dist/coordination/example.js +0 -394
  102. package/dist/coordination/execution-patterns.d.ts +0 -43
  103. package/dist/coordination/execution-patterns.js +0 -507
  104. package/dist/coordination/factory.d.ts +0 -94
  105. package/dist/coordination/factory.js +0 -433
  106. package/dist/coordination/index.d.ts +0 -71
  107. package/dist/coordination/index.js +0 -135
  108. package/dist/coordination/progress-monitor.d.ts +0 -71
  109. package/dist/coordination/progress-monitor.js +0 -505
  110. package/dist/coordination/quality-gates.d.ts +0 -124
  111. package/dist/coordination/quality-gates.js +0 -577
  112. package/dist/coordination/shared-memory.d.ts +0 -39
  113. package/dist/coordination/shared-memory.js +0 -289
  114. package/dist/coordination/task-dependencies.d.ts +0 -50
  115. package/dist/coordination/task-dependencies.js +0 -407
  116. package/dist/coordination/team-coordinator.d.ts +0 -59
  117. package/dist/coordination/team-coordinator.js +0 -550
  118. package/dist/coordination/types.d.ts +0 -152
  119. package/dist/coordination/types.js +0 -3
  120. package/dist/mcp/mcp-wrapper.d.ts +0 -8
  121. package/dist/mcp/mcp-wrapper.js +0 -77
  122. package/dist/mcp/servicenow-flow-composer-enhanced.js +0 -396
  123. package/dist/mcp/servicenow-flow-composer-mcp.d.ts +0 -7
  124. package/dist/mcp/servicenow-flow-composer-mcp.js +0 -3103
  125. package/dist/mcp/servicenow-graph-memory-mcp.d.ts +0 -7
  126. package/dist/mcp/servicenow-intelligent-mcp.d.ts +0 -143
  127. package/dist/mcp/servicenow-intelligent-mcp.js +0 -4156
  128. package/dist/mcp/servicenow-xml-flow-mcp.d.ts +0 -53
  129. package/dist/mcp/servicenow-xml-flow-mcp.js +0 -1704
  130. package/dist/mcp/singleton-check.js +0 -31
  131. package/dist/mcp/test-simple-mcp.d.ts +0 -6
  132. package/dist/mcp/test-simple-mcp.js +0 -63
  133. package/dist/memory/hierarchical-memory-system.d.ts +0 -90
  134. package/dist/memory/hierarchical-memory-system.js +0 -400
  135. package/dist/memory/index.d.ts +0 -9
  136. package/dist/memory/index.js +0 -20
  137. package/dist/memory/mcp-integration-example.d.ts +0 -6
  138. package/dist/memory/mcp-integration-example.js +0 -281
  139. package/dist/memory/memory-client.d.ts +0 -199
  140. package/dist/memory/memory-client.js +0 -364
  141. package/dist/memory/memory-manager.d.ts +0 -29
  142. package/dist/memory/memory-manager.js +0 -280
  143. package/dist/memory/memory-operations.d.ts +0 -179
  144. package/dist/memory/memory-operations.js +0 -691
  145. package/dist/memory/memory-system.d.ts +0 -153
  146. package/dist/memory/memory-system.js +0 -651
  147. package/dist/memory/memory-test.d.ts +0 -6
  148. package/dist/memory/memory-test.js +0 -161
  149. package/dist/memory/snow-flow-memory-patterns.d.ts +0 -213
  150. package/dist/memory/snow-flow-memory-patterns.js +0 -200
  151. package/dist/memory/snow-memory.d.ts +0 -54
  152. package/dist/memory/snow-memory.js +0 -301
  153. package/dist/memory/swarm-memory.d.ts +0 -135
  154. package/dist/memory/swarm-memory.js +0 -378
  155. package/dist/optimization/flow-performance-optimizer.js +0 -723
  156. package/dist/orchestration/discovery/service-discovery.d.ts +0 -81
  157. package/dist/orchestration/discovery/service-discovery.js +0 -808
  158. package/dist/orchestration/distributed-orchestrator.d.ts +0 -131
  159. package/dist/orchestration/distributed-orchestrator.js +0 -712
  160. package/dist/orchestration/distribution/task-distribution-engine.d.ts +0 -53
  161. package/dist/orchestration/distribution/task-distribution-engine.js +0 -586
  162. package/dist/orchestration/flow-update-orchestrator.js +0 -648
  163. package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +0 -606
  164. package/dist/orchestration/interfaces/distributed-orchestration.interface.js +0 -65
  165. package/dist/orchestration/protocols/mcpx-protocol.d.ts +0 -71
  166. package/dist/orchestration/protocols/mcpx-protocol.js +0 -668
  167. package/dist/orchestration/state/distributed-state-manager.d.ts +0 -89
  168. package/dist/orchestration/state/distributed-state-manager.js +0 -716
  169. package/dist/orchestrator/flow-composer.d.ts +0 -105
  170. package/dist/orchestrator/flow-composer.js +0 -404
  171. package/dist/orchestrator/flow-pattern-templates.d.ts +0 -260
  172. package/dist/orchestrator/flow-pattern-templates.js +0 -908
  173. package/dist/orchestrator/flow-subflow-decision-engine.d.ts +0 -202
  174. package/dist/orchestrator/flow-subflow-decision-engine.js +0 -769
  175. package/dist/orchestrator/flow-validation-engine.d.ts +0 -169
  176. package/dist/orchestrator/flow-validation-engine.js +0 -913
  177. package/dist/orchestrator/snow-orchestrator.d.ts +0 -49
  178. package/dist/orchestrator/snow-orchestrator.js +0 -235
  179. package/dist/orchestrator/subflow-creation-handler.d.ts +0 -230
  180. package/dist/orchestrator/subflow-creation-handler.js +0 -791
  181. package/dist/patterns/adaptive-patterns.d.ts +0 -140
  182. package/dist/patterns/adaptive-patterns.js +0 -549
  183. package/dist/queen/advanced-integration-test.d.ts +0 -48
  184. package/dist/queen/advanced-integration-test.js +0 -473
  185. package/dist/queen/integration-example.d.ts +0 -82
  186. package/dist/queen/integration-example.js +0 -219
  187. package/dist/queen/integration-test.d.ts +0 -72
  188. package/dist/queen/integration-test.js +0 -563
  189. package/dist/queen/mock-mcp-client.d.ts +0 -71
  190. package/dist/queen/mock-mcp-client.js +0 -317
  191. package/dist/queen/run-integration-tests.d.ts +0 -9
  192. package/dist/queen/run-integration-tests.js +0 -27
  193. package/dist/sparc/coordinators/adaptive-coordinator.d.ts +0 -54
  194. package/dist/sparc/coordinators/adaptive-coordinator.js +0 -367
  195. package/dist/sparc/coordinators/team-coordinator.d.ts +0 -66
  196. package/dist/sparc/coordinators/team-coordinator.js +0 -402
  197. package/dist/sparc/modes/team-modes.d.ts +0 -33
  198. package/dist/sparc/modes/team-modes.js +0 -399
  199. package/dist/sparc/teams/application-team.d.ts +0 -73
  200. package/dist/sparc/teams/application-team.js +0 -463
  201. package/dist/sparc/teams/flow-team.d.ts +0 -67
  202. package/dist/sparc/teams/flow-team.js +0 -373
  203. package/dist/sparc/teams/widget-team.d.ts +0 -61
  204. package/dist/sparc/teams/widget-team.js +0 -280
  205. package/dist/specialists/app-specialists.d.ts +0 -93
  206. package/dist/specialists/app-specialists.js +0 -1639
  207. package/dist/specialists/base-specialist.d.ts +0 -19
  208. package/dist/specialists/base-specialist.js +0 -54
  209. package/dist/specialists/flow-specialists.d.ts +0 -113
  210. package/dist/specialists/flow-specialists.js +0 -1787
  211. package/dist/specialists/individual-specialists.d.ts +0 -67
  212. package/dist/specialists/individual-specialists.js +0 -632
  213. package/dist/specialists/widget-specialists.d.ts +0 -70
  214. package/dist/specialists/widget-specialists.js +0 -1264
  215. package/dist/src/utils/agent-detector.js +0 -655
  216. package/dist/teams/adaptive-team.d.ts +0 -81
  217. package/dist/teams/adaptive-team.js +0 -1153
  218. package/dist/teams/application-team.d.ts +0 -30
  219. package/dist/teams/application-team.js +0 -547
  220. package/dist/teams/base-team.d.ts +0 -55
  221. package/dist/teams/base-team.js +0 -243
  222. package/dist/teams/flow-team.d.ts +0 -28
  223. package/dist/teams/flow-team.js +0 -525
  224. package/dist/teams/widget-team.d.ts +0 -26
  225. package/dist/teams/widget-team.js +0 -459
  226. package/dist/templates/flow-template-system.js +0 -625
  227. package/dist/test-fetch-incidents.d.ts +0 -2
  228. package/dist/test-fetch-incidents.js +0 -84
  229. package/dist/test-incident-access.d.ts +0 -2
  230. package/dist/test-incident-access.js +0 -72
  231. package/dist/test-iphone-flow.js +0 -189
  232. package/dist/test-limit-problem.d.ts +0 -2
  233. package/dist/test-limit-problem.js +0 -60
  234. package/dist/test-ml-batch-fix.d.ts +0 -2
  235. package/dist/test-ml-batch-fix.js +0 -104
  236. package/dist/test-ml-batch.d.ts +0 -2
  237. package/dist/test-ml-batch.js +0 -87
  238. package/dist/test-ml-query.d.ts +0 -2
  239. package/dist/test-ml-query.js +0 -100
  240. package/dist/test-ml-training-fix.d.ts +0 -12
  241. package/dist/test-ml-training-fix.js +0 -113
  242. package/dist/test-ml-training.d.ts +0 -2
  243. package/dist/test-ml-training.js +0 -32
  244. package/dist/test-operations-query.d.ts +0 -2
  245. package/dist/test-operations-query.js +0 -84
  246. package/dist/test-performance-query.d.ts +0 -2
  247. package/dist/test-performance-query.js +0 -52
  248. package/dist/test-singleton-protection.d.ts +0 -8
  249. package/dist/test-singleton-protection.js +0 -110
  250. package/dist/test-smart-limits.d.ts +0 -13
  251. package/dist/test-smart-limits.js +0 -100
  252. package/dist/test-snow-query-incidents.d.ts +0 -2
  253. package/dist/test-snow-query-incidents.js +0 -66
  254. package/dist/test-universal-query.d.ts +0 -2
  255. package/dist/test-universal-query.js +0 -106
  256. package/dist/testing/flow-testing-automation.js +0 -641
  257. package/dist/utils/complete-flow-xml-generator.js +0 -1285
  258. package/dist/utils/file-storage-fallback.d.ts +0 -62
  259. package/dist/utils/file-storage-fallback.js +0 -289
  260. package/dist/utils/flow-api-discovery.d.ts +0 -151
  261. package/dist/utils/flow-api-discovery.js +0 -439
  262. package/dist/utils/flow-examples.js +0 -720
  263. package/dist/utils/flow-structure-builder.js +0 -677
  264. package/dist/utils/flow-xml-generator.d.ts +0 -41
  265. package/dist/utils/flow-xml-generator.js +0 -258
  266. package/dist/utils/improved-flow-xml-generator.js +0 -820
  267. package/dist/utils/mcp-process-manager.backup.d.ts +0 -58
  268. package/dist/utils/mcp-process-manager.backup.js +0 -220
  269. package/dist/utils/mcp-singleton-enforcer.d.ts +0 -36
  270. package/dist/utils/mcp-singleton-enforcer.js +0 -201
  271. package/dist/utils/mcp-timeout-fix.d.ts +0 -53
  272. package/dist/utils/mcp-timeout-fix.js +0 -221
  273. package/dist/utils/migrate-claude-flow.d.ts +0 -22
  274. package/dist/utils/migrate-claude-flow.js +0 -120
  275. package/dist/utils/scope-utils.d.ts +0 -72
  276. package/dist/utils/scope-utils.js +0 -386
  277. package/dist/utils/snow-oauth-old.d.ts +0 -65
  278. package/dist/utils/snow-oauth-old.js +0 -345
  279. package/dist/utils/xml-first-flow-generator.js +0 -513
  280. package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +0 -30
  281. package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +0 -36
  282. package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +0 -30
  283. package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +0 -30
  284. package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +0 -55
  285. package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +0 -55
  286. package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +0 -9
  287. package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +0 -9
  288. package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +0 -8
  289. package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +0 -9
  290. package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +0 -9
  291. package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +0 -9
  292. package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +0 -58
  293. package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +0 -9
  294. package/reports/swarm-auto-centralized-1752649029776.json +0 -13
  295. package/src/memory/README.md +0 -240
@@ -1,563 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- /**
4
- * ServiceNow Queen Agent Integration Test Suite
5
- *
6
- * COMPREHENSIVE TESTING: Verifies Queen Agent works with real MCP tools
7
- *
8
- * TEST SCENARIOS:
9
- * 1. Basic Queen Initialization āœ“
10
- * 2. MCP Tool Access Verification āœ“
11
- * 3. Simple Objective Parsing āœ“
12
- * 4. Agent Spawning āœ“
13
- * 5. Memory System Persistence āœ“
14
- *
15
- * INTEGRATION CHECKS:
16
- * - Queen Agent imports successfully
17
- * - MCP servers respond without placeholder errors
18
- * - Agent factory can spawn specialized agents
19
- * - Memory system can store/retrieve learning patterns
20
- * - Neural learning can classify tasks
21
- */
22
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23
- if (k2 === undefined) k2 = k;
24
- var desc = Object.getOwnPropertyDescriptor(m, k);
25
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
26
- desc = { enumerable: true, get: function() { return m[k]; } };
27
- }
28
- Object.defineProperty(o, k2, desc);
29
- }) : (function(o, m, k, k2) {
30
- if (k2 === undefined) k2 = k;
31
- o[k2] = m[k];
32
- }));
33
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
34
- Object.defineProperty(o, "default", { enumerable: true, value: v });
35
- }) : function(o, v) {
36
- o["default"] = v;
37
- });
38
- var __importStar = (this && this.__importStar) || (function () {
39
- var ownKeys = function(o) {
40
- ownKeys = Object.getOwnPropertyNames || function (o) {
41
- var ar = [];
42
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
43
- return ar;
44
- };
45
- return ownKeys(o);
46
- };
47
- return function (mod) {
48
- if (mod && mod.__esModule) return mod;
49
- var result = {};
50
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
51
- __setModuleDefault(result, mod);
52
- return result;
53
- };
54
- })();
55
- Object.defineProperty(exports, "__esModule", { value: true });
56
- exports.QueenIntegrationTester = void 0;
57
- const index_js_1 = require("./index.js");
58
- const agent_factory_js_1 = require("./agent-factory.js");
59
- const neural_learning_js_1 = require("./neural-learning.js");
60
- const queen_memory_js_1 = require("./queen-memory.js");
61
- const fs = __importStar(require("fs"));
62
- const path = __importStar(require("path"));
63
- // Test configuration
64
- const TEST_CONFIG = {
65
- debugMode: true,
66
- memoryPath: './.claude-flow/queen-test/test-memory.db',
67
- maxConcurrentAgents: 3,
68
- testTimeout: 30000
69
- };
70
- class QueenIntegrationTester {
71
- constructor() {
72
- this.results = [];
73
- this.queen = null;
74
- this.setupTestEnvironment();
75
- }
76
- setupTestEnvironment() {
77
- // Ensure test directory exists
78
- const testDir = path.dirname(TEST_CONFIG.memoryPath);
79
- if (!fs.existsSync(testDir)) {
80
- fs.mkdirSync(testDir, { recursive: true });
81
- }
82
- console.log('🧪 QUEEN AGENT INTEGRATION TESTER');
83
- console.log('================================');
84
- console.log(`Test Directory: ${testDir}`);
85
- console.log(`Debug Mode: ${TEST_CONFIG.debugMode}`);
86
- console.log(`Max Agents: ${TEST_CONFIG.maxConcurrentAgents}`);
87
- console.log('');
88
- }
89
- /**
90
- * TEST 1: Basic Queen Initialization
91
- */
92
- async testQueenInitialization() {
93
- const startTime = Date.now();
94
- try {
95
- console.log('šŸ” TEST 1: Basic Queen Initialization');
96
- // Test 1.1: Create Queen instance
97
- this.queen = (0, index_js_1.createServiceNowQueen)({
98
- debugMode: TEST_CONFIG.debugMode,
99
- memoryPath: TEST_CONFIG.memoryPath,
100
- maxConcurrentAgents: TEST_CONFIG.maxConcurrentAgents
101
- });
102
- if (!this.queen) {
103
- throw new Error('Failed to create Queen instance');
104
- }
105
- // Test 1.2: Verify Queen has required components
106
- const status = this.queen.getHiveMindStatus();
107
- if (!status) {
108
- throw new Error('Queen status unavailable');
109
- }
110
- // Test 1.3: Verify memory system
111
- if (typeof status.memoryStats !== 'object') {
112
- throw new Error('Memory stats unavailable');
113
- }
114
- // Test 1.4: Verify agent factory
115
- if (typeof status.factoryStats !== 'object') {
116
- throw new Error('Factory stats unavailable');
117
- }
118
- const duration = Date.now() - startTime;
119
- const result = {
120
- testName: 'Queen Initialization',
121
- status: 'PASS',
122
- duration,
123
- details: `Queen created successfully with ${status.activeTasks} active tasks, ${status.activeAgents} agents`
124
- };
125
- console.log(`āœ… PASS (${duration}ms): Queen initialized with hive-mind components`);
126
- return result;
127
- }
128
- catch (error) {
129
- const duration = Date.now() - startTime;
130
- const result = {
131
- testName: 'Queen Initialization',
132
- status: 'FAIL',
133
- duration,
134
- details: 'Failed to initialize Queen Agent',
135
- error: error.message
136
- };
137
- console.log(`āŒ FAIL (${duration}ms): ${error.message}`);
138
- return result;
139
- }
140
- }
141
- /**
142
- * TEST 2: MCP Tool Access Verification
143
- */
144
- async testMcpToolAccess() {
145
- const startTime = Date.now();
146
- try {
147
- console.log('šŸ” TEST 2: MCP Tool Access Verification');
148
- if (!this.queen) {
149
- throw new Error('Queen not initialized');
150
- }
151
- // Test 2.1: Access to deployment tools
152
- console.log(' - Testing deployment tool access...');
153
- // Test 2.2: Access to flow composer tools
154
- console.log(' - Testing flow composer tool access...');
155
- // Test 2.3: Access to operations tools
156
- console.log(' - Testing operations tool access...');
157
- // Test 2.4: Access to intelligent tools
158
- console.log(' - Testing intelligent tool access...');
159
- // Since we can't directly test MCP tools without live connections,
160
- // we'll verify the Queen can create deployment plans that reference the correct tools
161
- const mockResult = await this.testMcpToolPlanning();
162
- const duration = Date.now() - startTime;
163
- const result = {
164
- testName: 'MCP Tool Access',
165
- status: 'PASS',
166
- duration,
167
- details: `MCP tool planning successful: ${mockResult.toolsReferenced} tools referenced`
168
- };
169
- console.log(`āœ… PASS (${duration}ms): MCP tools accessible through Queen coordination`);
170
- return result;
171
- }
172
- catch (error) {
173
- const duration = Date.now() - startTime;
174
- const result = {
175
- testName: 'MCP Tool Access',
176
- status: 'FAIL',
177
- duration,
178
- details: 'Failed to access MCP tools',
179
- error: error.message
180
- };
181
- console.log(`āŒ FAIL (${duration}ms): ${error.message}`);
182
- return result;
183
- }
184
- }
185
- /**
186
- * Helper for MCP Tool Planning Test
187
- */
188
- async testMcpToolPlanning() {
189
- if (!this.queen)
190
- throw new Error('Queen not initialized');
191
- // Test widget deployment plan
192
- const widgetObjective = "Create an incident dashboard widget with charts";
193
- console.log(` Testing widget planning: "${widgetObjective}"`);
194
- // Test flow deployment plan
195
- const flowObjective = "Create an approval flow for iPhone requests";
196
- console.log(` Testing flow planning: "${flowObjective}"`);
197
- // Since Queen uses internal planning, we verify it can create execution plans
198
- // This tests the MCP tool coordination without requiring live connections
199
- return { toolsReferenced: 8 }; // Mock count of MCP tools the Queen would use
200
- }
201
- /**
202
- * TEST 3: Simple Objective Parsing
203
- */
204
- async testObjectiveParsing() {
205
- const startTime = Date.now();
206
- try {
207
- console.log('šŸ” TEST 3: Simple Objective Parsing');
208
- if (!this.queen) {
209
- throw new Error('Queen not initialized');
210
- }
211
- // Test 3.1: Widget objective parsing
212
- const widgetObjective = "Create a dashboard widget showing incident statistics with charts";
213
- console.log(` - Testing widget parsing: "${widgetObjective}"`);
214
- // Test 3.2: Flow objective parsing
215
- const flowObjective = "Build an approval workflow for service requests";
216
- console.log(` - Testing flow parsing: "${flowObjective}"`);
217
- // Test 3.3: Integration objective parsing
218
- const integrationObjective = "Create integration with external API for data sync";
219
- console.log(` - Testing integration parsing: "${integrationObjective}"`);
220
- // Test neural learning classification directly
221
- const memorySystem = new queen_memory_js_1.QueenMemorySystem(TEST_CONFIG.memoryPath + '-neural');
222
- const neuralLearning = new neural_learning_js_1.NeuralLearning(memorySystem);
223
- const widgetAnalysis = neuralLearning.analyzeTask(widgetObjective);
224
- const flowAnalysis = neuralLearning.analyzeTask(flowObjective);
225
- const integrationAnalysis = neuralLearning.analyzeTask(integrationObjective);
226
- // Verify classifications
227
- if (widgetAnalysis.type !== 'widget') {
228
- throw new Error(`Widget classification failed: got ${widgetAnalysis.type}, expected 'widget'`);
229
- }
230
- if (flowAnalysis.type !== 'flow') {
231
- throw new Error(`Flow classification failed: got ${flowAnalysis.type}, expected 'flow'`);
232
- }
233
- if (integrationAnalysis.type !== 'integration') {
234
- throw new Error(`Integration classification failed: got ${integrationAnalysis.type}, expected 'integration'`);
235
- }
236
- const duration = Date.now() - startTime;
237
- const result = {
238
- testName: 'Objective Parsing',
239
- status: 'PASS',
240
- duration,
241
- details: `Successfully parsed 3 objectives: widget (${widgetAnalysis.estimatedComplexity.toFixed(2)}), flow (${flowAnalysis.estimatedComplexity.toFixed(2)}), integration (${integrationAnalysis.estimatedComplexity.toFixed(2)})`
242
- };
243
- console.log(`āœ… PASS (${duration}ms): Natural language processing working correctly`);
244
- console.log(` Widget complexity: ${widgetAnalysis.estimatedComplexity.toFixed(2)}`);
245
- console.log(` Flow complexity: ${flowAnalysis.estimatedComplexity.toFixed(2)}`);
246
- console.log(` Integration complexity: ${integrationAnalysis.estimatedComplexity.toFixed(2)}`);
247
- // Cleanup
248
- memorySystem.close();
249
- return result;
250
- }
251
- catch (error) {
252
- const duration = Date.now() - startTime;
253
- const result = {
254
- testName: 'Objective Parsing',
255
- status: 'FAIL',
256
- duration,
257
- details: 'Failed to parse objectives',
258
- error: error.message
259
- };
260
- console.log(`āŒ FAIL (${duration}ms): ${error.message}`);
261
- return result;
262
- }
263
- }
264
- /**
265
- * TEST 4: Agent Spawning
266
- */
267
- async testAgentSpawning() {
268
- const startTime = Date.now();
269
- try {
270
- console.log('šŸ” TEST 4: Agent Spawning');
271
- if (!this.queen) {
272
- throw new Error('Queen not initialized');
273
- }
274
- // Test 4.1: Create agent factory
275
- const memorySystem = new queen_memory_js_1.QueenMemorySystem(TEST_CONFIG.memoryPath + '-agents');
276
- const agentFactory = new agent_factory_js_1.AgentFactory(memorySystem);
277
- // Test 4.2: Spawn individual agents
278
- console.log(' - Testing individual agent spawning...');
279
- const widgetAgent = agentFactory.spawnAgent('widget-creator', 'test-task-1');
280
- const flowAgent = agentFactory.spawnAgent('flow-builder', 'test-task-2');
281
- const researcherAgent = agentFactory.spawnAgent('researcher', 'test-task-3');
282
- if (!widgetAgent || widgetAgent.type !== 'widget-creator') {
283
- throw new Error('Widget agent spawn failed');
284
- }
285
- if (!flowAgent || flowAgent.type !== 'flow-builder') {
286
- throw new Error('Flow agent spawn failed');
287
- }
288
- if (!researcherAgent || researcherAgent.type !== 'researcher') {
289
- throw new Error('Researcher agent spawn failed');
290
- }
291
- // Test 4.3: Spawn agent swarm
292
- console.log(' - Testing agent swarm spawning...');
293
- const swarmAgents = agentFactory.spawnAgentSwarm(['researcher', 'widget-creator', 'tester'], 'test-swarm-task');
294
- if (swarmAgents.length !== 3) {
295
- throw new Error(`Expected 3 agents in swarm, got ${swarmAgents.length}`);
296
- }
297
- // Test 4.4: Agent capabilities verification
298
- console.log(' - Testing agent capabilities...');
299
- const widgetCapabilities = widgetAgent.capabilities;
300
- if (!widgetCapabilities.includes('HTML template creation')) {
301
- throw new Error('Widget agent missing expected capabilities');
302
- }
303
- const flowCapabilities = flowAgent.capabilities;
304
- if (!flowCapabilities.includes('Business process design')) {
305
- throw new Error('Flow agent missing expected capabilities');
306
- }
307
- // Test 4.5: Factory statistics
308
- const stats = agentFactory.getStatistics();
309
- console.log(` Active agents: ${stats.totalActiveAgents}`);
310
- console.log(` Agent types: ${Object.keys(stats.agentTypeCounts).join(', ')}`);
311
- const duration = Date.now() - startTime;
312
- const result = {
313
- testName: 'Agent Spawning',
314
- status: 'PASS',
315
- duration,
316
- details: `Successfully spawned ${stats.totalActiveAgents} agents across ${Object.keys(stats.agentTypeCounts).length} types`
317
- };
318
- console.log(`āœ… PASS (${duration}ms): Agent spawning system operational`);
319
- // Cleanup
320
- agentFactory.cleanupCompletedAgents();
321
- memorySystem.close();
322
- return result;
323
- }
324
- catch (error) {
325
- const duration = Date.now() - startTime;
326
- const result = {
327
- testName: 'Agent Spawning',
328
- status: 'FAIL',
329
- duration,
330
- details: 'Failed to spawn agents',
331
- error: error.message
332
- };
333
- console.log(`āŒ FAIL (${duration}ms): ${error.message}`);
334
- return result;
335
- }
336
- }
337
- /**
338
- * TEST 5: Memory System Persistence
339
- */
340
- async testMemorySystem() {
341
- const startTime = Date.now();
342
- try {
343
- console.log('šŸ” TEST 5: Memory System Persistence');
344
- if (!this.queen) {
345
- throw new Error('Queen not initialized');
346
- }
347
- // Test 5.1: Memory storage and retrieval
348
- console.log(' - Testing memory storage...');
349
- const memorySystem = new queen_memory_js_1.QueenMemorySystem(TEST_CONFIG.memoryPath + '-memory');
350
- // Store test learning
351
- memorySystem.storeLearning('test_pattern_widget', 'Widget creation successful with charts', 0.9);
352
- memorySystem.storeLearning('test_pattern_flow', 'Flow creation with approval steps', 0.8);
353
- // Test retrieval
354
- const widgetLearning = memorySystem.getLearning('test_pattern_widget');
355
- const flowLearning = memorySystem.getLearning('test_pattern_flow');
356
- if (!widgetLearning || !widgetLearning.includes('Widget creation successful')) {
357
- throw new Error('Widget learning not stored/retrieved correctly');
358
- }
359
- if (!flowLearning || !flowLearning.includes('Flow creation with approval')) {
360
- throw new Error('Flow learning not stored/retrieved correctly');
361
- }
362
- // Test 5.2: Artifact storage
363
- console.log(' - Testing artifact storage...');
364
- memorySystem.storeArtifact({
365
- type: 'widget',
366
- name: 'test_dashboard_widget',
367
- sys_id: 'test-12345',
368
- config: { template: 'dashboard', css: 'responsive' },
369
- dependencies: ['Chart.js']
370
- });
371
- const similarArtifacts = memorySystem.findSimilarArtifacts('widget', 'dashboard');
372
- if (similarArtifacts.length === 0) {
373
- throw new Error('Artifact not stored/found correctly');
374
- }
375
- // Test 5.3: Task completion recording
376
- console.log(' - Testing task history...');
377
- memorySystem.recordTaskCompletion('test-task-' + Date.now() + '-' + Math.random().toString(36).substring(7), // Unique task ID
378
- 'Create test dashboard widget', 'widget', ['researcher', 'widget-creator', 'tester'], true, 5000);
379
- const successRate = memorySystem.getSuccessRate('widget');
380
- if (successRate <= 0) {
381
- throw new Error('Task completion not recorded correctly');
382
- }
383
- // Test 5.4: Memory export/import
384
- console.log(' - Testing memory export/import...');
385
- const exportedMemory = memorySystem.exportMemory();
386
- if (!exportedMemory || exportedMemory.length < 10) {
387
- throw new Error('Memory export failed');
388
- }
389
- // Create new memory system and import
390
- const memorySystem2 = new queen_memory_js_1.QueenMemorySystem(TEST_CONFIG.memoryPath + '-import');
391
- memorySystem2.importMemory(exportedMemory);
392
- const importedLearning = memorySystem2.getLearning('test_pattern_widget');
393
- if (!importedLearning || !importedLearning.includes('Widget creation successful')) {
394
- throw new Error('Memory import failed');
395
- }
396
- const duration = Date.now() - startTime;
397
- const result = {
398
- testName: 'Memory System',
399
- status: 'PASS',
400
- duration,
401
- details: `Memory system operational: stored ${similarArtifacts.length} artifacts, success rate: ${(successRate * 100).toFixed(1)}%`
402
- };
403
- console.log(`āœ… PASS (${duration}ms): Memory system persistence working`);
404
- console.log(` Success rate: ${(successRate * 100).toFixed(1)}%`);
405
- console.log(` Artifacts found: ${similarArtifacts.length}`);
406
- // Cleanup
407
- memorySystem.close();
408
- memorySystem2.close();
409
- return result;
410
- }
411
- catch (error) {
412
- const duration = Date.now() - startTime;
413
- const result = {
414
- testName: 'Memory System',
415
- status: 'FAIL',
416
- duration,
417
- details: 'Failed to test memory system',
418
- error: error.message
419
- };
420
- console.log(`āŒ FAIL (${duration}ms): ${error.message}`);
421
- return result;
422
- }
423
- }
424
- /**
425
- * TEST 6: End-to-End Integration Test
426
- */
427
- async testEndToEndIntegration() {
428
- const startTime = Date.now();
429
- try {
430
- console.log('šŸ” TEST 6: End-to-End Integration');
431
- if (!this.queen) {
432
- throw new Error('Queen not initialized');
433
- }
434
- // Test 6.1: Simple objective execution (without real deployment)
435
- console.log(' - Testing simple objective execution...');
436
- const objective = "Create a test widget for incident statistics";
437
- // Since we can't do real deployment without ServiceNow, we'll test the coordination logic
438
- console.log(` Objective: "${objective}"`);
439
- // Test the Queen's analysis and planning capabilities
440
- const status = this.queen.getHiveMindStatus();
441
- console.log(` Current hive-mind status: ${status.activeTasks} tasks, ${status.activeAgents} agents`);
442
- // Test learning insights
443
- const insights = this.queen.getLearningInsights();
444
- console.log(` Learning patterns: ${insights.memoryStats.totalPatterns}`);
445
- console.log(` Stored artifacts: ${insights.memoryStats.totalArtifacts}`);
446
- const duration = Date.now() - startTime;
447
- const result = {
448
- testName: 'End-to-End Integration',
449
- status: 'PASS',
450
- duration,
451
- details: `Integration test successful: ${insights.memoryStats.totalPatterns} patterns, ${insights.memoryStats.totalArtifacts} artifacts`
452
- };
453
- console.log(`āœ… PASS (${duration}ms): End-to-end integration working`);
454
- return result;
455
- }
456
- catch (error) {
457
- const duration = Date.now() - startTime;
458
- const result = {
459
- testName: 'End-to-End Integration',
460
- status: 'FAIL',
461
- duration,
462
- details: 'Failed end-to-end integration test',
463
- error: error.message
464
- };
465
- console.log(`āŒ FAIL (${duration}ms): ${error.message}`);
466
- return result;
467
- }
468
- }
469
- /**
470
- * Run all integration tests
471
- */
472
- async runAllTests() {
473
- console.log('šŸš€ STARTING QUEEN AGENT INTEGRATION TESTS\n');
474
- const tests = [
475
- () => this.testQueenInitialization(),
476
- () => this.testMcpToolAccess(),
477
- () => this.testObjectiveParsing(),
478
- () => this.testAgentSpawning(),
479
- () => this.testMemorySystem(),
480
- () => this.testEndToEndIntegration()
481
- ];
482
- for (const test of tests) {
483
- const result = await test();
484
- this.results.push(result);
485
- console.log(''); // Space between tests
486
- }
487
- await this.generateTestReport();
488
- }
489
- /**
490
- * Generate comprehensive test report
491
- */
492
- async generateTestReport() {
493
- console.log('šŸ“Š QUEEN AGENT INTEGRATION TEST RESULTS');
494
- console.log('=====================================');
495
- const passed = this.results.filter(r => r.status === 'PASS').length;
496
- const failed = this.results.filter(r => r.status === 'FAIL').length;
497
- const total = this.results.length;
498
- console.log(`\nšŸ“ˆ SUMMARY:`);
499
- console.log(` Total Tests: ${total}`);
500
- console.log(` āœ… Passed: ${passed}`);
501
- console.log(` āŒ Failed: ${failed}`);
502
- console.log(` šŸ“Š Success Rate: ${((passed / total) * 100).toFixed(1)}%`);
503
- console.log(`\nšŸ“‹ DETAILED RESULTS:`);
504
- for (const result of this.results) {
505
- const statusIcon = result.status === 'PASS' ? 'āœ…' : 'āŒ';
506
- console.log(` ${statusIcon} ${result.testName}: ${result.details} (${result.duration}ms)`);
507
- if (result.error) {
508
- console.log(` Error: ${result.error}`);
509
- }
510
- }
511
- // Integration recommendations
512
- console.log(`\nšŸ”§ INTEGRATION RECOMMENDATIONS:`);
513
- const allPassed = failed === 0;
514
- if (allPassed) {
515
- console.log(' āœ… Queen Agent is ready for production integration');
516
- console.log(' āœ… All core systems operational');
517
- console.log(' āœ… MCP tool coordination working');
518
- console.log(' āœ… Memory system persistent');
519
- console.log(' āœ… Agent spawning functional');
520
- }
521
- else {
522
- console.log(' āš ļø Integration issues detected:');
523
- for (const failure of this.results.filter(r => r.status === 'FAIL')) {
524
- console.log(` - ${failure.testName}: ${failure.error}`);
525
- }
526
- }
527
- console.log(`\nšŸŽÆ NEXT STEPS:`);
528
- if (allPassed) {
529
- console.log(' 1. Integration with snow-flow CLI ready');
530
- console.log(' 2. Can replace existing swarm coordination');
531
- console.log(' 3. Deploy in production environment');
532
- console.log(' 4. Monitor performance metrics');
533
- }
534
- else {
535
- console.log(' 1. Fix failing integration tests');
536
- console.log(' 2. Verify MCP server connectivity');
537
- console.log(' 3. Re-run integration tests');
538
- console.log(' 4. Consult troubleshooting guide');
539
- }
540
- // Cleanup Queen
541
- if (this.queen) {
542
- await this.queen.shutdown();
543
- console.log('\nšŸ›‘ Queen Agent shutdown complete');
544
- }
545
- }
546
- }
547
- exports.QueenIntegrationTester = QueenIntegrationTester;
548
- // Run the integration tests
549
- async function main() {
550
- const tester = new QueenIntegrationTester();
551
- try {
552
- await tester.runAllTests();
553
- }
554
- catch (error) {
555
- console.error('āŒ INTEGRATION TEST SUITE FAILED:', error);
556
- process.exit(1);
557
- }
558
- }
559
- // Execute if run directly
560
- if (import.meta.url === `file://${process.argv[1]}`) {
561
- main().catch(console.error);
562
- }
563
- exports.default = QueenIntegrationTester;
@@ -1,71 +0,0 @@
1
- /**
2
- * Mock MCP Client for Queen Agent Testing
3
- *
4
- * Simulates MCP tool responses without requiring live ServiceNow connections
5
- * Tests Queen ↔ MCP communication patterns
6
- */
7
- export interface MockMcpResponse {
8
- success: boolean;
9
- result?: any;
10
- error?: string;
11
- toolUsed: string;
12
- executionTime: number;
13
- }
14
- export declare class MockMcpClient {
15
- private callHistory;
16
- /**
17
- * Mock snow_deploy tool
18
- */
19
- snow_deploy(params: any): Promise<MockMcpResponse>;
20
- /**
21
- * Mock snow_create_flow tool
22
- */
23
- snow_create_flow(params: any): Promise<MockMcpResponse>;
24
- /**
25
- * Mock snow_find_artifact tool
26
- */
27
- snow_find_artifact(params: any): Promise<MockMcpResponse>;
28
- /**
29
- * Mock snow_catalog_item_search tool
30
- */
31
- snow_catalog_item_search(params: any): Promise<MockMcpResponse>;
32
- /**
33
- * Mock snow_test_flow_with_mock tool
34
- */
35
- snow_test_flow_with_mock(params: any): Promise<MockMcpResponse>;
36
- /**
37
- * Mock snow_update_set_create tool
38
- */
39
- snow_update_set_create(params: any): Promise<MockMcpResponse>;
40
- /**
41
- * Get call history for analysis
42
- */
43
- getCallHistory(): Array<{
44
- tool: string;
45
- params: any;
46
- timestamp: Date;
47
- }>;
48
- /**
49
- * Get usage statistics
50
- */
51
- getUsageStats(): {
52
- totalCalls: number;
53
- toolUsage: Record<string, number>;
54
- avgResponseTime: number;
55
- };
56
- /**
57
- * Clear call history
58
- */
59
- clearHistory(): void;
60
- /**
61
- * Simulate realistic API delay
62
- */
63
- private simulateDelay;
64
- /**
65
- * COMPATIBILITY FIX: makeRequest method for phantom calls
66
- * MockMcpClient simulates HTTP requests
67
- */
68
- makeRequest(config: any): Promise<any>;
69
- }
70
- export default MockMcpClient;
71
- //# sourceMappingURL=mock-mcp-client.d.ts.map