diff --git a/extensions/index.ts b/extensions/index.ts index 6844def..82432ba 100644 --- a/extensions/index.ts +++ b/extensions/index.ts @@ -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 // ========================================================================= diff --git a/templates/AGENTS.vocal-feedback.md b/templates/AGENTS.vocal-feedback.md index 66d8cb8..d578627 100644 --- a/templates/AGENTS.vocal-feedback.md +++ b/templates/AGENTS.vocal-feedback.md @@ -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