swarmdo 1.58.23 → 1.58.24

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