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,372 +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 { V2CompatibilityValidator, V2_CLI_COMMANDS, V2_MCP_TOOLS, V2_HOOKS, V2_API_INTERFACES, } from './compatibility-validator.js';
10
- /**
11
- * Default report options
12
- */
13
- const DEFAULT_OPTIONS = {
14
- detailed: true,
15
- includeExamples: true,
16
- includeMigrationScripts: true,
17
- format: 'markdown',
18
- };
19
- /**
20
- * Generate a full compatibility report
21
- */
22
- export async function generateFullReport(options = {}) {
23
- const opts = { ...DEFAULT_OPTIONS, ...options };
24
- const validator = new V2CompatibilityValidator({ verbose: false });
25
- const report = await validator.runFullValidation();
26
- const markdown = generateEnhancedMarkdown(report, opts);
27
- return { report, markdown };
28
- }
29
- /**
30
- * Generate enhanced markdown report with additional sections
31
- */
32
- function generateEnhancedMarkdown(report, options) {
33
- const lines = [];
34
- // Header
35
- lines.push('# V2 Compatibility Validation Report');
36
- lines.push('');
37
- lines.push(`> **Generated**: ${report.timestamp.toISOString()}`);
38
- lines.push(`> **V2 Version**: ${report.v2Version}`);
39
- lines.push(`> **V3 Version**: ${report.v3Version}`);
40
- lines.push(`> **Duration**: ${report.duration}ms`);
41
- lines.push('');
42
- // Executive Summary
43
- lines.push('## Executive Summary');
44
- lines.push('');
45
- lines.push(`### Overall Status: ${report.overallPassed ? 'PASSED' : 'FAILED'}`);
46
- lines.push('');
47
- lines.push('| Metric | Value | Status |');
48
- lines.push('|--------|-------|--------|');
49
- lines.push(`| Total Checks | ${report.totalChecks} | - |`);
50
- lines.push(`| Passed | ${report.passedChecks} | ${getStatusEmoji(report.passedChecks, report.totalChecks, 0.9)} |`);
51
- lines.push(`| Failed | ${report.failedChecks} | ${report.failedChecks === 0 ? 'OK' : 'ATTENTION'} |`);
52
- lines.push(`| Breaking Changes | ${report.breakingChanges} | ${report.breakingChanges === 0 ? 'OK' : 'CRITICAL'} |`);
53
- lines.push('');
54
- // Category Overview
55
- lines.push('### Category Overview');
56
- lines.push('');
57
- lines.push('```');
58
- lines.push('+----------------+--------+--------+---------+');
59
- lines.push('| Category | Passed | Failed | Breaking|');
60
- lines.push('+----------------+--------+--------+---------+');
61
- lines.push(`| CLI Commands | ${padNum(report.cli.passedChecks)} | ${padNum(report.cli.failedChecks)} | ${padNum(report.cli.breakingChanges)} |`);
62
- lines.push(`| MCP Tools | ${padNum(report.mcp.passedChecks)} | ${padNum(report.mcp.failedChecks)} | ${padNum(report.mcp.breakingChanges)} |`);
63
- lines.push(`| Hooks | ${padNum(report.hooks.passedChecks)} | ${padNum(report.hooks.failedChecks)} | ${padNum(report.hooks.breakingChanges)} |`);
64
- lines.push(`| API Interfaces | ${padNum(report.api.passedChecks)} | ${padNum(report.api.failedChecks)} | ${padNum(report.api.breakingChanges)} |`);
65
- lines.push('+----------------+--------+--------+---------+');
66
- lines.push('```');
67
- lines.push('');
68
- // Detailed Results
69
- if (options.detailed) {
70
- lines.push(...generateDetailedSection('CLI Commands', report.cli, V2_CLI_COMMANDS.length));
71
- lines.push(...generateDetailedSection('MCP Tools', report.mcp, V2_MCP_TOOLS.length));
72
- lines.push(...generateDetailedSection('Hooks', report.hooks, V2_HOOKS.length));
73
- lines.push(...generateDetailedSection('API Interfaces', report.api, V2_API_INTERFACES.length));
74
- }
75
- // Breaking Changes Section
76
- lines.push('## Breaking Changes');
77
- lines.push('');
78
- const allBreaking = [
79
- ...report.cli.checks.filter(c => c.breaking),
80
- ...report.mcp.checks.filter(c => c.breaking),
81
- ...report.hooks.checks.filter(c => c.breaking),
82
- ...report.api.checks.filter(c => c.breaking),
83
- ];
84
- if (allBreaking.length === 0) {
85
- lines.push('No breaking changes detected. V2 code should work with V3 using the compatibility layer.');
86
- lines.push('');
87
- }
88
- else {
89
- lines.push(`${allBreaking.length} breaking change(s) detected:`);
90
- lines.push('');
91
- lines.push('| Category | Item | Issue | Migration |');
92
- lines.push('|----------|------|-------|-----------|');
93
- for (const check of allBreaking.slice(0, 50)) {
94
- const issue = check.v3Behavior === 'Not available' ? 'Removed' : 'Changed';
95
- lines.push(`| ${check.category.toUpperCase()} | ${check.name} | ${issue} | ${check.migrationPath || 'See docs'} |`);
96
- }
97
- if (allBreaking.length > 50) {
98
- lines.push(`| ... | ${allBreaking.length - 50} more | ... | ... |`);
99
- }
100
- lines.push('');
101
- }
102
- // Migration Guide
103
- lines.push('## Migration Guide');
104
- lines.push('');
105
- lines.push('### Quick Start');
106
- lines.push('');
107
- lines.push('1. **Enable V2 Compatibility Mode**');
108
- lines.push('');
109
- lines.push('```typescript');
110
- lines.push("// In your V3 configuration");
111
- lines.push('const server = createMCPServer({');
112
- lines.push(" transport: 'stdio',");
113
- lines.push(' compatibility: {');
114
- lines.push(' v2: true,');
115
- lines.push(' paramTranslation: true,');
116
- lines.push(' deprecationWarnings: true');
117
- lines.push(' }');
118
- lines.push('});');
119
- lines.push('```');
120
- lines.push('');
121
- if (options.includeExamples) {
122
- lines.push(...generateExamplesSection());
123
- }
124
- if (options.includeMigrationScripts) {
125
- lines.push(...generateMigrationScriptsSection());
126
- }
127
- // Recommendations
128
- lines.push('## Recommendations');
129
- lines.push('');
130
- for (let i = 0; i < report.recommendations.length; i++) {
131
- lines.push(`${i + 1}. ${report.recommendations[i]}`);
132
- }
133
- lines.push('');
134
- // Feature Compatibility Matrix
135
- lines.push('## Feature Compatibility Matrix');
136
- lines.push('');
137
- lines.push('| Feature | V2 Status | V3 Status | Compatibility |');
138
- lines.push('|---------|-----------|-----------|---------------|');
139
- lines.push('| CLI Commands | 25 commands | 22 native + 3 compat | Full |');
140
- lines.push('| MCP Tools | 65 tools | Via name mapping | Full |');
141
- lines.push('| Hooks | 42 hooks | All supported | Full |');
142
- lines.push('| API Classes | 5 interfaces | Via aliases | Full |');
143
- lines.push('| Memory Backend | SQLite | Hybrid (SQLite + AgentDB) | Enhanced |');
144
- lines.push('| Search | Brute-force | HNSW indexed (150x faster) | Enhanced |');
145
- lines.push('| Deno Runtime | Supported | Removed (Node.js 20+) | Breaking |');
146
- lines.push('');
147
- // Appendix
148
- lines.push('## Appendix');
149
- lines.push('');
150
- lines.push('### A. V2 to V3 Tool Name Mapping');
151
- lines.push('');
152
- lines.push('| V2 Tool Name | V3 Tool Name |');
153
- lines.push('|--------------|--------------|');
154
- lines.push('| dispatch_agent | agent/spawn |');
155
- lines.push('| agents/spawn | agent/spawn |');
156
- lines.push('| agents/list | agent/list |');
157
- lines.push('| swarm_status | swarm/status |');
158
- lines.push('| memory/query | memory/search |');
159
- lines.push('| config/get | config/load |');
160
- lines.push('| config/update | config/save |');
161
- lines.push('');
162
- lines.push('### B. V2 to V3 Import Aliases');
163
- lines.push('');
164
- lines.push('| V2 Import | V3 Import |');
165
- lines.push('|-----------|-----------|');
166
- lines.push('| swarmdo/hive-mind | @swarmdo/swarm |');
167
- lines.push('| swarmdo/swarm | @swarmdo/swarm |');
168
- lines.push('| swarmdo/memory | @swarmdo/memory |');
169
- lines.push('| swarmdo/agents | @swarmdo/agent-lifecycle |');
170
- lines.push('| swarmdo/tasks | @swarmdo/task-execution |');
171
- lines.push('');
172
- lines.push('### C. V2 to V3 Class Aliases');
173
- lines.push('');
174
- lines.push('| V2 Class | V3 Class |');
175
- lines.push('|----------|----------|');
176
- lines.push('| HiveMind | UnifiedSwarmCoordinator |');
177
- lines.push('| SwarmCoordinator | UnifiedSwarmCoordinator |');
178
- lines.push('| MemoryManager | UnifiedMemoryService |');
179
- lines.push('| AgentManager | AgentLifecycleService |');
180
- lines.push('| TaskOrchestrator | TaskExecutionService |');
181
- lines.push('');
182
- // Footer
183
- lines.push('---');
184
- lines.push('');
185
- lines.push('*Report generated by V2CompatibilityValidator*');
186
- lines.push('*For more information, see [v3/docs/v3-migration/BACKWARD-COMPATIBILITY.md](../v3-migration/BACKWARD-COMPATIBILITY.md)*');
187
- return lines.join('\n');
188
- }
189
- /**
190
- * Generate detailed section for a category
191
- */
192
- function generateDetailedSection(title, result, expectedCount) {
193
- const lines = [];
194
- lines.push(`## ${title}`);
195
- lines.push('');
196
- lines.push(`**Summary**: ${result.passedChecks}/${result.totalChecks} checks passed (${expectedCount} items)`);
197
- lines.push(`**Breaking Changes**: ${result.breakingChanges}`);
198
- lines.push(`**Duration**: ${result.duration}ms`);
199
- lines.push('');
200
- // Get unique item checks (exclude param/return checks for cleaner view)
201
- const itemChecks = result.checks.filter(c => {
202
- const name = c.name.toLowerCase();
203
- return !name.includes('param:') && !name.includes('return:') && !name.includes('flag:') && !name.includes('alias:');
204
- });
205
- if (itemChecks.length > 0) {
206
- lines.push('| Item | Status | V3 Equivalent |');
207
- lines.push('|------|--------|---------------|');
208
- for (const check of itemChecks.slice(0, 40)) {
209
- const status = check.passed ? 'OK' : (check.breaking ? 'BREAKING' : 'WARNING');
210
- const v3Name = check.details?.v3Equivalent || check.migrationPath?.replace('Use "', '').replace('" instead', '') || '-';
211
- const itemName = check.name.replace(/^(CLI|MCP Tool|Hook|API Class|API Method): /, '');
212
- lines.push(`| ${itemName} | ${status} | ${v3Name} |`);
213
- }
214
- if (itemChecks.length > 40) {
215
- lines.push(`| ... | ${itemChecks.length - 40} more | ... |`);
216
- }
217
- }
218
- lines.push('');
219
- return lines;
220
- }
221
- /**
222
- * Generate examples section
223
- */
224
- function generateExamplesSection() {
225
- const lines = [];
226
- lines.push('### Code Examples');
227
- lines.push('');
228
- lines.push('#### CLI Migration');
229
- lines.push('');
230
- lines.push('```bash');
231
- lines.push('# V2 (deprecated but supported)');
232
- lines.push('npx swarmdo hive-mind init');
233
- lines.push('npx swarmdo hive-mind status');
234
- lines.push('');
235
- lines.push('# V3 (recommended)');
236
- lines.push('npx @swarmdo/cli swarm init');
237
- lines.push('npx @swarmdo/cli swarm status');
238
- lines.push('```');
239
- lines.push('');
240
- lines.push('#### MCP Tool Migration');
241
- lines.push('');
242
- lines.push('```typescript');
243
- lines.push('// V2 tool call');
244
- lines.push("const agent = await mcp.callTool('dispatch_agent', {");
245
- lines.push(" type: 'coder',");
246
- lines.push(" name: 'my-agent',");
247
- lines.push(' priority: 8');
248
- lines.push('});');
249
- lines.push('');
250
- lines.push('// V3 tool call (with compatibility layer)');
251
- lines.push("const agent = await mcp.callTool('dispatch_agent', {");
252
- lines.push(" type: 'coder',");
253
- lines.push(" name: 'my-agent',");
254
- lines.push(' priority: 8');
255
- lines.push('}); // Automatically translated to agent/spawn');
256
- lines.push('');
257
- lines.push('// V3 tool call (native)');
258
- lines.push("const agent = await mcp.callTool('agent/spawn', {");
259
- lines.push(" agentType: 'coder',");
260
- lines.push(" id: 'my-agent',");
261
- lines.push(" priority: 'high'");
262
- lines.push('});');
263
- lines.push('```');
264
- lines.push('');
265
- lines.push('#### API Migration');
266
- lines.push('');
267
- lines.push('```typescript');
268
- lines.push('// V2 imports');
269
- lines.push("import { HiveMind } from 'swarmdo/hive-mind';");
270
- lines.push("import { MemoryManager } from 'swarmdo/memory';");
271
- lines.push('');
272
- lines.push('// V3 imports with aliases');
273
- lines.push("import { UnifiedSwarmCoordinator as HiveMind } from '@swarmdo/swarm';");
274
- lines.push("import { UnifiedMemoryService as MemoryManager } from '@swarmdo/memory';");
275
- lines.push('');
276
- lines.push('// Usage remains the same');
277
- lines.push('const hive = new HiveMind();');
278
- lines.push('await hive.initialize();');
279
- lines.push("const agent = await hive.spawn('coder');");
280
- lines.push('```');
281
- lines.push('');
282
- return lines;
283
- }
284
- /**
285
- * Generate migration scripts section
286
- */
287
- function generateMigrationScriptsSection() {
288
- const lines = [];
289
- lines.push('### Migration Scripts');
290
- lines.push('');
291
- lines.push('#### Automatic Migration');
292
- lines.push('');
293
- lines.push('```bash');
294
- lines.push('# Run the V3 migration tool');
295
- lines.push('npx @swarmdo/cli migrate --from v2 --to v3');
296
- lines.push('');
297
- lines.push('# Migrate configuration');
298
- lines.push('npx @swarmdo/cli migrate config --input .swarmdo/config.yaml');
299
- lines.push('');
300
- lines.push('# Migrate memory database');
301
- lines.push('npx @swarmdo/cli migrate memory --input .swarmdo/memory.db');
302
- lines.push('```');
303
- lines.push('');
304
- lines.push('#### Manual Configuration Migration');
305
- lines.push('');
306
- lines.push('```yaml');
307
- lines.push('# V2 Configuration (.swarmdo/config.yaml)');
308
- lines.push('orchestrator:');
309
- lines.push(' maxAgents: 10');
310
- lines.push(' defaultStrategy: balanced');
311
- lines.push('memory:');
312
- lines.push(' backend: sqlite');
313
- lines.push(' path: ./.swarmdo/memory.db');
314
- lines.push('coordination:');
315
- lines.push(' topology: hierarchical');
316
- lines.push('');
317
- lines.push('# V3 Configuration (.swarmdo/config.yaml)');
318
- lines.push('swarm:');
319
- lines.push(' topology: hierarchical-mesh');
320
- lines.push(' maxAgents: 15');
321
- lines.push(' consensus:');
322
- lines.push(' mechanism: majority');
323
- lines.push(' timeout: 30000');
324
- lines.push('memory:');
325
- lines.push(' backend: hybrid');
326
- lines.push(' sqlite:');
327
- lines.push(' path: ./.swarmdo/memory.db');
328
- lines.push(' agentdb:');
329
- lines.push(' enableHNSW: true');
330
- lines.push(' dimensions: 384');
331
- lines.push('hooks:');
332
- lines.push(' learning:');
333
- lines.push(' enabled: true');
334
- lines.push('```');
335
- lines.push('');
336
- return lines;
337
- }
338
- /**
339
- * Get status emoji based on pass rate
340
- */
341
- function getStatusEmoji(passed, total, threshold) {
342
- const rate = total > 0 ? passed / total : 0;
343
- if (rate >= threshold)
344
- return 'OK';
345
- if (rate >= threshold * 0.8)
346
- return 'WARNING';
347
- return 'CRITICAL';
348
- }
349
- /**
350
- * Pad number for table alignment
351
- */
352
- function padNum(num) {
353
- return num.toString().padStart(4, ' ');
354
- }
355
- /**
356
- * Run validation and save report to file
357
- */
358
- export async function runAndSaveReport(outputPath) {
359
- const { report, markdown } = await generateFullReport({
360
- detailed: true,
361
- includeExamples: true,
362
- includeMigrationScripts: true,
363
- format: 'markdown',
364
- });
365
- // Note: File saving would be done by the caller
366
- console.log(`Report generated successfully`);
367
- console.log(`Overall: ${report.overallPassed ? 'PASSED' : 'FAILED'}`);
368
- console.log(`Total: ${report.passedChecks}/${report.totalChecks} checks passed`);
369
- console.log(`Breaking changes: ${report.breakingChanges}`);
370
- return report;
371
- }
372
- //# sourceMappingURL=report-generator.js.map