awc-zns-mtd 2.9.0 → 2.10.3

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 (38) hide show
  1. package/.github/workflows/ci.yml +148 -0
  2. package/.husky/pre-commit +2 -0
  3. package/.prettierignore +31 -0
  4. package/.prettierrc +13 -0
  5. package/IMPLEMENTATION_SUMMARY.md +410 -0
  6. package/PHASE_2_SUMMARY.md +289 -0
  7. package/README.md +114 -47
  8. package/SECURITY.md +58 -0
  9. package/eslint.config.js +70 -0
  10. package/jest.config.js +49 -0
  11. package/package.json +40 -14
  12. package/src/modules/custom-agents/cli/awc-agent.js +505 -372
  13. package/test/integration/cli/cli-commands.integration.test.js +105 -0
  14. package/test/setup.js +22 -0
  15. package/test/unit/commands/version.test.js +39 -0
  16. package/test/unit/config/config-manager.test.js +147 -0
  17. package/test/unit/utils/file-utils.test.js +177 -0
  18. package/test/unit/utils/validators.test.js +57 -0
  19. package/tools/cli/commands/init.js +556 -513
  20. package/tools/cli/commands/new-project.js +680 -659
  21. package/tools/cli/commands/validate.js +13 -13
  22. package/tools/cli/commands/version.js +5 -3
  23. package/tools/cli/utils/console-logger.js +39 -15
  24. package/tools/cli/utils/logger.js +176 -0
  25. package/tools/cli/utils/project-analyzer.js +33 -16
  26. package/tools/cli/utils/validators.js +144 -0
  27. package/tools/cli/utils/version.js +6 -2
  28. package/tools/config/config-manager.js +243 -0
  29. package/tools/version/changelog-manager.js +301 -288
  30. package/tools/version/update-checker.js +32 -32
  31. package/tools/version/version-bump.js +89 -90
  32. package/tools/version/version-manager.js +17 -7
  33. package/tsconfig.json +47 -0
  34. package/types/index.d.ts +206 -0
  35. package/tools/cli/commands/init-old.js +0 -147
  36. package/tools/cli/commands/new-project-broken.js +0 -1302
  37. package/tools/cli/commands/new-project-old.js +0 -1302
  38. package/tools/cli/commands/new-project.js.backup +0 -1302
