@saulwade/swl-ses 1.5.2 → 1.6.1
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.
- package/CLAUDE.md +32 -61
- package/README.md +20 -3
- package/agentes/datos-swl.md +1 -1
- package/agentes/frontend-angular-swl.md +7 -7
- package/agentes/frontend-css-swl.md +4 -4
- package/agentes/frontend-react-swl.md +7 -7
- package/agentes/frontend-swl.md +9 -9
- package/agentes/frontend-tailwind-swl.md +4 -4
- package/agentes/rendimiento-swl.md +2 -2
- package/bin/swl-ses.js +49 -7
- package/comandos/swl/brainstorm.md +1 -0
- package/comandos/swl/compactar.md +1 -1
- package/comandos/swl/discutir-fase.md +15 -1
- package/comandos/swl/mapear-codebase.md +1 -1
- package/comandos/swl/nemesis.md +29 -0
- package/comandos/swl/planear-fase.md +2 -2
- package/comandos/swl/verificar.md +4 -4
- package/habilidades/aprendizaje-continuo/SKILL.md +7 -1
- package/habilidades/diseno-herramientas-agente/SKILL.md +1 -0
- package/habilidades/doc-sync/SKILL.md +441 -1
- package/habilidades/doubt-driven-review/SKILL.md +177 -171
- package/habilidades/feynman-auditor-swl/SKILL.md +129 -123
- package/habilidades/infra-github-actions/SKILL.md +172 -166
- package/habilidades/meta-skills-estandar/recursos/skills-as-agents.md +163 -163
- package/habilidades/nemesis-evaluacion-json/SKILL.md +5 -0
- package/habilidades/nemesis-redistribuir/SKILL.md +5 -0
- package/habilidades/node-experto/SKILL.md +197 -3
- package/habilidades/prevencion-racionalizacion/SKILL.md +1 -0
- package/habilidades/privacy-memoria/SKILL.md +1 -0
- package/habilidades/sre-patrones/SKILL.md +1 -1
- package/habilidades/state-inconsistency-auditor-swl/SKILL.md +172 -166
- package/habilidades/tdd-workflow/SKILL.md +178 -3
- package/habilidades/verificacion-evidencia/SKILL.md +1 -0
- package/habilidades/web-fetcher-routing/SKILL.md +81 -75
- package/habilidades/workflow-claude-code/SKILL.md +2 -2
- package/hooks/extraccion-aprendizajes.js +11 -0
- package/manifiestos/modulos.json +2 -1
- package/manifiestos/skills-lock.json +1142 -1114
- package/package.json +7 -4
- package/plugin.json +4 -2
- package/reglas/auditorias-documentales-estructurales.md +205 -0
- package/schemas/agent-frontmatter.schema.json +1 -1
- package/scripts/desinstalar.js +105 -24
- package/scripts/generar-inventario.js +450 -420
- package/scripts/instalador.js +55 -4
- package/scripts/lib/parsear-opciones.js +3 -0
- package/scripts/lib/ui.js +148 -22
- package/scripts/tui/componentes/selector-multi.js +189 -0
- package/scripts/tui/componentes/selector-unico.js +158 -0
- package/scripts/tui/ejecutores.js +375 -0
- package/scripts/tui/index.js +162 -0
- package/scripts/tui/lib/colores.js +129 -0
- package/scripts/tui/lib/render.js +264 -0
- package/scripts/tui/lib/teclas.js +113 -0
- package/scripts/tui/pantallas/inspect.js +173 -0
- package/scripts/tui/pantallas/install-wizard.js +334 -0
- package/scripts/tui/pantallas/menu-principal.js +52 -0
- package/scripts/tui/pantallas/progreso.js +274 -0
- package/scripts/tui/pantallas/resumen.js +132 -0
- package/scripts/tui/pantallas/uninstall-wizard.js +208 -0
- package/scripts/tui/pantallas/update-wizard.js +232 -0
- package/scripts/tui/pantallas/welcome.js +187 -0
- package/scripts/verificar-docs-vs-codigo.js +654 -0
- package/scripts/verificar-evolucion.js +19 -3
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Pantalla Welcome de la TUI de swl-ses.
|
|
5
|
+
*
|
|
6
|
+
* Diseño:
|
|
7
|
+
* - Logo ASCII centrado en la parte superior
|
|
8
|
+
* - Tabla de runtimes detectados (nombre, scope, versión instalada, estado)
|
|
9
|
+
* - Pie con atajos: Enter continuar / Esc salir
|
|
10
|
+
*
|
|
11
|
+
* No-TTY: imprime versión texto plano y retorna { continuar: true } inmediatamente.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const path = require('path');
|
|
15
|
+
|
|
16
|
+
const render = require('../lib/render');
|
|
17
|
+
const teclas = require('../lib/teclas');
|
|
18
|
+
const { colores, semantico, iconos } = require('../lib/colores');
|
|
19
|
+
|
|
20
|
+
// Logo en caracteres ASCII art compactos (5 líneas)
|
|
21
|
+
const LOGO = [
|
|
22
|
+
' ███████ ██ ██ ██ ███████ ███████ ███████ ',
|
|
23
|
+
' ██ ██ ██ ██ ██ ██ ██ ',
|
|
24
|
+
' ███████ ██ █ ██ ██ ███████ █████ ███████ ',
|
|
25
|
+
' ██ ██ ███ ██ ██ ██ ██ ██ ',
|
|
26
|
+
' ███████ ███ ███ ███████ ███████ ███████ ███████ ',
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const SUBTITULO = 'Sistema de ingeniería de software auto-evolutivo multi-runtime';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Detecta runtimes instalados leyendo desde scripts/lib/detectar-runtime.
|
|
33
|
+
* No falla si la lib no está disponible — devuelve array vacío.
|
|
34
|
+
*/
|
|
35
|
+
function detectarInstalaciones() {
|
|
36
|
+
let detectarRuntimes;
|
|
37
|
+
let cargarEstado;
|
|
38
|
+
try {
|
|
39
|
+
({ detectarRuntimes } = require('../../lib/detectar-runtime'));
|
|
40
|
+
({ cargarEstado } = require('../../lib/estado'));
|
|
41
|
+
} catch (_) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const runtimes = detectarRuntimes();
|
|
46
|
+
const filas = [];
|
|
47
|
+
for (const runtime of runtimes) {
|
|
48
|
+
const dirs = [
|
|
49
|
+
{ ruta: runtime.global, scope: 'global' },
|
|
50
|
+
{ ruta: path.resolve(runtime.local), scope: 'proyecto' },
|
|
51
|
+
];
|
|
52
|
+
for (const { ruta, scope } of dirs) {
|
|
53
|
+
try {
|
|
54
|
+
const estado = cargarEstado(ruta);
|
|
55
|
+
if (!estado) continue;
|
|
56
|
+
filas.push({
|
|
57
|
+
runtime: runtime.nombre,
|
|
58
|
+
scope,
|
|
59
|
+
version: estado.versionSistema || 'desconocida',
|
|
60
|
+
perfil: estado.perfil || '-',
|
|
61
|
+
componentes: estado.componentesInstalados?.length || 0,
|
|
62
|
+
});
|
|
63
|
+
} catch (_) {
|
|
64
|
+
// ignorar errores de lectura
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return filas;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Pinta el contenido completo de la pantalla. Idempotente — se puede invocar
|
|
73
|
+
* múltiples veces (resize, re-render).
|
|
74
|
+
*/
|
|
75
|
+
function _renderizar(filas, version) {
|
|
76
|
+
render.limpiarPantalla();
|
|
77
|
+
const { cols, rows } = render.obtenerDimensiones();
|
|
78
|
+
|
|
79
|
+
// Logo centrado
|
|
80
|
+
const filaLogo = 2;
|
|
81
|
+
for (let i = 0; i < LOGO.length; i++) {
|
|
82
|
+
const linea = LOGO[i];
|
|
83
|
+
const colLogo = Math.max(1, Math.floor((cols - linea.length) / 2));
|
|
84
|
+
render.escribirEn(filaLogo + i, colLogo, semantico.titulo(linea));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Subtítulo + versión
|
|
88
|
+
const filaSub = filaLogo + LOGO.length + 1;
|
|
89
|
+
const subFinal = `${SUBTITULO} ${colores.dim('v' + version)}`;
|
|
90
|
+
const colSub = Math.max(1, Math.floor((cols - render.anchoVisual(subFinal)) / 2));
|
|
91
|
+
render.escribirEn(filaSub, colSub, subFinal);
|
|
92
|
+
|
|
93
|
+
// Tabla de runtimes detectados
|
|
94
|
+
const filaTabla = filaSub + 3;
|
|
95
|
+
if (filas.length === 0) {
|
|
96
|
+
const mensaje = colores.dim('No se detectaron instalaciones SWL en este equipo.');
|
|
97
|
+
const colMsg = Math.max(1, Math.floor((cols - render.anchoVisual(mensaje)) / 2));
|
|
98
|
+
render.escribirEn(filaTabla, colMsg, mensaje);
|
|
99
|
+
} else {
|
|
100
|
+
render.escribirEn(filaTabla - 1, 4, semantico.enfasis('Instalaciones detectadas:'));
|
|
101
|
+
const cabecera =
|
|
102
|
+
render.rellenarDer(colores.dim('Runtime'), 14) +
|
|
103
|
+
render.rellenarDer(colores.dim('Scope'), 10) +
|
|
104
|
+
render.rellenarDer(colores.dim('Versión'), 12) +
|
|
105
|
+
render.rellenarDer(colores.dim('Perfil'), 18) +
|
|
106
|
+
colores.dim('Componentes');
|
|
107
|
+
render.escribirEn(filaTabla, 4, cabecera);
|
|
108
|
+
|
|
109
|
+
filas.slice(0, rows - filaTabla - 4).forEach((f, i) => {
|
|
110
|
+
const estado = f.version === version
|
|
111
|
+
? semantico.exito(iconos.check)
|
|
112
|
+
: semantico.warn(iconos.warn);
|
|
113
|
+
const linea =
|
|
114
|
+
render.rellenarDer(`${estado} ${f.runtime}`, 14) +
|
|
115
|
+
render.rellenarDer(f.scope, 10) +
|
|
116
|
+
render.rellenarDer('v' + f.version, 12) +
|
|
117
|
+
render.rellenarDer(f.perfil, 18) +
|
|
118
|
+
colores.cyan(String(f.componentes));
|
|
119
|
+
render.escribirEn(filaTabla + 1 + i, 4, linea);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Mensaje central de continuación
|
|
124
|
+
const filaCont = rows - 4;
|
|
125
|
+
const mensaje = `Presiona ${semantico.cursor('Enter')} para continuar al menú principal o ${semantico.cursor('Esc')} para salir.`;
|
|
126
|
+
const colCont = Math.max(1, Math.floor((cols - render.anchoVisual(mensaje)) / 2));
|
|
127
|
+
render.escribirEn(filaCont, colCont, mensaje);
|
|
128
|
+
|
|
129
|
+
// Pie con atajos
|
|
130
|
+
render.dibujarPiePagina([
|
|
131
|
+
['Enter', 'continuar'],
|
|
132
|
+
['Esc', 'salir'],
|
|
133
|
+
]);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Muestra la pantalla Welcome y espera input del usuario.
|
|
138
|
+
*
|
|
139
|
+
* @returns {Promise<{ continuar: boolean, instalaciones: Array }>}
|
|
140
|
+
*/
|
|
141
|
+
function mostrarWelcome() {
|
|
142
|
+
const version = require('../../../package.json').version;
|
|
143
|
+
const filas = detectarInstalaciones();
|
|
144
|
+
|
|
145
|
+
return new Promise((resolve) => {
|
|
146
|
+
// Modo no-TTY: salida texto plano sin esperar input
|
|
147
|
+
if (!render.ES_TTY || !process.stdin.isTTY) {
|
|
148
|
+
console.log('');
|
|
149
|
+
console.log(` swl-ses v${version}`);
|
|
150
|
+
console.log(` ${SUBTITULO}`);
|
|
151
|
+
console.log('');
|
|
152
|
+
if (filas.length > 0) {
|
|
153
|
+
console.log(' Instalaciones detectadas:');
|
|
154
|
+
for (const f of filas) {
|
|
155
|
+
console.log(` ${f.runtime} (${f.scope}): v${f.version}, perfil ${f.perfil}`);
|
|
156
|
+
}
|
|
157
|
+
} else {
|
|
158
|
+
console.log(' No se detectaron instalaciones SWL.');
|
|
159
|
+
}
|
|
160
|
+
console.log('');
|
|
161
|
+
resolve({ continuar: true, instalaciones: filas });
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
render.iniciarModoTui();
|
|
166
|
+
_renderizar(filas, version);
|
|
167
|
+
|
|
168
|
+
// Re-renderizar en resize
|
|
169
|
+
const onResize = () => _renderizar(filas, version);
|
|
170
|
+
process.stdout.on('resize', onResize);
|
|
171
|
+
|
|
172
|
+
const teclado = teclas.crearTeclado();
|
|
173
|
+
|
|
174
|
+
function finalizar(continuar) {
|
|
175
|
+
teclado.desactivar();
|
|
176
|
+
process.stdout.removeListener('resize', onResize);
|
|
177
|
+
render.salirModoTui();
|
|
178
|
+
resolve({ continuar, instalaciones: filas });
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
teclado.on('return', () => finalizar(true));
|
|
182
|
+
teclado.on('escape', () => finalizar(false));
|
|
183
|
+
teclado.activar();
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
module.exports = { mostrarWelcome, detectarInstalaciones, LOGO, SUBTITULO };
|