swarmdo 1.4.8 → 1.6.0

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 (215) hide show
  1. package/.claude/helpers/statusline.cjs +7 -7
  2. package/README.md +9 -6
  3. package/package.json +5 -3
  4. package/v3/@swarmdo/cli/dist/src/commands/compact.d.ts +16 -0
  5. package/v3/@swarmdo/cli/dist/src/commands/compact.js +106 -0
  6. package/v3/@swarmdo/cli/dist/src/commands/hooks.js +26 -24
  7. package/v3/@swarmdo/cli/dist/src/commands/index.js +10 -3
  8. package/v3/@swarmdo/cli/dist/src/commands/integrations.d.ts +14 -0
  9. package/v3/@swarmdo/cli/dist/src/commands/integrations.js +158 -0
  10. package/v3/@swarmdo/cli/dist/src/commands/memory.js +50 -1
  11. package/v3/@swarmdo/cli/dist/src/commands/providers.js +3 -0
  12. package/v3/@swarmdo/cli/dist/src/commands/release.d.ts +15 -0
  13. package/v3/@swarmdo/cli/dist/src/commands/release.js +241 -0
  14. package/v3/@swarmdo/cli/dist/src/commands/security.js +14 -0
  15. package/v3/@swarmdo/cli/dist/src/commands/transcript.js +82 -1
  16. package/v3/@swarmdo/cli/dist/src/commands/usage.js +80 -1
  17. package/v3/@swarmdo/cli/dist/src/compact/compact.d.ts +60 -0
  18. package/v3/@swarmdo/cli/dist/src/compact/compact.js +170 -0
  19. package/v3/@swarmdo/cli/dist/src/config-lint/lint.js +11 -1
  20. package/v3/@swarmdo/cli/dist/src/index.js +4 -2
  21. package/v3/@swarmdo/cli/dist/src/init/statusline-generator.js +6 -6
  22. package/v3/@swarmdo/cli/dist/src/integrations/integrations.d.ts +54 -0
  23. package/v3/@swarmdo/cli/dist/src/integrations/integrations.js +162 -0
  24. package/v3/@swarmdo/cli/dist/src/mcp-tools/agent-execute-core.js +25 -3
  25. package/v3/@swarmdo/cli/dist/src/mcp-tools/agentdb-tools.js +8 -8
  26. package/v3/@swarmdo/cli/dist/src/memory/graph-edge-writer.d.ts +12 -0
  27. package/v3/@swarmdo/cli/dist/src/memory/graph-edge-writer.js +32 -1
  28. package/v3/@swarmdo/cli/dist/src/memory-vault/watch.d.ts +32 -0
  29. package/v3/@swarmdo/cli/dist/src/memory-vault/watch.js +66 -0
  30. package/v3/@swarmdo/cli/dist/src/providers/openrouter-config.d.ts +91 -0
  31. package/v3/@swarmdo/cli/dist/src/providers/openrouter-config.js +186 -0
  32. package/v3/@swarmdo/cli/dist/src/release/release.d.ts +72 -0
  33. package/v3/@swarmdo/cli/dist/src/release/release.js +86 -0
  34. package/v3/@swarmdo/cli/dist/src/resilience/backoff.d.ts +23 -0
  35. package/v3/@swarmdo/cli/dist/src/resilience/backoff.js +30 -0
  36. package/v3/@swarmdo/cli/dist/src/swarmvector/model-router.js +14 -0
  37. package/v3/@swarmdo/cli/dist/src/transcript/search.d.ts +39 -0
  38. package/v3/@swarmdo/cli/dist/src/transcript/search.js +67 -0
  39. package/v3/@swarmdo/cli/dist/src/usage/diff.d.ts +69 -0
  40. package/v3/@swarmdo/cli/dist/src/usage/diff.js +112 -0
  41. package/v3/@swarmdo/cli/package.json +4 -4
  42. package/v3/@swarmdo/cli-core/dist/src/index.js +1 -1
  43. package/v3/@swarmdo/codex/dist/cli.js +0 -0
  44. package/v3/@swarmdo/hooks/dist/cli/guidance-cli.js +0 -0
  45. package/v3/@swarmdo/hooks/dist/statusline/index.d.ts +3 -3
  46. package/v3/@swarmdo/hooks/dist/statusline/index.js +3 -3
  47. package/v3/@swarmdo/integration/dist/__tests__/agentic-flow-agent.test.js +4 -1
  48. package/v3/@swarmdo/neural/dist/flash-attention.d.ts +1 -1
  49. package/v3/@swarmdo/neural/dist/flash-attention.js +1 -1
  50. package/v3/@swarmdo/plugin-agent-federation/dist/plugin.js +1 -1
  51. package/v3/@swarmdo/plugin-agent-federation/dist/transport/midstream-aware-loader.js +2 -2
  52. package/v3/@swarmdo/providers/dist/swarmvector-provider.d.ts +1 -1
  53. package/v3/@swarmdo/providers/dist/swarmvector-provider.js +1 -1
  54. package/v3/@swarmdo/security/dist/input-validator.d.ts +6 -6
  55. package/v3/@swarmdo/shared/dist/hooks/safety/git-commit.js +1 -1
  56. package/v3/@swarmdo/shared/dist/mcp/transport/http.js +8 -1
  57. package/v3/vendor/agentdb/package.json +0 -1
  58. package/v3/vendor/agentic-flow/package.json +0 -1
  59. package/.claude/scheduled_tasks.lock +0 -1
  60. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  61. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/__main__.cpython-314.pyc +0 -0
  62. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/cli.cpython-314.pyc +0 -0
  63. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/compress.cpython-314.pyc +0 -0
  64. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/detect.cpython-314.pyc +0 -0
  65. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/validate.cpython-314.pyc +0 -0
  66. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.d.ts +0 -2
  67. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.js +0 -2
  68. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.d.ts +0 -138
  69. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.js +0 -418
  70. package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.d.ts +0 -15
  71. package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.js +0 -240
  72. package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.d.ts +0 -7
  73. package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.js +0 -508
  74. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.d.ts +0 -54
  75. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.js +0 -2
  76. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.d.ts +0 -46
  77. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.js +0 -2
  78. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.d.ts +0 -18
  79. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.js +0 -28
  80. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.d.ts +0 -5
  81. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.js +0 -2
  82. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.d.ts +0 -35
  83. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.js +0 -2
  84. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.d.ts +0 -11
  85. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.js +0 -2
  86. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.d.ts +0 -9
  87. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.js +0 -2
  88. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.d.ts +0 -5
  89. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.js +0 -2
  90. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.d.ts +0 -12
  91. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.js +0 -2
  92. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.d.ts +0 -19
  93. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.js +0 -2
  94. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.d.ts +0 -44
  95. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.js +0 -117
  96. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.d.ts +0 -70
  97. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.js +0 -194
  98. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.d.ts +0 -69
  99. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.js +0 -139
  100. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.d.ts +0 -34
  101. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.js +0 -101
  102. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.d.ts +0 -10
  103. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.js +0 -10
  104. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.d.ts +0 -64
  105. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.js +0 -70
  106. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.d.ts +0 -44
  107. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.js +0 -79
  108. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.d.ts +0 -37
  109. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.js +0 -39
  110. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.d.ts +0 -67
  111. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.js +0 -58
  112. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.d.ts +0 -45
  113. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.js +0 -63
  114. package/v3/@swarmdo/plugin-iot-cognitum/dist/index.d.ts +0 -26
  115. package/v3/@swarmdo/plugin-iot-cognitum/dist/index.js +0 -17
  116. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.d.ts +0 -51
  117. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.js +0 -110
  118. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.d.ts +0 -13
  119. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.js +0 -25
  120. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.d.ts +0 -11
  121. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.js +0 -19
  122. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.d.ts +0 -11
  123. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.js +0 -27
  124. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.d.ts +0 -6
  125. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.js +0 -6
  126. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.d.ts +0 -41
  127. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.js +0 -64
  128. package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.d.ts +0 -8
  129. package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.js +0 -703
  130. package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.d.ts +0 -23
  131. package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.js +0 -239
  132. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.d.ts +0 -17
  133. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.js +0 -42
  134. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.d.ts +0 -18
  135. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.js +0 -45
  136. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.d.ts +0 -19
  137. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.js +0 -50
  138. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.d.ts +0 -19
  139. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.js +0 -47
  140. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.d.ts +0 -17
  141. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.js +0 -40
  142. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.d.ts +0 -18
  143. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.js +0 -51
  144. package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.d.ts +0 -214
  145. package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.js +0 -595
  146. package/v3/@swarmdo/testing/dist/fixtures/agents.d.ts +0 -76
  147. package/v3/@swarmdo/testing/dist/fixtures/agents.js +0 -158
  148. package/v3/@swarmdo/testing/dist/fixtures/configurations.d.ts +0 -157
  149. package/v3/@swarmdo/testing/dist/fixtures/configurations.js +0 -337
  150. package/v3/@swarmdo/testing/dist/fixtures/index.d.ts +0 -10
  151. package/v3/@swarmdo/testing/dist/fixtures/index.js +0 -17
  152. package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.d.ts +0 -329
  153. package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.js +0 -714
  154. package/v3/@swarmdo/testing/dist/fixtures/memory-entries.d.ts +0 -159
  155. package/v3/@swarmdo/testing/dist/fixtures/memory-entries.js +0 -262
  156. package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.d.ts +0 -290
  157. package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.js +0 -547
  158. package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.d.ts +0 -289
  159. package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.js +0 -534
  160. package/v3/@swarmdo/testing/dist/fixtures/tasks.d.ts +0 -106
  161. package/v3/@swarmdo/testing/dist/fixtures/tasks.js +0 -229
  162. package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.d.ts +0 -213
  163. package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.js +0 -435
  164. package/v3/@swarmdo/testing/dist/helpers/assertions.d.ts +0 -135
  165. package/v3/@swarmdo/testing/dist/helpers/assertions.js +0 -217
  166. package/v3/@swarmdo/testing/dist/helpers/create-mock.d.ts +0 -96
  167. package/v3/@swarmdo/testing/dist/helpers/create-mock.js +0 -164
  168. package/v3/@swarmdo/testing/dist/helpers/index.d.ts +0 -14
  169. package/v3/@swarmdo/testing/dist/helpers/index.js +0 -22
  170. package/v3/@swarmdo/testing/dist/helpers/mock-factory.d.ts +0 -323
  171. package/v3/@swarmdo/testing/dist/helpers/mock-factory.js +0 -350
  172. package/v3/@swarmdo/testing/dist/helpers/setup-teardown.d.ts +0 -271
  173. package/v3/@swarmdo/testing/dist/helpers/setup-teardown.js +0 -446
  174. package/v3/@swarmdo/testing/dist/helpers/swarm-instance.d.ts +0 -142
  175. package/v3/@swarmdo/testing/dist/helpers/swarm-instance.js +0 -205
  176. package/v3/@swarmdo/testing/dist/helpers/test-application.d.ts +0 -190
  177. package/v3/@swarmdo/testing/dist/helpers/test-application.js +0 -138
  178. package/v3/@swarmdo/testing/dist/helpers/test-utils.d.ts +0 -274
  179. package/v3/@swarmdo/testing/dist/helpers/test-utils.js +0 -456
  180. package/v3/@swarmdo/testing/dist/index.d.ts +0 -42
  181. package/v3/@swarmdo/testing/dist/index.js +0 -66
  182. package/v3/@swarmdo/testing/dist/mocks/index.d.ts +0 -8
  183. package/v3/@swarmdo/testing/dist/mocks/index.js +0 -10
  184. package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.d.ts +0 -206
  185. package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.js +0 -575
  186. package/v3/@swarmdo/testing/dist/mocks/mock-services.d.ts +0 -287
  187. package/v3/@swarmdo/testing/dist/mocks/mock-services.js +0 -563
  188. package/v3/@swarmdo/testing/dist/regression/api-contract.d.ts +0 -109
  189. package/v3/@swarmdo/testing/dist/regression/api-contract.js +0 -374
  190. package/v3/@swarmdo/testing/dist/regression/index.d.ts +0 -18
  191. package/v3/@swarmdo/testing/dist/regression/index.js +0 -18
  192. package/v3/@swarmdo/testing/dist/regression/integration-regression.d.ts +0 -67
  193. package/v3/@swarmdo/testing/dist/regression/integration-regression.js +0 -334
  194. package/v3/@swarmdo/testing/dist/regression/performance-baseline.d.ts +0 -106
  195. package/v3/@swarmdo/testing/dist/regression/performance-baseline.js +0 -268
  196. package/v3/@swarmdo/testing/dist/regression/regression-runner.d.ts +0 -124
  197. package/v3/@swarmdo/testing/dist/regression/regression-runner.js +0 -227
  198. package/v3/@swarmdo/testing/dist/regression/security-regression.d.ts +0 -73
  199. package/v3/@swarmdo/testing/dist/regression/security-regression.js +0 -258
  200. package/v3/@swarmdo/testing/dist/setup.d.ts +0 -43
  201. package/v3/@swarmdo/testing/dist/setup.js +0 -91
  202. package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.d.ts +0 -10
  203. package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.js +0 -433
  204. package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.d.ts +0 -10
  205. package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.js +0 -352
  206. package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.d.ts +0 -206
  207. package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.js +0 -839
  208. package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.d.ts +0 -10
  209. package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.js +0 -428
  210. package/v3/@swarmdo/testing/dist/v2-compat/index.d.ts +0 -38
  211. package/v3/@swarmdo/testing/dist/v2-compat/index.js +0 -41
  212. package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.d.ts +0 -10
  213. package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.js +0 -419
  214. package/v3/@swarmdo/testing/dist/v2-compat/report-generator.d.ts +0 -34
  215. package/v3/@swarmdo/testing/dist/v2-compat/report-generator.js +0 -372