@@ -0,0 +1,243 @@
1
+ /**
2
+ * ConfigManager - Gestión centralizada de configuración
3
+ * Centraliza paths, constantes y configuración del framework
4
+ */
5
+
6
+ const path = require('path');
7
+ const os = require('os');
8
+
9
+ class ConfigManager {
10
+ /**
11
+ * Directorios principales
12
+ */
13
+ static get AWC_DIR() {
14
+ return '.awc';
15
+ }
16
+
17
+ static get AGENTS_DIR() {
18
+ return path.join(this.AWC_DIR, 'agents');
19
+ }
20
+
21
+ static get WORKFLOWS_DIR() {
22
+ return path.join(this.AWC_DIR, 'workflows');
23
+ }
24
+
25
+ static get TEMPLATES_DIR() {
26
+ return path.join(this.AWC_DIR, 'templates');
27
+ }
28
+
29
+ static get RESOURCES_DIR() {
30
+ return path.join(this.AWC_DIR, 'resources');
31
+ }
32
+
33
+ static get LOGS_DIR() {
34
+ return path.join(this.AWC_DIR, 'logs');
35
+ }
36
+
37
+ static get CONFIG_FILE() {
38
+ return path.join(this.AWC_DIR, 'config.yaml');
39
+ }
40
+
41
+ /**
42
+ * Módulos del framework
43
+ */
44
+ static get CORE_MODULE_PATH() {
45
+ return 'src/modules/awc-zns-mtd';
46
+ }
47
+
48
+ static get CUSTOM_MODULE_PATH() {
49
+ return 'src/modules/custom-agents';
50
+ }
51
+
52
+ /**
53
+ * Configuración de agentes
54
+ */
55
+ static get CORE_AGENTS() {
56
+ return ['zen-master', 'architect-senior', 'developer-pro', 'qa-specialist'];
57
+ }
58
+
59
+ static get AGENT_CATEGORIES() {
60
+ return [
61
+ 'core',
62
+ 'development',
63
+ 'qa_testing',
64
+ 'product_strategy',
65
+ 'support_maintenance',
66
+ 'frontend',
67
+ 'backend',
68
+ 'infrastructure',
69
+ 'architecture',
70
+ 'quality',
71
+ 'business',
72
+ 'ai',
73
+ 'documentation'
74
+ ];
75
+ }
76
+
77
+ /**
78
+ * Configuración de workflows
79
+ */
80
+ static get WORKFLOW_TYPES() {
81
+ return [
82
+ 'quick',
83
+ 'standard',
84
+ 'enterprise',
85
+ 'comercial-flow',
86
+ 'inception-flow',
87
+ 'development-flow',
88
+ 'qa-flow',
89
+ 'deployment-flow',
90
+ 'support-flow'
91
+ ];
92
+ }
93
+
94
+ /**
95
+ * Tipos de proyecto
96
+ */
97
+ static get PROJECT_TYPES() {
98
+ return ['code-audit', 'greenfield', 'migration', 'maintenance', 'mobile', 'api', 'enterprise'];
99
+ }
100
+
101
+ /**
102
+ * Tecnologías soportadas
103
+ */
104
+ static get SUPPORTED_TECHNOLOGIES() {
105
+ return [
106
+ 'java',
107
+ 'dotnet',
108
+ 'python',
109
+ 'php',
110
+ 'nodejs',
111
+ 'react',
112
+ 'angular',
113
+ 'vue',
114
+ 'react-native',
115
+ 'sql',
116
+ 'nosql'
117
+ ];
118
+ }
119
+
120
+ /**
121
+ * Configuración de logs
122
+ */
123
+ static get LOG_LEVELS() {
124
+ return ['error', 'warn', 'info', 'debug', 'verbose'];
125
+ }
126
+
127
+ static get DEFAULT_LOG_LEVEL() {
128
+ return process.env.LOG_LEVEL || 'info';
129
+ }
130
+
131
+ /**
132
+ * Configuración de versiones
133
+ */
134
+ static get SEMVER_TYPES() {
135
+ return ['major', 'minor', 'patch'];
136
+ }
137
+
138
+ /**
139
+ * Límites y validaciones
140
+ */
141
+ static get MAX_PROJECT_NAME_LENGTH() {
142
+ return 50;
143
+ }
144
+
145
+ static get MIN_PROJECT_NAME_LENGTH() {
146
+ return 3;
147
+ }
148
+
149
+ static get RESERVED_NAMES() {
150
+ return [
151
+ 'node_modules',
152
+ 'package.json',
153
+ 'package-lock.json',
154
+ '.git',
155
+ '.awc',
156
+ 'test',
157
+ 'dist',
158
+ 'build',
159
+ 'coverage'
160
+ ];
161
+ }
162
+
163
+ /**
164
+ * Paths del sistema
165
+ */
166
+ static get HOME_DIR() {
167
+ return os.homedir();
168
+ }
169
+
170
+ static get TEMP_DIR() {
171
+ return os.tmpdir();
172
+ }
173
+
174
+ /**
175
+ * Obtiene la ruta completa a un directorio del proyecto
176
+ * @param {string} cwd - Directorio actual
177
+ * @param {string} subPath - Subdirectorio
178
+ * @returns {string} - Path completo
179
+ */
180
+ static getProjectPath(cwd, subPath = '') {
181
+ return path.join(cwd, this.AWC_DIR, subPath);
182
+ }
183
+
184
+ /**
185
+ * Obtiene la ruta a los agentes del proyecto
186
+ * @param {string} cwd - Directorio actual
187
+ * @returns {string} - Path a agentes
188
+ */
189
+ static getAgentsPath(cwd) {
190
+ return this.getProjectPath(cwd, 'agents');
191
+ }
192
+
193
+ /**
194
+ * Obtiene la ruta a workflows del proyecto
195
+ * @param {string} cwd - Directorio actual
196
+ * @returns {string} - Path a workflows
197
+ */
198
+ static getWorkflowsPath(cwd) {
199
+ return this.getProjectPath(cwd, 'workflows');
200
+ }
201
+
202
+ /**
203
+ * Obtiene la configuración del entorno
204
+ * @returns {Object} - Configuración de entorno
205
+ */
206
+ static getEnvironmentConfig() {
207
+ return {
208
+ nodeVersion: process.version,
209
+ platform: os.platform(),
210
+ arch: os.arch(),
211
+ cwd: process.cwd(),
212
+ env: process.env.NODE_ENV || 'development'
213
+ };
214
+ }
215
+
216
+ /**
217
+ * Valida la configuración del proyecto
218
+ * @param {Object} config - Configuración a validar
219
+ * @returns {Object} - { valid: boolean, errors: string[] }
220
+ */
221
+ static validateConfig(config) {
222
+ const errors = [];
223
+
224
+ if (!config.projectName) {
225
+ errors.push('projectName es requerido');
226
+ }
227
+
228
+ if (!config.version) {
229
+ errors.push('version es requerida');
230
+ }
231
+
232
+ if (config.workflow && !this.WORKFLOW_TYPES.includes(config.workflow)) {
233
+ errors.push(`workflow inválido: ${config.workflow}`);
234
+ }
235
+
236
+ return {
237
+ valid: errors.length === 0,
238
+ errors
239
+ };
240
+ }
241
+ }
242
+
243
+ module.exports = ConfigManager;