swarmdo 1.45.0 → 1.54.1

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 (207) hide show
  1. package/.claude/helpers/hook-handler.cjs +16 -0
  2. package/.claude/helpers/router.cjs +27 -1
  3. package/.claude/settings.local.json +7 -0
  4. package/README.md +6 -2
  5. package/package.json +1 -1
  6. package/v3/@swarmdo/cli/dist/src/agent-bridge/bridge.d.ts +104 -0
  7. package/v3/@swarmdo/cli/dist/src/agent-bridge/bridge.js +133 -0
  8. package/v3/@swarmdo/cli/dist/src/commands/agent.js +133 -1
  9. package/v3/@swarmdo/cli/dist/src/commands/config.js +32 -1
  10. package/v3/@swarmdo/cli/dist/src/commands/hidden-coupling.d.ts +19 -0
  11. package/v3/@swarmdo/cli/dist/src/commands/hidden-coupling.js +92 -0
  12. package/v3/@swarmdo/cli/dist/src/commands/index.js +14 -4
  13. package/v3/@swarmdo/cli/dist/src/commands/ownership.d.ts +18 -0
  14. package/v3/@swarmdo/cli/dist/src/commands/ownership.js +88 -0
  15. package/v3/@swarmdo/cli/dist/src/commands/pack.js +4 -4
  16. package/v3/@swarmdo/cli/dist/src/commands/standup.d.ts +18 -0
  17. package/v3/@swarmdo/cli/dist/src/commands/standup.js +116 -0
  18. package/v3/@swarmdo/cli/dist/src/commands/swarm.js +29 -0
  19. package/v3/@swarmdo/cli/dist/src/config-lint/commands-lint.d.ts +31 -0
  20. package/v3/@swarmdo/cli/dist/src/config-lint/commands-lint.js +127 -0
  21. package/v3/@swarmdo/cli/dist/src/config-lint/lint.d.ts +5 -0
  22. package/v3/@swarmdo/cli/dist/src/config-lint/lint.js +4 -0
  23. package/v3/@swarmdo/cli/dist/src/coupling/hidden.d.ts +45 -0
  24. package/v3/@swarmdo/cli/dist/src/coupling/hidden.js +66 -0
  25. package/v3/@swarmdo/cli/dist/src/init/helpers-generator.js +41 -1
  26. package/v3/@swarmdo/cli/dist/src/mcp-client.js +2 -0
  27. package/v3/@swarmdo/cli/dist/src/mcp-tools/agent-tools.js +166 -0
  28. package/v3/@swarmdo/cli/dist/src/mcp-tools/index.d.ts +1 -0
  29. package/v3/@swarmdo/cli/dist/src/mcp-tools/index.js +1 -0
  30. package/v3/@swarmdo/cli/dist/src/mcp-tools/ownership-tools.d.ts +14 -0
  31. package/v3/@swarmdo/cli/dist/src/mcp-tools/ownership-tools.js +51 -0
  32. package/v3/@swarmdo/cli/dist/src/mcp-tools/profiles.js +1 -0
  33. package/v3/@swarmdo/cli/dist/src/mcp-tools/swarm-tools.d.ts +33 -0
  34. package/v3/@swarmdo/cli/dist/src/mcp-tools/swarm-tools.js +73 -38
  35. package/v3/@swarmdo/cli/dist/src/ownership/ownership.d.ts +61 -0
  36. package/v3/@swarmdo/cli/dist/src/ownership/ownership.js +151 -0
  37. package/v3/@swarmdo/cli/dist/src/pack/pack.d.ts +1 -1
  38. package/v3/@swarmdo/cli/dist/src/pack/pack.js +12 -4
  39. package/v3/@swarmdo/cli/dist/src/redact/redact.js +28 -9
  40. package/v3/@swarmdo/cli/dist/src/standup/standup.d.ts +83 -0
  41. package/v3/@swarmdo/cli/dist/src/standup/standup.js +157 -0
  42. package/v3/@swarmdo/cli/package.json +1 -1
  43. package/v3/@swarmdo/cli-core/dist/src/index.js +1 -1
  44. package/v3/@swarmdo/codex/dist/cli.js +0 -0
  45. package/v3/@swarmdo/hooks/dist/cli/guidance-cli.js +0 -0
  46. package/v3/@swarmdo/hooks/dist/statusline/index.d.ts +3 -3
  47. package/v3/@swarmdo/hooks/dist/statusline/index.js +3 -3
  48. package/v3/@swarmdo/integration/dist/__tests__/agentic-flow-agent.test.js +1 -4
  49. package/v3/@swarmdo/neural/dist/flash-attention.d.ts +1 -1
  50. package/v3/@swarmdo/neural/dist/flash-attention.js +1 -1
  51. package/v3/@swarmdo/plugin-agent-federation/dist/plugin.js +1 -1
  52. package/v3/@swarmdo/plugin-agent-federation/dist/transport/midstream-aware-loader.js +2 -2
  53. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.d.ts +2 -0
  54. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.js +2 -0
  55. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.d.ts +138 -0
  56. package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.js +418 -0
  57. package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.d.ts +15 -0
  58. package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.js +240 -0
  59. package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.d.ts +7 -0
  60. package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.js +508 -0
  61. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.d.ts +54 -0
  62. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.js +2 -0
  63. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.d.ts +46 -0
  64. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.js +2 -0
  65. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.d.ts +18 -0
  66. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.js +28 -0
  67. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.d.ts +5 -0
  68. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.js +2 -0
  69. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.d.ts +35 -0
  70. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.js +2 -0
  71. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.d.ts +11 -0
  72. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.js +2 -0
  73. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.d.ts +9 -0
  74. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.js +2 -0
  75. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.d.ts +5 -0
  76. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.js +2 -0
  77. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.d.ts +12 -0
  78. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.js +2 -0
  79. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.d.ts +19 -0
  80. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.js +2 -0
  81. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.d.ts +44 -0
  82. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.js +117 -0
  83. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.d.ts +70 -0
  84. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.js +194 -0
  85. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.d.ts +69 -0
  86. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.js +139 -0
  87. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.d.ts +34 -0
  88. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.js +101 -0
  89. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.d.ts +10 -0
  90. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.js +10 -0
  91. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.d.ts +64 -0
  92. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.js +70 -0
  93. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.d.ts +44 -0
  94. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.js +79 -0
  95. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.d.ts +37 -0
  96. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.js +39 -0
  97. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.d.ts +67 -0
  98. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.js +58 -0
  99. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.d.ts +45 -0
  100. package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.js +63 -0
  101. package/v3/@swarmdo/plugin-iot-cognitum/dist/index.d.ts +26 -0
  102. package/v3/@swarmdo/plugin-iot-cognitum/dist/index.js +17 -0
  103. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.d.ts +51 -0
  104. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.js +110 -0
  105. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.d.ts +13 -0
  106. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.js +25 -0
  107. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.d.ts +11 -0
  108. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.js +19 -0
  109. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.d.ts +11 -0
  110. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.js +27 -0
  111. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.d.ts +6 -0
  112. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.js +6 -0
  113. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.d.ts +41 -0
  114. package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.js +64 -0
  115. package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.d.ts +8 -0
  116. package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.js +703 -0
  117. package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.d.ts +23 -0
  118. package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.js +239 -0
  119. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.d.ts +17 -0
  120. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.js +42 -0
  121. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.d.ts +18 -0
  122. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.js +45 -0
  123. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.d.ts +19 -0
  124. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.js +50 -0
  125. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.d.ts +19 -0
  126. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.js +47 -0
  127. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.d.ts +17 -0
  128. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.js +40 -0
  129. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.d.ts +18 -0
  130. package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.js +51 -0
  131. package/v3/@swarmdo/providers/dist/swarmvector-provider.d.ts +1 -1
  132. package/v3/@swarmdo/providers/dist/swarmvector-provider.js +1 -1
  133. package/v3/@swarmdo/security/dist/input-validator.d.ts +6 -6
  134. package/v3/@swarmdo/shared/dist/hooks/safety/git-commit.js +1 -1
  135. package/v3/@swarmdo/shared/dist/mcp/transport/http.js +1 -8
  136. package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.d.ts +214 -0
  137. package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.js +595 -0
  138. package/v3/@swarmdo/testing/dist/fixtures/agents.d.ts +76 -0
  139. package/v3/@swarmdo/testing/dist/fixtures/agents.js +158 -0
  140. package/v3/@swarmdo/testing/dist/fixtures/configurations.d.ts +157 -0
  141. package/v3/@swarmdo/testing/dist/fixtures/configurations.js +337 -0
  142. package/v3/@swarmdo/testing/dist/fixtures/index.d.ts +10 -0
  143. package/v3/@swarmdo/testing/dist/fixtures/index.js +17 -0
  144. package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.d.ts +329 -0
  145. package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.js +714 -0
  146. package/v3/@swarmdo/testing/dist/fixtures/memory-entries.d.ts +159 -0
  147. package/v3/@swarmdo/testing/dist/fixtures/memory-entries.js +262 -0
  148. package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.d.ts +290 -0
  149. package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.js +547 -0
  150. package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.d.ts +289 -0
  151. package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.js +534 -0
  152. package/v3/@swarmdo/testing/dist/fixtures/tasks.d.ts +106 -0
  153. package/v3/@swarmdo/testing/dist/fixtures/tasks.js +229 -0
  154. package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.d.ts +213 -0
  155. package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.js +435 -0
  156. package/v3/@swarmdo/testing/dist/helpers/assertions.d.ts +135 -0
  157. package/v3/@swarmdo/testing/dist/helpers/assertions.js +217 -0
  158. package/v3/@swarmdo/testing/dist/helpers/create-mock.d.ts +96 -0
  159. package/v3/@swarmdo/testing/dist/helpers/create-mock.js +164 -0
  160. package/v3/@swarmdo/testing/dist/helpers/index.d.ts +14 -0
  161. package/v3/@swarmdo/testing/dist/helpers/index.js +22 -0
  162. package/v3/@swarmdo/testing/dist/helpers/mock-factory.d.ts +323 -0
  163. package/v3/@swarmdo/testing/dist/helpers/mock-factory.js +350 -0
  164. package/v3/@swarmdo/testing/dist/helpers/setup-teardown.d.ts +271 -0
  165. package/v3/@swarmdo/testing/dist/helpers/setup-teardown.js +446 -0
  166. package/v3/@swarmdo/testing/dist/helpers/swarm-instance.d.ts +142 -0
  167. package/v3/@swarmdo/testing/dist/helpers/swarm-instance.js +205 -0
  168. package/v3/@swarmdo/testing/dist/helpers/test-application.d.ts +190 -0
  169. package/v3/@swarmdo/testing/dist/helpers/test-application.js +138 -0
  170. package/v3/@swarmdo/testing/dist/helpers/test-utils.d.ts +274 -0
  171. package/v3/@swarmdo/testing/dist/helpers/test-utils.js +456 -0
  172. package/v3/@swarmdo/testing/dist/index.d.ts +42 -0
  173. package/v3/@swarmdo/testing/dist/index.js +66 -0
  174. package/v3/@swarmdo/testing/dist/mocks/index.d.ts +8 -0
  175. package/v3/@swarmdo/testing/dist/mocks/index.js +10 -0
  176. package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.d.ts +206 -0
  177. package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.js +575 -0
  178. package/v3/@swarmdo/testing/dist/mocks/mock-services.d.ts +287 -0
  179. package/v3/@swarmdo/testing/dist/mocks/mock-services.js +563 -0
  180. package/v3/@swarmdo/testing/dist/regression/api-contract.d.ts +109 -0
  181. package/v3/@swarmdo/testing/dist/regression/api-contract.js +374 -0
  182. package/v3/@swarmdo/testing/dist/regression/index.d.ts +18 -0
  183. package/v3/@swarmdo/testing/dist/regression/index.js +18 -0
  184. package/v3/@swarmdo/testing/dist/regression/integration-regression.d.ts +67 -0
  185. package/v3/@swarmdo/testing/dist/regression/integration-regression.js +334 -0
  186. package/v3/@swarmdo/testing/dist/regression/performance-baseline.d.ts +106 -0
  187. package/v3/@swarmdo/testing/dist/regression/performance-baseline.js +268 -0
  188. package/v3/@swarmdo/testing/dist/regression/regression-runner.d.ts +124 -0
  189. package/v3/@swarmdo/testing/dist/regression/regression-runner.js +227 -0
  190. package/v3/@swarmdo/testing/dist/regression/security-regression.d.ts +73 -0
  191. package/v3/@swarmdo/testing/dist/regression/security-regression.js +258 -0
  192. package/v3/@swarmdo/testing/dist/setup.d.ts +43 -0
  193. package/v3/@swarmdo/testing/dist/setup.js +91 -0
  194. package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.d.ts +10 -0
  195. package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.js +433 -0
  196. package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.d.ts +10 -0
  197. package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.js +352 -0
  198. package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.d.ts +206 -0
  199. package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.js +839 -0
  200. package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.d.ts +10 -0
  201. package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.js +428 -0
  202. package/v3/@swarmdo/testing/dist/v2-compat/index.d.ts +38 -0
  203. package/v3/@swarmdo/testing/dist/v2-compat/index.js +41 -0
  204. package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.d.ts +10 -0
  205. package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.js +419 -0
  206. package/v3/@swarmdo/testing/dist/v2-compat/report-generator.d.ts +34 -0
  207. package/v3/@swarmdo/testing/dist/v2-compat/report-generator.js +372 -0
