Comando /agy:vocal per toggle feedback vocale + template aggiornato
This commit is contained in:
@@ -1266,6 +1266,41 @@ export default function agyExtension(pi: ExtensionAPI) {
|
||||
},
|
||||
});
|
||||
|
||||
pi.registerCommand("agy:vocal", {
|
||||
description: "Attiva/disattiva il feedback vocale TTS. Uso: /agy:vocal [on|off|status]",
|
||||
handler: async (args, ctx) => {
|
||||
const arg = (args ?? "").trim().toLowerCase();
|
||||
const current = getConfig("ttsNotify") ?? "true";
|
||||
|
||||
if (arg === "on") {
|
||||
setConfig("ttsNotify", "true");
|
||||
ctx.ui.notify("🔊 Feedback vocale ATTIVATO", "info");
|
||||
ttsSpeak("Feedback vocale attivato.").catch(() => {});
|
||||
return;
|
||||
}
|
||||
if (arg === "off") {
|
||||
setConfig("ttsNotify", "false");
|
||||
ctx.ui.notify("🔇 Feedback vocale DISATTIVATO", "info");
|
||||
return;
|
||||
}
|
||||
if (arg === "status" || !arg) {
|
||||
const on = current !== "false";
|
||||
ctx.ui.notify(on ? "🔊 Feedback vocale: ATTIVO" : "🔇 Feedback vocale: DISATTIVO", "info");
|
||||
return;
|
||||
}
|
||||
|
||||
// toggle
|
||||
if (current === "false") {
|
||||
setConfig("ttsNotify", "true");
|
||||
ctx.ui.notify("🔊 Feedback vocale ATTIVATO", "info");
|
||||
ttsSpeak("Feedback vocale attivato.").catch(() => {});
|
||||
} else {
|
||||
setConfig("ttsNotify", "false");
|
||||
ctx.ui.notify("🔇 Feedback vocale DISATTIVATO", "info");
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// =========================================================================
|
||||
// Comando: /agy:config — gestione configurazione persistente
|
||||
// =========================================================================
|
||||
|
||||
@@ -27,6 +27,7 @@ agy_tts(text="Step completato: ho analizzato il file e trovato l'errore. Obietti
|
||||
- **Errori**: se uno step fallisce, annuncia il problema e cosa intendi fare
|
||||
- **Non ripetere**: se il riassunto è identico al precedente, omettilo
|
||||
- **Rispetta la config**: se `ttsNotify` è `false` nella config di agy-pi, salta il feedback vocale
|
||||
- **Toggle rapido**: l'utente può attivare/disattivare il feedback vocale con `/agy:vocal` (on|off|status)
|
||||
- **Non interrompere**: il feedback vocale non deve bloccare il flusso di lavoro (fire-and-forget)
|
||||
|
||||
### Esempi
|
||||
|
||||
Reference in New Issue
Block a user