@@ -1,419 +0,0 @@
1
- /**
2
- * V2 MCP Tool Compatibility Tests
3
- *
4
- * Tests all 65 V2 MCP tools work via name mapping and parameter translation.
5
- * Verifies parameter translation and response format compatibility.
6
- *
7
- * @module v3/testing/v2-compat/mcp-compat.test
8
- */
9
- import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
10
- import { V2CompatibilityValidator, V2_MCP_TOOLS, } from './compatibility-validator.js';
11
- /**
12
- * Tool name mapping from V2 to V3
13
- */
14
- const TOOL_NAME_MAPPING = {
15
- // Agent tools
16
- 'dispatch_agent': 'agent/spawn',
17
- 'agents/spawn': 'agent/spawn',
18
- 'agents/list': 'agent/list',
19
- 'agents/terminate': 'agent/terminate',
20
- 'agents/info': 'agent/status',
21
- 'agent/create': 'agent/spawn',
22
- // Swarm tools
23
- 'swarm_status': 'swarm/status',
24
- 'swarm/get-status': 'swarm/status',
25
- 'swarm/get-comprehensive-status': 'swarm/status',
26
- 'mcp__swarmdo-swarm__swarm_init': 'swarm/init',
27
- 'mcp__swarmdo-swarm__swarm_status': 'swarm/status',
28
- 'mcp__swarmdo-swarm__agent_spawn': 'agent/spawn',
29
- 'mcp__swarmdo-swarm__agent_list': 'agent/list',
30
- 'mcp__swarmdo-swarm__agent_metrics': 'agent/status',
31
- // Memory tools
32
- 'memory/query': 'memory/search',
33
- 'mcp__swarmdo-swarm__memory_usage': 'memory/list',
34
- // Config tools
35
- 'config/get': 'config/load',
36
- 'config/update': 'config/save',
37
- // Neural tools
38
- 'mcp__swarmdo-swarm__neural_status': 'hooks/metrics',
39
- 'mcp__swarmdo-swarm__neural_train': 'hooks/pretrain',
40
- };
41
- /**
42
- * Create mock MCP client
43
- */
44
- function createMockMCPClient() {
45
- const v3Tools = [
46
- 'agent/spawn', 'agent/list', 'agent/terminate', 'agent/status',
47
- 'swarm/init', 'swarm/status', 'swarm/scale', 'swarm/consensus', 'swarm/broadcast',
48
- 'memory/store', 'memory/search', 'memory/delete', 'memory/list',
49
- 'task/create', 'task/assign', 'task/status', 'task/complete',
50
- 'config/load', 'config/save',
51
- 'hooks/metrics', 'hooks/pretrain',
52
- 'github/pr-create', 'github/pr-review', 'github/issue-create',
53
- ];
54
- return {
55
- callTool: vi.fn().mockImplementation(async (name, params) => {
56
- const v3Name = TOOL_NAME_MAPPING[name] || name;
57
- if (!v3Tools.includes(v3Name)) {
58
- throw new Error(`Tool not found: ${name} (translated: ${v3Name})`);
59
- }
60
- // Simulate tool responses
61
- const responses = {
62
- 'agent/spawn': { id: 'agent-1', type: params.agentType || params.type, status: 'active' },
63
- 'agent/list': [{ id: 'agent-1', type: 'coder', status: 'active' }],
64
- 'agent/terminate': { success: true },
65
- 'agent/status': { id: 'agent-1', metrics: { tasksCompleted: 0 } },
66
- 'swarm/init': { id: 'swarm-1', topology: 'hierarchical-mesh' },
67
- 'swarm/status': { agents: 0, topology: 'hierarchical-mesh', status: 'active' },
68
- 'memory/store': { id: 'mem-1', stored: true },
69
- 'memory/search': [{ id: 'mem-1', content: 'test' }],
70
- 'memory/list': [{ id: 'mem-1', type: 'pattern' }],
71
- 'task/create': { id: 'task-1', status: 'pending' },
72
- 'config/load': { value: 'test-value' },
73
- 'config/save': { success: true },
74
- 'hooks/metrics': { patterns: 10, successRate: 0.85 },
75
- 'hooks/pretrain': { trained: true, patterns: 100 },
76
- };
77
- return responses[v3Name] || { success: true };
78
- }),
79
- getTools: vi.fn().mockReturnValue(v3Tools),
80
- translateToolName: vi.fn().mockImplementation((v2Name) => TOOL_NAME_MAPPING[v2Name] || v2Name),
81
- translateParams: vi.fn().mockImplementation((toolName, params) => {
82
- // Parameter translation logic
83
- if (toolName === 'dispatch_agent' || toolName === 'agents/spawn') {
84
- return {
85
- agentType: params.type,
86
- id: params.name,
87
- config: {
88
- capabilities: params.capabilities,
89
- systemPrompt: params.systemPrompt,
90
- },
91
- priority: params.priority > 5 ? 'high' : 'normal',
92
- };
93
- }
94
- if (toolName === 'memory/query') {
95
- return {
96
- query: params.search,
97
- searchType: 'hybrid',
98
- type: params.type,
99
- limit: params.limit || 10,
100
- };
101
- }
102
- if (toolName.includes('swarm_init')) {
103
- return {
104
- topology: params.topology || 'hierarchical-mesh',
105
- maxAgents: params.maxAgents || 15,
106
- config: {
107
- consensusMechanism: params.consensus || 'majority',
108
- },
109
- };
110
- }
111
- return params;
112
- }),
113
- };
114
- }
115
- describe('V2 MCP Tool Compatibility', () => {
116
- let validator;
117
- let mockMCP;
118
- beforeEach(() => {
119
- mockMCP = createMockMCPClient();
120
- validator = new V2CompatibilityValidator({
121
- verbose: false,
122
- });
123
- });
124
- afterEach(() => {
125
- vi.clearAllMocks();
126
- });
127
- describe('Agent Tools', () => {
128
- const agentTools = V2_MCP_TOOLS.filter(t => t.name.includes('agent') || t.name === 'dispatch_agent');
129
- it.each(agentTools)('should support V2 tool: $name', async (tool) => {
130
- const params = Object.fromEntries(Object.entries(tool.parameters)
131
- .filter(([, def]) => def.required)
132
- .map(([key, def]) => [key, def.type === 'string' ? 'test' : {}]));
133
- const result = await mockMCP.callTool(tool.name, params);
134
- expect(result).toBeDefined();
135
- });
136
- it('should translate dispatch_agent to agent/spawn', () => {
137
- const v3Name = mockMCP.translateToolName('dispatch_agent');
138
- expect(v3Name).toBe('agent/spawn');
139
- });
140
- it('should translate agents/spawn to agent/spawn', () => {
141
- const v3Name = mockMCP.translateToolName('agents/spawn');
142
- expect(v3Name).toBe('agent/spawn');
143
- });
144
- it('should translate agents/info to agent/status', () => {
145
- const v3Name = mockMCP.translateToolName('agents/info');
146
- expect(v3Name).toBe('agent/status');
147
- });
148
- it('should translate agent parameters correctly', () => {
149
- const v2Params = {
150
- type: 'coder',
151
- name: 'my-coder',
152
- capabilities: ['coding'],
153
- priority: 8,
154
- };
155
- const v3Params = mockMCP.translateParams('dispatch_agent', v2Params);
156
- expect(v3Params.agentType).toBe('coder');
157
- expect(v3Params.id).toBe('my-coder');
158
- expect(v3Params.priority).toBe('high');
159
- });
160
- it('should handle mcp__swarmdo-swarm__agent_spawn', async () => {
161
- const result = await mockMCP.callTool('mcp__swarmdo-swarm__agent_spawn', { type: 'coder' });
162
- expect(result).toHaveProperty('id');
163
- expect(result).toHaveProperty('type');
164
- });
165
- });
166
- describe('Swarm Tools', () => {
167
- const swarmTools = V2_MCP_TOOLS.filter(t => t.name.includes('swarm'));
168
- it.each(swarmTools)('should support V2 tool: $name', async (tool) => {
169
- const params = Object.fromEntries(Object.entries(tool.parameters)
170
- .filter(([, def]) => def.required)
171
- .map(([key, def]) => [key, def.type === 'string' ? 'test' : {}]));
172
- const result = await mockMCP.callTool(tool.name, params);
173
- expect(result).toBeDefined();
174
- });
175
- it('should translate swarm_status to swarm/status', () => {
176
- const v3Name = mockMCP.translateToolName('swarm_status');
177
- expect(v3Name).toBe('swarm/status');
178
- });
179
- it('should translate swarm/get-comprehensive-status to swarm/status', () => {
180
- const v3Name = mockMCP.translateToolName('swarm/get-comprehensive-status');
181
- expect(v3Name).toBe('swarm/status');
182
- });
183
- it('should translate swarm init parameters', () => {
184
- const v2Params = {
185
- topology: 'mesh',
186
- maxAgents: 10,
187
- consensus: 'quorum',
188
- };
189
- const v3Params = mockMCP.translateParams('mcp__swarmdo-swarm__swarm_init', v2Params);
190
- expect(v3Params.topology).toBe('mesh');
191
- expect(v3Params.maxAgents).toBe(10);
192
- expect(v3Params.config).toHaveProperty('consensusMechanism');
193
- });
194
- it('should return compatible swarm status response', async () => {
195
- const result = await mockMCP.callTool('swarm_status', {});
196
- expect(result).toHaveProperty('agents');
197
- expect(result).toHaveProperty('topology');
198
- expect(result).toHaveProperty('status');
199
- });
200
- });
201
- describe('Memory Tools', () => {
202
- const memoryTools = V2_MCP_TOOLS.filter(t => t.name.includes('memory'));
203
- it.each(memoryTools)('should support V2 tool: $name', async (tool) => {
204
- const params = Object.fromEntries(Object.entries(tool.parameters)
205
- .filter(([, def]) => def.required)
206
- .map(([key, def]) => [key, def.type === 'string' ? 'test' : {}]));
207
- const result = await mockMCP.callTool(tool.name, params);
208
- expect(result).toBeDefined();
209
- });
210
- it('should translate memory/query to memory/search', () => {
211
- const v3Name = mockMCP.translateToolName('memory/query');
212
- expect(v3Name).toBe('memory/search');
213
- });
214
- it('should translate memory query parameters', () => {
215
- const v2Params = {
216
- search: 'test query',
217
- type: 'pattern',
218
- limit: 20,
219
- };
220
- const v3Params = mockMCP.translateParams('memory/query', v2Params);
221
- expect(v3Params.query).toBe('test query');
222
- expect(v3Params.searchType).toBe('hybrid');
223
- expect(v3Params.limit).toBe(20);
224
- });
225
- it('should return array from memory search', async () => {
226
- const result = await mockMCP.callTool('memory/query', { search: 'test' });
227
- expect(Array.isArray(result)).toBe(true);
228
- });
229
- });
230
- describe('Config Tools', () => {
231
- it('should translate config/get to config/load', () => {
232
- const v3Name = mockMCP.translateToolName('config/get');
233
- expect(v3Name).toBe('config/load');
234
- });
235
- it('should translate config/update to config/save', () => {
236
- const v3Name = mockMCP.translateToolName('config/update');
237
- expect(v3Name).toBe('config/save');
238
- });
239
- it('should handle config get operation', async () => {
240
- const result = await mockMCP.callTool('config/get', { key: 'test.key' });
241
- expect(result).toHaveProperty('value');
242
- });
243
- it('should handle config update operation', async () => {
244
- const result = await mockMCP.callTool('config/update', {
245
- key: 'test.key',
246
- value: 'new-value',
247
- });
248
- expect(result).toHaveProperty('success');
249
- });
250
- });
251
- describe('Task Tools', () => {
252
- const taskTools = V2_MCP_TOOLS.filter(t => t.name.startsWith('task/'));
253
- it.each(taskTools)('should support V2 tool: $name', async (tool) => {
254
- const params = Object.fromEntries(Object.entries(tool.parameters)
255
- .filter(([, def]) => def.required)
256
- .map(([key, def]) => [key, def.type === 'string' ? 'test' : 'test']));
257
- const result = await mockMCP.callTool(tool.name, params);
258
- expect(result).toBeDefined();
259
- });
260
- it('should create task with description', async () => {
261
- const result = await mockMCP.callTool('task/create', {
262
- description: 'Test task',
263
- });
264
- expect(result).toHaveProperty('id');
265
- expect(result).toHaveProperty('status');
266
- });
267
- it('should assign task to agent', async () => {
268
- const result = await mockMCP.callTool('task/assign', {
269
- taskId: 'task-1',
270
- agentId: 'agent-1',
271
- });
272
- expect(result).toBeDefined();
273
- });
274
- });
275
- describe('Neural/Learning Tools', () => {
276
- it('should translate neural_status to hooks/metrics', () => {
277
- const v3Name = mockMCP.translateToolName('mcp__swarmdo-swarm__neural_status');
278
- expect(v3Name).toBe('hooks/metrics');
279
- });
280
- it('should translate neural_train to hooks/pretrain', () => {
281
- const v3Name = mockMCP.translateToolName('mcp__swarmdo-swarm__neural_train');
282
- expect(v3Name).toBe('hooks/pretrain');
283
- });
284
- it('should return compatible metrics response', async () => {
285
- const result = await mockMCP.callTool('mcp__swarmdo-swarm__neural_status', {});
286
- expect(result).toHaveProperty('patterns');
287
- expect(result).toHaveProperty('successRate');
288
- });
289
- it('should handle pretrain operation', async () => {
290
- const result = await mockMCP.callTool('mcp__swarmdo-swarm__neural_train', {
291
- data: { source: 'repo' },
292
- });
293
- expect(result).toHaveProperty('trained');
294
- });
295
- });
296
- describe('GitHub Tools', () => {
297
- const githubTools = V2_MCP_TOOLS.filter(t => t.name.startsWith('github/'));
298
- it.each(githubTools)('should support V2 tool: $name', async (tool) => {
299
- const params = Object.fromEntries(Object.entries(tool.parameters)
300
- .filter(([, def]) => def.required)
301
- .map(([key, def]) => {
302
- if (def.type === 'number')
303
- return [key, 1];
304
- return [key, 'test'];
305
- }));
306
- const result = await mockMCP.callTool(tool.name, params);
307
- expect(result).toBeDefined();
308
- });
309
- it('should handle PR creation', async () => {
310
- const result = await mockMCP.callTool('github/pr-create', {
311
- title: 'Test PR',
312
- body: 'Test body',
313
- });
314
- expect(result).toBeDefined();
315
- });
316
- it('should handle PR review', async () => {
317
- const result = await mockMCP.callTool('github/pr-review', {
318
- prNumber: 123,
319
- });
320
- expect(result).toBeDefined();
321
- });
322
- });
323
- describe('Error Handling', () => {
324
- it('should throw for unknown tool', async () => {
325
- await expect(mockMCP.callTool('unknown/tool', {}))
326
- .rejects.toThrow('Tool not found');
327
- });
328
- it('should handle missing required parameters gracefully', async () => {
329
- // Tool should still be callable even with empty params for testing
330
- const result = await mockMCP.callTool('agent/list', {});
331
- expect(result).toBeDefined();
332
- });
333
- });
334
- describe('Full MCP Validation', () => {
335
- it('should pass full MCP validation', async () => {
336
- const result = await validator.validateMCPTools();
337
- expect(result.category).toBe('mcp');
338
- expect(result.totalChecks).toBeGreaterThan(0);
339
- expect(result.passedChecks).toBeGreaterThan(0);
340
- });
341
- it('should detect all V2 MCP tools', async () => {
342
- const result = await validator.validateMCPTools();
343
- const toolChecks = result.checks.filter(c => c.name.startsWith('MCP Tool:'));
344
- expect(toolChecks.length).toBeGreaterThanOrEqual(V2_MCP_TOOLS.length);
345
- });
346
- it('should verify parameter translation', async () => {
347
- const result = await validator.validateMCPTools();
348
- const paramChecks = result.checks.filter(c => c.name.includes('Param:'));
349
- expect(paramChecks.length).toBeGreaterThan(0);
350
- });
351
- it('should identify V3 equivalents', async () => {
352
- const result = await validator.validateMCPTools();
353
- for (const check of result.checks.filter(c => c.name.startsWith('MCP Tool:'))) {
354
- if (check.passed && check.details) {
355
- expect(check.details.v3Equivalent).toBeDefined();
356
- }
357
- }
358
- });
359
- it('should report breaking changes correctly', async () => {
360
- const result = await validator.validateMCPTools();
361
- // Most tools should have V3 equivalents
362
- expect(result.breakingChanges).toBeLessThan(result.totalChecks * 0.2);
363
- });
364
- });
365
- describe('Response Format Compatibility', () => {
366
- it('should return consistent agent info format', async () => {
367
- const result = await mockMCP.callTool('dispatch_agent', { type: 'coder' });
368
- expect(result).toHaveProperty('id');
369
- expect(result).toHaveProperty('type');
370
- expect(result).toHaveProperty('status');
371
- });
372
- it('should return array for list operations', async () => {
373
- const agentList = await mockMCP.callTool('agents/list', {});
374
- const memoryList = await mockMCP.callTool('memory/query', { search: 'test' });
375
- expect(Array.isArray(agentList)).toBe(true);
376
- expect(Array.isArray(memoryList)).toBe(true);
377
- });
378
- it('should return success boolean for mutations', async () => {
379
- const terminateResult = await mockMCP.callTool('agents/terminate', { id: 'agent-1' });
380
- const configResult = await mockMCP.callTool('config/update', { key: 'k', value: 'v' });
381
- expect(terminateResult).toHaveProperty('success');
382
- expect(configResult).toHaveProperty('success');
383
- });
384
- });
385
- });
386
- describe('MCP Tool Coverage', () => {
387
- it('should define at least 30 V2 MCP tools', () => {
388
- expect(V2_MCP_TOOLS.length).toBeGreaterThanOrEqual(30);
389
- });
390
- it('should have V3 equivalents for most tools', () => {
391
- const withEquivalent = V2_MCP_TOOLS.filter(t => t.v3Equivalent);
392
- expect(withEquivalent.length).toBeGreaterThan(V2_MCP_TOOLS.length * 0.8);
393
- });
394
- it('should categorize tools correctly', () => {
395
- const categories = {
396
- agent: V2_MCP_TOOLS.filter(t => t.name.includes('agent') || t.name === 'dispatch_agent'),
397
- swarm: V2_MCP_TOOLS.filter(t => t.name.includes('swarm')),
398
- memory: V2_MCP_TOOLS.filter(t => t.name.includes('memory')),
399
- config: V2_MCP_TOOLS.filter(t => t.name.includes('config')),
400
- task: V2_MCP_TOOLS.filter(t => t.name.startsWith('task/')),
401
- neural: V2_MCP_TOOLS.filter(t => t.name.includes('neural')),
402
- github: V2_MCP_TOOLS.filter(t => t.name.startsWith('github/')),
403
- coordinate: V2_MCP_TOOLS.filter(t => t.name.startsWith('coordinate/')),
404
- };
405
- expect(categories.agent.length).toBeGreaterThanOrEqual(6);
406
- expect(categories.swarm.length).toBeGreaterThanOrEqual(5);
407
- expect(categories.memory.length).toBeGreaterThanOrEqual(3);
408
- });
409
- it('should define required parameters correctly', () => {
410
- for (const tool of V2_MCP_TOOLS) {
411
- for (const [, def] of Object.entries(tool.parameters)) {
412
- expect(def).toHaveProperty('type');
413
- expect(def).toHaveProperty('required');
414
- expect(typeof def.required).toBe('boolean');
415
- }
416
- }
417
- });
418
- });
419
- //# sourceMappingURL=mcp-compat.test.js.map
@@ -1,34 +0,0 @@
1
- /**
2
- * V2 Compatibility Report Generator
3
- *
4
- * Generates comprehensive markdown reports for V2 compatibility validation.
5
- * Provides detailed analysis of compatibility status, breaking changes, and migration recommendations.
6
- *
7
- * @module v3/testing/v2-compat/report-generator
8
- */
9
- import { type FullValidationReport } from './compatibility-validator.js';
10
- /**
11
- * Report generation options
12
- */
13
- export interface ReportOptions {
14
- /** Include detailed check results */
15
- detailed: boolean;
16
- /** Include code examples */
17
- includeExamples: boolean;
18
- /** Include migration scripts */
19
- includeMigrationScripts: boolean;
20
- /** Output format */
21
- format: 'markdown' | 'json' | 'html';
22
- }
23
- /**
24
- * Generate a full compatibility report
25
- */
26
- export declare function generateFullReport(options?: Partial<ReportOptions>): Promise<{
27
- report: FullValidationReport;
28
- markdown: string;
29
- }>;
30
- /**
31
- * Run validation and save report to file
32
- */
33
- export declare function runAndSaveReport(outputPath: string): Promise<FullValidationReport>;
34
- //# sourceMappingURL=report-generator.d.ts.map