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,714 +0,0 @@
1
- /**
2
- * @swarmdo/testing - MCP Fixtures
3
- *
4
- * Comprehensive mock MCP tools, contexts, and server configurations for testing.
5
- * Supports all MCP protocol operations and Swarmdo tool integrations.
6
- *
7
- * Based on ADR-005 (MCP-first API design) and V3 specifications.
8
- */
9
- import { vi } from 'vitest';
10
- /**
11
- * Pre-defined MCP tools for Swarmdo
12
- */
13
- export const mcpTools = {
14
- // Swarm management tools
15
- swarmInit: {
16
- name: 'swarm_init',
17
- description: 'Initialize a new swarm with specified topology and configuration',
18
- inputSchema: {
19
- type: 'object',
20
- properties: {
21
- topology: {
22
- type: 'string',
23
- description: 'Swarm topology (hierarchical, mesh, adaptive, hierarchical-mesh)',
24
- enum: ['hierarchical', 'mesh', 'ring', 'star', 'adaptive', 'hierarchical-mesh'],
25
- },
26
- maxAgents: {
27
- type: 'number',
28
- description: 'Maximum number of agents in the swarm',
29
- default: 15,
30
- },
31
- consensusProtocol: {
32
- type: 'string',
33
- description: 'Consensus protocol to use',
34
- enum: ['raft', 'pbft', 'gossip', 'byzantine'],
35
- },
36
- },
37
- required: ['topology'],
38
- },
39
- },
40
- agentSpawn: {
41
- name: 'agent_spawn',
42
- description: 'Spawn a new agent with specified type and configuration',
43
- inputSchema: {
44
- type: 'object',
45
- properties: {
46
- type: {
47
- type: 'string',
48
- description: 'Agent type (queen-coordinator, coder, tester, etc.)',
49
- },
50
- name: {
51
- type: 'string',
52
- description: 'Agent name',
53
- },
54
- capabilities: {
55
- type: 'array',
56
- description: 'Agent capabilities',
57
- items: { type: 'string' },
58
- },
59
- priority: {
60
- type: 'number',
61
- description: 'Agent priority (0-100)',
62
- default: 50,
63
- },
64
- },
65
- required: ['type'],
66
- },
67
- },
68
- taskOrchestrate: {
69
- name: 'task_orchestrate',
70
- description: 'Orchestrate a task across multiple agents',
71
- inputSchema: {
72
- type: 'object',
73
- properties: {
74
- taskName: {
75
- type: 'string',
76
- description: 'Name of the task',
77
- },
78
- taskType: {
79
- type: 'string',
80
- description: 'Type of task (security, coding, testing, review)',
81
- },
82
- payload: {
83
- type: 'object',
84
- description: 'Task payload',
85
- },
86
- agents: {
87
- type: 'array',
88
- description: 'List of agent IDs to coordinate',
89
- items: { type: 'string' },
90
- },
91
- parallel: {
92
- type: 'boolean',
93
- description: 'Execute tasks in parallel',
94
- default: true,
95
- },
96
- },
97
- required: ['taskName', 'taskType'],
98
- },
99
- },
100
- // Memory tools
101
- memoryStore: {
102
- name: 'memory_store',
103
- description: 'Store a value in memory with optional embedding',
104
- inputSchema: {
105
- type: 'object',
106
- properties: {
107
- key: {
108
- type: 'string',
109
- description: 'Memory key',
110
- },
111
- value: {
112
- type: 'object',
113
- description: 'Value to store',
114
- },
115
- type: {
116
- type: 'string',
117
- description: 'Memory type',
118
- enum: ['short-term', 'long-term', 'semantic', 'episodic'],
119
- },
120
- ttl: {
121
- type: 'number',
122
- description: 'Time-to-live in milliseconds',
123
- },
124
- generateEmbedding: {
125
- type: 'boolean',
126
- description: 'Generate vector embedding for semantic search',
127
- default: false,
128
- },
129
- },
130
- required: ['key', 'value'],
131
- },
132
- },
133
- memorySearch: {
134
- name: 'memory_search',
135
- description: 'Search memory using semantic vector search',
136
- inputSchema: {
137
- type: 'object',
138
- properties: {
139
- query: {
140
- type: 'string',
141
- description: 'Search query',
142
- },
143
- topK: {
144
- type: 'number',
145
- description: 'Number of results to return',
146
- default: 10,
147
- },
148
- threshold: {
149
- type: 'number',
150
- description: 'Minimum similarity threshold (0-1)',
151
- default: 0.7,
152
- },
153
- filters: {
154
- type: 'object',
155
- description: 'Additional filters',
156
- },
157
- },
158
- required: ['query'],
159
- },
160
- },
161
- // Status tools
162
- swarmStatus: {
163
- name: 'swarm_status',
164
- description: 'Get current swarm status and metrics',
165
- inputSchema: {
166
- type: 'object',
167
- properties: {
168
- includeMetrics: {
169
- type: 'boolean',
170
- description: 'Include detailed metrics',
171
- default: true,
172
- },
173
- includeAgents: {
174
- type: 'boolean',
175
- description: 'Include agent details',
176
- default: false,
177
- },
178
- },
179
- },
180
- },
181
- agentList: {
182
- name: 'agent_list',
183
- description: 'List all agents in the swarm',
184
- inputSchema: {
185
- type: 'object',
186
- properties: {
187
- status: {
188
- type: 'string',
189
- description: 'Filter by agent status',
190
- enum: ['idle', 'busy', 'terminated', 'error', 'all'],
191
- },
192
- type: {
193
- type: 'string',
194
- description: 'Filter by agent type',
195
- },
196
- },
197
- },
198
- },
199
- agentMetrics: {
200
- name: 'agent_metrics',
201
- description: 'Get metrics for a specific agent',
202
- inputSchema: {
203
- type: 'object',
204
- properties: {
205
- agentId: {
206
- type: 'string',
207
- description: 'Agent ID',
208
- },
209
- },
210
- required: ['agentId'],
211
- },
212
- },
213
- // Neural/Learning tools
214
- neuralStatus: {
215
- name: 'neural_status',
216
- description: 'Get neural learning system status',
217
- inputSchema: {
218
- type: 'object',
219
- properties: {
220
- includePatterns: {
221
- type: 'boolean',
222
- description: 'Include learned patterns summary',
223
- default: false,
224
- },
225
- },
226
- },
227
- },
228
- neuralTrain: {
229
- name: 'neural_train',
230
- description: 'Trigger neural training with current data',
231
- inputSchema: {
232
- type: 'object',
233
- properties: {
234
- algorithm: {
235
- type: 'string',
236
- description: 'Training algorithm',
237
- enum: ['ppo', 'dqn', 'a2c', 'sarsa', 'q-learning'],
238
- },
239
- epochs: {
240
- type: 'number',
241
- description: 'Number of training epochs',
242
- default: 10,
243
- },
244
- },
245
- },
246
- },
247
- // GitHub integration tools
248
- githubSwarm: {
249
- name: 'github_swarm',
250
- description: 'Initialize GitHub integration for a repository',
251
- inputSchema: {
252
- type: 'object',
253
- properties: {
254
- repo: {
255
- type: 'string',
256
- description: 'Repository in owner/repo format',
257
- },
258
- features: {
259
- type: 'array',
260
- description: 'Features to enable',
261
- items: { type: 'string' },
262
- default: ['issues', 'prs', 'reviews'],
263
- },
264
- },
265
- required: ['repo'],
266
- },
267
- },
268
- codeReview: {
269
- name: 'code_review',
270
- description: 'Request code review from swarm agents',
271
- inputSchema: {
272
- type: 'object',
273
- properties: {
274
- prNumber: {
275
- type: 'number',
276
- description: 'Pull request number',
277
- },
278
- repo: {
279
- type: 'string',
280
- description: 'Repository in owner/repo format',
281
- },
282
- focus: {
283
- type: 'array',
284
- description: 'Review focus areas',
285
- items: { type: 'string' },
286
- default: ['security', 'performance', 'style'],
287
- },
288
- },
289
- required: ['prNumber', 'repo'],
290
- },
291
- },
292
- };
293
- /**
294
- * Pre-defined MCP resources
295
- */
296
- export const mcpResources = {
297
- swarmConfig: {
298
- uri: 'swarmdo://config/swarm',
299
- name: 'Swarm Configuration',
300
- description: 'Current swarm configuration',
301
- mimeType: 'application/json',
302
- },
303
- agentRegistry: {
304
- uri: 'swarmdo://agents/registry',
305
- name: 'Agent Registry',
306
- description: 'Registry of all available agent types',
307
- mimeType: 'application/json',
308
- },
309
- memoryStats: {
310
- uri: 'swarmdo://memory/stats',
311
- name: 'Memory Statistics',
312
- description: 'Memory system statistics and metrics',
313
- mimeType: 'application/json',
314
- },
315
- learningPatterns: {
316
- uri: 'swarmdo://neural/patterns',
317
- name: 'Learning Patterns',
318
- description: 'Learned patterns from ReasoningBank',
319
- mimeType: 'application/json',
320
- },
321
- };
322
- /**
323
- * Pre-defined MCP prompts
324
- */
325
- export const mcpPrompts = {
326
- codeAnalysis: {
327
- name: 'analyze_code',
328
- description: 'Analyze code for security, performance, and style issues',
329
- arguments: [
330
- { name: 'language', description: 'Programming language', required: true },
331
- { name: 'focus', description: 'Analysis focus area', required: false },
332
- ],
333
- },
334
- taskPlanning: {
335
- name: 'plan_task',
336
- description: 'Generate a task execution plan',
337
- arguments: [
338
- { name: 'objective', description: 'Task objective', required: true },
339
- { name: 'constraints', description: 'Task constraints', required: false },
340
- ],
341
- },
342
- securityReview: {
343
- name: 'security_review',
344
- description: 'Perform security review on code or configuration',
345
- arguments: [
346
- { name: 'target', description: 'Review target (file, directory, config)', required: true },
347
- { name: 'severity', description: 'Minimum severity level', required: false },
348
- ],
349
- },
350
- };
351
- /**
352
- * Pre-defined MCP server configurations
353
- */
354
- export const mcpServerConfigs = {
355
- development: {
356
- name: 'swarmdo-dev',
357
- version: '3.0.0-alpha',
358
- transport: {
359
- type: 'http',
360
- port: 3000,
361
- host: 'localhost',
362
- timeout: 30000,
363
- },
364
- tools: Object.values(mcpTools),
365
- resources: Object.values(mcpResources),
366
- prompts: Object.values(mcpPrompts),
367
- capabilities: {
368
- tools: true,
369
- resources: true,
370
- prompts: true,
371
- logging: true,
372
- experimental: { streaming: true },
373
- },
374
- },
375
- production: {
376
- name: 'swarmdo',
377
- version: '3.0.0',
378
- transport: {
379
- type: 'http',
380
- port: 443,
381
- host: '0.0.0.0',
382
- timeout: 15000,
383
- },
384
- capabilities: {
385
- tools: true,
386
- resources: true,
387
- prompts: true,
388
- logging: false,
389
- },
390
- },
391
- stdio: {
392
- name: 'swarmdo-stdio',
393
- version: '3.0.0-alpha',
394
- transport: {
395
- type: 'stdio',
396
- timeout: 60000,
397
- },
398
- capabilities: {
399
- tools: true,
400
- resources: true,
401
- prompts: true,
402
- logging: true,
403
- },
404
- },
405
- websocket: {
406
- name: 'swarmdo-ws',
407
- version: '3.0.0-alpha',
408
- transport: {
409
- type: 'websocket',
410
- port: 8080,
411
- host: 'localhost',
412
- path: '/mcp',
413
- timeout: 30000,
414
- },
415
- capabilities: {
416
- tools: true,
417
- resources: true,
418
- prompts: true,
419
- logging: true,
420
- experimental: { streaming: true, multiplexing: true },
421
- },
422
- },
423
- };
424
- /**
425
- * Pre-defined MCP tool results
426
- */
427
- export const mcpToolResults = {
428
- success: {
429
- content: [
430
- {
431
- type: 'text',
432
- text: 'Operation completed successfully',
433
- },
434
- ],
435
- },
436
- swarmInitialized: {
437
- content: [
438
- {
439
- type: 'text',
440
- text: JSON.stringify({
441
- swarmId: 'swarm-001',
442
- topology: 'hierarchical-mesh',
443
- status: 'active',
444
- agentCount: 15,
445
- }),
446
- },
447
- ],
448
- },
449
- agentSpawned: {
450
- content: [
451
- {
452
- type: 'text',
453
- text: JSON.stringify({
454
- agentId: 'agent-coder-001',
455
- type: 'coder',
456
- status: 'idle',
457
- capabilities: ['coding', 'implementation', 'debugging'],
458
- }),
459
- },
460
- ],
461
- },
462
- memorySearchResults: {
463
- content: [
464
- {
465
- type: 'text',
466
- text: JSON.stringify({
467
- results: [
468
- { key: 'pattern-001', score: 0.95 },
469
- { key: 'pattern-002', score: 0.88 },
470
- ],
471
- totalCount: 2,
472
- latencyMs: 15,
473
- }),
474
- },
475
- ],
476
- },
477
- error: {
478
- content: [
479
- {
480
- type: 'text',
481
- text: 'Operation failed: Invalid parameters',
482
- },
483
- ],
484
- isError: true,
485
- },
486
- };
487
- /**
488
- * Pre-defined MCP errors
489
- */
490
- export const mcpErrors = {
491
- parseError: {
492
- code: -32700,
493
- message: 'Parse error',
494
- data: { details: 'Invalid JSON received' },
495
- },
496
- invalidRequest: {
497
- code: -32600,
498
- message: 'Invalid request',
499
- data: { details: 'Missing required field' },
500
- },
501
- methodNotFound: {
502
- code: -32601,
503
- message: 'Method not found',
504
- data: { method: 'unknown_method' },
505
- },
506
- invalidParams: {
507
- code: -32602,
508
- message: 'Invalid params',
509
- data: { param: 'topology', expected: 'string' },
510
- },
511
- internalError: {
512
- code: -32603,
513
- message: 'Internal error',
514
- data: { details: 'Unexpected server error' },
515
- },
516
- toolNotFound: {
517
- code: -32001,
518
- message: 'Tool not found',
519
- data: { tool: 'unknown_tool' },
520
- },
521
- resourceNotFound: {
522
- code: -32002,
523
- message: 'Resource not found',
524
- data: { uri: 'unknown://resource' },
525
- },
526
- };
527
- /**
528
- * Pre-defined session contexts
529
- */
530
- export const mcpSessionContexts = {
531
- active: {
532
- sessionId: 'session-001',
533
- clientInfo: {
534
- name: 'claude-code',
535
- version: '1.0.0',
536
- },
537
- capabilities: {
538
- tools: true,
539
- resources: true,
540
- prompts: true,
541
- },
542
- startedAt: new Date('2024-01-15T10:00:00Z'),
543
- lastActivity: new Date(),
544
- requestCount: 42,
545
- },
546
- new: {
547
- sessionId: 'session-002',
548
- clientInfo: {
549
- name: 'test-client',
550
- version: '0.1.0',
551
- },
552
- capabilities: {
553
- tools: true,
554
- },
555
- startedAt: new Date(),
556
- lastActivity: new Date(),
557
- requestCount: 0,
558
- },
559
- expired: {
560
- sessionId: 'session-003',
561
- clientInfo: {
562
- name: 'old-client',
563
- version: '0.0.1',
564
- },
565
- capabilities: {},
566
- startedAt: new Date('2024-01-01T00:00:00Z'),
567
- lastActivity: new Date('2024-01-01T01:00:00Z'),
568
- requestCount: 5,
569
- },
570
- };
571
- /**
572
- * Factory function to create MCP tool
573
- */
574
- export function createMCPTool(base, overrides) {
575
- return {
576
- ...mcpTools[base],
577
- ...overrides,
578
- };
579
- }
580
- /**
581
- * Factory function to create MCP server config
582
- */
583
- export function createMCPServerConfig(base = 'development', overrides) {
584
- return {
585
- ...mcpServerConfigs[base],
586
- ...overrides,
587
- };
588
- }
589
- /**
590
- * Factory function to create MCP request
591
- */
592
- export function createMCPRequest(method, params, overrides) {
593
- return {
594
- jsonrpc: '2.0',
595
- id: `req-${Date.now()}`,
596
- method,
597
- params,
598
- ...overrides,
599
- };
600
- }
601
- /**
602
- * Factory function to create MCP response
603
- */
604
- export function createMCPResponse(id, result, error) {
605
- return {
606
- jsonrpc: '2.0',
607
- id,
608
- result,
609
- error,
610
- };
611
- }
612
- /**
613
- * Factory function to create MCP tool result
614
- */
615
- export function createMCPToolResult(text, isError = false) {
616
- return {
617
- content: [{ type: 'text', text }],
618
- isError,
619
- };
620
- }
621
- /**
622
- * Factory function to create session context
623
- */
624
- export function createMCPSessionContext(base = 'active', overrides) {
625
- return {
626
- ...mcpSessionContexts[base],
627
- ...overrides,
628
- sessionId: overrides?.sessionId ?? `session-${Date.now()}`,
629
- startedAt: overrides?.startedAt ?? new Date(),
630
- lastActivity: overrides?.lastActivity ?? new Date(),
631
- };
632
- }
633
- /**
634
- * Invalid MCP configurations for error testing
635
- */
636
- export const invalidMCPConfigs = {
637
- emptyName: {
638
- ...mcpServerConfigs.development,
639
- name: '',
640
- },
641
- invalidPort: {
642
- ...mcpServerConfigs.development,
643
- transport: {
644
- type: 'http',
645
- port: -1,
646
- host: 'localhost',
647
- },
648
- },
649
- missingTransport: {
650
- name: 'invalid-server',
651
- version: '1.0.0',
652
- transport: undefined,
653
- },
654
- };
655
- /**
656
- * Create a mock MCP client
657
- */
658
- export function createMockMCPClient() {
659
- return {
660
- connect: vi.fn().mockResolvedValue(undefined),
661
- disconnect: vi.fn().mockResolvedValue(undefined),
662
- callTool: vi.fn().mockResolvedValue(mcpToolResults.success),
663
- listTools: vi.fn().mockResolvedValue(Object.values(mcpTools)),
664
- readResource: vi.fn().mockResolvedValue({
665
- type: 'resource',
666
- resource: { uri: 'test://resource', text: '{}' },
667
- }),
668
- listResources: vi.fn().mockResolvedValue(Object.values(mcpResources)),
669
- getPrompt: vi.fn().mockResolvedValue('Generated prompt text'),
670
- listPrompts: vi.fn().mockResolvedValue(Object.values(mcpPrompts)),
671
- isConnected: vi.fn().mockReturnValue(true),
672
- getSessionContext: vi.fn().mockReturnValue(mcpSessionContexts.active),
673
- };
674
- }
675
- /**
676
- * Create a mock MCP server
677
- */
678
- export function createMockMCPServer() {
679
- return {
680
- start: vi.fn().mockResolvedValue(undefined),
681
- stop: vi.fn().mockResolvedValue(undefined),
682
- registerTool: vi.fn(),
683
- registerResource: vi.fn(),
684
- registerPrompt: vi.fn(),
685
- handleRequest: vi.fn().mockResolvedValue({
686
- jsonrpc: '2.0',
687
- id: 1,
688
- result: { success: true },
689
- }),
690
- getStatus: vi.fn().mockReturnValue({
691
- running: true,
692
- transport: 'http',
693
- connectedClients: 1,
694
- toolsRegistered: Object.keys(mcpTools).length,
695
- resourcesRegistered: Object.keys(mcpResources).length,
696
- promptsRegistered: Object.keys(mcpPrompts).length,
697
- requestsHandled: 100,
698
- errorsCount: 0,
699
- uptime: 3600000,
700
- }),
701
- };
702
- }
703
- /**
704
- * Create a mock MCP transport
705
- */
706
- export function createMockMCPTransport() {
707
- return {
708
- send: vi.fn().mockResolvedValue(undefined),
709
- receive: vi.fn().mockResolvedValue('{}'),
710
- close: vi.fn().mockResolvedValue(undefined),
711
- isOpen: vi.fn().mockReturnValue(true),
712
- };
713
- }
714
- //# sourceMappingURL=mcp-fixtures.js.map