@@ -0,0 +1,374 @@
1
+ /**
2
+ * API Contract Validator
3
+ *
4
+ * Validates MCP tool interfaces to detect breaking changes.
5
+ *
6
+ * @module v3/testing/regression/api-contract
7
+ */
8
+ import { readFile, writeFile, mkdir } from 'fs/promises';
9
+ import { join, dirname } from 'path';
10
+ /**
11
+ * MCP tool definitions to validate
12
+ */
13
+ const MCP_TOOLS = [
14
+ {
15
+ name: 'agent/spawn',
16
+ version: '1.0.0',
17
+ description: 'Spawn a new agent',
18
+ input: {
19
+ type: 'object',
20
+ properties: {
21
+ agentType: { type: 'string', description: 'Type of agent to spawn' },
22
+ id: { type: 'string', description: 'Optional agent ID' },
23
+ config: { type: 'object', description: 'Agent configuration' },
24
+ priority: { type: 'string', enum: ['low', 'normal', 'high', 'critical'] },
25
+ metadata: { type: 'object', description: 'Additional metadata' },
26
+ },
27
+ required: ['agentType'],
28
+ },
29
+ output: {
30
+ type: 'object',
31
+ properties: {
32
+ agentId: { type: 'string' },
33
+ status: { type: 'string' },
34
+ createdAt: { type: 'string' },
35
+ },
36
+ },
37
+ required: ['agentType'],
38
+ optional: ['id', 'config', 'priority', 'metadata'],
39
+ errors: [
40
+ { code: -32602, message: 'Invalid agent type', description: 'The specified agent type is not valid' },
41
+ { code: -32000, message: 'Agent spawn failed', description: 'Failed to spawn agent' },
42
+ ],
43
+ },
44
+ {
45
+ name: 'agent/list',
46
+ version: '1.0.0',
47
+ description: 'List all agents',
48
+ input: {
49
+ type: 'object',
50
+ properties: {
51
+ status: { type: 'string', enum: ['active', 'idle', 'terminated', 'all'] },
52
+ agentType: { type: 'string' },
53
+ },
54
+ },
55
+ output: {
56
+ type: 'object',
57
+ properties: {
58
+ agents: { type: 'array', items: { type: 'object' } },
59
+ totalCount: { type: 'number' },
60
+ },
61
+ },
62
+ required: [],
63
+ optional: ['status', 'agentType'],
64
+ errors: [],
65
+ },
66
+ {
67
+ name: 'memory/store',
68
+ version: '1.0.0',
69
+ description: 'Store a memory entry',
70
+ input: {
71
+ type: 'object',
72
+ properties: {
73
+ content: { type: 'string', description: 'Memory content' },
74
+ category: { type: 'string', description: 'Memory category' },
75
+ metadata: { type: 'object', description: 'Additional metadata' },
76
+ tags: { type: 'array', items: { type: 'string' } },
77
+ ttl: { type: 'number', description: 'Time-to-live in seconds' },
78
+ },
79
+ required: ['content'],
80
+ },
81
+ output: {
82
+ type: 'object',
83
+ properties: {
84
+ id: { type: 'string' },
85
+ storedAt: { type: 'string' },
86
+ expiresAt: { type: 'string' },
87
+ },
88
+ },
89
+ required: ['content'],
90
+ optional: ['category', 'metadata', 'tags', 'ttl'],
91
+ errors: [
92
+ { code: -32000, message: 'Storage failed', description: 'Failed to store memory' },
93
+ ],
94
+ },
95
+ {
96
+ name: 'memory/search',
97
+ version: '1.0.0',
98
+ description: 'Search memory entries',
99
+ input: {
100
+ type: 'object',
101
+ properties: {
102
+ query: { type: 'string', description: 'Search query' },
103
+ category: { type: 'string' },
104
+ limit: { type: 'number', default: 10 },
105
+ threshold: { type: 'number', default: 0.7 },
106
+ semantic: { type: 'boolean', default: true },
107
+ },
108
+ required: ['query'],
109
+ },
110
+ output: {
111
+ type: 'object',
112
+ properties: {
113
+ results: { type: 'array', items: { type: 'object' } },
114
+ totalMatches: { type: 'number' },
115
+ searchTime: { type: 'number' },
116
+ },
117
+ },
118
+ required: ['query'],
119
+ optional: ['category', 'limit', 'threshold', 'semantic'],
120
+ errors: [],
121
+ },
122
+ {
123
+ name: 'swarm/init',
124
+ version: '1.0.0',
125
+ description: 'Initialize a swarm',
126
+ input: {
127
+ type: 'object',
128
+ properties: {
129
+ topology: { type: 'string', enum: ['hierarchical', 'mesh', 'star', 'ring', 'adaptive'] },
130
+ maxAgents: { type: 'number' },
131
+ config: { type: 'object' },
132
+ },
133
+ required: ['topology'],
134
+ },
135
+ output: {
136
+ type: 'object',
137
+ properties: {
138
+ swarmId: { type: 'string' },
139
+ status: { type: 'string' },
140
+ topology: { type: 'string' },
141
+ },
142
+ },
143
+ required: ['topology'],
144
+ optional: ['maxAgents', 'config'],
145
+ errors: [
146
+ { code: -32602, message: 'Invalid topology', description: 'The specified topology is not valid' },
147
+ ],
148
+ },
149
+ {
150
+ name: 'task/orchestrate',
151
+ version: '1.0.0',
152
+ description: 'Orchestrate a complex task',
153
+ input: {
154
+ type: 'object',
155
+ properties: {
156
+ description: { type: 'string' },
157
+ strategy: { type: 'string', enum: ['sequential', 'parallel', 'adaptive'] },
158
+ maxAgents: { type: 'number' },
159
+ timeout: { type: 'number' },
160
+ },
161
+ required: ['description'],
162
+ },
163
+ output: {
164
+ type: 'object',
165
+ properties: {
166
+ taskId: { type: 'string' },
167
+ phases: { type: 'array' },
168
+ estimatedDuration: { type: 'number' },
169
+ },
170
+ },
171
+ required: ['description'],
172
+ optional: ['strategy', 'maxAgents', 'timeout'],
173
+ errors: [],
174
+ },
175
+ ];
176
+ /**
177
+ * API Contract Validator
178
+ *
179
+ * Validates MCP tool contracts for breaking changes.
180
+ */
181
+ export class APIContractValidator {
182
+ contractPath;
183
+ cachedContracts = null;
184
+ constructor(basePath = '.regression-baselines') {
185
+ this.contractPath = join(basePath, 'contracts.json');
186
+ }
187
+ /**
188
+ * Capture current contracts as baseline
189
+ */
190
+ async captureContracts() {
191
+ const contracts = {
192
+ version: '1.0.0',
193
+ capturedAt: Date.now(),
194
+ contracts: MCP_TOOLS,
195
+ };
196
+ await this.saveContracts(contracts);
197
+ this.cachedContracts = contracts;
198
+ return contracts;
199
+ }
200
+ /**
201
+ * Validate all contracts against baseline
202
+ */
203
+ async validateAll() {
204
+ const baseline = await this.loadContracts();
205
+ if (!baseline) {
206
+ console.warn('No contract baseline found. Capturing initial contracts...');
207
+ await this.captureContracts();
208
+ return [];
209
+ }
210
+ const validations = [];
211
+ for (const current of MCP_TOOLS) {
212
+ const baselineContract = baseline.contracts.find((c) => c.name === current.name);
213
+ if (!baselineContract) {
214
+ // New endpoint added
215
+ validations.push({
216
+ endpoint: current.name,
217
+ valid: true,
218
+ breaking: false,
219
+ message: 'New endpoint added',
220
+ diffs: [{
221
+ type: 'added',
222
+ path: current.name,
223
+ description: `New endpoint: ${current.description}`,
224
+ breaking: false,
225
+ }],
226
+ });
227
+ continue;
228
+ }
229
+ const diffs = this.compareContracts(baselineContract, current);
230
+ const hasBreakingChanges = diffs.some((d) => d.breaking);
231
+ validations.push({
232
+ endpoint: current.name,
233
+ valid: !hasBreakingChanges,
234
+ breaking: hasBreakingChanges,
235
+ message: hasBreakingChanges
236
+ ? `Breaking changes detected: ${diffs.filter((d) => d.breaking).map((d) => d.description).join(', ')}`
237
+ : diffs.length > 0
238
+ ? `Non-breaking changes: ${diffs.map((d) => d.description).join(', ')}`
239
+ : 'No changes',
240
+ diffs,
241
+ });
242
+ }
243
+ // Check for removed endpoints
244
+ for (const baselineContract of baseline.contracts) {
245
+ const stillExists = MCP_TOOLS.find((c) => c.name === baselineContract.name);
246
+ if (!stillExists) {
247
+ validations.push({
248
+ endpoint: baselineContract.name,
249
+ valid: false,
250
+ breaking: true,
251
+ message: 'Endpoint removed',
252
+ diffs: [{
253
+ type: 'removed',
254
+ path: baselineContract.name,
255
+ description: `Endpoint removed: ${baselineContract.name}`,
256
+ breaking: true,
257
+ }],
258
+ });
259
+ }
260
+ }
261
+ return validations;
262
+ }
263
+ /**
264
+ * Compare two contracts for differences
265
+ */
266
+ compareContracts(baseline, current) {
267
+ const diffs = [];
268
+ // Check required parameters
269
+ for (const param of baseline.required) {
270
+ if (!current.required.includes(param)) {
271
+ if (current.optional.includes(param)) {
272
+ // Parameter became optional - not breaking
273
+ diffs.push({
274
+ type: 'changed',
275
+ path: `${baseline.name}.input.${param}`,
276
+ description: `Parameter '${param}' changed from required to optional`,
277
+ breaking: false,
278
+ oldValue: 'required',
279
+ newValue: 'optional',
280
+ });
281
+ }
282
+ else {
283
+ // Parameter removed - breaking
284
+ diffs.push({
285
+ type: 'removed',
286
+ path: `${baseline.name}.input.${param}`,
287
+ description: `Required parameter '${param}' removed`,
288
+ breaking: true,
289
+ });
290
+ }
291
+ }
292
+ }
293
+ // Check for new required parameters (breaking)
294
+ for (const param of current.required) {
295
+ if (!baseline.required.includes(param) && !baseline.optional.includes(param)) {
296
+ diffs.push({
297
+ type: 'added',
298
+ path: `${baseline.name}.input.${param}`,
299
+ description: `New required parameter '${param}' added`,
300
+ breaking: true,
301
+ });
302
+ }
303
+ }
304
+ // Check for new optional parameters (not breaking)
305
+ for (const param of current.optional) {
306
+ if (!baseline.required.includes(param) && !baseline.optional.includes(param)) {
307
+ diffs.push({
308
+ type: 'added',
309
+ path: `${baseline.name}.input.${param}`,
310
+ description: `New optional parameter '${param}' added`,
311
+ breaking: false,
312
+ });
313
+ }
314
+ }
315
+ // Check input schema changes
316
+ if (baseline.input.properties && current.input.properties) {
317
+ for (const [name, prop] of Object.entries(baseline.input.properties)) {
318
+ const currentProp = current.input.properties[name];
319
+ if (currentProp) {
320
+ // Check type changes
321
+ if (prop.type !== currentProp.type) {
322
+ diffs.push({
323
+ type: 'changed',
324
+ path: `${baseline.name}.input.${name}.type`,
325
+ description: `Type of '${name}' changed from '${prop.type}' to '${currentProp.type}'`,
326
+ breaking: true,
327
+ oldValue: prop.type,
328
+ newValue: currentProp.type,
329
+ });
330
+ }
331
+ // Check enum changes
332
+ if (prop.enum && currentProp.enum) {
333
+ const removedValues = prop.enum.filter((v) => !currentProp.enum.includes(v));
334
+ if (removedValues.length > 0) {
335
+ diffs.push({
336
+ type: 'changed',
337
+ path: `${baseline.name}.input.${name}.enum`,
338
+ description: `Enum values removed from '${name}': ${removedValues.join(', ')}`,
339
+ breaking: true,
340
+ oldValue: prop.enum,
341
+ newValue: currentProp.enum,
342
+ });
343
+ }
344
+ }
345
+ }
346
+ }
347
+ }
348
+ return diffs;
349
+ }
350
+ /**
351
+ * Load contracts from file
352
+ */
353
+ async loadContracts() {
354
+ if (this.cachedContracts) {
355
+ return this.cachedContracts;
356
+ }
357
+ try {
358
+ const content = await readFile(this.contractPath, 'utf-8');
359
+ this.cachedContracts = JSON.parse(content);
360
+ return this.cachedContracts;
361
+ }
362
+ catch {
363
+ return null;
364
+ }
365
+ }
366
+ /**
367
+ * Save contracts to file
368
+ */
369
+ async saveContracts(contracts) {
370
+ await mkdir(dirname(this.contractPath), { recursive: true });
371
+ await writeFile(this.contractPath, JSON.stringify(contracts, null, 2));
372
+ }
373
+ }
374
+ //# sourceMappingURL=api-contract.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Regression Testing System
3
+ *
4
+ * Comprehensive regression detection to prevent capability degradation
5
+ * as new features are added. Includes:
6
+ * - Performance baselines
7
+ * - Security vulnerability checks
8
+ * - API contract validation
9
+ * - Integration verification
10
+ *
11
+ * @module v3/testing/regression
12
+ */
13
+ export { RegressionTestRunner, type RegressionConfig, type RegressionResult, type RegressionReport, } from './regression-runner.js';
14
+ export { PerformanceBaseline, type BaselineMetric, type BaselineComparison, type BaselineConfig, } from './performance-baseline.js';
15
+ export { SecurityRegressionChecker, type SecurityCheck, type SecurityVulnerability, type SecurityReport, } from './security-regression.js';
16
+ export { APIContractValidator, type ContractDefinition, type ContractValidation, type ContractDiff, } from './api-contract.js';
17
+ export { IntegrationRegressionSuite, type IntegrationTest, type IntegrationResult, } from './integration-regression.js';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Regression Testing System
3
+ *
4
+ * Comprehensive regression detection to prevent capability degradation
5
+ * as new features are added. Includes:
6
+ * - Performance baselines
7
+ * - Security vulnerability checks
8
+ * - API contract validation
9
+ * - Integration verification
10
+ *
11
+ * @module v3/testing/regression
12
+ */
13
+ export { RegressionTestRunner, } from './regression-runner.js';
14
+ export { PerformanceBaseline, } from './performance-baseline.js';
15
+ export { SecurityRegressionChecker, } from './security-regression.js';
16
+ export { APIContractValidator, } from './api-contract.js';
17
+ export { IntegrationRegressionSuite, } from './integration-regression.js';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Integration Regression Suite
3
+ *
4
+ * Validates critical integration paths work correctly.
5
+ *
6
+ * @module v3/testing/regression/integration-regression
7
+ */
8
+ /**
9
+ * Integration test definition
10
+ */
11
+ export interface IntegrationTest {
12
+ name: string;
13
+ description: string;
14
+ category: 'memory' | 'swarm' | 'mcp' | 'hooks' | 'events';
15
+ critical: boolean;
16
+ timeout: number;
17
+ run: () => Promise<boolean>;
18
+ }
19
+ /**
20
+ * Integration test result
21
+ */
22
+ export interface IntegrationResult {
23
+ name: string;
24
+ category: string;
25
+ passed: boolean;
26
+ duration: number;
27
+ error?: string;
28
+ details?: Record<string, unknown>;
29
+ }
30
+ /**
31
+ * Integration Regression Suite
32
+ *
33
+ * Runs critical integration tests to catch regressions.
34
+ */
35
+ export declare class IntegrationRegressionSuite {
36
+ private readonly tests;
37
+ constructor();
38
+ /**
39
+ * Run all integration tests
40
+ */
41
+ runAll(): Promise<IntegrationResult[]>;
42
+ /**
43
+ * Run tests by category
44
+ */
45
+ runCategory(category: IntegrationTest['category']): Promise<IntegrationResult[]>;
46
+ /**
47
+ * Run critical tests only
48
+ */
49
+ runCritical(): Promise<IntegrationResult[]>;
50
+ /**
51
+ * Run a single test
52
+ */
53
+ private runTest;
54
+ /**
55
+ * Register default integration tests
56
+ */
57
+ private registerDefaultTests;
58
+ /**
59
+ * Add a custom test
60
+ */
61
+ addTest(test: IntegrationTest): void;
62
+ /**
63
+ * Get all registered tests
64
+ */
65
+ getTests(): IntegrationTest[];
66
+ }
67
+ //# sourceMappingURL=integration-regression.d.ts.map