@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,103 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.AliasService = void 0;
46
+ const fs = __importStar(require("fs"));
47
+ const path = __importStar(require("path"));
48
+ const common_1 = require("@nestjs/common");
49
+ let AliasService = class AliasService {
50
+ constructor() {
51
+ this.aliases = {};
52
+ const home = process.env.HOME || process.env.USERPROFILE || '';
53
+ const dir = path.join(home, '.evolith');
54
+ if (!fs.existsSync(dir)) {
55
+ fs.mkdirSync(dir, { recursive: true });
56
+ }
57
+ this.aliasFile = path.join(dir, 'aliases.json');
58
+ this.load();
59
+ }
60
+ load() {
61
+ if (fs.existsSync(this.aliasFile)) {
62
+ try {
63
+ const data = fs.readFileSync(this.aliasFile, 'utf-8');
64
+ this.aliases = JSON.parse(data);
65
+ }
66
+ catch {
67
+ this.aliases = {};
68
+ }
69
+ }
70
+ }
71
+ save() {
72
+ fs.writeFileSync(this.aliasFile, JSON.stringify(this.aliases, null, 2), 'utf-8');
73
+ }
74
+ getAll() {
75
+ return { ...this.aliases };
76
+ }
77
+ add(alias, command) {
78
+ if (this.aliases[alias]) {
79
+ throw new Error(`Alias \"${alias}\" already exists`);
80
+ }
81
+ if (Object.keys(this.aliases).includes(command)) {
82
+ throw new Error(`Cannot alias to an existing command name \"${command}\"`);
83
+ }
84
+ this.aliases[alias] = command;
85
+ this.save();
86
+ }
87
+ remove(alias) {
88
+ if (!this.aliases[alias]) {
89
+ throw new Error(`Alias \"${alias}\" not found`);
90
+ }
91
+ delete this.aliases[alias];
92
+ this.save();
93
+ }
94
+ resolve(aliasOrCommand) {
95
+ return this.aliases[aliasOrCommand] || aliasOrCommand;
96
+ }
97
+ };
98
+ exports.AliasService = AliasService;
99
+ exports.AliasService = AliasService = __decorate([
100
+ (0, common_1.Injectable)(),
101
+ __metadata("design:paramtypes", [])
102
+ ], AliasService);
103
+ //# sourceMappingURL=alias.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias.service.js","sourceRoot":"","sources":["../../src/config/alias.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;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EAAE,CAAC;IAC7B,CAAC;IAED,GAAG,CAAC,KAAa,EAAE,OAAe;QAChC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,8CAA8C,OAAO,IAAI,CAAC,CAAC;QAC7E,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,WAAW,KAAK,cAAc,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,OAAO,CAAC,cAAsB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,cAAc,CAAC;IACxD,CAAC;CACF,CAAA;AAvDY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;;GACA,YAAY,CAuDxB"}
@@ -0,0 +1,16 @@
1
+ export type ContributionType = 'ruleset' | 'topology' | 'adr' | 'template';
2
+ export interface Contribution {
3
+ type: ContributionType;
4
+ path: string;
5
+ author: string;
6
+ description: string;
7
+ }
8
+ export interface ValidationResult {
9
+ valid: boolean;
10
+ errors: string[];
11
+ warnings: string[];
12
+ }
13
+ export declare class ContributionValidator {
14
+ validate(contribution: Contribution): ValidationResult;
15
+ validateBatch(contributions: Contribution[]): Map<string, ValidationResult>;
16
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContributionValidator = void 0;
4
+ class ContributionValidator {
5
+ validate(contribution) {
6
+ const errors = [];
7
+ const warnings = [];
8
+ if (!contribution.path || contribution.path.trim().length === 0) {
9
+ errors.push('Contribution path is required');
10
+ }
11
+ if (!contribution.author || contribution.author.trim().length === 0) {
12
+ errors.push('Contribution author is required');
13
+ }
14
+ if (!contribution.description || contribution.description.trim().length === 0) {
15
+ warnings.push('Contribution description is empty — recommended for review clarity');
16
+ }
17
+ if (contribution.type === 'ruleset' && !contribution.path.endsWith('.rules.json')) {
18
+ errors.push('Ruleset contributions must end with .rules.json');
19
+ }
20
+ if (contribution.type === 'adr' && !contribution.path.includes('/adrs/')) {
21
+ errors.push('ADR contributions must be placed under a /adrs/ directory');
22
+ }
23
+ return { valid: errors.length === 0, errors, warnings };
24
+ }
25
+ validateBatch(contributions) {
26
+ const results = new Map();
27
+ for (const contrib of contributions) {
28
+ results.set(contrib.path, this.validate(contrib));
29
+ }
30
+ return results;
31
+ }
32
+ }
33
+ exports.ContributionValidator = ContributionValidator;
34
+ //# sourceMappingURL=contribution-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contribution-validator.js","sourceRoot":"","sources":["../../src/contributions/contribution-validator.ts"],"names":[],"mappings":";;;AAeA,MAAa,qBAAqB;IAChC,QAAQ,CAAC,YAA0B;QACjC,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,IAAI,CAAC,YAAY,CAAC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChE,MAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QAC/C,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,MAAM,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpE,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QACjD,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,WAAW,IAAI,YAAY,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9E,QAAQ,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;QACtF,CAAC;QAED,IAAI,YAAY,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YAClF,MAAM,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;QACjE,CAAC;QAED,IAAI,YAAY,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzE,MAAM,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;QAC3E,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC1D,CAAC;IAED,aAAa,CAAC,aAA6B;QACzC,MAAM,OAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;QACpD,KAAK,MAAM,OAAO,IAAI,aAAa,EAAE,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAnCD,sDAmCC"}
@@ -0,0 +1 @@
1
+ export { ContributionValidator, Contribution, ContributionType, ValidationResult } from './contribution-validator';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContributionValidator = void 0;
4
+ var contribution_validator_1 = require("./contribution-validator");
5
+ Object.defineProperty(exports, "ContributionValidator", { enumerable: true, get: function () { return contribution_validator_1.ContributionValidator; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contributions/index.ts"],"names":[],"mappings":";;;AAAA,mEAAmH;AAA1G,+HAAA,qBAAqB,OAAA"}
@@ -0,0 +1,30 @@
1
+ import { IFileSystem } from '@evolith/core-domain/domain/interfaces';
2
+ export interface AgentInfo {
3
+ name: string;
4
+ version: string;
5
+ template: string;
6
+ rulesetFiles: string[];
7
+ installedAt: string;
8
+ description?: string;
9
+ adrs?: string[];
10
+ rulesets?: string[];
11
+ lastValidated?: string;
12
+ }
13
+ export interface AgentRegistry {
14
+ agents: AgentInfo[];
15
+ lastUpdated: string;
16
+ }
17
+ export declare class AgentRegistryService {
18
+ private readonly fs;
19
+ private readonly registryFileName;
20
+ private readonly agentsDirName;
21
+ constructor(fs: IFileSystem);
22
+ discover(repoPath: string): Promise<AgentInfo[]>;
23
+ installAgent(repoPath: string, agentInfo: AgentInfo, rulesetContent: Record<string, unknown>): Promise<void>;
24
+ unregister(repoPath: string, agentName: string): Promise<boolean>;
25
+ getAgent(repoPath: string, agentName: string): Promise<AgentInfo | undefined>;
26
+ updateAgent(repoPath: string, agentName: string, config: AgentInfo, rulesetContent: Record<string, unknown>): Promise<boolean>;
27
+ updateLastValidated(repoPath: string, agentName: string): Promise<void>;
28
+ exportManifest(repoPath: string): Promise<string>;
29
+ private loadOrCreateRegistry;
30
+ }
@@ -0,0 +1,175 @@
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 __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AgentRegistryService = void 0;
37
+ const path = __importStar(require("path"));
38
+ class AgentRegistryService {
39
+ constructor(fs) {
40
+ this.registryFileName = 'agents-registry.json';
41
+ this.agentsDirName = 'rulesets/agents';
42
+ this.fs = fs;
43
+ }
44
+ async discover(repoPath) {
45
+ const agentsPath = path.join(repoPath, this.agentsDirName);
46
+ if (!(await this.fs.exists(agentsPath))) {
47
+ return [];
48
+ }
49
+ const registryPath = path.join(agentsPath, this.registryFileName);
50
+ if (await this.fs.exists(registryPath)) {
51
+ const registry = await this.fs.readJson(registryPath);
52
+ return registry.agents || [];
53
+ }
54
+ const entries = await this.fs.readdirNames(agentsPath);
55
+ const agents = [];
56
+ for (const entry of entries) {
57
+ const agentPath = path.join(agentsPath, entry);
58
+ const stat = await this.fs.stat(agentPath);
59
+ if (stat.isDirectory()) {
60
+ const agentConfigPath = path.join(agentPath, 'agent.config.json');
61
+ if (await this.fs.exists(agentConfigPath)) {
62
+ const agentData = await this.fs.readJson(agentConfigPath);
63
+ agents.push(agentData);
64
+ }
65
+ }
66
+ }
67
+ return agents;
68
+ }
69
+ async installAgent(repoPath, agentInfo, rulesetContent) {
70
+ const agentsPath = path.join(repoPath, this.agentsDirName);
71
+ await this.fs.ensureDir(agentsPath);
72
+ const agentPath = path.join(agentsPath, agentInfo.name);
73
+ await this.fs.ensureDir(agentPath);
74
+ const configPath = path.join(agentPath, 'agent.config.json');
75
+ const rulesetPath = path.join(agentPath, 'agent.rules.json');
76
+ await this.fs.writeJson(configPath, agentInfo);
77
+ await this.fs.writeJson(rulesetPath, rulesetContent);
78
+ const registry = await this.loadOrCreateRegistry(agentsPath);
79
+ const existingIdx = registry.agents.findIndex(a => a.name === agentInfo.name);
80
+ if (existingIdx >= 0) {
81
+ registry.agents[existingIdx] = agentInfo;
82
+ }
83
+ else {
84
+ registry.agents.push(agentInfo);
85
+ }
86
+ registry.lastUpdated = new Date().toISOString();
87
+ await this.fs.writeJson(path.join(agentsPath, this.registryFileName), registry);
88
+ }
89
+ async unregister(repoPath, agentName) {
90
+ const agentsPath = path.join(repoPath, this.agentsDirName);
91
+ const registryPath = path.join(agentsPath, this.registryFileName);
92
+ if (!(await this.fs.exists(registryPath))) {
93
+ return false;
94
+ }
95
+ const registry = await this.fs.readJson(registryPath);
96
+ const idx = registry.agents.findIndex(a => a.name === agentName);
97
+ if (idx < 0) {
98
+ return false;
99
+ }
100
+ registry.agents.splice(idx, 1);
101
+ registry.lastUpdated = new Date().toISOString();
102
+ await this.fs.writeJson(registryPath, registry);
103
+ const agentPath = path.join(agentsPath, agentName);
104
+ if (await this.fs.exists(agentPath)) {
105
+ await this.fs.remove(agentPath);
106
+ }
107
+ return true;
108
+ }
109
+ async getAgent(repoPath, agentName) {
110
+ const agents = await this.discover(repoPath);
111
+ return agents.find(a => a.name === agentName);
112
+ }
113
+ async updateAgent(repoPath, agentName, config, rulesetContent) {
114
+ const agentsPath = path.join(repoPath, this.agentsDirName);
115
+ const agentPath = path.join(agentsPath, agentName);
116
+ if (!(await this.fs.exists(agentPath))) {
117
+ return false;
118
+ }
119
+ await this.fs.writeJson(path.join(agentPath, 'agent.config.json'), config);
120
+ await this.fs.writeJson(path.join(agentPath, 'agent.rules.json'), rulesetContent);
121
+ const registryPath = path.join(agentsPath, this.registryFileName);
122
+ if (await this.fs.exists(registryPath)) {
123
+ const registry = await this.fs.readJson(registryPath);
124
+ const idx = registry.agents.findIndex(a => a.name === agentName);
125
+ if (idx >= 0) {
126
+ registry.agents[idx] = config;
127
+ registry.lastUpdated = new Date().toISOString();
128
+ await this.fs.writeJson(registryPath, registry);
129
+ }
130
+ }
131
+ return true;
132
+ }
133
+ async updateLastValidated(repoPath, agentName) {
134
+ const agentsPath = path.join(repoPath, this.agentsDirName);
135
+ const registryPath = path.join(agentsPath, this.registryFileName);
136
+ if (!(await this.fs.exists(registryPath))) {
137
+ return;
138
+ }
139
+ const registry = await this.fs.readJson(registryPath);
140
+ const agent = registry.agents.find(a => a.name === agentName);
141
+ if (agent) {
142
+ agent.lastValidated = new Date().toISOString();
143
+ registry.lastUpdated = new Date().toISOString();
144
+ await this.fs.writeJson(registryPath, registry);
145
+ }
146
+ }
147
+ async exportManifest(repoPath) {
148
+ const agents = await this.discover(repoPath);
149
+ return JSON.stringify({
150
+ version: '1.0',
151
+ exportedAt: new Date().toISOString(),
152
+ agentCount: agents.length,
153
+ agents: agents.map(a => ({
154
+ name: a.name,
155
+ version: a.version,
156
+ template: a.template,
157
+ rulesets: a.rulesetFiles,
158
+ installedAt: a.installedAt,
159
+ status: a.lastValidated ? 'validated' : 'pending',
160
+ })),
161
+ }, null, 2);
162
+ }
163
+ async loadOrCreateRegistry(agentsPath) {
164
+ const registryPath = path.join(agentsPath, this.registryFileName);
165
+ if (await this.fs.exists(registryPath)) {
166
+ return await this.fs.readJson(registryPath);
167
+ }
168
+ return {
169
+ agents: [],
170
+ lastUpdated: new Date().toISOString(),
171
+ };
172
+ }
173
+ }
174
+ exports.AgentRegistryService = AgentRegistryService;
175
+ //# sourceMappingURL=agent-registry.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-registry.service.js","sourceRoot":"","sources":["../../../src/infrastructure/adapters/agent-registry.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAoB7B,MAAa,oBAAoB;IAK/B,YAAY,EAAe;QAHV,qBAAgB,GAAG,sBAAsB,CAAC;QAC1C,kBAAa,GAAG,iBAAiB,CAAC;QAGjD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB;QAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAE3D,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;YACxC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAElE,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;YACvC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAkB,CAAC;YACvE,OAAO,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC;QAC/B,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACvD,MAAM,MAAM,GAAgB,EAAE,CAAC;QAE/B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAC/C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,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AgB,CAAC,CAAC;QAElE,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;YACvC,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAkB,CAAC;QAC/D,CAAC;QAED,OAAO;YACL,MAAM,EAAE,EAAE;YACV,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACtC,CAAC;IACJ,CAAC;CACF;AA1KD,oDA0KC"}
@@ -0,0 +1,19 @@
1
+ import { WorkspaceManagerStrategy } from '@evolith/core-domain/application/architecture/workspace-manager.strategy';
2
+ import { ICommandExecutor } from '@evolith/core-domain/domain/interfaces';
3
+ import { PromptService } from '../prompts/prompt.service';
4
+ export declare class NxWorkspaceStrategy implements WorkspaceManagerStrategy {
5
+ private readonly commandExecutor;
6
+ private readonly promptService;
7
+ private frontendFramework;
8
+ private dryRun;
9
+ constructor(commandExecutor: ICommandExecutor, promptService: PromptService);
10
+ setDryRun(dryRun: boolean): void;
11
+ private getTargetDir;
12
+ private runNx;
13
+ private runNpm;
14
+ installDependencies(frontendFramework: string, orm: string): Promise<void>;
15
+ generateStandardWebApp(name: string, framework: string): Promise<void>;
16
+ generateHostApp(name: string, remotes: string[], framework: string): Promise<void>;
17
+ generateApiApp(name: string): Promise<void>;
18
+ generateLibrary(name: string, type: 'domain' | 'shell' | 'shared'): Promise<void>;
19
+ }
@@ -0,0 +1,125 @@
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 __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.NxWorkspaceStrategy = void 0;
40
+ const chalk_1 = __importDefault(require("chalk"));
41
+ const path = __importStar(require("path"));
42
+ const process = __importStar(require("process"));
43
+ const MFE_CAPABLE_FRAMEWORKS = new Set(['react', 'angular']);
44
+ class NxWorkspaceStrategy {
45
+ constructor(commandExecutor, promptService) {
46
+ this.commandExecutor = commandExecutor;
47
+ this.promptService = promptService;
48
+ this.frontendFramework = 'react';
49
+ this.dryRun = false;
50
+ }
51
+ setDryRun(dryRun) {
52
+ this.dryRun = dryRun;
53
+ }
54
+ getTargetDir() {
55
+ const currentDir = process.cwd();
56
+ return path.join(currentDir, 'src');
57
+ }
58
+ async runNx(command) {
59
+ const targetDir = this.getTargetDir();
60
+ if (this.dryRun) {
61
+ this.promptService.showInfo(chalk_1.default.yellow(`[DRY-RUN] Would execute in ${targetDir}: npx nx ${command}`));
62
+ return;
63
+ }
64
+ this.promptService.showInfo(chalk_1.default.gray(`> Executing in ${targetDir}: npx nx ${command}`));
65
+ await this.commandExecutor.executeOrThrow(`npx nx ${command} --no-interactive`, targetDir);
66
+ }
67
+ async runNpm(command) {
68
+ const targetDir = this.getTargetDir();
69
+ if (this.dryRun) {
70
+ this.promptService.showInfo(chalk_1.default.yellow(`[DRY-RUN] Would execute in ${targetDir}: npm ${command}`));
71
+ return;
72
+ }
73
+ this.promptService.showInfo(chalk_1.default.gray(`> Executing in ${targetDir}: npm ${command}`));
74
+ await this.commandExecutor.executeOrThrow(`npm ${command} --legacy-peer-deps`, targetDir);
75
+ }
76
+ async installDependencies(frontendFramework, orm) {
77
+ const fw = frontendFramework.toLowerCase();
78
+ this.frontendFramework = fw;
79
+ this.promptService.showInfo(chalk_1.default.cyan(`\nšŸ“¦ Installing Nx Plugins for ${fw.toUpperCase()} and NestJS...`));
80
+ await this.runNpm(`install -D @nx/nest @nx/${fw} @nx/webpack`);
81
+ if (orm.toLowerCase() === 'prisma') {
82
+ await this.runNpm(`install -D prisma @prisma/client`);
83
+ }
84
+ else if (orm.toLowerCase() === 'typeorm') {
85
+ await this.runNpm(`install -D typeorm`);
86
+ }
87
+ }
88
+ async generateStandardWebApp(name, framework) {
89
+ const fw = framework.toLowerCase();
90
+ this.frontendFramework = fw;
91
+ this.promptService.showInfo(chalk_1.default.cyan(`\nšŸ—ļø Generating Standard Web App (Phase 1) [${name}] (${fw.toUpperCase()})...`));
92
+ await this.runNx(`g @nx/${fw}:app --name=${name} --directory=apps/${name}`);
93
+ }
94
+ async generateHostApp(name, remotes, framework) {
95
+ const fw = framework.toLowerCase();
96
+ this.frontendFramework = fw;
97
+ this.promptService.showInfo(chalk_1.default.cyan(`\nšŸ—ļø Generating MFE Host App [${name}] with Remotes [${remotes.join(', ')}] (${fw.toUpperCase()})...`));
98
+ if (!MFE_CAPABLE_FRAMEWORKS.has(fw)) {
99
+ this.promptService.showInfo(chalk_1.default.yellow(`⚠ @nx/${fw} does not provide a native Module Federation :host generator.\n` +
100
+ ` Generating a standard ${fw.toUpperCase()} app instead. Configure MFE manually\n` +
101
+ ` (e.g. @originjs/vite-plugin-federation for Vue).`));
102
+ await this.runNx(`g @nx/${fw}:app --name=${name} --directory=apps/${name}`);
103
+ return;
104
+ }
105
+ const remotesFlag = remotes.length > 0 ? `--remotes=${remotes.join(',')}` : '';
106
+ await this.runNx(`g @nx/${fw}:host --name=${name} ${remotesFlag} --directory=apps/${name}`);
107
+ }
108
+ async generateApiApp(name) {
109
+ this.promptService.showInfo(chalk_1.default.cyan(`\nāš™ļø Generating NestJS API App [${name}]...`));
110
+ await this.runNx(`g @nx/nest:app --name=${name} --directory=apps/${name}`);
111
+ }
112
+ async generateLibrary(name, type) {
113
+ this.promptService.showInfo(chalk_1.default.cyan(`\nšŸ“š Generating Library [${type}/${name}]...`));
114
+ if (type === 'shared' && name.includes('ui')) {
115
+ const fw = this.frontendFramework;
116
+ this.promptService.showInfo(chalk_1.default.gray(` Using @nx/${fw}:library for shared UI library.`));
117
+ await this.runNx(`g @nx/${fw}:library --name=${name} --directory=libs/${type}/${name}`);
118
+ }
119
+ else {
120
+ await this.runNx(`g @nx/nest:library --name=${name} --directory=libs/${type}/${name}`);
121
+ }
122
+ }
123
+ }
124
+ exports.NxWorkspaceStrategy = NxWorkspaceStrategy;
125
+ //# sourceMappingURL=nx-workspace.strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nx-workspace.strategy.js","sourceRoot":"","sources":["../../../src/infrastructure/architecture/nx-workspace.strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,kDAA0B;AAC1B,2CAA6B;AAC7B,iDAAmC;AAQnC,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAE7D,MAAa,mBAAmB;IAK9B,YACmB,eAAiC,EACjC,aAA4B;QAD5B,oBAAe,GAAf,eAAe,CAAkB;QACjC,kBAAa,GAAb,aAAa,CAAe;QALvC,s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I,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAG7C,MAAM,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC;YAClC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,eAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,iCAAiC,CAAC,CAAC,CAAC;YAC7F,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,mBAAmB,IAAI,qBAAqB,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;QAC1F,CAAC;aAAM,CAAC;YAEN,MAAM,IAAI,CAAC,KAAK,CAAC,6BAA6B,IAAI,qBAAqB,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;CACF;AArGD,kDAqGC"}
@@ -0,0 +1,17 @@
1
+ export type TopologyDimension = 'progressive-axis' | 'execution' | 'integration' | 'data' | 'ai';
2
+ export interface TopologyDescriptor {
3
+ id: string;
4
+ name: string;
5
+ dimension: TopologyDimension;
6
+ }
7
+ export declare const CANONICAL_TOPOLOGIES: readonly TopologyDescriptor[];
8
+ export declare const TOPOLOGY_IDS: readonly string[];
9
+ export declare const PROGRESSIVE_AXIS: readonly string[];
10
+ export declare const LEVEL_TO_TOPOLOGY: Readonly<Record<string, string>>;
11
+ export declare const TOPOLOGY_TO_LEVEL: Readonly<Record<string, 'F1' | 'F2' | 'F3'>>;
12
+ export declare function isCanonicalTopology(value: string): boolean;
13
+ export declare function isLegacyLevel(value: string): boolean;
14
+ export declare function normalizeTopology(value: string): string | null;
15
+ export declare function toLegacyLevel(value: string): 'F1' | 'F2' | 'F3' | null;
16
+ export declare function topologyHelpList(): string;
17
+ export declare function toProgressivePhase(value: string): '1' | '2' | '3' | null;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TOPOLOGY_TO_LEVEL = exports.LEVEL_TO_TOPOLOGY = exports.PROGRESSIVE_AXIS = exports.TOPOLOGY_IDS = exports.CANONICAL_TOPOLOGIES = void 0;
4
+ exports.isCanonicalTopology = isCanonicalTopology;
5
+ exports.isLegacyLevel = isLegacyLevel;
6
+ exports.normalizeTopology = normalizeTopology;
7
+ exports.toLegacyLevel = toLegacyLevel;
8
+ exports.topologyHelpList = topologyHelpList;
9
+ exports.toProgressivePhase = toProgressivePhase;
10
+ exports.CANONICAL_TOPOLOGIES = [
11
+ { id: 'modular-monolith', name: 'Modular Monolith', dimension: 'progressive-axis' },
12
+ { id: 'distributed-modules', name: 'Distributed Modules', dimension: 'progressive-axis' },
13
+ { id: 'microservices', name: 'Microservices', dimension: 'progressive-axis' },
14
+ { id: 'serverless', name: 'Serverless', dimension: 'execution' },
15
+ { id: 'edge-computing', name: 'Edge Computing', dimension: 'execution' },
16
+ { id: 'event-driven', name: 'Event-Driven', dimension: 'integration' },
17
+ { id: 'data-mesh', name: 'Data Mesh', dimension: 'data' },
18
+ { id: 'agentic-ai', name: 'Agentic AI', dimension: 'ai' },
19
+ ];
20
+ exports.TOPOLOGY_IDS = exports.CANONICAL_TOPOLOGIES.map((t) => t.id);
21
+ exports.PROGRESSIVE_AXIS = [
22
+ 'modular-monolith',
23
+ 'distributed-modules',
24
+ 'microservices',
25
+ ];
26
+ exports.LEVEL_TO_TOPOLOGY = {
27
+ F1: 'modular-monolith',
28
+ F2: 'distributed-modules',
29
+ F3: 'microservices',
30
+ };
31
+ exports.TOPOLOGY_TO_LEVEL = {
32
+ 'modular-monolith': 'F1',
33
+ 'distributed-modules': 'F2',
34
+ 'microservices': 'F3',
35
+ };
36
+ const LEVEL_PATTERN = /^F[1-3]$/i;
37
+ function isCanonicalTopology(value) {
38
+ return exports.TOPOLOGY_IDS.includes(value);
39
+ }
40
+ function isLegacyLevel(value) {
41
+ return LEVEL_PATTERN.test(value);
42
+ }
43
+ function normalizeTopology(value) {
44
+ const trimmed = value.trim();
45
+ if (isCanonicalTopology(trimmed))
46
+ return trimmed;
47
+ if (isLegacyLevel(trimmed))
48
+ return exports.LEVEL_TO_TOPOLOGY[trimmed.toUpperCase()];
49
+ return null;
50
+ }
51
+ function toLegacyLevel(value) {
52
+ const trimmed = value.trim();
53
+ if (isLegacyLevel(trimmed))
54
+ return trimmed.toUpperCase();
55
+ if (exports.TOPOLOGY_TO_LEVEL[trimmed])
56
+ return exports.TOPOLOGY_TO_LEVEL[trimmed];
57
+ return null;
58
+ }
59
+ function topologyHelpList() {
60
+ return exports.TOPOLOGY_IDS.join(', ');
61
+ }
62
+ function toProgressivePhase(value) {
63
+ const trimmed = value.trim();
64
+ if (trimmed === '1' || trimmed === '2' || trimmed === '3')
65
+ return trimmed;
66
+ const level = toLegacyLevel(trimmed);
67
+ return level ? level.slice(1) : null;
68
+ }
69
+ //# sourceMappingURL=topology-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topology-catalog.js","sourceRoot":"","sources":["../../../src/infrastructure/architecture/topology-catalog.ts"],"names":[],"mappings":";;;AAoEA,kDAEC;AAGD,sCAEC;AAOD,8CAKC;AAOD,sCAKC;AAGD,4CAEC;AAOD,gDAKC;AAxFY,QAAA,oBAAoB,GAAkC;IACjE,EAAE,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,kBAAkB,EAAE;IACnF,EAAE,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,qBAAqB,EAAE,SAAS,EAAE,kBAAkB,EAAE;IACzF,EAAE,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,kBAAkB,EAAE;IAC7E,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE;IAChE,EAAE,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE;IACxE,EAAE,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,SAA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