awc-zns-mtd 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +101 -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
@@ -1,372 +1,505 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * AWC Agent CLI - Gestión automática de agentes custom
5
- * Framework: AWC-ZNS-MTD v1.0.0
6
- * Uso: awc-agent <comando> [opciones]
7
- */
8
-
9
- const fs = require('fs');
10
- const path = require('path');
11
- const yaml = require('js-yaml');
12
-
13
- // Colores para terminal (expandidos)
14
- const colors = {
15
- reset: '\x1b[0m',
16
- bright: '\x1b[1m',
17
- dim: '\x1b[2m',
18
- cyan: '\x1b[36m',
19
- green: '\x1b[32m',
20
- yellow: '\x1b[33m',
21
- blue: '\x1b[34m',
22
- magenta: '\x1b[35m',
23
- red: '\x1b[31m',
24
- white: '\x1b[37m',
25
- bgCyan: '\x1b[46m',
26
- bgGreen: '\x1b[42m',
27
- bgBlue: '\x1b[44m'
28
- };
29
-
30
- // Logo AWC
31
- function displayLogo() {
32
- console.log();
33
- console.log(colors.cyan + colors.bright + ' █████╗ ██╗ ██╗ ██████╗');
34
- console.log(' ██╔══██╗██║ ██║██╔════╝');
35
- console.log(' ███████║██║ █╗ ██║██║ ');
36
- console.log(' ██╔══██║██║███╗██║██║ ');
37
- console.log(' ██║ ██║╚███╔███╔╝╚██████╗');
38
- console.log(' ╚═╝ ╚═╝ ╚══╝╚══╝ ╚═════╝' + colors.reset);
39
- console.log();
40
- console.log(colors.magenta + colors.bright + ' ╔═══════════════════════════════╗');
41
- console.log('' + colors.white + 'ZNS-MTD Agent Framework' + colors.magenta + ' ║');
42
- console.log(' ║ ' + colors.dim + colors.white + 'Zen • Neutro • Sistemático' + colors.magenta + colors.bright + ' ║');
43
- console.log(' ╚═══════════════════════════════╝' + colors.reset);
44
- console.log();
45
- console.log(colors.dim + ' 🚀 22 Agentes Especializados | 191 Workflows' + colors.reset);
46
- console.log();
47
- }
48
-
49
- // Detectar si está instalado globalmente desde NPM o local
50
- const isGlobalInstall = !fs.existsSync(path.join(__dirname, '../agents'));
51
- const AGENTS_DATA_DIR = isGlobalInstall
52
- ? path.join(__dirname, 'agents-data')
53
- : path.join(__dirname, '../agents');
54
- const CONFIG_FILE = isGlobalInstall
55
- ? path.join(__dirname, 'config.yaml')
56
- : path.join(__dirname, '../config.yaml');
57
- const WORKSPACE_AGENTS_DIR = path.join(process.cwd(), '.awc-agents');
58
-
59
- // Cargar configuración
60
- function loadConfig() {
61
- const configContent = fs.readFileSync(CONFIG_FILE, 'utf8');
62
- return yaml.load(configContent);
63
- }
64
-
65
- // Listar todos los agentes
66
- function listAgents() {
67
- const config = loadConfig();
68
-
69
- displayLogo();
70
- console.log(`${colors.bright}${colors.bgCyan}${colors.white} 📋 AGENTES DISPONIBLES ${colors.reset} ${colors.dim}22 agentes • 191 workflows${colors.reset}\n`);
71
-
72
- const categories = {
73
- 'Frontend': [],
74
- 'Backend': [],
75
- 'Infrastructure': [],
76
- 'Architecture': [],
77
- 'Quality': [],
78
- 'Business': [],
79
- 'AI': [],
80
- 'Documentation': []
81
- };
82
-
83
- // Organizar por categoría
84
- config.module.agents.forEach((agent, index) => {
85
- const cat = agent.category === 'development'
86
- ? (agent.subcategory === 'frontend' || agent.subcategory === 'mobile' ? 'Frontend' : 'Backend')
87
- : agent.category === 'infrastructure' ? 'Infrastructure'
88
- : agent.category === 'architecture' ? 'Architecture'
89
- : agent.category === 'quality' ? 'Quality'
90
- : agent.category === 'business' ? 'Business'
91
- : agent.category === 'ai' ? 'AI'
92
- : 'Documentation';
93
-
94
- categories[cat].push({ ...agent, index: index + 1 });
95
- });
96
-
97
- // Mostrar por categoría con diseño mejorado
98
- Object.entries(categories).forEach(([category, agents]) => {
99
- if (agents.length === 0) return;
100
-
101
- const icon = getCategoryIcon(category);
102
- console.log(`${colors.bright}${colors.blue}╭─ ${icon} ${category.toUpperCase()}${colors.reset} ${colors.dim}(${agents.length} agentes)${colors.reset}`);
103
-
104
- agents.forEach((agent, idx) => {
105
- const isLast = idx === agents.length - 1;
106
- const prefix = isLast ? '╰─' : '├─';
107
- console.log(`${colors.blue}${prefix}${colors.reset} ${colors.bright}${colors.green}${agent.index.toString().padStart(2, '0')}${colors.reset} ${colors.dim}│${colors.reset} ${colors.cyan}${agent.id.padEnd(36)}${colors.reset} ${colors.dim}│${colors.reset} ${colors.yellow}${agent.workflows} workflows${colors.reset}`);
108
- });
109
- console.log('');
110
- });
111
-
112
- console.log(`${colors.bright}${colors.magenta}┌─────────────────────────────────────────────────────────┐${colors.reset}`);
113
- console.log(`${colors.bright}${colors.magenta}│${colors.reset} ${colors.yellow}💡 Comandos rápidos:${colors.reset} ${colors.bright}${colors.magenta}│${colors.reset}`);
114
- console.log(`${colors.bright}${colors.magenta}│${colors.reset} ${colors.cyan}awc-agent load 1${colors.reset} ${colors.dim}→ Cargar agente #1${colors.reset} ${colors.bright}${colors.magenta}│${colors.reset}`);
115
- console.log(`${colors.bright}${colors.magenta}│${colors.reset} ${colors.cyan}awc-agent search java${colors.reset} ${colors.dim}→ Buscar por tecnología${colors.reset} ${colors.bright}${colors.magenta}│${colors.reset}`);
116
- console.log(`${colors.bright}${colors.magenta}└─────────────────────────────────────────────────────────┘${colors.reset}\n`);
117
- }
118
-
119
- function getCategoryIcon(category) {
120
- const icons = {
121
- 'Frontend': '🎨',
122
- 'Backend': '',
123
- 'Infrastructure': '🛠️',
124
- 'Architecture': '🏗️',
125
- 'Quality': '🔍',
126
- 'Business': '📊',
127
- 'AI': '🤖',
128
- 'Documentation': '📄'
129
- };
130
- return icons[category] || '📦';
131
- }
132
-
133
- // Inicializar agentes en workspace
134
- function initWorkspace() {
135
- console.log();
136
- console.log(`${colors.bright}${colors.cyan}⚙️ Inicializando workspace AWC...${colors.reset}\n`);
137
-
138
- // Crear carpeta .awc-agents en el workspace actual
139
- if (!fs.existsSync(WORKSPACE_AGENTS_DIR)) {
140
- fs.mkdirSync(WORKSPACE_AGENTS_DIR, { recursive: true });
141
- }
142
-
143
- // Copiar todos los agentes YAML
144
- const config = loadConfig();
145
- let copiedCount = 0;
146
-
147
- config.module.agents.forEach(agent => {
148
- const sourceFile = path.join(AGENTS_DATA_DIR, path.basename(agent.file));
149
- const destFile = path.join(WORKSPACE_AGENTS_DIR, path.basename(agent.file));
150
-
151
- if (fs.existsSync(sourceFile)) {
152
- fs.copyFileSync(sourceFile, destFile);
153
- copiedCount++;
154
- process.stdout.write(`${colors.dim} ✓ ${path.basename(agent.file)}${colors.reset}\r`);
155
- }
156
- });
157
-
158
- console.log('\n');
159
- console.log(`${colors.bright}${colors.bgGreen}${colors.white} ✅ WORKSPACE INICIALIZADO ${colors.reset}\n`);
160
- console.log(`${colors.dim}╭─────────────────────────────────────────────╮${colors.reset}`);
161
- console.log(`${colors.dim}│${colors.reset} ${colors.cyan}Carpeta:${colors.reset} ${WORKSPACE_AGENTS_DIR.substring(WORKSPACE_AGENTS_DIR.lastIndexOf(path.sep) + 1).padEnd(23)} ${colors.dim}│${colors.reset}`);
162
- console.log(`${colors.dim}│${colors.reset} ${colors.cyan}Agentes:${colors.reset} ${(copiedCount + '/22').padEnd(23)} ${colors.dim}│${colors.reset}`);
163
- console.log(`${colors.dim}╰─────────────────────────────────────────────╯${colors.reset}\n`);
164
- console.log(`${colors.yellow}💡 Siguiente paso:${colors.reset}`);
165
- console.log(` ${colors.bright}${colors.green}awc-agent load 1${colors.reset} ${colors.dim}# Cargar tu primer agente${colors.reset}\n`);
166
- }
167
-
168
- // Cargar agente específico
169
- function loadAgent(agentIdOrNumber) {
170
- const config = loadConfig();
171
- let agent;
172
-
173
- // Buscar por número o ID
174
- if (!isNaN(agentIdOrNumber)) {
175
- const index = parseInt(agentIdOrNumber) - 1;
176
- agent = config.module.agents[index];
177
- } else {
178
- agent = config.module.agents.find(a => a.id === agentIdOrNumber);
179
- }
180
-
181
- if (!agent) {
182
- console.log(`\n${colors.red} Agente no encontrado: ${agentIdOrNumber}${colors.reset}`);
183
- console.log(`${colors.yellow}💡 Usa ${colors.bright}awc-agent list${colors.reset}${colors.yellow} para ver agentes disponibles${colors.reset}\n`);
184
- return;
185
- }
186
-
187
- // Asegurar que el workspace esté inicializado
188
- if (!fs.existsSync(WORKSPACE_AGENTS_DIR)) {
189
- console.log(`\n${colors.yellow}⚠️ Inicializando workspace por primera vez...${colors.reset}\n`);
190
- initWorkspace();
191
- }
192
-
193
- const agentFileName = path.basename(agent.file);
194
- const workspaceAgentPath = path.join(WORKSPACE_AGENTS_DIR, agentFileName);
195
- const sourceAgentPath = path.join(AGENTS_DATA_DIR, agentFileName);
196
-
197
- // Copiar agente al workspace si no existe
198
- if (!fs.existsSync(workspaceAgentPath) && fs.existsSync(sourceAgentPath)) {
199
- fs.copyFileSync(sourceAgentPath, workspaceAgentPath);
200
- }
201
-
202
- const agentPath = fs.existsSync(workspaceAgentPath) ? workspaceAgentPath : sourceAgentPath;
203
- const agentContent = fs.readFileSync(agentPath, 'utf8');
204
- const agentData = yaml.load(agentContent);
205
-
206
- console.log();
207
- console.log(`${colors.bright}${colors.bgGreen}${colors.white} ✅ AGENTE CARGADO ${colors.reset}\n`);
208
- console.log(`${colors.dim}╭──────────────────────────────────────────────────────────╮${colors.reset}`);
209
- console.log(`${colors.dim}│${colors.reset} ${colors.cyan}Nombre:${colors.reset} ${(agentData.agent.metadata.name).padEnd(42)} ${colors.dim}│${colors.reset}`);
210
- console.log(`${colors.dim}│${colors.reset} ${colors.cyan}ID:${colors.reset} ${agent.id.padEnd(42)} ${colors.dim}│${colors.reset}`);
211
- console.log(`${colors.dim}│${colors.reset} ${colors.cyan}Stack:${colors.reset} ${agent.stack.slice(0, 3).join(', ').padEnd(42)} ${colors.dim}│${colors.reset}`);
212
- console.log(`${colors.dim}│${colors.reset} ${colors.cyan}Workflows:${colors.reset} ${(agent.workflows + ' disponibles').padEnd(42)} ${colors.dim}│${colors.reset}`);
213
- console.log(`${colors.dim}╰──────────────────────────────────────────────────────────╯${colors.reset}\n`);
214
-
215
- // Mostrar comando para Copilot Chat con diseño destacado
216
- console.log(`${colors.bright}${colors.magenta}╔════════════════════════════════════════════════════════════╗${colors.reset}`);
217
- console.log(`${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.yellow}📋 COPIAR EN GITHUB COPILOT CHAT:${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`);
218
- console.log(`${colors.bright}${colors.magenta}╠════════════════════════════════════════════════════════════╣${colors.reset}`);
219
- console.log(`${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`);
220
- console.log(`${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.green}#file:.awc-agents/${agentFileName}${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`);
221
- console.log(`${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.green}actúa como este agente, muestra *help${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`);
222
- console.log(`${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`);
223
- console.log(`${colors.bright}${colors.magenta}╚════════════════════════════════════════════════════════════╝${colors.reset}\n`);
224
-
225
- // Mostrar workflows disponibles
226
- if (agentData.agent.workflows && agentData.agent.workflows.list) {
227
- console.log(`${colors.bright}${colors.blue}🎯 WORKFLOWS DISPONIBLES:${colors.reset}\n`);
228
- const maxToShow = 5;
229
- agentData.agent.workflows.list.slice(0, maxToShow).forEach(workflow => {
230
- console.log(` ${colors.green}▸ ${colors.bright}*${workflow.id}${colors.reset}`);
231
- console.log(` ${colors.dim}${workflow.description}${colors.reset}\n`);
232
- });
233
-
234
- if (agentData.agent.workflows.list.length > maxToShow) {
235
- console.log(` ${colors.dim}... y ${agentData.agent.workflows.list.length - maxToShow} workflows más${colors.reset}\n`);
236
- }
237
- }
238
- }
239
-
240
- // Buscar agente por tecnología
241
- function searchByTech(tech) {
242
- const config = loadConfig();
243
- const results = config.module.agents.filter(agent =>
244
- agent.stack.some(s => s.toLowerCase().includes(tech.toLowerCase())) ||
245
- agent.whenToUse.toLowerCase().includes(tech.toLowerCase())
246
- );
247
-
248
- if (results.length === 0) {
249
- console.log(`\n${colors.red}❌ No se encontraron agentes para: ${tech}${colors.reset}`);
250
- console.log(`${colors.yellow}💡 Prueba con: react, java, python, docker, kubernetes, etc.${colors.reset}\n`);
251
- return;
252
- }
253
-
254
- console.log();
255
- console.log(`${colors.bright}${colors.bgBlue}${colors.white} 🔍 RESULTADOS PARA: ${tech.toUpperCase()} ${colors.reset} ${colors.dim}${results.length} agentes encontrados${colors.reset}\n`);
256
-
257
- results.forEach((agent, index) => {
258
- const agentNumber = config.module.agents.indexOf(agent) + 1;
259
- const isLast = index === results.length - 1;
260
-
261
- console.log(`${colors.dim}${isLast ? '╰─' : '├─'}${colors.reset} ${colors.bright}${colors.green}#${agentNumber.toString().padStart(2, '0')}${colors.reset} ${colors.cyan}${agent.id}${colors.reset}`);
262
- console.log(`${colors.dim}${isLast ? ' ' : '│ '}${colors.reset} ${colors.yellow}↳ ${agent.stack.slice(0, 4).join(' • ')}${colors.reset}`);
263
- console.log(`${colors.dim}${isLast ? ' ' : '│ '}${colors.reset} ${colors.dim}${agent.workflows} workflows disponibles${colors.reset}`);
264
- if (!isLast) console.log(`${colors.dim}│${colors.reset}`);
265
- });
266
-
267
- console.log();
268
- console.log(`${colors.yellow}💡 Cargar agente:${colors.reset} ${colors.bright}${colors.green}awc-agent load ${config.module.agents.indexOf(results[0]) + 1}${colors.reset}\n`);
269
- }
270
-
271
- // Mostrar help
272
- function showHelp() {
273
- displayLogo();
274
-
275
- console.log(`${colors.bright}${colors.cyan}USO:${colors.reset}`);
276
- console.log(` ${colors.dim}awc-agent <comando> [opciones]${colors.reset}\n`);
277
-
278
- console.log(`${colors.bright}${colors.cyan}COMANDOS PRINCIPALES:${colors.reset}\n`);
279
-
280
- console.log(` ${colors.bright}${colors.green}init${colors.reset} ${colors.dim}│${colors.reset} Inicializa workspace (.awc-agents/)`);
281
- console.log(` ${colors.bright}${colors.green}list${colors.reset} ${colors.dim}│${colors.reset} Lista todos los agentes (22 agentes)`);
282
- console.log(` ${colors.bright}${colors.green}load <id|#>${colors.reset} ${colors.dim}│${colors.reset} Carga un agente específico`);
283
- console.log(` ${colors.bright}${colors.green}search <tech>${colors.reset} ${colors.dim}│${colors.reset} Busca agentes por tecnología`);
284
- console.log(` ${colors.bright}${colors.green}help${colors.reset} ${colors.dim}│${colors.reset} Muestra esta ayuda\n`);
285
-
286
- console.log(`${colors.bright}${colors.cyan}EJEMPLOS DE USO:${colors.reset}\n`);
287
- console.log(` ${colors.dim}# Primera vez (inicializar)${colors.reset}`);
288
- console.log(` ${colors.cyan}$ awc-agent init${colors.reset}\n`);
289
-
290
- console.log(` ${colors.dim}# Listar todos los agentes${colors.reset}`);
291
- console.log(` ${colors.cyan}$ awc-agent list${colors.reset}\n`);
292
-
293
- console.log(` ${colors.dim}# Cargar agente por número${colors.reset}`);
294
- console.log(` ${colors.cyan}$ awc-agent load 1${colors.reset} ${colors.dim}# Frontend React${colors.reset}`);
295
- console.log(` ${colors.cyan}$ awc-agent load 3${colors.reset} ${colors.dim}# Backend Java${colors.reset}\n`);
296
-
297
- console.log(` ${colors.dim}# Cargar agente por ID${colors.reset}`);
298
- console.log(` ${colors.cyan}$ awc-agent load backend-java-senior${colors.reset}\n`);
299
-
300
- console.log(` ${colors.dim}# Buscar por tecnología${colors.reset}`);
301
- console.log(` ${colors.cyan}$ awc-agent search react${colors.reset} ${colors.dim}# Agentes React${colors.reset}`);
302
- console.log(` ${colors.cyan}$ awc-agent search java${colors.reset} ${colors.dim}# Agentes Java${colors.reset}`);
303
- console.log(` ${colors.cyan}$ awc-agent search docker${colors.reset} ${colors.dim}# DevOps/Docker${colors.reset}\n`);
304
-
305
- console.log(`${colors.bright}${colors.cyan}FLUJO DE TRABAJO TÍPICO:${colors.reset}\n`);
306
- console.log(` ${colors.yellow}1.${colors.reset} ${colors.dim}Inicializar workspace${colors.reset} ${colors.cyan}awc-agent init${colors.reset}`);
307
- console.log(` ${colors.yellow}2.${colors.reset} ${colors.dim}Ver agentes disponibles${colors.reset} ${colors.cyan}awc-agent list${colors.reset}`);
308
- console.log(` ${colors.yellow}3.${colors.reset} ${colors.dim}Cargar agente deseado${colors.reset} ${colors.cyan}awc-agent load 3${colors.reset}`);
309
- console.log(` ${colors.yellow}4.${colors.reset} ${colors.dim}Copiar comando generado${colors.reset} ${colors.green}#file:.awc-agents/...${colors.reset}`);
310
- console.log(` ${colors.yellow}5.${colors.reset} ${colors.dim}Pegar en Copilot Chat${colors.reset} ${colors.magenta}Ejecutar workflows${colors.reset}\n`);
311
-
312
- console.log(`${colors.bright}${colors.cyan}CATEGORÍAS DISPONIBLES:${colors.reset}\n`);
313
- console.log(` 🎨 Frontend (2) Backend (4) 🛠️ Infrastructure (2)`);
314
- console.log(` 🏗️ Architecture (4) 🔍 Quality (3) 📊 Business (2)`);
315
- console.log(` 🤖 AI/Prompts (2) 📄 Documentation (3)\n`);
316
-
317
- console.log(`${colors.dim}────────────────────────────────────────────────────────────${colors.reset}`);
318
- console.log(`${colors.bright}${colors.magenta}Framework AWC-ZNS-MTD v1.0.0${colors.reset} ${colors.dim}│ Zen • Neutro • Sistemático${colors.reset}`);
319
- console.log(`${colors.dim}────────────────────────────────────────────────────────────${colors.reset}\n`);
320
- }
321
-
322
- // Main
323
- function main() {
324
- const args = process.argv.slice(2);
325
- const command = args[0];
326
-
327
- if (!command || command === 'help' || command === '--help' || command === '-h') {
328
- showHelp();
329
- return;
330
- }
331
-
332
- switch (command) {
333
- case 'init':
334
- initWorkspace();
335
- break;
336
- case 'list':
337
- case 'ls':
338
- listAgents();
339
- break;
340
- case 'load':
341
- case 'use':
342
- if (!args[1]) {
343
- console.log(`\n${colors.red}❌ Especifica un agente${colors.reset}`);
344
- console.log(`${colors.yellow}💡 Uso:${colors.reset} ${colors.bright}awc-agent load <número>${colors.reset}`);
345
- console.log(`${colors.yellow}💡 Ejemplo:${colors.reset} ${colors.cyan}awc-agent load 1${colors.reset}\n`);
346
- return;
347
- }
348
- loadAgent(args[1]);
349
- break;
350
- case 'search':
351
- case 'find':
352
- if (!args[1]) {
353
- console.log(`\n${colors.red}❌ Especifica una tecnología${colors.reset}`);
354
- console.log(`${colors.yellow}💡 Uso:${colors.reset} ${colors.bright}awc-agent search <tech>${colors.reset}`);
355
- console.log(`${colors.yellow}💡 Ejemplo:${colors.reset} ${colors.cyan}awc-agent search react${colors.reset}\n`);
356
- return;
357
- }
358
- searchByTech(args[1]);
359
- break;
360
- case 'version':
361
- case '--version':
362
- case '-v':
363
- console.log(`\n${colors.bright}${colors.cyan}awc-agent-cli${colors.reset} ${colors.green}v1.0.0${colors.reset}`);
364
- console.log(`${colors.dim}AWC-ZNS-MTD Framework${colors.reset}\n`);
365
- break;
366
- default:
367
- console.log(`\n${colors.red}❌ Comando desconocido: ${command}${colors.reset}\n`);
368
- showHelp();
369
- }
370
- }
371
-
372
- main();
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * AWC Agent CLI - Gestión automática de agentes custom
5
+ * Framework: AWC-ZNS-MTD v1.0.0
6
+ * Uso: awc-agent <comando> [opciones]
7
+ */
8
+
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+ const yaml = require('js-yaml');
12
+
13
+ // Colores para terminal (expandidos)
14
+ const colors = {
15
+ reset: '\x1b[0m',
16
+ bright: '\x1b[1m',
17
+ dim: '\x1b[2m',
18
+ cyan: '\x1b[36m',
19
+ green: '\x1b[32m',
20
+ yellow: '\x1b[33m',
21
+ blue: '\x1b[34m',
22
+ magenta: '\x1b[35m',
23
+ red: '\x1b[31m',
24
+ white: '\x1b[37m',
25
+ bgCyan: '\x1b[46m',
26
+ bgGreen: '\x1b[42m',
27
+ bgBlue: '\x1b[44m'
28
+ };
29
+
30
+ // Logo AWC
31
+ function displayLogo() {
32
+ console.log();
33
+ console.log(`${colors.cyan + colors.bright} █████╗ ██╗ ██╗ ██████╗`);
34
+ console.log(' ██╔══██╗██║ ██║██╔════╝');
35
+ console.log(' ███████║██║ █╗ ██║██║ ');
36
+ console.log(' ██╔══██║██║███╗██║██║ ');
37
+ console.log(' ██║ ██║╚███╔███╔╝╚██████╗');
38
+ console.log(` ╚═╝ ╚═╝ ╚══╝╚══╝ ╚═════╝${colors.reset}`);
39
+ console.log();
40
+ console.log(`${colors.magenta + colors.bright} ╔═══════════════════════════════╗`);
41
+ console.log(`${colors.white}ZNS-MTD Agent Framework${colors.magenta} ║`);
42
+ console.log(
43
+ ` ║ ${colors.dim}${colors.white}Zen Neutro • Sistemático${colors.magenta}${colors.bright} ║`
44
+ );
45
+ console.log(` ╚═══════════════════════════════╝${colors.reset}`);
46
+ console.log();
47
+ console.log(`${colors.dim} 🚀 22 Agentes Especializados | 191 Workflows${colors.reset}`);
48
+ console.log();
49
+ }
50
+
51
+ // Detectar si está instalado globalmente desde NPM o local
52
+ const isGlobalInstall = !fs.existsSync(path.join(__dirname, '../agents'));
53
+ const AGENTS_DATA_DIR = isGlobalInstall
54
+ ? path.join(__dirname, 'agents-data')
55
+ : path.join(__dirname, '../agents');
56
+ const CONFIG_FILE = isGlobalInstall
57
+ ? path.join(__dirname, 'config.yaml')
58
+ : path.join(__dirname, '../config.yaml');
59
+ const WORKSPACE_AGENTS_DIR = path.join(process.cwd(), '.awc-agents');
60
+
61
+ // Cargar configuración
62
+ function loadConfig() {
63
+ const configContent = fs.readFileSync(CONFIG_FILE, 'utf8');
64
+ return yaml.load(configContent);
65
+ }
66
+
67
+ // Listar todos los agentes
68
+ function listAgents() {
69
+ const config = loadConfig();
70
+
71
+ displayLogo();
72
+ console.log(
73
+ `${colors.bright}${colors.bgCyan}${colors.white} 📋 AGENTES DISPONIBLES ${colors.reset} ${colors.dim}22 agentes • 191 workflows${colors.reset}\n`
74
+ );
75
+
76
+ const categories = {
77
+ Frontend: [],
78
+ Backend: [],
79
+ Infrastructure: [],
80
+ Architecture: [],
81
+ Quality: [],
82
+ Business: [],
83
+ AI: [],
84
+ Documentation: []
85
+ };
86
+
87
+ // Organizar por categoría
88
+ config.module.agents.forEach((agent, index) => {
89
+ const cat =
90
+ agent.category === 'development'
91
+ ? agent.subcategory === 'frontend' || agent.subcategory === 'mobile'
92
+ ? 'Frontend'
93
+ : 'Backend'
94
+ : agent.category === 'infrastructure'
95
+ ? 'Infrastructure'
96
+ : agent.category === 'architecture'
97
+ ? 'Architecture'
98
+ : agent.category === 'quality'
99
+ ? 'Quality'
100
+ : agent.category === 'business'
101
+ ? 'Business'
102
+ : agent.category === 'ai'
103
+ ? 'AI'
104
+ : 'Documentation';
105
+
106
+ categories[cat].push({ ...agent, index: index + 1 });
107
+ });
108
+
109
+ // Mostrar por categoría con diseño mejorado
110
+ Object.entries(categories).forEach(([category, agents]) => {
111
+ if (agents.length === 0) {
112
+ return;
113
+ }
114
+
115
+ const icon = getCategoryIcon(category);
116
+ console.log(
117
+ `${colors.bright}${colors.blue}╭─ ${icon} ${category.toUpperCase()}${colors.reset} ${colors.dim}(${agents.length} agentes)${colors.reset}`
118
+ );
119
+
120
+ agents.forEach((agent, idx) => {
121
+ const isLast = idx === agents.length - 1;
122
+ const prefix = isLast ? '╰─' : '├─';
123
+ console.log(
124
+ `${colors.blue}${prefix}${colors.reset} ${colors.bright}${colors.green}${agent.index.toString().padStart(2, '0')}${colors.reset} ${colors.dim}│${colors.reset} ${colors.cyan}${agent.id.padEnd(36)}${colors.reset} ${colors.dim}│${colors.reset} ${colors.yellow}${agent.workflows} workflows${colors.reset}`
125
+ );
126
+ });
127
+ console.log('');
128
+ });
129
+
130
+ console.log(
131
+ `${colors.bright}${colors.magenta}┌─────────────────────────────────────────────────────────┐${colors.reset}`
132
+ );
133
+ console.log(
134
+ `${colors.bright}${colors.magenta}│${colors.reset} ${colors.yellow}💡 Comandos rápidos:${colors.reset} ${colors.bright}${colors.magenta}│${colors.reset}`
135
+ );
136
+ console.log(
137
+ `${colors.bright}${colors.magenta}│${colors.reset} ${colors.cyan}awc-agent load 1${colors.reset} ${colors.dim}→ Cargar agente #1${colors.reset} ${colors.bright}${colors.magenta}│${colors.reset}`
138
+ );
139
+ console.log(
140
+ `${colors.bright}${colors.magenta}│${colors.reset} ${colors.cyan}awc-agent search java${colors.reset} ${colors.dim}→ Buscar por tecnología${colors.reset} ${colors.bright}${colors.magenta}│${colors.reset}`
141
+ );
142
+ console.log(
143
+ `${colors.bright}${colors.magenta}└─────────────────────────────────────────────────────────┘${colors.reset}\n`
144
+ );
145
+ }
146
+
147
+ function getCategoryIcon(category) {
148
+ const icons = {
149
+ Frontend: '🎨',
150
+ Backend: '☕',
151
+ Infrastructure: '🛠️',
152
+ Architecture: '🏗️',
153
+ Quality: '🔍',
154
+ Business: '📊',
155
+ AI: '🤖',
156
+ Documentation: '📄'
157
+ };
158
+ return icons[category] || '📦';
159
+ }
160
+
161
+ // Inicializar agentes en workspace
162
+ function initWorkspace() {
163
+ console.log();
164
+ console.log(`${colors.bright}${colors.cyan}⚙️ Inicializando workspace AWC...${colors.reset}\n`);
165
+
166
+ // Crear carpeta .awc-agents en el workspace actual
167
+ if (!fs.existsSync(WORKSPACE_AGENTS_DIR)) {
168
+ fs.mkdirSync(WORKSPACE_AGENTS_DIR, { recursive: true });
169
+ }
170
+
171
+ // Copiar todos los agentes YAML
172
+ const config = loadConfig();
173
+ let copiedCount = 0;
174
+
175
+ config.module.agents.forEach((agent) => {
176
+ const sourceFile = path.join(AGENTS_DATA_DIR, path.basename(agent.file));
177
+ const destFile = path.join(WORKSPACE_AGENTS_DIR, path.basename(agent.file));
178
+
179
+ if (fs.existsSync(sourceFile)) {
180
+ fs.copyFileSync(sourceFile, destFile);
181
+ copiedCount++;
182
+ process.stdout.write(`${colors.dim} ${path.basename(agent.file)}${colors.reset}\r`);
183
+ }
184
+ });
185
+
186
+ console.log('\n');
187
+ console.log(
188
+ `${colors.bright}${colors.bgGreen}${colors.white} ✅ WORKSPACE INICIALIZADO ${colors.reset}\n`
189
+ );
190
+ console.log(`${colors.dim}╭─────────────────────────────────────────────╮${colors.reset}`);
191
+ console.log(
192
+ `${colors.dim}│${colors.reset} ${colors.cyan}Carpeta:${colors.reset} ${WORKSPACE_AGENTS_DIR.substring(WORKSPACE_AGENTS_DIR.lastIndexOf(path.sep) + 1).padEnd(23)} ${colors.dim}│${colors.reset}`
193
+ );
194
+ console.log(
195
+ `${colors.dim}│${colors.reset} ${colors.cyan}Agentes:${colors.reset} ${`${copiedCount}/22`.padEnd(23)} ${colors.dim}│${colors.reset}`
196
+ );
197
+ console.log(`${colors.dim}╰─────────────────────────────────────────────╯${colors.reset}\n`);
198
+ console.log(`${colors.yellow}💡 Siguiente paso:${colors.reset}`);
199
+ console.log(
200
+ ` ${colors.bright}${colors.green}awc-agent load 1${colors.reset} ${colors.dim}# Cargar tu primer agente${colors.reset}\n`
201
+ );
202
+ }
203
+
204
+ // Cargar agente específico
205
+ function loadAgent(agentIdOrNumber) {
206
+ const config = loadConfig();
207
+ let agent;
208
+
209
+ // Buscar por número o ID
210
+ if (!isNaN(agentIdOrNumber)) {
211
+ const index = parseInt(agentIdOrNumber) - 1;
212
+ agent = config.module.agents[index];
213
+ } else {
214
+ agent = config.module.agents.find((a) => a.id === agentIdOrNumber);
215
+ }
216
+
217
+ if (!agent) {
218
+ console.log(`\n${colors.red}❌ Agente no encontrado: ${agentIdOrNumber}${colors.reset}`);
219
+ console.log(
220
+ `${colors.yellow}💡 Usa ${colors.bright}awc-agent list${colors.reset}${colors.yellow} para ver agentes disponibles${colors.reset}\n`
221
+ );
222
+ return;
223
+ }
224
+
225
+ // Asegurar que el workspace esté inicializado
226
+ if (!fs.existsSync(WORKSPACE_AGENTS_DIR)) {
227
+ console.log(
228
+ `\n${colors.yellow}⚠️ Inicializando workspace por primera vez...${colors.reset}\n`
229
+ );
230
+ initWorkspace();
231
+ }
232
+
233
+ const agentFileName = path.basename(agent.file);
234
+ const workspaceAgentPath = path.join(WORKSPACE_AGENTS_DIR, agentFileName);
235
+ const sourceAgentPath = path.join(AGENTS_DATA_DIR, agentFileName);
236
+
237
+ // Copiar agente al workspace si no existe
238
+ if (!fs.existsSync(workspaceAgentPath) && fs.existsSync(sourceAgentPath)) {
239
+ fs.copyFileSync(sourceAgentPath, workspaceAgentPath);
240
+ }
241
+
242
+ const agentPath = fs.existsSync(workspaceAgentPath) ? workspaceAgentPath : sourceAgentPath;
243
+ const agentContent = fs.readFileSync(agentPath, 'utf8');
244
+ const agentData = yaml.load(agentContent);
245
+
246
+ console.log();
247
+ console.log(
248
+ `${colors.bright}${colors.bgGreen}${colors.white} AGENTE CARGADO ${colors.reset}\n`
249
+ );
250
+ console.log(
251
+ `${colors.dim}╭──────────────────────────────────────────────────────────╮${colors.reset}`
252
+ );
253
+ console.log(
254
+ `${colors.dim}│${colors.reset} ${colors.cyan}Nombre:${colors.reset} ${agentData.agent.metadata.name.padEnd(42)} ${colors.dim}│${colors.reset}`
255
+ );
256
+ console.log(
257
+ `${colors.dim}│${colors.reset} ${colors.cyan}ID:${colors.reset} ${agent.id.padEnd(42)} ${colors.dim}│${colors.reset}`
258
+ );
259
+ console.log(
260
+ `${colors.dim}│${colors.reset} ${colors.cyan}Stack:${colors.reset} ${agent.stack.slice(0, 3).join(', ').padEnd(42)} ${colors.dim}│${colors.reset}`
261
+ );
262
+ console.log(
263
+ `${colors.dim}│${colors.reset} ${colors.cyan}Workflows:${colors.reset} ${`${agent.workflows} disponibles`.padEnd(42)} ${colors.dim}│${colors.reset}`
264
+ );
265
+ console.log(
266
+ `${colors.dim}╰──────────────────────────────────────────────────────────╯${colors.reset}\n`
267
+ );
268
+
269
+ // Mostrar comando para Copilot Chat con diseño destacado
270
+ console.log(
271
+ `${colors.bright}${colors.magenta}╔════════════════════════════════════════════════════════════╗${colors.reset}`
272
+ );
273
+ console.log(
274
+ `${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.yellow}📋 COPIAR EN GITHUB COPILOT CHAT:${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`
275
+ );
276
+ console.log(
277
+ `${colors.bright}${colors.magenta}╠════════════════════════════════════════════════════════════╣${colors.reset}`
278
+ );
279
+ console.log(
280
+ `${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`
281
+ );
282
+ console.log(
283
+ `${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.green}#file:.awc-agents/${agentFileName}${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`
284
+ );
285
+ console.log(
286
+ `${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.green}actúa como este agente, muestra *help${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`
287
+ );
288
+ console.log(
289
+ `${colors.bright}${colors.magenta}║${colors.reset} ${colors.bright}${colors.magenta}║${colors.reset}`
290
+ );
291
+ console.log(
292
+ `${colors.bright}${colors.magenta}╚════════════════════════════════════════════════════════════╝${colors.reset}\n`
293
+ );
294
+
295
+ // Mostrar workflows disponibles
296
+ if (agentData.agent.workflows && agentData.agent.workflows.list) {
297
+ console.log(`${colors.bright}${colors.blue}🎯 WORKFLOWS DISPONIBLES:${colors.reset}\n`);
298
+ const maxToShow = 5;
299
+ agentData.agent.workflows.list.slice(0, maxToShow).forEach((workflow) => {
300
+ console.log(` ${colors.green} ${colors.bright}*${workflow.id}${colors.reset}`);
301
+ console.log(` ${colors.dim}${workflow.description}${colors.reset}\n`);
302
+ });
303
+
304
+ if (agentData.agent.workflows.list.length > maxToShow) {
305
+ console.log(
306
+ ` ${colors.dim}... y ${agentData.agent.workflows.list.length - maxToShow} workflows más${colors.reset}\n`
307
+ );
308
+ }
309
+ }
310
+ }
311
+
312
+ // Buscar agente por tecnología
313
+ function searchByTech(tech) {
314
+ const config = loadConfig();
315
+ const results = config.module.agents.filter(
316
+ (agent) =>
317
+ agent.stack.some((s) => s.toLowerCase().includes(tech.toLowerCase())) ||
318
+ agent.whenToUse.toLowerCase().includes(tech.toLowerCase())
319
+ );
320
+
321
+ if (results.length === 0) {
322
+ console.log(`\n${colors.red}❌ No se encontraron agentes para: ${tech}${colors.reset}`);
323
+ console.log(
324
+ `${colors.yellow}💡 Prueba con: react, java, python, docker, kubernetes, etc.${colors.reset}\n`
325
+ );
326
+ return;
327
+ }
328
+
329
+ console.log();
330
+ console.log(
331
+ `${colors.bright}${colors.bgBlue}${colors.white} 🔍 RESULTADOS PARA: ${tech.toUpperCase()} ${colors.reset} ${colors.dim}${results.length} agentes encontrados${colors.reset}\n`
332
+ );
333
+
334
+ results.forEach((agent, index) => {
335
+ const agentNumber = config.module.agents.indexOf(agent) + 1;
336
+ const isLast = index === results.length - 1;
337
+
338
+ console.log(
339
+ `${colors.dim}${isLast ? '╰─' : '├─'}${colors.reset} ${colors.bright}${colors.green}#${agentNumber.toString().padStart(2, '0')}${colors.reset} ${colors.cyan}${agent.id}${colors.reset}`
340
+ );
341
+ console.log(
342
+ `${colors.dim}${isLast ? ' ' : '│ '}${colors.reset} ${colors.yellow}↳ ${agent.stack.slice(0, 4).join(' • ')}${colors.reset}`
343
+ );
344
+ console.log(
345
+ `${colors.dim}${isLast ? ' ' : '│ '}${colors.reset} ${colors.dim}${agent.workflows} workflows disponibles${colors.reset}`
346
+ );
347
+ if (!isLast) {
348
+ console.log(`${colors.dim}│${colors.reset}`);
349
+ }
350
+ });
351
+
352
+ console.log();
353
+ console.log(
354
+ `${colors.yellow}💡 Cargar agente:${colors.reset} ${colors.bright}${colors.green}awc-agent load ${config.module.agents.indexOf(results[0]) + 1}${colors.reset}\n`
355
+ );
356
+ }
357
+
358
+ // Mostrar help
359
+ function showHelp() {
360
+ displayLogo();
361
+
362
+ console.log(`${colors.bright}${colors.cyan}USO:${colors.reset}`);
363
+ console.log(` ${colors.dim}awc-agent <comando> [opciones]${colors.reset}\n`);
364
+
365
+ console.log(`${colors.bright}${colors.cyan}COMANDOS PRINCIPALES:${colors.reset}\n`);
366
+
367
+ console.log(
368
+ ` ${colors.bright}${colors.green}init${colors.reset} ${colors.dim}│${colors.reset} Inicializa workspace (.awc-agents/)`
369
+ );
370
+ console.log(
371
+ ` ${colors.bright}${colors.green}list${colors.reset} ${colors.dim}│${colors.reset} Lista todos los agentes (22 agentes)`
372
+ );
373
+ console.log(
374
+ ` ${colors.bright}${colors.green}load <id|#>${colors.reset} ${colors.dim}│${colors.reset} Carga un agente específico`
375
+ );
376
+ console.log(
377
+ ` ${colors.bright}${colors.green}search <tech>${colors.reset} ${colors.dim}│${colors.reset} Busca agentes por tecnología`
378
+ );
379
+ console.log(
380
+ ` ${colors.bright}${colors.green}help${colors.reset} ${colors.dim}│${colors.reset} Muestra esta ayuda\n`
381
+ );
382
+
383
+ console.log(`${colors.bright}${colors.cyan}EJEMPLOS DE USO:${colors.reset}\n`);
384
+ console.log(` ${colors.dim}# Primera vez (inicializar)${colors.reset}`);
385
+ console.log(` ${colors.cyan}$ awc-agent init${colors.reset}\n`);
386
+
387
+ console.log(` ${colors.dim}# Listar todos los agentes${colors.reset}`);
388
+ console.log(` ${colors.cyan}$ awc-agent list${colors.reset}\n`);
389
+
390
+ console.log(` ${colors.dim}# Cargar agente por número${colors.reset}`);
391
+ console.log(
392
+ ` ${colors.cyan}$ awc-agent load 1${colors.reset} ${colors.dim}# Frontend React${colors.reset}`
393
+ );
394
+ console.log(
395
+ ` ${colors.cyan}$ awc-agent load 3${colors.reset} ${colors.dim}# Backend Java${colors.reset}\n`
396
+ );
397
+
398
+ console.log(` ${colors.dim}# Cargar agente por ID${colors.reset}`);
399
+ console.log(` ${colors.cyan}$ awc-agent load backend-java-senior${colors.reset}\n`);
400
+
401
+ console.log(` ${colors.dim}# Buscar por tecnología${colors.reset}`);
402
+ console.log(
403
+ ` ${colors.cyan}$ awc-agent search react${colors.reset} ${colors.dim}# Agentes React${colors.reset}`
404
+ );
405
+ console.log(
406
+ ` ${colors.cyan}$ awc-agent search java${colors.reset} ${colors.dim}# Agentes Java${colors.reset}`
407
+ );
408
+ console.log(
409
+ ` ${colors.cyan}$ awc-agent search docker${colors.reset} ${colors.dim}# DevOps/Docker${colors.reset}\n`
410
+ );
411
+
412
+ console.log(`${colors.bright}${colors.cyan}FLUJO DE TRABAJO TÍPICO:${colors.reset}\n`);
413
+ console.log(
414
+ ` ${colors.yellow}1.${colors.reset} ${colors.dim}Inicializar workspace${colors.reset} ${colors.cyan}awc-agent init${colors.reset}`
415
+ );
416
+ console.log(
417
+ ` ${colors.yellow}2.${colors.reset} ${colors.dim}Ver agentes disponibles${colors.reset} ${colors.cyan}awc-agent list${colors.reset}`
418
+ );
419
+ console.log(
420
+ ` ${colors.yellow}3.${colors.reset} ${colors.dim}Cargar agente deseado${colors.reset} ${colors.cyan}awc-agent load 3${colors.reset}`
421
+ );
422
+ console.log(
423
+ ` ${colors.yellow}4.${colors.reset} ${colors.dim}Copiar comando generado${colors.reset} ${colors.green}#file:.awc-agents/...${colors.reset}`
424
+ );
425
+ console.log(
426
+ ` ${colors.yellow}5.${colors.reset} ${colors.dim}Pegar en Copilot Chat${colors.reset} ${colors.magenta}Ejecutar workflows${colors.reset}\n`
427
+ );
428
+
429
+ console.log(`${colors.bright}${colors.cyan}CATEGORÍAS DISPONIBLES:${colors.reset}\n`);
430
+ console.log(' 🎨 Frontend (2) ☕ Backend (4) 🛠️ Infrastructure (2)');
431
+ console.log(' 🏗️ Architecture (4) 🔍 Quality (3) 📊 Business (2)');
432
+ console.log(' 🤖 AI/Prompts (2) 📄 Documentation (3)\n');
433
+
434
+ console.log(
435
+ `${colors.dim}────────────────────────────────────────────────────────────${colors.reset}`
436
+ );
437
+ console.log(
438
+ `${colors.bright}${colors.magenta}Framework AWC-ZNS-MTD v1.0.0${colors.reset} ${colors.dim}│ Zen • Neutro • Sistemático${colors.reset}`
439
+ );
440
+ console.log(
441
+ `${colors.dim}────────────────────────────────────────────────────────────${colors.reset}\n`
442
+ );
443
+ }
444
+
445
+ // Main
446
+ function main() {
447
+ const args = process.argv.slice(2);
448
+ const command = args[0];
449
+
450
+ if (!command || command === 'help' || command === '--help' || command === '-h') {
451
+ showHelp();
452
+ return;
453
+ }
454
+
455
+ switch (command) {
456
+ case 'init':
457
+ initWorkspace();
458
+ break;
459
+ case 'list':
460
+ case 'ls':
461
+ listAgents();
462
+ break;
463
+ case 'load':
464
+ case 'use':
465
+ if (!args[1]) {
466
+ console.log(`\n${colors.red}❌ Especifica un agente${colors.reset}`);
467
+ console.log(
468
+ `${colors.yellow}💡 Uso:${colors.reset} ${colors.bright}awc-agent load <número>${colors.reset}`
469
+ );
470
+ console.log(
471
+ `${colors.yellow}💡 Ejemplo:${colors.reset} ${colors.cyan}awc-agent load 1${colors.reset}\n`
472
+ );
473
+ return;
474
+ }
475
+ loadAgent(args[1]);
476
+ break;
477
+ case 'search':
478
+ case 'find':
479
+ if (!args[1]) {
480
+ console.log(`\n${colors.red}❌ Especifica una tecnología${colors.reset}`);
481
+ console.log(
482
+ `${colors.yellow}💡 Uso:${colors.reset} ${colors.bright}awc-agent search <tech>${colors.reset}`
483
+ );
484
+ console.log(
485
+ `${colors.yellow}💡 Ejemplo:${colors.reset} ${colors.cyan}awc-agent search react${colors.reset}\n`
486
+ );
487
+ return;
488
+ }
489
+ searchByTech(args[1]);
490
+ break;
491
+ case 'version':
492
+ case '--version':
493
+ case '-v':
494
+ console.log(
495
+ `\n${colors.bright}${colors.cyan}awc-agent-cli${colors.reset} ${colors.green}v1.0.0${colors.reset}`
496
+ );
497
+ console.log(`${colors.dim}AWC-ZNS-MTD Framework${colors.reset}\n`);
498
+ break;
499
+ default:
500
+ console.log(`\n${colors.red}❌ Comando desconocido: ${command}${colors.reset}\n`);
501
+ showHelp();
502
+ }
503
+ }
504
+
505
+ main();