@evolith/smart-cli 1.1.2 → 1.1.4

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 (200) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/app.module.d.ts +2 -0
  3. package/dist/app.module.js +134 -0
  4. package/dist/app.module.js.map +1 -0
  5. package/dist/commands/adr/adr.command.d.ts +34 -0
  6. package/dist/commands/adr/adr.command.js +351 -0
  7. package/dist/commands/adr/adr.command.js.map +1 -0
  8. package/dist/commands/agents/agents.command.d.ts +14 -0
  9. package/dist/commands/agents/agents.command.js +61 -0
  10. package/dist/commands/agents/agents.command.js.map +1 -0
  11. package/dist/commands/agents/index.d.ts +1 -0
  12. package/dist/commands/agents/index.js +6 -0
  13. package/dist/commands/agents/index.js.map +1 -0
  14. package/dist/commands/alias/alias.command.d.ts +16 -0
  15. package/dist/commands/alias/alias.command.js +95 -0
  16. package/dist/commands/alias/alias.command.js.map +1 -0
  17. package/dist/commands/api/api.catalog.d.ts +38 -0
  18. package/dist/commands/api/api.catalog.js +167 -0
  19. package/dist/commands/api/api.catalog.js.map +1 -0
  20. package/dist/commands/api/api.command.d.ts +21 -0
  21. package/dist/commands/api/api.command.js +162 -0
  22. package/dist/commands/api/api.command.js.map +1 -0
  23. package/dist/commands/architecture/scaffold/index.d.ts +2 -0
  24. package/dist/commands/architecture/scaffold/index.js +6 -0
  25. package/dist/commands/architecture/scaffold/index.js.map +1 -0
  26. package/dist/commands/architecture/scaffold/scaffold-strategy.d.ts +15 -0
  27. package/dist/commands/architecture/scaffold/scaffold-strategy.js +20 -0
  28. package/dist/commands/architecture/scaffold/scaffold-strategy.js.map +1 -0
  29. package/dist/commands/architecture/scaffold.command.d.ts +16 -0
  30. package/dist/commands/architecture/scaffold.command.js +328 -0
  31. package/dist/commands/architecture/scaffold.command.js.map +1 -0
  32. package/dist/commands/completion/completion.command.d.ts +28 -0
  33. package/dist/commands/completion/completion.command.js +321 -0
  34. package/dist/commands/completion/completion.command.js.map +1 -0
  35. package/dist/commands/docs/docs.command.d.ts +17 -0
  36. package/dist/commands/docs/docs.command.js +292 -0
  37. package/dist/commands/docs/docs.command.js.map +1 -0
  38. package/dist/commands/drift/drift.command.d.ts +28 -0
  39. package/dist/commands/drift/drift.command.js +292 -0
  40. package/dist/commands/drift/drift.command.js.map +1 -0
  41. package/dist/commands/fixtures/fixtures.command.d.ts +21 -0
  42. package/dist/commands/fixtures/fixtures.command.js +310 -0
  43. package/dist/commands/fixtures/fixtures.command.js.map +1 -0
  44. package/dist/commands/gate/gate.command.d.ts +29 -0
  45. package/dist/commands/gate/gate.command.js +193 -0
  46. package/dist/commands/gate/gate.command.js.map +1 -0
  47. package/dist/commands/history/history.command.d.ts +29 -0
  48. package/dist/commands/history/history.command.js +237 -0
  49. package/dist/commands/history/history.command.js.map +1 -0
  50. package/dist/commands/init/agents.command.d.ts +24 -0
  51. package/dist/commands/init/agents.command.js +330 -0
  52. package/dist/commands/init/agents.command.js.map +1 -0
  53. package/dist/commands/init/init.command.d.ts +26 -0
  54. package/dist/commands/init/init.command.js +170 -0
  55. package/dist/commands/init/init.command.js.map +1 -0
  56. package/dist/commands/init/init.wizard.d.ts +19 -0
  57. package/dist/commands/init/init.wizard.js +181 -0
  58. package/dist/commands/init/init.wizard.js.map +1 -0
  59. package/dist/commands/init/upgrade.command.d.ts +22 -0
  60. package/dist/commands/init/upgrade.command.js +178 -0
  61. package/dist/commands/init/upgrade.command.js.map +1 -0
  62. package/dist/commands/mcp/mcp-serve.command.d.ts +17 -0
  63. package/dist/commands/mcp/mcp-serve.command.js +153 -0
  64. package/dist/commands/mcp/mcp-serve.command.js.map +1 -0
  65. package/dist/commands/phase/phase-advance.command.d.ts +30 -0
  66. package/dist/commands/phase/phase-advance.command.js +206 -0
  67. package/dist/commands/phase/phase-advance.command.js.map +1 -0
  68. package/dist/commands/profile/profile.command.d.ts +18 -0
  69. package/dist/commands/profile/profile.command.js +198 -0
  70. package/dist/commands/profile/profile.command.js.map +1 -0
  71. package/dist/commands/sdlc/gate-status.command.d.ts +10 -0
  72. package/dist/commands/sdlc/gate-status.command.js +162 -0
  73. package/dist/commands/sdlc/gate-status.command.js.map +1 -0
  74. package/dist/commands/sdlc/generate-domain.command.d.ts +8 -0
  75. package/dist/commands/sdlc/generate-domain.command.js +165 -0
  76. package/dist/commands/sdlc/generate-domain.command.js.map +1 -0
  77. package/dist/commands/sdlc/handoff.command.d.ts +27 -0
  78. package/dist/commands/sdlc/handoff.command.js +275 -0
  79. package/dist/commands/sdlc/handoff.command.js.map +1 -0
  80. package/dist/commands/sdlc/sdlc.command.d.ts +5 -0
  81. package/dist/commands/sdlc/sdlc.command.js +44 -0
  82. package/dist/commands/sdlc/sdlc.command.js.map +1 -0
  83. package/dist/commands/standards/standards.command.d.ts +30 -0
  84. package/dist/commands/standards/standards.command.js +283 -0
  85. package/dist/commands/standards/standards.command.js.map +1 -0
  86. package/dist/commands/update/update.command.d.ts +21 -0
  87. package/dist/commands/update/update.command.js +214 -0
  88. package/dist/commands/update/update.command.js.map +1 -0
  89. package/dist/commands/upgrade/index.d.ts +1 -0
  90. package/dist/commands/upgrade/index.js +6 -0
  91. package/dist/commands/upgrade/index.js.map +1 -0
  92. package/dist/commands/upgrade/upgrade.command.d.ts +14 -0
  93. package/dist/commands/upgrade/upgrade.command.js +58 -0
  94. package/dist/commands/upgrade/upgrade.command.js.map +1 -0
  95. package/dist/commands/validate/validate.command.d.ts +43 -0
  96. package/dist/commands/validate/validate.command.js +528 -0
  97. package/dist/commands/validate/validate.command.js.map +1 -0
  98. package/dist/config/alias.service.d.ts +14 -0
  99. package/dist/config/alias.service.js +103 -0
  100. package/dist/config/alias.service.js.map +1 -0
  101. package/dist/contributions/contribution-validator.d.ts +16 -0
  102. package/dist/contributions/contribution-validator.js +34 -0
  103. package/dist/contributions/contribution-validator.js.map +1 -0
  104. package/dist/contributions/index.d.ts +1 -0
  105. package/dist/contributions/index.js +6 -0
  106. package/dist/contributions/index.js.map +1 -0
  107. package/dist/infrastructure/adapters/agent-registry.service.d.ts +30 -0
  108. package/dist/infrastructure/adapters/agent-registry.service.js +175 -0
  109. package/dist/infrastructure/adapters/agent-registry.service.js.map +1 -0
  110. package/dist/infrastructure/architecture/nx-workspace.strategy.d.ts +19 -0
  111. package/dist/infrastructure/architecture/nx-workspace.strategy.js +125 -0
  112. package/dist/infrastructure/architecture/nx-workspace.strategy.js.map +1 -0
  113. package/dist/infrastructure/architecture/topology-catalog.d.ts +17 -0
  114. package/dist/infrastructure/architecture/topology-catalog.js +69 -0
  115. package/dist/infrastructure/architecture/topology-catalog.js.map +1 -0
  116. package/dist/infrastructure/catalog/catalog-loader.d.ts +21 -0
  117. package/dist/infrastructure/catalog/catalog-loader.js +144 -0
  118. package/dist/infrastructure/catalog/catalog-loader.js.map +1 -0
  119. package/dist/infrastructure/cli/base-command.d.ts +14 -0
  120. package/dist/infrastructure/cli/base-command.js +41 -0
  121. package/dist/infrastructure/cli/base-command.js.map +1 -0
  122. package/dist/infrastructure/cli/command-executor.d.ts +20 -0
  123. package/dist/infrastructure/cli/command-executor.js +110 -0
  124. package/dist/infrastructure/cli/command-executor.js.map +1 -0
  125. package/dist/infrastructure/cli/providers/index.d.ts +52 -0
  126. package/dist/infrastructure/cli/providers/index.js +175 -0
  127. package/dist/infrastructure/cli/providers/index.js.map +1 -0
  128. package/dist/infrastructure/config/config.service.d.ts +34 -0
  129. package/dist/infrastructure/config/config.service.js +126 -0
  130. package/dist/infrastructure/config/config.service.js.map +1 -0
  131. package/dist/infrastructure/filesystem/file-manager.service.d.ts +12 -0
  132. package/dist/infrastructure/filesystem/file-manager.service.js +79 -0
  133. package/dist/infrastructure/filesystem/file-manager.service.js.map +1 -0
  134. package/dist/infrastructure/formatters/output-formatter.service.d.ts +28 -0
  135. package/dist/infrastructure/formatters/output-formatter.service.js +199 -0
  136. package/dist/infrastructure/formatters/output-formatter.service.js.map +1 -0
  137. package/dist/infrastructure/observability/command-watcher.d.ts +45 -0
  138. package/dist/infrastructure/observability/command-watcher.js +199 -0
  139. package/dist/infrastructure/observability/command-watcher.js.map +1 -0
  140. package/dist/infrastructure/observability/error-reporter.d.ts +47 -0
  141. package/dist/infrastructure/observability/error-reporter.js +163 -0
  142. package/dist/infrastructure/observability/error-reporter.js.map +1 -0
  143. package/dist/infrastructure/observability/index.d.ts +11 -0
  144. package/dist/infrastructure/observability/index.js +31 -0
  145. package/dist/infrastructure/observability/index.js.map +1 -0
  146. package/dist/infrastructure/observability/otel-tracing.d.ts +4 -0
  147. package/dist/infrastructure/observability/otel-tracing.js +34 -0
  148. package/dist/infrastructure/observability/otel-tracing.js.map +1 -0
  149. package/dist/infrastructure/observability/structured-logger.d.ts +53 -0
  150. package/dist/infrastructure/observability/structured-logger.js +123 -0
  151. package/dist/infrastructure/observability/structured-logger.js.map +1 -0
  152. package/dist/infrastructure/observability/timing.d.ts +23 -0
  153. package/dist/infrastructure/observability/timing.js +140 -0
  154. package/dist/infrastructure/observability/timing.js.map +1 -0
  155. package/dist/infrastructure/observability/tool-usage-telemetry.service.d.ts +46 -0
  156. package/dist/infrastructure/observability/tool-usage-telemetry.service.js +181 -0
  157. package/dist/infrastructure/observability/tool-usage-telemetry.service.js.map +1 -0
  158. package/dist/infrastructure/plugins/plugin-loader.d.ts +10 -0
  159. package/dist/infrastructure/plugins/plugin-loader.js +145 -0
  160. package/dist/infrastructure/plugins/plugin-loader.js.map +1 -0
  161. package/dist/infrastructure/plugins/plugin.module.d.ts +4 -0
  162. package/dist/infrastructure/plugins/plugin.module.js +28 -0
  163. package/dist/infrastructure/plugins/plugin.module.js.map +1 -0
  164. package/dist/infrastructure/prompts/init-prompt-group.d.ts +3 -0
  165. package/dist/infrastructure/prompts/init-prompt-group.js +115 -0
  166. package/dist/infrastructure/prompts/init-prompt-group.js.map +1 -0
  167. package/dist/infrastructure/prompts/init-prompt-options.d.ts +10 -0
  168. package/dist/infrastructure/prompts/init-prompt-options.js +40 -0
  169. package/dist/infrastructure/prompts/init-prompt-options.js.map +1 -0
  170. package/dist/infrastructure/prompts/progress.service.d.ts +24 -0
  171. package/dist/infrastructure/prompts/progress.service.js +180 -0
  172. package/dist/infrastructure/prompts/progress.service.js.map +1 -0
  173. package/dist/infrastructure/prompts/prompt.service.d.ts +42 -0
  174. package/dist/infrastructure/prompts/prompt.service.js +142 -0
  175. package/dist/infrastructure/prompts/prompt.service.js.map +1 -0
  176. package/dist/infrastructure/prompts/wizard.service.d.ts +27 -0
  177. package/dist/infrastructure/prompts/wizard.service.js +163 -0
  178. package/dist/infrastructure/prompts/wizard.service.js.map +1 -0
  179. package/dist/infrastructure/providers/config-parser.provider.d.ts +15 -0
  180. package/dist/infrastructure/providers/config-parser.provider.js +68 -0
  181. package/dist/infrastructure/providers/config-parser.provider.js.map +1 -0
  182. package/dist/infrastructure/providers/logger.provider.d.ts +10 -0
  183. package/dist/infrastructure/providers/logger.provider.js +84 -0
  184. package/dist/infrastructure/providers/logger.provider.js.map +1 -0
  185. package/dist/infrastructure/providers/mock-filesystem.provider.d.ts +34 -0
  186. package/dist/infrastructure/providers/mock-filesystem.provider.js +129 -0
  187. package/dist/infrastructure/providers/mock-filesystem.provider.js.map +1 -0
  188. package/dist/infrastructure/providers/node-filesystem.provider.d.ts +23 -0
  189. package/dist/infrastructure/providers/node-filesystem.provider.js +117 -0
  190. package/dist/infrastructure/providers/node-filesystem.provider.js.map +1 -0
  191. package/dist/main.d.ts +2 -0
  192. package/dist/main.js +27 -0
  193. package/dist/main.js.map +1 -0
  194. package/dist/plugins/index.d.ts +1 -0
  195. package/dist/plugins/index.js +6 -0
  196. package/dist/plugins/index.js.map +1 -0
  197. package/dist/plugins/plugin-registry.d.ts +22 -0
  198. package/dist/plugins/plugin-registry.js +33 -0
  199. package/dist/plugins/plugin-registry.js.map +1 -0
  200. package/package.json +1 -1
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.InitWizardCommand = void 0;
16
+ const nest_commander_1 = require("nest-commander");
17
+ const base_command_1 = require("../../infrastructure/cli/base-command");
18
+ const wizard_service_1 = require("../../infrastructure/prompts/wizard.service");
19
+ const prompt_service_1 = require("../../infrastructure/prompts/prompt.service");
20
+ const catalog_loader_1 = require("../../infrastructure/catalog/catalog-loader");
21
+ const common_1 = require("@nestjs/common");
22
+ const services_1 = require("@evolith/core-domain/application/services");
23
+ let InitWizardCommand = class InitWizardCommand extends base_command_1.BaseEvolithCommand {
24
+ constructor(wizardService, promptService, catalogLoader, fileSystem) {
25
+ super('InitWizardCommand', promptService);
26
+ this.wizardService = wizardService;
27
+ this.catalogLoader = catalogLoader;
28
+ this.fileSystem = fileSystem;
29
+ }
30
+ async executeCommand(passedParam, options) {
31
+ const useWizard = options?.wizard ?? true;
32
+ const noInteractive = options?.noInteractive ?? false;
33
+ if (!useWizard) {
34
+ this.logger.log('Use "evolith init" for standard initialization');
35
+ return;
36
+ }
37
+ const fs = this.fileSystem;
38
+ const useCase = new services_1.InitializeProjectUseCase(fs, this.catalogLoader);
39
+ const steps = [
40
+ {
41
+ id: 'project-name',
42
+ title: 'Project Name',
43
+ description: 'Enter your project name',
44
+ run: async () => {
45
+ const name = await this.promptService.text({
46
+ message: 'What is your project name?',
47
+ placeholder: 'my-evolith-project',
48
+ validate: (value) => {
49
+ if (!value || value.length < 3) {
50
+ return 'Project name must be at least 3 characters';
51
+ }
52
+ return undefined;
53
+ },
54
+ });
55
+ return { projectName: name };
56
+ },
57
+ },
58
+ {
59
+ id: 'runtime',
60
+ title: 'Runtime Selection',
61
+ description: 'Choose your runtime environment',
62
+ run: async () => {
63
+ const runtime = await this.promptService.select({
64
+ message: 'Select runtime:',
65
+ options: [
66
+ { value: 'nodejs', label: 'Node.js' },
67
+ { value: 'dotnet', label: '.NET' },
68
+ { value: 'android', label: 'Android' },
69
+ ],
70
+ });
71
+ return { runtime };
72
+ },
73
+ },
74
+ {
75
+ id: 'monorepo',
76
+ title: 'Monorepo Configuration',
77
+ description: 'Configure monorepo structure',
78
+ run: async () => {
79
+ const monorepo = await this.promptService.select({
80
+ message: 'Monorepo setup:',
81
+ options: [
82
+ { value: 'none', label: 'Single project' },
83
+ { value: 'npm', label: 'NPM workspaces' },
84
+ { value: 'pnpm', label: 'pnpm workspaces' },
85
+ ],
86
+ });
87
+ return { monorepo };
88
+ },
89
+ },
90
+ {
91
+ id: 'architecture',
92
+ title: 'Architecture Pattern',
93
+ description: 'Select architecture pattern',
94
+ run: async () => {
95
+ const arch = await this.promptService.select({
96
+ message: 'Architecture:',
97
+ options: [
98
+ { value: 'clean', label: 'Clean Architecture' },
99
+ { value: 'hexagonal', label: 'Hexagonal' },
100
+ { value: 'layered', label: 'Layered' },
101
+ ],
102
+ });
103
+ return { arch };
104
+ },
105
+ },
106
+ ];
107
+ try {
108
+ const result = await this.wizardService.start({
109
+ title: 'Evolith Project Initialization Wizard',
110
+ steps,
111
+ noInteractive,
112
+ });
113
+ if (result && result.projectName) {
114
+ this.promptService.startSpinner('Creating project structure...');
115
+ const initResult = await useCase.execute({
116
+ name: result.projectName,
117
+ runtime: result.runtime,
118
+ monorepo: result.monorepo,
119
+ architecture: result.arch,
120
+ database: 'none',
121
+ apiProtocol: 'rest',
122
+ ciCd: 'none',
123
+ observability: 'none',
124
+ features: [],
125
+ agents: [],
126
+ }, process.cwd());
127
+ this.promptService.stopSpinner();
128
+ if (initResult.success) {
129
+ this.promptService.showSuccess(`Project ${result.projectName} created successfully!`);
130
+ this.promptService.showInfo(`Artifacts: ${initResult.artifacts.length}`);
131
+ }
132
+ else {
133
+ this.promptService.showError('Failed to create project');
134
+ }
135
+ }
136
+ }
137
+ catch (error) {
138
+ if (error instanceof Error && error.name === 'UserCancelledError') {
139
+ this.promptService.showInfo('Initialization cancelled');
140
+ return;
141
+ }
142
+ throw error;
143
+ }
144
+ }
145
+ parseNoWizard() {
146
+ return true;
147
+ }
148
+ parseNoInteractive() {
149
+ return true;
150
+ }
151
+ };
152
+ exports.InitWizardCommand = InitWizardCommand;
153
+ __decorate([
154
+ (0, nest_commander_1.Option)({
155
+ flags: '--no-wizard',
156
+ description: 'Use standard init instead of wizard',
157
+ }),
158
+ __metadata("design:type", Function),
159
+ __metadata("design:paramtypes", []),
160
+ __metadata("design:returntype", Boolean)
161
+ ], InitWizardCommand.prototype, "parseNoWizard", null);
162
+ __decorate([
163
+ (0, nest_commander_1.Option)({
164
+ flags: '--no-interactive',
165
+ description: 'Run in non-interactive mode (CI/automation)',
166
+ }),
167
+ __metadata("design:type", Function),
168
+ __metadata("design:paramtypes", []),
169
+ __metadata("design:returntype", Boolean)
170
+ ], InitWizardCommand.prototype, "parseNoInteractive", null);
171
+ exports.InitWizardCommand = InitWizardCommand = __decorate([
172
+ (0, nest_commander_1.Command)({
173
+ name: 'init-wizard',
174
+ description: 'Interactive wizard for project initialization',
175
+ }),
176
+ __param(3, (0, common_1.Inject)('IFileSystem')),
177
+ __metadata("design:paramtypes", [wizard_service_1.WizardService,
178
+ prompt_service_1.PromptService,
179
+ catalog_loader_1.CatalogLoader, Object])
180
+ ], InitWizardCommand);
181
+ //# sourceMappingURL=init.wizard.js.map
@@ -0,0 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infrastructure/cli/base-command';
2
+ import { PromptService } from '../../infrastructure/prompts/prompt.service';
3
+ import { ConfigService } from '../../infrastructure/config/config.service';
4
+ interface UpgradeCommandOptions {
5
+ dryRun?: boolean;
6
+ force?: boolean;
7
+ core?: string;
8
+ report?: boolean;
9
+ }
10
+ export declare class UpgradeCommand extends BaseEvolithCommand {
11
+ constructor(promptService: PromptService, configService?: ConfigService);
12
+ executeCommand(passedParam: string[], options?: UpgradeCommandOptions): Promise<void>;
13
+ private printUpgradePlan;
14
+ private getChangeIcon;
15
+ private getRiskColor;
16
+ private findCorePath;
17
+ parseDryRun(): boolean;
18
+ parseForce(): boolean;
19
+ parseCore(val: string): string;
20
+ parseReport(): boolean;
21
+ }
22
+ export {};
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.UpgradeCommand = void 0;
16
+ const nest_commander_1 = require("nest-commander");
17
+ const chalk_1 = __importDefault(require("chalk"));
18
+ const satellite_upgrade_service_1 = require("@evolith/core-domain/application/upgrade/satellite-upgrade.service");
19
+ const base_command_1 = require("../../infrastructure/cli/base-command");
20
+ const prompt_service_1 = require("../../infrastructure/prompts/prompt.service");
21
+ const config_service_1 = require("../../infrastructure/config/config.service");
22
+ let UpgradeCommand = class UpgradeCommand extends base_command_1.BaseEvolithCommand {
23
+ constructor(promptService, configService) {
24
+ super('UpgradeCommand', promptService, configService);
25
+ }
26
+ async executeCommand(passedParam, options) {
27
+ const satellitePath = process.cwd();
28
+ const corePath = options?.core || this.profile.core || this.findCorePath(satellitePath);
29
+ const service = new satellite_upgrade_service_1.SatelliteUpgradeService();
30
+ this.promptService.showIntro('Evolith SDK - Satélite Upgrade');
31
+ this.promptService.startSpinner('Planning upgrade...');
32
+ try {
33
+ const plan = await service.planUpgrade({ satellitePath, corePath });
34
+ this.promptService.stopSpinner();
35
+ if (plan.changes.length === 0) {
36
+ this.promptService.showSuccess('Satellite is already up to date');
37
+ this.promptService.showOutro('No upgrade needed.');
38
+ return;
39
+ }
40
+ this.printUpgradePlan(plan);
41
+ if (options?.dryRun) {
42
+ const _result = await service.executeUpgrade({
43
+ satellitePath,
44
+ corePath,
45
+ dryRun: true,
46
+ });
47
+ this.promptService.showInfo('Dry run complete - no changes applied');
48
+ this.promptService.showOutro('Dry run finished.');
49
+ return;
50
+ }
51
+ if (plan.breakingChanges.length > 0 && !options?.force) {
52
+ this.promptService.showWarning(`⚠ ${plan.breakingChanges.length} breaking change(s) detected`);
53
+ this.promptService.showInfo('Use --force to proceed with breaking changes');
54
+ this.promptService.showOutro('Upgrade cancelled.');
55
+ return;
56
+ }
57
+ const confirm = await this.promptService.confirm(`Apply ${plan.changes.length} change(s)?`, true);
58
+ if (!confirm) {
59
+ this.promptService.showOutro('Upgrade cancelled.');
60
+ return;
61
+ }
62
+ this.promptService.startSpinner('Applying upgrade...');
63
+ const result = await service.executeUpgrade({
64
+ satellitePath,
65
+ corePath,
66
+ force: options?.force,
67
+ });
68
+ this.promptService.stopSpinner();
69
+ const report = await service.getUpgradeReport(result);
70
+ console.log(`\n${chalk_1.default.bgCyan.black(' Upgrade Report ')}\n${report}\n`);
71
+ if (result.success) {
72
+ this.promptService.showSuccess(`Upgrade complete: ${result.changesApplied} change(s) applied`);
73
+ }
74
+ else {
75
+ this.promptService.showError(`Upgrade completed with errors: ${result.errors.length}`);
76
+ }
77
+ this.promptService.showOutro(result.success ? 'Upgrade finished.' : 'Upgrade finished with errors.');
78
+ }
79
+ catch (error) {
80
+ this.promptService.stopSpinner();
81
+ throw error;
82
+ }
83
+ }
84
+ printUpgradePlan(plan) {
85
+ console.log(chalk_1.default.bold('\n📋 Upgrade Plan\n'));
86
+ console.log(`${chalk_1.default.bold('Current Version:')} ${chalk_1.default.cyan(plan.currentVersion)}`);
87
+ console.log(`${chalk_1.default.bold('Target Version:')} ${chalk_1.default.cyan(plan.targetVersion)}`);
88
+ console.log(`${chalk_1.default.bold('Risk Level:')} ${plan.estimatedRisk === 'high' ? chalk_1.default.red(plan.estimatedRisk.toUpperCase()) : plan.estimatedRisk === 'medium' ? chalk_1.default.yellow(plan.estimatedRisk.toUpperCase()) : chalk_1.default.green(plan.estimatedRisk.toUpperCase())}`);
89
+ console.log(`${chalk_1.default.bold('Total Changes:')} ${plan.changes.length}`);
90
+ if (plan.breakingChanges.length > 0) {
91
+ console.log(`${chalk_1.default.red('⚠ Breaking Changes:')} ${plan.breakingChanges.length}`);
92
+ }
93
+ console.log(chalk_1.default.cyan('\nChanges:'));
94
+ for (const change of plan.changes) {
95
+ const icon = this.getChangeIcon(change.type);
96
+ const breaking = change.breaking ? chalk_1.default.red(' [BREAKING]') : '';
97
+ console.log(` ${icon} ${change.description}${breaking}`);
98
+ }
99
+ console.log('');
100
+ }
101
+ getChangeIcon(type) {
102
+ switch (type) {
103
+ case 'add': return chalk_1.default.green('+');
104
+ case 'modify': return chalk_1.default.yellow('~');
105
+ case 'remove': return chalk_1.default.red('-');
106
+ case 'migrate': return chalk_1.default.blue('»');
107
+ default: return '?';
108
+ }
109
+ }
110
+ getRiskColor(risk) {
111
+ switch (risk) {
112
+ case 'high': return 'high';
113
+ case 'medium': return 'medium';
114
+ default: return 'low';
115
+ }
116
+ }
117
+ findCorePath(satellitePath) {
118
+ return satellitePath;
119
+ }
120
+ parseDryRun() {
121
+ return true;
122
+ }
123
+ parseForce() {
124
+ return true;
125
+ }
126
+ parseCore(val) {
127
+ return val;
128
+ }
129
+ parseReport() {
130
+ return true;
131
+ }
132
+ };
133
+ exports.UpgradeCommand = UpgradeCommand;
134
+ __decorate([
135
+ (0, nest_commander_1.Option)({
136
+ flags: '-d, --dry-run',
137
+ description: 'Ejecuta en modo simulacro sin alterar archivos',
138
+ }),
139
+ __metadata("design:type", Function),
140
+ __metadata("design:paramtypes", []),
141
+ __metadata("design:returntype", Boolean)
142
+ ], UpgradeCommand.prototype, "parseDryRun", null);
143
+ __decorate([
144
+ (0, nest_commander_1.Option)({
145
+ flags: '-f, --force',
146
+ description: 'Force upgrade even with breaking changes',
147
+ }),
148
+ __metadata("design:type", Function),
149
+ __metadata("design:paramtypes", []),
150
+ __metadata("design:returntype", Boolean)
151
+ ], UpgradeCommand.prototype, "parseForce", null);
152
+ __decorate([
153
+ (0, nest_commander_1.Option)({
154
+ flags: '-c, --core [path]',
155
+ description: 'Path to Evolith core repository',
156
+ }),
157
+ __metadata("design:type", Function),
158
+ __metadata("design:paramtypes", [String]),
159
+ __metadata("design:returntype", String)
160
+ ], UpgradeCommand.prototype, "parseCore", null);
161
+ __decorate([
162
+ (0, nest_commander_1.Option)({
163
+ flags: '--report',
164
+ description: 'Show detailed upgrade report',
165
+ }),
166
+ __metadata("design:type", Function),
167
+ __metadata("design:paramtypes", []),
168
+ __metadata("design:returntype", Boolean)
169
+ ], UpgradeCommand.prototype, "parseReport", null);
170
+ exports.UpgradeCommand = UpgradeCommand = __decorate([
171
+ (0, nest_commander_1.Command)({
172
+ name: 'upgrade',
173
+ description: 'Actualiza el repositorio satélite cuando el upstream Evolith recibe nuevas reglas',
174
+ }),
175
+ __metadata("design:paramtypes", [prompt_service_1.PromptService,
176
+ config_service_1.ConfigService])
177
+ ], UpgradeCommand);
178
+ //# sourceMappingURL=upgrade.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade.command.js","sourceRoot":"","sources":["../../../src/commands/init/upgrade.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAiD;AACjD,kDAA0B;AAC1B,kHAA0H;AAC1H,wEAA2E;AAC3E,gFAA4E;AAC5E,+EAA2E;AAapE,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,iCAAkB;IACpD,YACE,aAA4B,EAC5B,aAA6B;QAE7B,KAAK,CAAC,gBAAgB,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,WAAqB,EAAE,OAA+B;QACzE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QAExF,MAAM,OAAO,GAAG,IAAI,mDAAuB,EAAE,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,gCAAgC,CAAC,CAAC;QAC/D,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;QAEvD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC;YACpE,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;YAEjC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9B,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,iCAAiC,CAAC,CAAC;gBAClE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;gBACnD,OAAO;YACT,CAAC;YAED,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,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,CAAC;;;;iDAGD;yBA3JU,cAAc;IAJ1B,IAAA,wBAAO,EAAC;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,mFAAmF;KACjG,CAAC;qCAGiB,8BAAa;QACZ,8BAAa;GAHpB,cAAc,CA4J1B"}
@@ -0,0 +1,17 @@
1
+ import { BaseEvolithCommand } from "../../infrastructure/cli/base-command";
2
+ type McpTransport = "stdio" | "http";
3
+ interface McpServeOptions {
4
+ transport?: McpTransport;
5
+ port?: number;
6
+ apiKey?: string;
7
+ noConfirm?: boolean;
8
+ }
9
+ export declare class McpServeCommand extends BaseEvolithCommand {
10
+ constructor();
11
+ executeCommand(passedParam: string[], options?: McpServeOptions): Promise<void>;
12
+ parseTransport(val: string): McpTransport;
13
+ parsePort(val: string): number;
14
+ parseApiKey(val: string): string;
15
+ parseNoConfirm(): boolean;
16
+ }
17
+ export {};
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ var __metadata = (this && this.__metadata) || function (k, v) {
42
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
43
+ };
44
+ var __importDefault = (this && this.__importDefault) || function (mod) {
45
+ return (mod && mod.__esModule) ? mod : { "default": mod };
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.McpServeCommand = void 0;
49
+ const nest_commander_1 = require("nest-commander");
50
+ const chalk_1 = __importDefault(require("chalk"));
51
+ const base_command_1 = require("../../infrastructure/cli/base-command");
52
+ let McpServeCommand = class McpServeCommand extends base_command_1.BaseEvolithCommand {
53
+ constructor() {
54
+ super("McpServeCommand");
55
+ }
56
+ async executeCommand(passedParam, options) {
57
+ console.warn(chalk_1.default.yellow("⚠ Deprecation warning: smart-cli mcp will be removed in a future major version. " +
58
+ "Please migrate to the standalone @evolith/mcp-server package. " +
59
+ "Run `npx @evolith/mcp-server serve` or `evolith-mcp serve` instead."));
60
+ const action = passedParam[0] || "serve";
61
+ if (action === "serve") {
62
+ const transport = options?.transport || "stdio";
63
+ const port = options?.port || parseInt(process.env.PORT || "3000", 10);
64
+ const apiKey = options?.apiKey || process.env.EVOLITH_API_KEY;
65
+ const noConfirm = options?.noConfirm ?? false;
66
+ if (transport === "http") {
67
+ this.promptService.showIntro("Evolith SDK - MCP Server (HTTP)");
68
+ this.logger.log(`Starting MCP server over HTTP on port ${port}...`);
69
+ if (apiKey) {
70
+ this.promptService.showInfo(chalk_1.default.cyan("API key authentication enabled"));
71
+ }
72
+ if (noConfirm) {
73
+ this.promptService.showWarning(chalk_1.default.yellow("Confirmation prompts disabled (--no-confirm)"));
74
+ }
75
+ }
76
+ else {
77
+ this.promptService.showIntro("Evolith SDK - MCP Server (stdio)");
78
+ this.logger.log("Starting MCP server over stdio...");
79
+ if (noConfirm) {
80
+ this.promptService.showWarning(chalk_1.default.yellow("Confirmation prompts disabled (--no-confirm)"));
81
+ }
82
+ }
83
+ const { startMcpServer } = await Promise.resolve().then(() => __importStar(require("@evolith/mcp-server")));
84
+ await startMcpServer({ transport, port, apiKey });
85
+ return;
86
+ }
87
+ else if (action === "version") {
88
+ this.promptService.showInfo("Evolith MCP Server v1.0.0");
89
+ return;
90
+ }
91
+ else {
92
+ this.logger.warn(`Unknown MCP action: ${action}`);
93
+ this.promptService.showError(`Unknown action: ${action}. Use 'evolith mcp serve' to start the server.`);
94
+ }
95
+ }
96
+ parseTransport(val) {
97
+ return val;
98
+ }
99
+ parsePort(val) {
100
+ return parseInt(val, 10) || 3000;
101
+ }
102
+ parseApiKey(val) {
103
+ return val;
104
+ }
105
+ parseNoConfirm() {
106
+ return true;
107
+ }
108
+ };
109
+ exports.McpServeCommand = McpServeCommand;
110
+ __decorate([
111
+ (0, nest_commander_1.Option)({
112
+ flags: "-t, --transport <stdio|http>",
113
+ description: "Transport type: stdio (default) or http",
114
+ }),
115
+ __metadata("design:type", Function),
116
+ __metadata("design:paramtypes", [String]),
117
+ __metadata("design:returntype", String)
118
+ ], McpServeCommand.prototype, "parseTransport", null);
119
+ __decorate([
120
+ (0, nest_commander_1.Option)({
121
+ flags: "-p, --port <number>",
122
+ description: "HTTP server port (default: 3000)",
123
+ }),
124
+ __metadata("design:type", Function),
125
+ __metadata("design:paramtypes", [String]),
126
+ __metadata("design:returntype", Number)
127
+ ], McpServeCommand.prototype, "parsePort", null);
128
+ __decorate([
129
+ (0, nest_commander_1.Option)({
130
+ flags: "--api-key <key>",
131
+ description: "API key for authentication",
132
+ }),
133
+ __metadata("design:type", Function),
134
+ __metadata("design:paramtypes", [String]),
135
+ __metadata("design:returntype", String)
136
+ ], McpServeCommand.prototype, "parseApiKey", null);
137
+ __decorate([
138
+ (0, nest_commander_1.Option)({
139
+ flags: "--no-confirm",
140
+ description: "Skip interactive confirmation prompts for mutative operations (CI/automation mode)",
141
+ }),
142
+ __metadata("design:type", Function),
143
+ __metadata("design:paramtypes", []),
144
+ __metadata("design:returntype", Boolean)
145
+ ], McpServeCommand.prototype, "parseNoConfirm", null);
146
+ exports.McpServeCommand = McpServeCommand = __decorate([
147
+ (0, nest_commander_1.Command)({
148
+ name: "mcp",
149
+ description: "Start Evolith MCP server for AI agent integration",
150
+ }),
151
+ __metadata("design:paramtypes", [])
152
+ ], McpServeCommand);
153
+ //# sourceMappingURL=mcp-serve.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-serve.command.js","sourceRoot":"","sources":["../../../src/commands/mcp/mcp-serve.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAiD;AACjD,kDAA0B;AAC1B,wEAA2E;AAepE,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,iCAAkB;IACrD;QACE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,WAAqB,EACrB,OAAyB;QAGzB,OAAO,CAAC,IAAI,CACV,eAAK,CAAC,MAAM,CACV,kFAAkF;YAChF,gEAAgE;YAChE,qEAAqE,CACxE,CACF,CAAC;QAEF,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC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"}
@@ -0,0 +1,30 @@
1
+ import { ProposePhaseAdvanceUseCase } from '@evolith/core-domain/application/use-cases/propose-phase-advance.use-case';
2
+ import { BaseEvolithCommand } from '../../infrastructure/cli/base-command';
3
+ import { PromptService } from '../../infrastructure/prompts/prompt.service';
4
+ interface PhaseAdvanceCommandOptions {
5
+ from?: string;
6
+ to?: string;
7
+ project?: string;
8
+ core?: string;
9
+ format?: string;
10
+ evaluatedBy?: string;
11
+ initiative?: string;
12
+ tenant?: string;
13
+ webhookUrl?: string;
14
+ }
15
+ export declare class PhaseAdvanceCommand extends BaseEvolithCommand {
16
+ private readonly useCase;
17
+ constructor(useCase: ProposePhaseAdvanceUseCase, promptService: PromptService);
18
+ executeCommand(inputs: string[], options?: PhaseAdvanceCommandOptions): Promise<void>;
19
+ private printHuman;
20
+ parseFrom(val: string): string;
21
+ parseTo(val: string): string;
22
+ parseProject(val: string): string;
23
+ parseCore(val: string): string;
24
+ parseFormat(val: string): string;
25
+ parseEvaluatedBy(val: string): string;
26
+ parseInitiative(val: string): string;
27
+ parseTenant(val: string): string;
28
+ parseWebhookUrl(val: string): string;
29
+ }
30
+ export {};