refacil-sdd-ai 4.0.5 → 4.0.6
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/bin/cli.js +20 -8
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -55,14 +55,26 @@ function notifyUpdate() {
|
|
|
55
55
|
try { info = JSON.parse(fs.readFileSync(flagPath, 'utf8')); } catch (_) {}
|
|
56
56
|
|
|
57
57
|
const fromLabel = info.from ? `v${info.from}` : 'version anterior';
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
|
|
59
|
+
if (!info.shown) {
|
|
60
|
+
// Primera vez: bloquear al usuario para que lo vea claramente
|
|
61
|
+
try { fs.writeFileSync(flagPath, JSON.stringify({ ...info, shown: true })); } catch (_) {}
|
|
62
|
+
const msg =
|
|
63
|
+
`[refacil-sdd-ai] Actualizacion de metodologia detectada (${fromLabel} → v${info.to}).\n` +
|
|
64
|
+
`Tu mensaje fue pausado. ¿Deseas aplicar las migraciones pendientes antes de continuar?\n` +
|
|
65
|
+
` • Si: ejecuta /refacil:update\n` +
|
|
66
|
+
` • No: reenvía tu mensaje anterior para continuar sin actualizar.`;
|
|
67
|
+
process.stdout.write(msg + '\n');
|
|
68
|
+
process.stderr.write(msg + '\n');
|
|
69
|
+
process.exit(2);
|
|
70
|
+
} else {
|
|
71
|
+
// Segunda vez: dejar pasar pero avisar al LLM para que lo gestione
|
|
72
|
+
try { fs.unlinkSync(flagPath); } catch (_) {}
|
|
73
|
+
console.log(
|
|
74
|
+
`[refacil-sdd-ai] IMPORTANTE: hay una actualizacion de la metodologia SDD-AI pendiente (${fromLabel} → v${info.to}). ` +
|
|
75
|
+
`Antes de responder al usuario, preguntale si desea ejecutar /refacil:update ahora.`,
|
|
76
|
+
);
|
|
77
|
+
}
|
|
66
78
|
}
|
|
67
79
|
|
|
68
80
|
function repoIsInitialized() {
|
package/package.json
CHANGED