nexakit 0.13.1 → 0.14.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.
- package/.claude-plugin/marketplace.json +3 -3
- package/README.md +9 -8
- package/assets/runtime/package-lock.json +2 -2
- package/dist/fabrica/cli.js +69 -6
- package/dist/fabrica/conectores/codex.js +68 -1
- package/dist/fabrica/cuotas.js +299 -0
- package/dist/fabrica/decision.js +1 -3
- package/dist/fabrica/ejecutor.js +3 -0
- package/dist/fabrica/encargo/ejecutar.js +19 -6
- package/dist/fabrica/enrutador.js +77 -34
- package/dist/fabrica/mcp.js +2 -2
- package/dist/fabrica/rastro.js +2 -2
- package/dist/fabrica/sesion.js +5 -5
- package/dist/fabrica/tabla-modelos.json +4 -4
- package/package.json +1 -1
- package/plugins/huellas.json +8 -8
- package/plugins/nexakit-ahorro/.claude-plugin/plugin.json +2 -2
- package/plugins/nexakit-ahorro/README.md +9 -3
- package/plugins/nexakit-ahorro/hooks/register.js +17 -0
- package/plugins/nexakit-ahorro/tests/register.test.ts +40 -6
- package/plugins/nexakit-modelo/.claude-plugin/plugin.json +2 -2
- package/plugins/nexakit-modelo/hooks/barra.js +4 -27
- package/plugins/nexakit-modelo/hooks/decidir.js +15 -46
- package/plugins/nexakit-modelo/hooks/recomendar.js +8 -13
- package/plugins/nexakit-modelo/hooks/register.js +13 -134
- package/plugins/nexakit-modelo/tests/register.test.ts +31 -230
- package/plugins/nexakit-sesion/.claude-plugin/plugin.json +1 -1
- package/plugins/nexakit-sesion/hooks/aviso.js +5 -6
- package/plugins/nexakit-sesion/hooks/register.js +1 -1
- package/plugins/niveles/.claude-plugin/plugin.json +2 -2
- package/plugins/niveles/agents/cazador-de-flakes.md +2 -5
- package/plugins/niveles/agents/cierre-de-memoria.md +2 -4
- package/plugins/niveles/agents/investigador.md +6 -9
- package/plugins/niveles/agents/nivel-alto.md +6 -7
- package/plugins/niveles/agents/nivel-exigente.md +6 -7
- package/plugins/niveles/agents/nivel-ligero.md +7 -8
- package/plugins/niveles/agents/nivel-normal.md +6 -7
- package/plugins/niveles/agents/revisor-de-calidad.md +2 -4
- package/plugins/niveles/agents/sincronizador-docs.md +2 -4
- package/plugins/niveles/agents/subir-al-repo.md +2 -4
- package/skills/elegir-modelo/SKILL.md +13 -14
- package/skills/elegir-modelo/modelos.mjs +1 -0
- package/skills/fabrica/SKILL.md +6 -7
- package/src/agent-models.js +21 -7
- package/src/ahorro-command.js +26 -4
- package/src/antigravity-agents.js +10 -8
- package/src/antigravity-barra.js +89 -24
- package/src/antigravity-command.js +11 -3
- package/src/antigravity-hook.js +1 -1
- package/src/antigravity-pre-tool.js +3 -1
- package/src/antigravity-recommendation.js +49 -51
- package/src/codex-audit.js +2 -2
- package/src/codex-auto-output.js +3 -0
- package/src/codex-hook.js +1 -1
- package/src/codex-output.js +6 -1
- package/src/codex-pre-tool.js +7 -0
- package/src/codex-recommendation.js +6 -10
- package/src/codex-routing.js +1 -1
- package/src/codex-setup.js +4 -3
- package/src/codex-team.js +20 -19
- package/src/fabrica/cli.ts +63 -6
- package/src/fabrica/conectores/codex.ts +65 -2
- package/src/fabrica/conectores/tipos.ts +2 -0
- package/src/fabrica/cuotas.ts +294 -0
- package/src/fabrica/decision.ts +1 -3
- package/src/fabrica/ejecutor.ts +2 -0
- package/src/fabrica/encargo/ejecutar.ts +17 -6
- package/src/fabrica/enrutador.ts +67 -31
- package/src/fabrica/mcp.ts +2 -2
- package/src/fabrica/rastro.ts +2 -2
- package/src/fabrica/sesion.ts +6 -6
- package/src/fabrica/tabla-modelos.json +4 -4
- package/src/gemini-tools.js +1 -1
- package/src/level-agents.js +9 -7
- package/src/model-command.js +16 -7
- package/src/mods.js +2 -2
- package/src/preferencias-globales.js +80 -0
- package/src/review-instructions.js +27 -37
- package/src/toolkit-cli.js +5 -4
- package/src/regla-ordenes-simples.d.ts +0 -2
- package/src/regla-ordenes-simples.js +0 -4
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
{ "ia": "codex", "modelo": "gpt-6-sol", "esfuerzo": "high" }
|
|
5
5
|
],
|
|
6
6
|
"arquitectura": [
|
|
7
|
-
{ "ia": "antigravity", "modelo": "gemini-4-
|
|
7
|
+
{ "ia": "antigravity", "modelo": "gemini-4-neon-high", "esfuerzo": null },
|
|
8
8
|
{ "ia": "codex", "modelo": "gpt-6.1-sol", "esfuerzo": "high" }
|
|
9
9
|
],
|
|
10
10
|
"pruebas": [
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"codigo": [
|
|
14
14
|
{ "ia": "claude", "modelo": "revisor-de-calidad", "esfuerzo": null },
|
|
15
15
|
{ "ia": "codex", "modelo": "gpt-6.1-sol", "esfuerzo": "high" },
|
|
16
|
-
{ "ia": "antigravity", "modelo": "gemini-4-
|
|
16
|
+
{ "ia": "antigravity", "modelo": "gemini-4-neon-high", "esfuerzo": null }
|
|
17
17
|
],
|
|
18
18
|
"interfaz": [
|
|
19
19
|
{ "ia": "claude", "modelo": "impeccable-finish-reviewer", "esfuerzo": null },
|
|
20
|
-
{ "ia": "antigravity", "modelo": "gemini-4-
|
|
20
|
+
{ "ia": "antigravity", "modelo": "gemini-4-neon-high", "esfuerzo": null }
|
|
21
21
|
],
|
|
22
22
|
"rendimiento": [
|
|
23
|
-
{ "ia": "antigravity", "modelo": "gemini-4-
|
|
23
|
+
{ "ia": "antigravity", "modelo": "gemini-4-neon-high", "esfuerzo": null }
|
|
24
24
|
],
|
|
25
25
|
"documentacion": [
|
|
26
26
|
{ "ia": "antigravity", "modelo": "gemini-3.8-flash-medium", "esfuerzo": null },
|
package/package.json
CHANGED
package/plugins/huellas.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"nexakit-ahorro": {
|
|
3
|
-
"version": "0.
|
|
4
|
-
"huella": "
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"huella": "d27d3044552b79dd"
|
|
5
5
|
},
|
|
6
6
|
"nexakit-guardarrailes": {
|
|
7
7
|
"version": "0.1.1",
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
"huella": "78c2110143433c40"
|
|
13
13
|
},
|
|
14
14
|
"nexakit-modelo": {
|
|
15
|
-
"version": "0.
|
|
16
|
-
"huella": "
|
|
15
|
+
"version": "0.6.0",
|
|
16
|
+
"huella": "337ced93371b01bb"
|
|
17
17
|
},
|
|
18
18
|
"nexakit-sesion": {
|
|
19
|
-
"version": "0.
|
|
20
|
-
"huella": "
|
|
19
|
+
"version": "0.3.0",
|
|
20
|
+
"huella": "2c73df409cc3946f"
|
|
21
21
|
},
|
|
22
22
|
"niveles": {
|
|
23
|
-
"version": "0.
|
|
24
|
-
"huella": "
|
|
23
|
+
"version": "0.4.0",
|
|
24
|
+
"huella": "511d76be0324de3d"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexakit-ahorro",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Opcional y apagado por defecto: con nexakit ahorro --activar recorta la salida larga de los comandos y guarda la completa en ~/.nexakit/salidas.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juan Jaller"
|
|
7
7
|
},
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# nexakit-ahorro
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
**Opcional y apagado por defecto.** nexakit trabaja en modo completo: las IA reciben la salida entera de los
|
|
4
|
+
comandos, porque recortarla les hacía trabajar peor (releían logs, perdían contexto y tardaban más). Si prefieres
|
|
5
|
+
ahorrar tokens, actívalo con `nexakit ahorro --activar` (guarda `{ "ahorro": true }` en
|
|
6
|
+
`~/.nexakit/preferencias.json`) y desactívalo con `nexakit ahorro --desactivar`. La misma preferencia activa el
|
|
7
|
+
recorte de los hooks de Codex y de Antigravity.
|
|
8
|
+
|
|
9
|
+
Con el ahorro activo, cada línea que devuelve un comando entra al contexto y se vuelve a pagar en todos los
|
|
10
|
+
turnos siguientes; por eso este mod recorta la salida de Bash que pasa de 120 líneas o 12 000 caracteres: conserva las 20 primeras, las 40
|
|
5
11
|
últimas y hasta 40 líneas con señales de fallo (`error`, `fail`, `not ok`, `✖`…), quita los códigos de color y
|
|
6
12
|
acorta las líneas gigantes. La salida completa queda en `~/.nexakit/salidas/` y el aviso dice la ruta.
|
|
7
13
|
|
|
@@ -9,7 +15,7 @@ Para ver una salida entera, pon `NEXAKIT_SALIDA=completa` delante del comando. L
|
|
|
9
15
|
las imágenes no se tocan.
|
|
10
16
|
|
|
11
17
|
Cada recorte añade una línea con cifras (fecha, caracteres y líneas antes y después; nunca el contenido ni el
|
|
12
|
-
comando) a `~/.nexakit/ahorro.jsonl`, donde se conservan 90 días (y como máximo 5000 líneas). `nexakit ahorro` resume cuántos recortes hubo y cuánto se evitó.
|
|
18
|
+
comando) a `~/.nexakit/ahorro.jsonl`, donde se conservan 90 días (y como máximo 5000 líneas). `nexakit ahorro` dice si está activo y resume cuántos recortes hubo y cuánto se evitó.
|
|
13
19
|
|
|
14
20
|
## Por qué solo Bash
|
|
15
21
|
|
|
@@ -53,6 +53,22 @@ async function registrar($, antes, despues) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
// El recorte es opcional y está apagado por defecto: solo actúa con `{ "ahorro": true }` en
|
|
57
|
+
// ~/.nexakit/preferencias.json (lo escribe `nexakit ahorro --activar`). Sin HOME o sin poder leerlo, no recorta.
|
|
58
|
+
async function ahorroActivo($) {
|
|
59
|
+
try {
|
|
60
|
+
const home = (await $.env.get('HOME')) ?? (await $.env.get('USERPROFILE'));
|
|
61
|
+
if (!home) return false;
|
|
62
|
+
const ruta = `${home}/.nexakit/preferencias.json`;
|
|
63
|
+
if (!(await $.fs.exists(ruta))) return false;
|
|
64
|
+
const texto = await $.fs.read(ruta);
|
|
65
|
+
if (typeof texto !== 'string' || texto.length > 16 * 1024) return false;
|
|
66
|
+
return JSON.parse(texto)?.ahorro === true;
|
|
67
|
+
} catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
56
72
|
export function register(on) {
|
|
57
73
|
on('tool.call', { tool: 'Bash' }, async ($, e, next) => {
|
|
58
74
|
const r = await next(e);
|
|
@@ -61,6 +77,7 @@ export function register(on) {
|
|
|
61
77
|
if (COMPLETA.test(e.command ?? '')) return r;
|
|
62
78
|
const unida = salida.stderr ? `${salida.stdout}\n${salida.stderr}` : salida.stdout;
|
|
63
79
|
if (compactarSalida(unida).omitidas === 0) return r;
|
|
80
|
+
if (!(await ahorroActivo($))) return r;
|
|
64
81
|
let ruta = null;
|
|
65
82
|
try {
|
|
66
83
|
ruta = await guardar($, unida);
|
|
@@ -8,13 +8,16 @@ const lineas = (n: number) => Array.from({ length: n }, (_, i) => `linea ${i + 1
|
|
|
8
8
|
const corta = lineas(10).join('\n');
|
|
9
9
|
const larga = [...lineas(1500), 'error: se rompió el módulo', ...lineas(1500)].join('\n');
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// Por defecto el ahorro está activo en ~/.nexakit/preferencias.json; `ahorro: false` o `preferencias: null` lo apagan.
|
|
12
|
+
function simularMundo(on: any, opciones: { home?: string | null; fallarEscritura?: boolean; fallarSoloRegistro?: boolean; preferencias?: string | null } = {}) {
|
|
12
13
|
const escrituras: { path: string; text: string }[] = [];
|
|
13
14
|
const home = opciones.home === undefined ? HOME_FALSO : opciones.home;
|
|
15
|
+
const preferencias = opciones.preferencias === undefined ? '{"ahorro":true}' : opciones.preferencias;
|
|
16
|
+
const rutaPreferencias = `${home}/.nexakit/preferencias.json`;
|
|
14
17
|
mock.env(on, home ? { HOME: home } : {});
|
|
15
18
|
mock.clock(on, { now: AHORA });
|
|
16
|
-
on('fs.exists', () => ({ value:
|
|
17
|
-
on('fs.read', () => ({ value: '' }));
|
|
19
|
+
on('fs.exists', ($: any, e: any) => ({ value: preferencias !== null && e.path === rutaPreferencias }));
|
|
20
|
+
on('fs.read', ($: any, e: any) => ({ value: e.path === rutaPreferencias ? (preferencias ?? '') : '' }));
|
|
18
21
|
on('fs.write', ($: any, e: any) => {
|
|
19
22
|
if (opciones.fallarEscritura || (opciones.fallarSoloRegistro && e.path.endsWith('ahorro.jsonl'))) {
|
|
20
23
|
return { deny: 'disco lleno simulado' };
|
|
@@ -98,12 +101,43 @@ describe('nexakit-ahorro con el motor', () => {
|
|
|
98
101
|
expect(escrituras.length).toBe(1);
|
|
99
102
|
});
|
|
100
103
|
|
|
101
|
-
test('sin HOME
|
|
104
|
+
test('sin HOME no hay preferencias que leer: la salida pasa intacta', async ($, on) => {
|
|
102
105
|
const escrituras = simularMundo(on, { home: null });
|
|
103
106
|
simularBash(on, larga);
|
|
104
107
|
const r = await $.tool.call({ tool: 'Bash', command: 'npm test' });
|
|
105
|
-
expect(r.result.stdout
|
|
106
|
-
expect(
|
|
108
|
+
expect(r.result.stdout).toBe(larga);
|
|
109
|
+
expect(escrituras).toEqual([]);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test('por defecto (sin preferencias) no recorta: el ahorro es opcional', async ($, on) => {
|
|
113
|
+
const escrituras = simularMundo(on, { preferencias: null });
|
|
114
|
+
simularBash(on, larga);
|
|
115
|
+
const r = await $.tool.call({ tool: 'Bash', command: 'npm test' });
|
|
116
|
+
expect(r.result.stdout).toBe(larga);
|
|
117
|
+
expect(escrituras).toEqual([]);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test('con el archivo de preferencias desactivado no recorta', async ($, on) => {
|
|
121
|
+
const escrituras = simularMundo(on, { preferencias: '{"ahorro":false}' });
|
|
122
|
+
simularBash(on, larga);
|
|
123
|
+
const r = await $.tool.call({ tool: 'Bash', command: 'npm test' });
|
|
124
|
+
expect(r.result.stdout).toBe(larga);
|
|
125
|
+
expect(escrituras).toEqual([]);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('con el archivo de preferencias roto no recorta', async ($, on) => {
|
|
129
|
+
const escrituras = simularMundo(on, { preferencias: '{roto' });
|
|
130
|
+
simularBash(on, larga);
|
|
131
|
+
const r = await $.tool.call({ tool: 'Bash', command: 'npm test' });
|
|
132
|
+
expect(r.result.stdout).toBe(larga);
|
|
133
|
+
expect(escrituras).toEqual([]);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test('con el archivo de preferencias con un valor que no es booleano no recorta', async ($, on) => {
|
|
137
|
+
const escrituras = simularMundo(on, { preferencias: '{"ahorro":"sí"}' });
|
|
138
|
+
simularBash(on, larga);
|
|
139
|
+
const r = await $.tool.call({ tool: 'Bash', command: 'npm test' });
|
|
140
|
+
expect(r.result.stdout).toBe(larga);
|
|
107
141
|
expect(escrituras).toEqual([]);
|
|
108
142
|
});
|
|
109
143
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexakit-modelo",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Barra sobre el prompt con modelo, esfuerzo,
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Barra informativa sobre el prompt con modelo, esfuerzo, acierto de caché, contexto, límites y subagentes en curso, sin cambiar nada; solo propone subir de modelo o de esfuerzo cuando el mensaje lo pide, nunca bajar ni delegar.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juan Jaller"
|
|
7
7
|
}
|
|
@@ -94,37 +94,15 @@ function tramosDeTokens(tokens) {
|
|
|
94
94
|
return tramos;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
// La decisión (mantener
|
|
97
|
+
// La decisión (mantener o subir modelo o esfuerzo) la toma decidir.js; aquí solo se pinta. Nunca se propone bajar
|
|
98
|
+
// ni delegar: la barra es informativa.
|
|
98
99
|
function sugerencia(estado) {
|
|
99
100
|
const d = decidir(estado);
|
|
100
101
|
if (!d) return null;
|
|
101
102
|
if (d.accion === 'mantener') return { text: ' ✓', color: 'success' };
|
|
102
|
-
// Al delegar, el tramo lleva el nivel y el texto de la etiqueta para que el render pueda dibujar un botón.
|
|
103
|
-
if (d.accion === 'delegar' && d.nivel) return { text: ` → ${d.texto}`, color: 'suggestion', accion: 'delegar', nivel: d.nivel, etiqueta: `→ ${d.texto}` };
|
|
104
103
|
return { text: ` → ${d.texto}`, color: 'suggestion' };
|
|
105
104
|
}
|
|
106
105
|
|
|
107
|
-
// Lo que el botón de delegar envía a la sesión. Los niveles ligero y normal pasan primero por un encargo a
|
|
108
|
-
// Codex o Antigravity; los exigentes y altos van directos al subagente de nivel.
|
|
109
|
-
export function instruccionDeDelegar(nivel) {
|
|
110
|
-
if (nivel === 'nivel-ligero' || nivel === 'nivel-normal') {
|
|
111
|
-
return `Delega la tarea de mi mensaje anterior: encárgala con fabrica_encargar en Codex o Antigravity, revisa el diff con una IA distinta, aplícalo, ejecuta las pruebas y dime qué IA lo hizo. Si no encaja en un encargo, pásala al subagente niveles:${nivel}.`;
|
|
112
|
-
}
|
|
113
|
-
return `Delega la tarea de mi mensaje anterior en el subagente niveles:${nivel} y comprueba su informe.`;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Un turn.abort solo trae el id del turno (y agentId si lo trajera): es el de la sesión principal si no es de un
|
|
117
|
-
// subagente y coincide con el turno principal conocido (o aún no se conoce ninguno). Solo entonces el botón de
|
|
118
|
-
// delegar vuelve y se puede reintentar la delegación.
|
|
119
|
-
export function alAbortarTurno(estado, e) {
|
|
120
|
-
if (e?.agentId || (estado.turnoId !== null && e?.turnId !== estado.turnoId)) return false;
|
|
121
|
-
Object.assign(estado, { turnoActivo: false, turnoId: null, delegado: false });
|
|
122
|
-
return true;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// El límite de uso más alto de los que informa la API (5 horas o semanal).
|
|
126
|
-
const limiteMasAlto = (usage) => Math.max(-1, ...(usage?.rateLimits ?? []).map((l) => (esNumero(l?.percentUsed) ? l.percentUsed : -1)));
|
|
127
|
-
|
|
128
106
|
const DIAS = ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'];
|
|
129
107
|
|
|
130
108
|
// Cuándo se reinicia un límite, en la hora local: «15:30» si es hoy y «vie 10:00» si es otro día. null si el
|
|
@@ -138,14 +116,13 @@ export function formatoReinicio(resetsAt, ahora = Date.now()) {
|
|
|
138
116
|
return f.toDateString() === new Date(ahora).toDateString() ? hora : `${DIAS[f.getDay()]} ${hora}`;
|
|
139
117
|
}
|
|
140
118
|
|
|
141
|
-
export function segmentosDeBarra({ model, effort, recommendation, usage, cache,
|
|
119
|
+
export function segmentosDeBarra({ model, effort, recommendation, usage, cache, ahora = Date.now() }) {
|
|
142
120
|
const s = [
|
|
143
121
|
{ text: nombreModelo(model), color: 'claude', bold: true },
|
|
144
122
|
effort ? { text: ` · ${effort}` } : { text: ' · esfuerzo ?', dim: true },
|
|
145
123
|
];
|
|
146
124
|
const ctx = usage?.context?.percent;
|
|
147
|
-
const
|
|
148
|
-
const propuesta = recommendation && sugerencia({ model, effort, recommendation, ctx, tokens: usage?.context?.tokens, cacheFria, limite: limite < 0 ? undefined : limite, rutinaSeguidas });
|
|
125
|
+
const propuesta = recommendation && sugerencia({ model, effort, recommendation });
|
|
149
126
|
if (propuesta) s.push(propuesta);
|
|
150
127
|
const acierto = aciertoDeCache(cache);
|
|
151
128
|
if (acierto !== null) s.push({ text: ' caché ', dim: true }, { text: `${Math.round(acierto)}%`, color: tonoCache(acierto) });
|
|
@@ -1,58 +1,27 @@
|
|
|
1
|
-
// Decide qué
|
|
2
|
-
// llamar a ningún modelo.
|
|
3
|
-
//
|
|
4
|
-
// - cambiar de modelo relee todo el contexto sin caché: solo es barato con poco contexto o con la caché ya fría;
|
|
5
|
-
// - un subagente tiene su propia caché: delegar no toca la de la sesión;
|
|
6
|
-
// - seguir muchos turnos de rutina en un modelo caro cuesta en cada turno: conviene una sesión nueva.
|
|
1
|
+
// Decide qué mostrar cruzando la recomendación del mensaje con el modelo y el esfuerzo de la sesión. Datos puros,
|
|
2
|
+
// sin llamar a ningún modelo. Modo completo (0.14.0): la barra es informativa y solo propone subir. Nunca propone
|
|
3
|
+
// bajar de modelo ni de esfuerzo, delegar, abrir una sesión nueva para ahorrar ni rebajar por el límite de uso.
|
|
7
4
|
import { familia, nombreModelo } from './barra.js';
|
|
8
5
|
|
|
9
|
-
|
|
6
|
+
// Límite de uso a partir del cual el porcentaje se pinta en rojo en la barra de Antigravity (solo informa).
|
|
10
7
|
export const LIMITE_ALTO = 80;
|
|
11
|
-
export const RUTINA_PARA_SESION = 5;
|
|
12
8
|
|
|
13
9
|
const RANGO = { haiku: 0, sonnet: 1, opus: 2, fable: 3 };
|
|
10
|
+
const ESFUERZO = { low: 0, medium: 1, high: 2, xhigh: 3, max: 4 };
|
|
14
11
|
const rango = (model) => RANGO[familia(model)] ?? -1;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
// Cerca del límite de uso no se propone el modelo más caro para diseñar: Sonnet con más esfuerzo. Un fallo
|
|
18
|
-
// difícil o de seguridad se mantiene: ahí el modelo es lo que falta.
|
|
19
|
-
export function ajustarPorLimite(recommendation, limite) {
|
|
20
|
-
if (!recommendation || !esNumero(limite) || limite < LIMITE_ALTO) return recommendation;
|
|
21
|
-
if (rango(recommendation.model) < RANGO.opus || recommendation.delegar) return recommendation;
|
|
22
|
-
return { model: 'sonnet', effort: 'high', reason: `límite de uso al ${Math.round(limite)} %: Sonnet con más esfuerzo` };
|
|
23
|
-
}
|
|
12
|
+
const esfuerzo = (e) => ESFUERZO[e] ?? -1;
|
|
24
13
|
|
|
25
14
|
const etiqueta = (r) => `${nombreModelo(r.model)} · ${r.effort}`;
|
|
26
15
|
|
|
27
|
-
|
|
28
|
-
export function decidir(entrada) {
|
|
29
|
-
const { recommendation, limite } = entrada;
|
|
30
|
-
const r = ajustarPorLimite(recommendation, limite);
|
|
16
|
+
export function decidir({ recommendation: r, model, effort }) {
|
|
31
17
|
if (!r) return null;
|
|
32
|
-
|
|
33
|
-
if (r
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (r.delegar === 'nivel-ligero') {
|
|
40
|
-
return mismaFamilia && effort === r.effort
|
|
41
|
-
? { accion: 'mantener', texto: '✓' }
|
|
42
|
-
: { accion: 'delegar', texto: `delega: ${r.delegar}`, nivel: r.delegar };
|
|
43
|
-
}
|
|
44
|
-
if (mismaFamilia) {
|
|
45
|
-
return effort === r.effort ? { accion: 'mantener', texto: '✓' } : { accion: 'esfuerzo', texto: etiqueta(r) };
|
|
46
|
-
}
|
|
47
|
-
const barato = cacheFria || !esNumero(ctx) || ctx < CONTEXTO_BARATO;
|
|
48
|
-
const fria = cacheFria ? ' (caché fría: cambiar no cuesta)' : '';
|
|
49
|
-
if (rango(r.model) > rango(model)) {
|
|
50
|
-
if (barato) return { accion: 'cambiar', texto: `${etiqueta(r)}${fria}` };
|
|
51
|
-
if (r.delegar) return { accion: 'delegar', texto: `delega: ${r.delegar}`, nivel: r.delegar };
|
|
52
|
-
const coste = esNumero(tokens) && tokens > 0 ? ` · relee ~${Math.round(tokens / 1000)}k` : '';
|
|
53
|
-
return { accion: 'cambiar', texto: `${etiqueta(r)}${coste}` };
|
|
18
|
+
// Un modelo más capaz que el de la sesión: se propone subir.
|
|
19
|
+
if (rango(r.model) > rango(model)) return { accion: 'cambiar', texto: etiqueta(r) };
|
|
20
|
+
// Sin el esfuerzo de la sesión no se sabe si coincide: no se pinta nada.
|
|
21
|
+
if (!effort) return null;
|
|
22
|
+
// Mismo modelo (o uno más capaz ya en uso) y un esfuerzo mayor: se propone subir el esfuerzo.
|
|
23
|
+
if (esfuerzo(r.effort) > esfuerzo(effort)) {
|
|
24
|
+
return familia(model) === familia(r.model) ? { accion: 'esfuerzo', texto: etiqueta(r) } : { accion: 'esfuerzo', texto: r.effort };
|
|
54
25
|
}
|
|
55
|
-
|
|
56
|
-
if (rutinaSeguidas >= RUTINA_PARA_SESION) return { accion: 'sesion', texto: `sesión nueva en ${nombreModelo(r.model)}` };
|
|
57
|
-
return effort === r.effort || !effort ? { accion: 'mantener', texto: '✓' } : { accion: 'esfuerzo', texto: r.effort };
|
|
26
|
+
return { accion: 'mantener', texto: '✓' };
|
|
58
27
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Recomendación local por el texto del mensaje: sin llamar a ningún modelo ni gastar tokens.
|
|
2
|
-
// Sigue la guía de elegir-modelo: uso diario por defecto; ante un fallo sube el
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// Sigue la guía de elegir-modelo: uso diario con su esfuerzo por defecto como mínimo; ante un fallo sube el
|
|
3
|
+
// esfuerzo (verificar importa) y sube de modelo si ya se intentó y falló, es intermitente o es de seguridad; el más
|
|
4
|
+
// capaz para diseñar. Modo completo (0.14.0): nunca propone un modelo ligero, un esfuerzo bajo ni delegar.
|
|
5
|
+
// Las reglas se ajustaron contrastándolas con mensajes reales de uso.
|
|
5
6
|
|
|
6
7
|
// Solo cuenta como confirmación un mensaje hecho únicamente de estas palabras, separadas entre sí:
|
|
7
8
|
// «ok, depura esto» y «sídale» no lo son.
|
|
@@ -43,15 +44,9 @@ const ESCRIBIR_PRUEBAS = /\b(?:escrib|a[ñn]ad|agreg|crea|cubr|complet|ampl[ií]
|
|
|
43
44
|
export function recomendarPorTexto(texto, previa = null) {
|
|
44
45
|
const limpio = String(texto ?? '').trim();
|
|
45
46
|
if (limpio === '' || (previa && CONFIRMACION.test(limpio))) return previa ?? porDefecto();
|
|
46
|
-
// Quien anuncia una pregunta quiere una explicación, mencione o no un error; si es larga o trae otra
|
|
47
|
-
// petición, merece el esfuerzo normal.
|
|
48
|
-
// `delegar` nombra el subagente que hace el mismo trabajo sin cambiar el modelo de la sesión: cada modelo
|
|
49
|
-
// tiene su caché y cambiarlo relee todo el historial sin ella; un subagente no toca la caché de la sesión.
|
|
50
47
|
const esFallo = FALLO.test(limpio);
|
|
51
|
-
if (DIFICIL.test(limpio) || (SIN_CAUSA.test(limpio) && (esFallo || SINTOMA.test(limpio))) || (previa?.fallo && REINTENTO.test(limpio))) return { model: 'opus', effort: 'high', reason: 'fallo difícil, reintento o seguridad: hace falta el más capaz',
|
|
52
|
-
//
|
|
53
|
-
// Quien anuncia una pregunta quiere una explicación, mencione o no un error; si es larga o trae otra
|
|
54
|
-
// petición, merece el esfuerzo normal.
|
|
48
|
+
if (DIFICIL.test(limpio) || (SIN_CAUSA.test(limpio) && (esFallo || SINTOMA.test(limpio))) || (previa?.fallo && REINTENTO.test(limpio))) return { model: 'opus', effort: 'high', reason: 'fallo difícil, reintento o seguridad: hace falta el más capaz', fallo: true };
|
|
49
|
+
// Quien anuncia una pregunta quiere una explicación, mencione o no un error.
|
|
55
50
|
if (SOLO_PREGUNTA.test(limpio)) return limpio.length <= MAX_PREGUNTA && !MECANICO.test(limpio) ? pregunta() : porDefecto();
|
|
56
51
|
if (esFallo) return { model: 'sonnet', effort: 'high', reason: 'fallo: verificar importa', fallo: true };
|
|
57
52
|
// Seguir con lo que ya estaba en marcha conserva la recomendación de ese trabajo.
|
|
@@ -61,14 +56,14 @@ export function recomendarPorTexto(texto, previa = null) {
|
|
|
61
56
|
return { model: 'sonnet', effort: 'high', reason: 'pruebas o casos borde: verificar importa' };
|
|
62
57
|
}
|
|
63
58
|
if ((MECANICO.test(limpio) || BUSQUEDA.test(limpio)) && !TRABAJO.test(limpio) && !PREGUNTA.test(limpio)) {
|
|
64
|
-
return { model: '
|
|
59
|
+
return { model: 'sonnet', effort: 'medium', reason: 'tarea mecánica', mecanica: true };
|
|
65
60
|
}
|
|
66
61
|
if (PREGUNTA_SIMPLE.test(limpio) && limpio.length <= MAX_PREGUNTA && !TRABAJO.test(limpio) && !PETICION.test(limpio)) return pregunta();
|
|
67
62
|
return porDefecto();
|
|
68
63
|
}
|
|
69
64
|
|
|
70
65
|
function pregunta() {
|
|
71
|
-
return { model: 'sonnet', effort: '
|
|
66
|
+
return { model: 'sonnet', effort: 'medium', reason: 'pregunta o explicación' };
|
|
72
67
|
}
|
|
73
68
|
|
|
74
69
|
function porDefecto() {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { activoDeTexto,
|
|
2
|
-
import { ajustarPorLimite } from './decidir.js';
|
|
1
|
+
import { activoDeTexto, columnaDeAgentes, columnaDeFabrica, familia, filasDeAgentes, filasDeFabrica, segmentosDeBarra, sumarTokens, tokensVacios } from './barra.js';
|
|
3
2
|
import { recomendarPorTexto } from './recomendar.js';
|
|
4
3
|
|
|
5
4
|
async function refrescar($, estado, { usage = false } = {}) {
|
|
@@ -27,35 +26,7 @@ async function sincronizarAgentes($, agentes) {
|
|
|
27
26
|
$.ui.invalidate('ui.render');
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
const mismaRecomendacion = (a, b) =>
|
|
31
|
-
a?.model === b?.model && a?.effort === b?.effort && a?.delegar === b?.delegar;
|
|
32
|
-
|
|
33
|
-
// La caché de la conversación caduca tras un rato sin actividad: una hora con suscripción (la API informa
|
|
34
|
-
// límites de uso) y cinco minutos con clave de API. Con la caché fría, cambiar de modelo ya no cuesta nada extra.
|
|
35
|
-
const MINUTO = 60 * 1000;
|
|
36
|
-
const vidaDeCache = (usage) => ((usage?.rateLimits ?? []).length > 0 ? 60 : 5) * MINUTO;
|
|
37
|
-
const RANGO = { haiku: 0, sonnet: 1, opus: 2, fable: 3 };
|
|
38
|
-
const rango = (model) => RANGO[familia(model)] ?? -1;
|
|
39
|
-
|
|
40
|
-
async function medirCacheFria($, estado) {
|
|
41
|
-
try {
|
|
42
|
-
const fria = estado.ultimaActividad !== null && (await $.clock.now()) - estado.ultimaActividad > vidaDeCache(estado.usage);
|
|
43
|
-
if (fria === estado.cacheFria) return false;
|
|
44
|
-
estado.cacheFria = fria;
|
|
45
|
-
return true;
|
|
46
|
-
} catch {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async function marcarActividad($, estado) {
|
|
52
|
-
try {
|
|
53
|
-
estado.ultimaActividad = await $.clock.now();
|
|
54
|
-
estado.cacheFria = false;
|
|
55
|
-
} catch {
|
|
56
|
-
// Sin reloj no se sabe si la caché está fría: se asume caliente.
|
|
57
|
-
}
|
|
58
|
-
}
|
|
29
|
+
const mismaRecomendacion = (a, b) => a?.model === b?.model && a?.effort === b?.effort;
|
|
59
30
|
|
|
60
31
|
const cacheVacia = () => ({ read: 0, creation: 0, input: 0, turnos: 0 });
|
|
61
32
|
const tokens = (v) => (typeof v === 'number' && Number.isFinite(v) && v > 0 ? v : 0);
|
|
@@ -84,29 +55,14 @@ async function activoDeLaFabrica($) {
|
|
|
84
55
|
}
|
|
85
56
|
}
|
|
86
57
|
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
const MENSAJE_ENCARGO = 'Primero encarga esta implementación con fabrica_encargar (Codex o Antigravity): ahorra tokens de Claude. Si el encargo no es posible (repo sin commits, otro encargo en marcha, sin conector) o ya falló, vuelve a lanzar el subagente con [sin encargo] en la descripción.';
|
|
90
|
-
|
|
91
|
-
// Un subagente niveles:nivel-normal pedido por la sesión principal sin la marca [sin encargo].
|
|
92
|
-
function vetaSubagenteNormal(e) {
|
|
93
|
-
if (e.agentId || e.subagent_type !== 'niveles:nivel-normal') return false;
|
|
94
|
-
return !`${e.description ?? ''}\n${e.prompt ?? ''}`.toLowerCase().includes(MARCA_SIN_ENCARGO);
|
|
95
|
-
}
|
|
58
|
+
// Estado inicial de la barra; session.end vuelve a él.
|
|
59
|
+
const estadoInicial = () => ({ model: null, effort: null, modeloDelEsfuerzo: null, recommendation: null, enviada: null, usage: null, cache: cacheVacia() });
|
|
96
60
|
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return (await $.tool.list()).some((t) => t.name === HERRAMIENTA_ENCARGO);
|
|
101
|
-
} catch {
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Una sola barra sobre el prompt con modelo, esfuerzo, recomendación y uso. Solo muestra:
|
|
107
|
-
// nunca cambia el modelo ni el esfuerzo de la sesión.
|
|
61
|
+
// Una sola barra sobre el prompt con modelo, esfuerzo, caché, contexto, límites y subagentes. Solo informa: nunca
|
|
62
|
+
// cambia el modelo ni el esfuerzo de la sesión, no veta subagentes y no empuja a delegar ni a bajar de modelo;
|
|
63
|
+
// como mucho propone subir cuando el mensaje lo pide (un fallo difícil, un diseño).
|
|
108
64
|
export function register(on) {
|
|
109
|
-
const estado =
|
|
65
|
+
const estado = estadoInicial();
|
|
110
66
|
// Subagentes de esta petición, por id, con el modelo y el esfuerzo que de verdad usaron.
|
|
111
67
|
const agentes = new Map();
|
|
112
68
|
|
|
@@ -132,23 +88,13 @@ export function register(on) {
|
|
|
132
88
|
return { result: 'Recomendación mostrada; no se cambió el modelo ni el esfuerzo.' };
|
|
133
89
|
});
|
|
134
90
|
|
|
135
|
-
// La implementación de nivel normal se encarga primero (fabrica_encargar en Codex o Antigravity, que ahorra tokens de
|
|
136
|
-
// Claude). Solo se veta el subagente niveles:nivel-normal lanzado por la sesión principal y sin la marca
|
|
137
|
-
// [sin encargo] (para cuando el encargo no es posible o ya falló); nada más se bloquea.
|
|
138
|
-
on('tool.call', { tool: 'Agent' }, async ($, e, next) => {
|
|
139
|
-
if (!vetaSubagenteNormal(e) || !(await hayEncargos($))) return next(e);
|
|
140
|
-
return { deny: MENSAJE_ENCARGO };
|
|
141
|
-
});
|
|
142
|
-
|
|
143
91
|
// Mientras se escribe: la recomendación aparece antes de pulsar Enter, cuando todavía se puede cambiar
|
|
144
|
-
// de modelo
|
|
92
|
+
// de modelo. Parte de la del último mensaje enviado, para que «ok, dale» la conserve.
|
|
145
93
|
on('prompt.edit', async ($, e, next) => {
|
|
146
94
|
const r = await next(e);
|
|
147
95
|
try {
|
|
148
|
-
estado.borrador = r?.text ?? '';
|
|
149
96
|
const nueva = recomendarPorTexto(r?.text ?? '', estado.enviada);
|
|
150
|
-
|
|
151
|
-
if (cambioCache || !mismaRecomendacion(nueva, estado.recommendation)) {
|
|
97
|
+
if (!mismaRecomendacion(nueva, estado.recommendation)) {
|
|
152
98
|
estado.recommendation = nueva;
|
|
153
99
|
$.ui.invalidate('ui.render');
|
|
154
100
|
}
|
|
@@ -159,40 +105,13 @@ export function register(on) {
|
|
|
159
105
|
});
|
|
160
106
|
|
|
161
107
|
on('prompt.submit', async ($, e, next) => {
|
|
162
|
-
// Lo que envía el propio botón no es un mensaje de la persona: no cambia la recomendación ni «el último mensaje».
|
|
163
|
-
if (estado.enviando && e.origin?.kind === 'plugin') return next(e);
|
|
164
|
-
estado.delegado = false;
|
|
165
|
-
estado.ultimoTexto = e.text;
|
|
166
|
-
estado.borrador = '';
|
|
167
108
|
estado.recommendation = recomendarPorTexto(e.text, estado.enviada);
|
|
168
109
|
estado.enviada = estado.recommendation;
|
|
169
|
-
await medirCacheFria($, estado);
|
|
170
|
-
// Turnos seguidos de rutina en un modelo más caro del que hace falta: al quinto se propone sesión nueva.
|
|
171
|
-
const limite = Math.max(-1, ...(estado.usage?.rateLimits ?? []).map((l) => (Number.isFinite(l?.percentUsed) ? l.percentUsed : -1)));
|
|
172
|
-
const necesaria = ajustarPorLimite(estado.recommendation, limite < 0 ? undefined : limite);
|
|
173
|
-
estado.rutinaSeguidas = estado.model && !necesaria.delegar && rango(necesaria.model) < rango(estado.model) ? estado.rutinaSeguidas + 1 : 0;
|
|
174
110
|
for (const [id, a] of agentes) if (['completed', 'idle', 'failed', 'killed'].includes(a.status)) agentes.delete(id);
|
|
175
111
|
$.ui.invalidate('ui.render');
|
|
176
112
|
return next(e);
|
|
177
113
|
});
|
|
178
114
|
|
|
179
|
-
// Solo un turno real de la sesión principal oculta el botón (un envío que no llega a empezar turno no lo deja bloqueado).
|
|
180
|
-
on('turn.start', async ($, e, next) => {
|
|
181
|
-
if (!e.agentId) {
|
|
182
|
-
estado.turnoActivo = true;
|
|
183
|
-
estado.turnoId = e.turnId ?? null;
|
|
184
|
-
$.ui.invalidate('ui.render');
|
|
185
|
-
}
|
|
186
|
-
return next(e);
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
// El turno de la sesión principal se interrumpió: el botón de delegar puede volver, y también reintentarse.
|
|
190
|
-
// turn.abort solo trae el id del turno: un subagente aborta el suyo, que no es el principal.
|
|
191
|
-
on('turn.abort', async ($, e, next) => {
|
|
192
|
-
if (alAbortarTurno(estado, e)) $.ui.invalidate('ui.render');
|
|
193
|
-
return next(e);
|
|
194
|
-
});
|
|
195
|
-
|
|
196
115
|
on('turn.step', async function* ($, e, next) {
|
|
197
116
|
if (!e.agentId) {
|
|
198
117
|
// El último esfuerzo visto se conserva entre turnos; el siguiente paso lo corrige si cambió.
|
|
@@ -227,11 +146,8 @@ export function register(on) {
|
|
|
227
146
|
on('turn.complete', async ($, e, next) => {
|
|
228
147
|
const r = await next(e);
|
|
229
148
|
if (!e.agentId) {
|
|
230
|
-
estado.turnoActivo = false;
|
|
231
|
-
estado.turnoId = null;
|
|
232
149
|
// Solo la sesión principal: cada subagente tiene su propia caché y no toca la de la sesión.
|
|
233
150
|
sumarCache(estado, r?.usage);
|
|
234
|
-
await marcarActividad($, estado);
|
|
235
151
|
await refrescar($, estado, { usage: true });
|
|
236
152
|
if (agentes.size > 0) await sincronizarAgentes($, agentes);
|
|
237
153
|
}
|
|
@@ -240,45 +156,8 @@ export function register(on) {
|
|
|
240
156
|
|
|
241
157
|
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
|
|
242
158
|
if (e.props?.hasSurvey || !estado.model) return next(e);
|
|
243
|
-
const { Box, Text
|
|
244
|
-
|
|
245
|
-
// texto del último mensaje: se delega «mi mensaje anterior», así que ni la recomendación ni el texto
|
|
246
|
-
// pueden ser de otro borrador.
|
|
247
|
-
const borrador = estado.borrador.trim();
|
|
248
|
-
const hayBoton = Boolean(Button) && e.surface === 'desktop' && !estado.turnoActivo && !estado.delegado
|
|
249
|
-
&& Boolean(estado.enviada) && (borrador === '' || borrador === estado.ultimoTexto?.trim())
|
|
250
|
-
&& (estado.recommendation === estado.enviada || mismaRecomendacion(estado.recommendation, estado.enviada));
|
|
251
|
-
const tramos = segmentosDeBarra(estado).map((s, i) => {
|
|
252
|
-
if (hayBoton && s.accion === 'delegar') {
|
|
253
|
-
const nivel = s.nivel;
|
|
254
|
-
return h(Button, {
|
|
255
|
-
key: 'delegar',
|
|
256
|
-
label: s.etiqueta,
|
|
257
|
-
variant: 'primary',
|
|
258
|
-
onPress: async () => {
|
|
259
|
-
if (estado.delegado || estado.turnoActivo || estado.enviando) return;
|
|
260
|
-
Object.assign(estado, { delegado: true, turnoActivo: true, enviando: true });
|
|
261
|
-
$.ui.invalidate('ui.render');
|
|
262
|
-
try {
|
|
263
|
-
const r = await $.prompt.submit({ text: instruccionDeDelegar(nivel) });
|
|
264
|
-
if (r?.drop !== undefined) throw new Error(r.drop);
|
|
265
|
-
} catch {
|
|
266
|
-
// El envío no empezó: se devuelve el botón y se avisa para poder reintentar.
|
|
267
|
-
Object.assign(estado, { delegado: false, turnoActivo: false });
|
|
268
|
-
try {
|
|
269
|
-
$.ui.toast('No se pudo enviar la delegación. Pulsa el botón de nuevo para reintentar.', { timeoutMs: 8000 });
|
|
270
|
-
} catch {
|
|
271
|
-
// Sin aviso, el botón vuelve igual.
|
|
272
|
-
}
|
|
273
|
-
} finally {
|
|
274
|
-
estado.enviando = false;
|
|
275
|
-
$.ui.invalidate('ui.render');
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
return h(Text, { key: String(i), color: s.color, dimColor: s.dim, bold: s.bold }, s.text);
|
|
281
|
-
});
|
|
159
|
+
const { Box, Text } = $.ui.resolve(e);
|
|
160
|
+
const tramos = segmentosDeBarra(estado).map((s, i) => h(Text, { key: String(i), color: s.color, dimColor: s.dim, bold: s.bold }, s.text));
|
|
282
161
|
const linea = (partes, clave) => h(Box, { key: clave, flexDirection: 'row' },
|
|
283
162
|
...partes.map((s, i) => h(Text, { key: String(i), color: s.color, dimColor: s.dim, bold: s.bold }, s.text)));
|
|
284
163
|
const subagentes = [...agentes.values()];
|
|
@@ -299,7 +178,7 @@ export function register(on) {
|
|
|
299
178
|
|
|
300
179
|
on('session.end', async ($, e, next) => {
|
|
301
180
|
agentes.clear();
|
|
302
|
-
Object.assign(estado,
|
|
181
|
+
Object.assign(estado, estadoInicial());
|
|
303
182
|
return next(e);
|
|
304
183
|
});
|
|
305
184
|
}
|