swarmdo 1.4.8 → 1.5.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 (210) hide show
  1. package/.claude/helpers/statusline.cjs +7 -7
  2. package/README.md +3 -1
  3. package/package.json +5 -3
  4. package/v3/@swarmdo/cli/dist/src/commands/hooks.js +26 -24
  5. package/v3/@swarmdo/cli/dist/src/commands/index.js +4 -0
  6. package/v3/@swarmdo/cli/dist/src/commands/integrations.d.ts +14 -0
  7. package/v3/@swarmdo/cli/dist/src/commands/integrations.js +158 -0
  8. package/v3/@swarmdo/cli/dist/src/commands/memory.js +50 -1
  9. package/v3/@swarmdo/cli/dist/src/commands/providers.js +3 -0
  10. package/v3/@swarmdo/cli/dist/src/commands/release.d.ts +15 -0
  11. package/v3/@swarmdo/cli/dist/src/commands/release.js +224 -0
  12. package/v3/@swarmdo/cli/dist/src/commands/security.js +14 -0
  13. package/v3/@swarmdo/cli/dist/src/commands/transcript.js +82 -1
  14. package/v3/@swarmdo/cli/dist/src/commands/usage.js +80 -1
  15. package/v3/@swarmdo/cli/dist/src/config-lint/lint.js +11 -1
  16. package/v3/@swarmdo/cli/dist/src/init/statusline-generator.js +6 -6
  17. package/v3/@swarmdo/cli/dist/src/integrations/integrations.d.ts +54 -0
  18. package/v3/@swarmdo/cli/dist/src/integrations/integrations.js +162 -0
  19. package/v3/@swarmdo/cli/dist/src/mcp-tools/agent-execute-core.js +25 -3
  20. package/v3/@swarmdo/cli/dist/src/mcp-tools/agentdb-tools.js +8 -8
  21. package/v3/@swarmdo/cli/dist/src/memory/graph-edge-writer.d.ts +12 -0
  22. package/v3/@swarmdo/cli/dist/src/memory/graph-edge-writer.js +32 -1
  23. package/v3/@swarmdo/cli/dist/src/memory-vault/watch.d.ts +32 -0
  24. package/v3/@swarmdo/cli/dist/src/memory-vault/watch.js +66 -0
  25. package/v3/@swarmdo/cli/dist/src/providers/openrouter-config.d.ts +91 -0
  26. package/v3/@swarmdo/cli/dist/src/providers/openrouter-config.js +186 -0
  27. package/v3/@swarmdo/cli/dist/src/release/release.d.ts +72 -0
  28. package/v3/@swarmdo/cli/dist/src/release/release.js +86 -0
  29. package/v3/@swarmdo/cli/dist/src/resilience/backoff.d.ts +23 -0
  30. package/v3/@swarmdo/cli/dist/src/resilience/backoff.js +30 -0
  31. package/v3/@swarmdo/cli/dist/src/swarmvector/model-router.js +14 -0
  32. package/v3/@swarmdo/cli/dist/src/transcript/search.d.ts +39 -0
  33. package/v3/@swarmdo/cli/dist/src/transcript/search.js +67 -0
  34. package/v3/@swarmdo/cli/dist/src/usage/diff.d.ts +69 -0
  35. package/v3/@swarmdo/cli/dist/src/usage/diff.js +112 -0
  36. package/v3/@swarmdo/cli/package.json +4 -4
  37. package/v3/@swarmdo/cli-core/dist/src/index.js +1 -1
  38. package/v3/@swarmdo/codex/dist/cli.js +0 -0
  39. package/v3/@swarmdo/hooks/dist/cli/guidance-cli.js +0 -0
  40. package/v3/@swarmdo/hooks/dist/statusline/index.d.ts +3 -3
  41. package/v3/@swarmdo/hooks/dist/statusline/index.js +3 -3
  42. package/v3/@swarmdo/integration/dist/__tests__/agentic-flow-agent.test.js +4 -1
  43. package/v3/@swarmdo/neural/dist/flash-attention.d.ts +1 -1
  44. package/v3/@swarmdo/neural/dist/flash-attention.js +1 -1
  45. package/v3/@swarmdo/plugin-agent-federation/dist/plugin.js +1 -1
  46. package/v3/@swarmdo/plugin-agent-federation/dist/transport/midstream-aware-loader.js +2 -2
  47. package/v3/@swarmdo/providers/dist/swarmvector-provider.d.ts +1 -1
  48. package/v3/@swarmdo/providers/dist/swarmvector-provider.js +1 -1
  49. package/v3/@swarmdo/security/dist/input-validator.d.ts +6 -6
  50. package/v3/@swarmdo/shared/dist/hooks/safety/git-commit.js +1 -1
  51. package/v3/@swarmdo/shared/dist/mcp/transport/http.js +8 -1
  52. package/v3/vendor/agentdb/package.json +0 -1
  53. package/v3/vendor/agentic-flow/package.json +0 -1
  54. package/.claude/scheduled_tasks.lock +0 -1
  55. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  56. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/__main__.cpython-314.pyc +0 -0
  57. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/cli.cpython-314.pyc +0 -0
  58. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/compress.cpython-314.pyc +0 -0
  59. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/detect.cpython-314.pyc +0 -0
  60. package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/validate.cpython-314.pyc +0 -0
  61. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.d.ts +0 -2
  62. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.js +0 -2
  63. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.d.ts +0 -138
  64. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.js +0 -418
  65. package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.d.ts +0 -15
  66. package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.js +0 -240
  67. package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.d.ts +0 -7
  68. package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.js +0 -508
  69. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.d.ts +0 -54
  70. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.js +0 -2
  71. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.d.ts +0 -46
  72. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.js +0 -2
  73. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.d.ts +0 -18
  74. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.js +0 -28
  75. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.d.ts +0 -5
  76. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.js +0 -2
  77. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.d.ts +0 -35
  78. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.js +0 -2
  79. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.d.ts +0 -11
  80. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.js +0 -2
  81. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.d.ts +0 -9
  82. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.js +0 -2
  83. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.d.ts +0 -5
  84. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.js +0 -2
  85. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.d.ts +0 -12
  86. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.js +0 -2
  87. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.d.ts +0 -19
  88. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.js +0 -2
  89. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.d.ts +0 -44
  90. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.js +0 -117
  91. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.d.ts +0 -70
  92. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.js +0 -194
  93. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.d.ts +0 -69
  94. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.js +0 -139
  95. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.d.ts +0 -34
  96. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.js +0 -101
  97. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.d.ts +0 -10
  98. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.js +0 -10
  99. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.d.ts +0 -64
  100. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.js +0 -70
  101. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.d.ts +0 -44
  102. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.js +0 -79
  103. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.d.ts +0 -37
  104. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.js +0 -39
  105. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.d.ts +0 -67
  106. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.js +0 -58
  107. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.d.ts +0 -45
  108. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.js +0 -63
  109. package/v3/@swarmdo/plugin-iot-cognitum/dist/index.d.ts +0 -26
  110. package/v3/@swarmdo/plugin-iot-cognitum/dist/index.js +0 -17
  111. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.d.ts +0 -51
  112. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.js +0 -110
  113. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.d.ts +0 -13
  114. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.js +0 -25
  115. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.d.ts +0 -11
  116. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.js +0 -19
  117. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.d.ts +0 -11
  118. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.js +0 -27
  119. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.d.ts +0 -6
  120. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.js +0 -6
  121. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.d.ts +0 -41
  122. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.js +0 -64
  123. package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.d.ts +0 -8
  124. package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.js +0 -703
  125. package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.d.ts +0 -23
  126. package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.js +0 -239
  127. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.d.ts +0 -17
  128. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.js +0 -42
  129. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.d.ts +0 -18
  130. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.js +0 -45
  131. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.d.ts +0 -19
  132. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.js +0 -50
  133. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.d.ts +0 -19
  134. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.js +0 -47
  135. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.d.ts +0 -17
  136. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.js +0 -40
  137. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.d.ts +0 -18
  138. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.js +0 -51
  139. package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.d.ts +0 -214
  140. package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.js +0 -595
  141. package/v3/@swarmdo/testing/dist/fixtures/agents.d.ts +0 -76
  142. package/v3/@swarmdo/testing/dist/fixtures/agents.js +0 -158
  143. package/v3/@swarmdo/testing/dist/fixtures/configurations.d.ts +0 -157
  144. package/v3/@swarmdo/testing/dist/fixtures/configurations.js +0 -337
  145. package/v3/@swarmdo/testing/dist/fixtures/index.d.ts +0 -10
  146. package/v3/@swarmdo/testing/dist/fixtures/index.js +0 -17
  147. package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.d.ts +0 -329
  148. package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.js +0 -714
  149. package/v3/@swarmdo/testing/dist/fixtures/memory-entries.d.ts +0 -159
  150. package/v3/@swarmdo/testing/dist/fixtures/memory-entries.js +0 -262
  151. package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.d.ts +0 -290
  152. package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.js +0 -547
  153. package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.d.ts +0 -289
  154. package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.js +0 -534
  155. package/v3/@swarmdo/testing/dist/fixtures/tasks.d.ts +0 -106
  156. package/v3/@swarmdo/testing/dist/fixtures/tasks.js +0 -229
  157. package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.d.ts +0 -213
  158. package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.js +0 -435
  159. package/v3/@swarmdo/testing/dist/helpers/assertions.d.ts +0 -135
  160. package/v3/@swarmdo/testing/dist/helpers/assertions.js +0 -217
  161. package/v3/@swarmdo/testing/dist/helpers/create-mock.d.ts +0 -96
  162. package/v3/@swarmdo/testing/dist/helpers/create-mock.js +0 -164
  163. package/v3/@swarmdo/testing/dist/helpers/index.d.ts +0 -14
  164. package/v3/@swarmdo/testing/dist/helpers/index.js +0 -22
  165. package/v3/@swarmdo/testing/dist/helpers/mock-factory.d.ts +0 -323
  166. package/v3/@swarmdo/testing/dist/helpers/mock-factory.js +0 -350
  167. package/v3/@swarmdo/testing/dist/helpers/setup-teardown.d.ts +0 -271
  168. package/v3/@swarmdo/testing/dist/helpers/setup-teardown.js +0 -446
  169. package/v3/@swarmdo/testing/dist/helpers/swarm-instance.d.ts +0 -142
  170. package/v3/@swarmdo/testing/dist/helpers/swarm-instance.js +0 -205
  171. package/v3/@swarmdo/testing/dist/helpers/test-application.d.ts +0 -190
  172. package/v3/@swarmdo/testing/dist/helpers/test-application.js +0 -138
  173. package/v3/@swarmdo/testing/dist/helpers/test-utils.d.ts +0 -274
  174. package/v3/@swarmdo/testing/dist/helpers/test-utils.js +0 -456
  175. package/v3/@swarmdo/testing/dist/index.d.ts +0 -42
  176. package/v3/@swarmdo/testing/dist/index.js +0 -66
  177. package/v3/@swarmdo/testing/dist/mocks/index.d.ts +0 -8
  178. package/v3/@swarmdo/testing/dist/mocks/index.js +0 -10
  179. package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.d.ts +0 -206
  180. package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.js +0 -575
  181. package/v3/@swarmdo/testing/dist/mocks/mock-services.d.ts +0 -287
  182. package/v3/@swarmdo/testing/dist/mocks/mock-services.js +0 -563
  183. package/v3/@swarmdo/testing/dist/regression/api-contract.d.ts +0 -109
  184. package/v3/@swarmdo/testing/dist/regression/api-contract.js +0 -374
  185. package/v3/@swarmdo/testing/dist/regression/index.d.ts +0 -18
  186. package/v3/@swarmdo/testing/dist/regression/index.js +0 -18
  187. package/v3/@swarmdo/testing/dist/regression/integration-regression.d.ts +0 -67
  188. package/v3/@swarmdo/testing/dist/regression/integration-regression.js +0 -334
  189. package/v3/@swarmdo/testing/dist/regression/performance-baseline.d.ts +0 -106
  190. package/v3/@swarmdo/testing/dist/regression/performance-baseline.js +0 -268
  191. package/v3/@swarmdo/testing/dist/regression/regression-runner.d.ts +0 -124
  192. package/v3/@swarmdo/testing/dist/regression/regression-runner.js +0 -227
  193. package/v3/@swarmdo/testing/dist/regression/security-regression.d.ts +0 -73
  194. package/v3/@swarmdo/testing/dist/regression/security-regression.js +0 -258
  195. package/v3/@swarmdo/testing/dist/setup.d.ts +0 -43
  196. package/v3/@swarmdo/testing/dist/setup.js +0 -91
  197. package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.d.ts +0 -10
  198. package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.js +0 -433
  199. package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.d.ts +0 -10
  200. package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.js +0 -352
  201. package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.d.ts +0 -206
  202. package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.js +0 -839
  203. package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.d.ts +0 -10
  204. package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.js +0 -428
  205. package/v3/@swarmdo/testing/dist/v2-compat/index.d.ts +0 -38
  206. package/v3/@swarmdo/testing/dist/v2-compat/index.js +0 -41
  207. package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.d.ts +0 -10
  208. package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.js +0 -419
  209. package/v3/@swarmdo/testing/dist/v2-compat/report-generator.d.ts +0 -34
  210. 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