Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(wake): in-app activation switch + honest two-way onboarding (wake word vs hotkey)
Ruben Lütke81efcb708e83
diff --git a/jarvis/core/config_writer.py b/jarvis/core/config_writer.pyindex b9712d0d00..fa2cb35e74 100644--- a/jarvis/core/config_writer.py+++ b/jarvis/core/config_writer.py@@ -449,6 +449,25 @@ def set_wake_word(log.debug("persona-name strip skipped: %s", exc)+def set_wake_word_enabled(enabled: bool, *, path: Path = DEFAULT_CONFIG_FILE) -> None:+ """Persist the wake-word activation toggle to ``[trigger] wake_word_enabled``.++ This is the "how do you activate Jarvis" master switch: True = always-on wake+ word (which requires a local model that matches the user's word — see+ ``resolve_wake_plan``), False = hotkey / push-to-talk only. It was previously+ settable ONLY by hand-editing jarvis.toml (default False), so a fresh+ downloader could never turn their wake word on in-app.++ TOML-only by design, same as ``set_autostart``: ``trigger.wake_word_enabled``+ is NOT tracked in ``config-soll.json`` (only ``trigger.single_turn_mode`` is), # i18n-allow+ so the drift-guard never reverts it and a plain atomic write suffices.++ Takes effect on the next voice-pipeline bootstrap (a Jarvis restart): the+ detector enable-flags are resolved once at SpeechPipeline construction.+ """+ _patch_table(path, "trigger", "wake_word_enabled", bool(enabled))++def set_autostart(enabled: bool, *, path: Path = DEFAULT_CONFIG_FILE) -> None:"""Persist the login-autostart toggle to ``[autostart] enabled`` in jarvis.toml.diff --git a/jarvis/ui/web/frontend/src/components/onboarding/steps/WakeWordStep.test.tsx b/jarvis/ui/web/frontend/src/components/onboarding/steps/WakeWordStep.test.tsxindex d61c86452d..58205485a7 100644--- a/jarvis/ui/web/frontend/src/components/onboarding/steps/WakeWordStep.test.tsx+++ b/jarvis/ui/web/frontend/src/components/onboarding/steps/WakeWordStep.test.tsx@@ -1,28 +1,79 @@import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";import { afterEach, expect, it, vi } from "vitest";vi.mock("@/i18n", () => ({ useT: () => (k: string) => k }));-const saveWakeWord = vi.fn().mockResolvedValue({ ok: true });-vi.mock("@/hooks/useWakeWord", () => ({ useWakeWord: () => ({ saveWakeWord }) }));+const saveWakeWord = vi.fn().mockResolvedValue({ ok: true, degraded: false });+const setWakeActivation = vi.fn().mockResolvedValue({ ok: true, enabled: true, restart_required: true });+vi.mock("@/hooks/useWakeWord", () => ({+ useWakeWord: () => ({ saveWakeWord, setWakeActivation }),+ useLocalSpeechInstall: () => ({+ status: { state: "idle", message: "", available: true },+ install: vi.fn(),+ }),+}));import { WakeWordStep } from "./WakeWordStep";-afterEach(() => { cleanup(); saveWakeWord.mockClear(); });+afterEach(() => {+ cleanup();+ saveWakeWord.mockClear();+ saveWakeWord.mockResolvedValue({ ok: true, degraded: false });+ setWakeActivation.mockClear();+});const onb = {state: { legal_references: [{ label: "EUIPO", url: "https://euipo.europa.eu/eSearch/" }] },acknowledgeWakeWord: vi.fn().mockResolvedValue(undefined),} as never;-it("shows the derived-name preview only after a valid word is typed", () => {- render(<WakeWordStep onb={onb} goNext={vi.fn()} goBack={vi.fn()} skip={vi.fn()} isFirst={false} isLast={false} />);- // No preview before typing.+function renderStep(goNext = vi.fn()) {+ render(<WakeWordStep onb={onb} goNext={goNext} goBack={vi.fn()} skip={vi.fn()} isFirst={false} isLast={false} />);+ return { goNext };+}++function selectWakeMode() {+ fireEvent.click(screen.getByRole("button", { name: /mode_wake_title/ }));+}++function selectShortcutMode() {+ fireEvent.click(screen.getByRole("button", { name: /mode_shortcut_title/ }));+}++it("shows the mode choice first, with wake-word and keyboard-shortcut options", () => {+ renderStep();+ expect(screen.getByRole("button", { name: /mode_wake_title/ })).toBeDefined();+ expect(screen.getByRole("button", { name: /mode_shortcut_title/ })).toBeDefined();+ // Neither the wake-word input nor the shortcut CTA are visible yet.+ expect(screen.queryByRole("textbox")).toBeNull();+});++it("keyboard-shortcut path: turns the wake word off and advances, no phrase required", async () => {+ const { goNext } = renderStep();+ selectShortcutMode();+ fireEvent.click(screen.getByRole("button", { name: "onboarding.wake_word.shortcut_cta" }));+ await waitFor(() => expect(setWakeActivation).toHaveBeenCalledWith(false));+ expect(goNext).toHaveBeenCalled();+ // The wake-only save path was never touched.+ expect(saveWakeWord).not.toHaveBeenCalled();+});++it("back-to-choice returns from a chosen mode to the mode picker", () => {+ renderStep();+ selectWakeMode();+ expect(screen.getByRole("textbox")).toBeDefined();+ fireEvent.click(screen.getByRole("button", { name: "onboarding.wake_word.back_to_choice" }));+ expect(screen.getByRole("button", { name: /mode_wake_title/ })).toBeDefined();+ expect(screen.queryByRole("textbox")).toBeNull();+});++it("wake-word path: shows the derived-name preview only after a valid word is typed", () => {+ renderStep();+ selectWakeMode();expect(screen.queryByText("onboarding.wake_word.derived_name")).toBeNull();- // A valid word (>= 2 chars) surfaces the hint line.fireEvent.change(screen.getByRole("textbox"), { target: { value: "Nova" } });expect(screen.queryByText("onboarding.wake_word.derived_name")).not.toBeNull();});-it("requires word + acknowledgment, then saves 'Hey <word>' and advances", async () => {- const goNext = vi.fn();- render(<WakeWordStep onb={onb} goNext={goNext} goBack={vi.fn()} skip={vi.fn()} isFirst={false} isLast={false} />);+it("wake-word path: requires word + ack, saves 'Hey <word>', activates the wake word, and advances", async () => {+ const { goNext } = renderStep();+ selectWakeMode();// The trademark references are tucked behind a "How to check" toggle now —// reveal them before asserting the register link is present.@@ -41,5 +92,26 @@ it("requires word + acknowledgment, then saves 'Hey <word>' and advances", asyncawait waitFor(() => expect(saveWakeWord).toHaveBeenCalled());expect(saveWakeWord.mock.calls[0][0].phrase).toBe("Hey Nova");expect((onb as never as { acknowledgeWakeWord: ReturnType<typeof vi.fn> }).acknowledgeWakeWord).toHaveBeenCalled();+ await waitFor(() => expect(setWakeActivation).toHaveBeenCalledWith(true));+ expect(goNext).toHaveBeenCalled();+});++it("wake-word path: a degraded save does NOT advance and offers the local-speech install", async () => {+ saveWakeWord.mockResolvedValue({ ok: true, degraded: true });+ const { goNext } = renderStep();+ selectWakeMode();++ fireEvent.change(screen.getByRole("textbox"), { target: { value: "Nova" } });+ fireEvent.click(screen.getByRole("checkbox"));+ fireEvent.click(screen.getByRole("button", { name: "onboarding.wake_word.cta" }));++ await waitFor(() =>+ expect(screen.getByText("settings_view.wake_word.needs_whisper_hint")).toBeDefined(),+ );+ expect(goNext).not.toHaveBeenCalled();+ expect(setWakeActivation).not.toHaveBeenCalled();++ fireEvent.click(screen.getByRole("button", { name: "onboarding.wake_word.continue_anyway" }));+ await waitFor(() => expect(setWakeActivation).toHaveBeenCalledWith(true));expect(goNext).toHaveBeenCalled();});diff --git a/jarvis/ui/web/frontend/src/components/onboarding/steps/WakeWordStep.tsx b/jarvis/ui/web/frontend/src/components/onboarding/steps/WakeWordStep.tsxindex b307103c3a..4fe7236fe4 100644--- a/jarvis/ui/web/frontend/src/components/onboarding/steps/WakeWordStep.tsx+++ b/jarvis/ui/web/frontend/src/components/onboarding/steps/WakeWordStep.tsx@@ -5,25 +5,31 @@ import { useT } from "@/i18n";import { deriveAssistantName } from "@/lib/deriveAssistantName";import type { StepProps } from "../OnboardingFlow";-// Phrases that run on the always-on neural wake (openWakeWord) with zero-// download and no GPU — they ship as pretrained models in every install-// (KNOWN_OWW_MODELS in jarvis/speech/wake_constants.py). Any OTHER phrase needs-// the local-Whisper pack; without it the backend degrades to a built-in phrase.-// Kept in lockstep with KNOWN_OWW_MODELS; a miss here only means we skip the-// green "instant" hint — the authoritative signal is the save's `degraded` flag.-const INSTANT_CORE_WORDS = new Set(["jarvis", "rhasspy"]);+type Mode = "choice" | "wake" | "shortcut";+/**+ * Two honest activation paths — no branded default (Marvel owns "Jarvis" as a+ * trademark, so recommending "Hey Jarvis" out of the box is off the table):+ *+ * - "wake": the user picks their OWN word. It only actually fires once a local+ * model exists for that exact word — if the save comes back `degraded` we do+ * NOT silently advance, we offer the one-click local-speech install or an+ * honest "continue anyway" (wake word off until the pack lands).+ * - "shortcut": no wake word at all — push-to-talk via a keyboard shortcut,+ * editable later in Settings. This is a first-class option, not a fallback.+ */export function WakeWordStep({ onb, goNext }: StepProps) {const t = useT();- const { saveWakeWord } = useWakeWord();+ const { saveWakeWord, setWakeActivation } = useWakeWord();+ const [mode, setMode] = useState<Mode>("choice");const [word, setWord] = useState("");const [ack, setAck] = useState(false);const [busy, setBusy] = useState(false);const [err, setErr] = useState<string | null>(null);const [showRefs, setShowRefs] = useState(false);- // Set when a save resolved to a degraded engine (the chosen phrase has no- // pretrained model AND local Whisper is absent). We DON'T advance silently in- // that case — we tell the user and offer the one-click local-speech install.+ // Set when a save resolved to a degraded engine (no local model matches the+ // user's own word). We DON'T advance silently in that case — we tell the+ // user and offer the one-click local-speech install, or an honest opt-out.const [degraded, setDegraded] = useState(false);const { status: install, install: startInstall } = useLocalSpeechInstall();@@ -31,7 +37,6 @@ export function WakeWordStep({ onb, goNext }: StepProps) {const canSave = trimmed.length >= 2 && ack && !busy;const derivedName = deriveAssistantName(`Hey ${trimmed}`);const refs = onb.state?.legal_references ?? [];- const isInstantWord = INSTANT_CORE_WORDS.has(trimmed.toLowerCase());function setWordReset(next: string) {// Any edit invalidates a previous degraded verdict — back to the normal CTA.@@ -40,7 +45,7 @@ export function WakeWordStep({ onb, goNext }: StepProps) {if (err) setErr(null);}- async function onSave() {+ async function onSaveWake() {if (!canSave) return;setBusy(true);setErr(null);@@ -48,12 +53,14 @@ export function WakeWordStep({ onb, goNext }: StepProps) {await onb.acknowledgeWakeWord();const result = await saveWakeWord({ phrase: `Hey ${trimmed}`, engine: "auto", persist: true });// Honesty gate: only advance when the phrase will actually be heard. A- // degraded result means the app would listen for a built-in fallback word,- // not the user's — surface it instead of pretending it worked.+ // degraded result means no local model matches the user's own word — the+ // wake word would effectively be off — so surface that instead of+ // pretending it worked.if (result.degraded) {setDegraded(true);return;}+ await setWakeActivation(true);goNext();} catch (e) {setErr((e as Error).message);@@ -62,9 +69,93 @@ export function WakeWordStep({ onb, goNext }: StepProps) {}}+ async function onContinueDegraded() {+ setBusy(true);+ setErr(null);+ try {+ await setWakeActivation(true);+ goNext();+ } catch (e) {+ setErr((e as Error).message);+ } finally {+ setBusy(false);+ }+ }++ async function onChooseShortcut() {+ setBusy(true);+ setErr(null);+ try {+ await setWakeActivation(false);+ goNext();+ } catch (e) {+ setErr((e as Error).message);+ } finally {+ setBusy(false);+ }+ }++ if (mode === "choice") {+ return (+ <div className="flex flex-col gap-4">+ <h2 className="font-display text-lg font-semibold">{t("onboarding.wake_word.choice_title")}</h2>+ <p className="text-sm text-muted-foreground">{t("onboarding.wake_word.choice_body")}</p>+ <div className="flex flex-col gap-3">+ <button+ type="button"+ onClick={() => setMode("wake")}+ className="flex flex-col gap-1 rounded-lg border border-muted-foreground/25 p-4 text-left hover:border-primary hover:bg-primary/5"+ >+ <span className="font-medium">{t("onboarding.wake_word.mode_wake_title")}</span>+ <span className="text-xs text-muted-foreground">{t("onboarding.wake_word.mode_wake_body")}</span>+ </button>+ <button+ type="button"+ onClick={() => setMode("shortcut")}+ className="flex flex-col gap-1 rounded-lg border border-muted-foreground/25 p-4 text-left hover:border-primary hover:bg-primary/5"+ >+ <span className="font-medium">{t("onboarding.wake_word.mode_shortcut_title")}</span>+ <span className="text-xs text-muted-foreground">{t("onboarding.wake_word.mode_shortcut_body")}</span>+ </button>+ </div>+ </div>+ );+ }++ if (mode === "shortcut") {+ return (+ <div className="flex flex-col gap-4">+ <div className="flex items-center justify-between">+ <h2 className="font-display text-lg font-semibold">{t("onboarding.wake_word.mode_shortcut_title")}</h2>+ <button+ type="button"+ onClick={() => setMode("choice")}+ className="text-xs text-muted-foreground underline"+ >+ {t("onboarding.wake_word.back_to_choice")}+ </button>+ </div>+ <p className="text-sm text-muted-foreground">{t("onboarding.wake_word.shortcut_note")}</p>+ {err && <p className="text-xs text-amber-500">{err}</p>}+ <Button className="w-full" disabled={busy} onClick={onChooseShortcut}>+ {busy ? t("onboarding.wake_word.saving") : t("onboarding.wake_word.shortcut_cta")}+ </Button>+ </div>+ );+ }+return (<div className="flex flex-col gap-4">- <h2 className="font-display text-lg font-semibold">{t("onboarding.wake_word.title")}</h2>+ <div className="flex items-center justify-between">+ <h2 className="font-display text-lg font-semibold">{t("onboarding.wake_word.title")}</h2>+ <button+ type="button"+ onClick={() => setMode("choice")}+ className="text-xs text-muted-foreground underline"+ >+ {t("onboarding.wake_word.back_to_choice")}+ </button>+ </div><p className="text-sm text-muted-foreground">{t("onboarding.wake_word.body")}</p><div className="flex items-center gap-2">@@ -83,27 +174,12 @@ export function WakeWordStep({ onb, goNext }: StepProps) {/></div>- {/* Recommended shortcut: "Hey Jarvis" runs out-of-the-box on any machine. */}- {!isInstantWord && (- <button- type="button"- onClick={() => setWordReset("Jarvis")}- className="self-start rounded-md border border-primary/40 px-3 py-1.5 text-xs font-medium text-primary hover:bg-primary/10"- >- {t("onboarding.wake_word.recommended_cta")}- </button>- )}-{trimmed.length >= 2 && derivedName ? (<p className="text-xs text-muted-foreground">{t("onboarding.wake_word.derived_name").replace("{0}", derivedName)}</p>) : null}- {isInstantWord && (- <p className="text-xs text-emerald-500">{t("onboarding.wake_word.instant_ok")}</p>- )}-<p className="text-xs text-muted-foreground">{t("onboarding.wake_word.notice")}{" "}<button@@ -139,9 +215,9 @@ export function WakeWordStep({ onb, goNext }: StepProps) {{err && <p className="text-xs text-amber-500">{err}</p>}{degraded ? (- // The chosen phrase has no pretrained model and local Whisper is absent.- // Offer the one-click local-speech install, or continue with the honest- // knowledge that the word takes effect after the pack is installed.+ // The chosen word has no pretrained model and local Whisper is absent.+ // Offer the one-click local-speech install, or continue with the+ // honest knowledge that the wake word stays off until the pack lands.<div className="flex flex-col gap-2 rounded-md border border-amber-500/40 bg-amber-500/5 p-3"><p className="text-xs text-amber-500">{t("settings_view.wake_word.needs_whisper_hint")}@@ -172,13 +248,13 @@ export function WakeWordStep({ onb, goNext }: StepProps) {: t("settings_view.wake_word.enable_local_button")}</Button>)}- <Button className="flex-1" onClick={goNext}>+ <Button className="flex-1" disabled={busy} onClick={onContinueDegraded}>{t("onboarding.wake_word.continue_anyway")}</Button></div></div>) : (- <Button className="w-full" disabled={!canSave} onClick={onSave}>+ <Button className="w-full" disabled={!canSave} onClick={onSaveWake}>{busy ? t("onboarding.wake_word.saving") : t("onboarding.wake_word.cta")}</Button>)}diff --git a/jarvis/ui/web/frontend/src/hooks/useWakeWord.ts b/jarvis/ui/web/frontend/src/hooks/useWakeWord.tsindex 6a612b65ef..346b03347a 100644--- a/jarvis/ui/web/frontend/src/hooks/useWakeWord.ts+++ b/jarvis/ui/web/frontend/src/hooks/useWakeWord.ts@@ -13,6 +13,9 @@ export interface WakeWordConfig {engines: string[];instant_phrases: string[];local_whisper_available: boolean;+ // The activation master switch: true = always-on wake word (needs a local+ // model for the user's word), false = hotkey / push-to-talk only.+ enabled: boolean;}/**@@ -39,6 +42,9 @@ export interface WakeWordSaveResult {engine: string;resolved_engine: string;degraded: boolean;+ // False when no local model matches the user's word: the wake word is off and+ // hotkey / push-to-talk is the activation.+ wake_available: boolean;message: string;persisted: boolean;restart_required: boolean;@@ -108,7 +114,27 @@ export function useWakeWord() {[],);- return { config, loading, error, refetch, saveWakeWord };+ // Turn the always-on wake word ON/OFF (the activation master switch). Persists+ // to jarvis.toml; the change takes effect after a voice restart. Returns+ // whether a restart is required (always true today).+ const setWakeActivation = useCallback(+ async (enabled: boolean): Promise<{ ok: boolean; enabled: boolean; restart_required: boolean }> => {+ const res = await fetch("/api/settings/wake-word/activation", {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ enabled }),+ });+ const body = await res.json().catch(() => ({}));+ if (!res.ok) {+ throw new Error(body.detail ?? `HTTP ${res.status}`);+ }+ window.dispatchEvent(new CustomEvent("jarvis:wake-word-changed"));+ return body as { ok: boolean; enabled: boolean; restart_required: boolean };+ },+ [],+ );++ return { config, loading, error, refetch, saveWakeWord, setWakeActivation };}/**diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex aed11c369b..636a6e264d 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -1022,6 +1022,9 @@"wake_word": {"title": "Wake-Word","description": "Aktivierungsphrase für den Sprachmodus. Tippe deine eigene ein.",+ "activation_title": "Aktivierungswort einschalten",+ "activation_hint": "An: Jarvis hört ständig auf dein Wort (braucht ein lokales Modell). Aus: aktiviere per Tastenkombination (Push-to-Talk).",+ "activation_saved": "Aktivierung gespeichert — Neustart nötig, damit sie greift.","phrase_label": "Aktivierungsphrase","phrase_placeholder": "z. B. Jonas","engine_label": "Erkennungs-Engine",@@ -1462,6 +1465,15 @@"reply_label": "Antwortsprache"},"wake_word": {+ "choice_title": "Wie möchtest du {name} aktivieren?",+ "choice_body": "Wähle, was zu deiner Arbeitsweise passt — du kannst das später in den Einstellungen ändern.",+ "mode_wake_title": "Aktivierungswort",+ "mode_wake_body": "Sag jederzeit dein eigenes Wort — {name} hört ständig mit. Braucht ein kleines lokales Modell für genau dein Wort.",+ "mode_shortcut_title": "Tastenkombination",+ "mode_shortcut_body": "Kein Aktivierungswort — halte eine Taste gedrückt, um zu sprechen, lass los zum Senden (Push-to-Talk).",+ "back_to_choice": "Zurück",+ "shortcut_note": "Du aktivierst {name} stattdessen über eine Tastenkombination statt über ein Aktivierungswort. Die genaue Taste kannst du jederzeit in den Einstellungen → Wake-Word festlegen.",+ "shortcut_cta": "Weiter","title": "Wähle dein Aktivierungswort","body": "Wähle das Wort, das deinen Assistenten aufweckt. \"Hey\" bleibt fest — den Rest bestimmst du.","prefix": "Hey",@@ -1475,8 +1487,6 @@"cta": "Aktivierungswort speichern","saving": "Speichern…","derived_name": "Dein Assistent heißt dann: {0}",- "recommended_cta": "„Hey Jarvis“ nehmen — läuft sofort auf jedem Computer",- "instant_ok": "Läuft sofort — kein Download nötig.","continue_anyway": "Trotzdem fortfahren"},"api_keys": {diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex de1cab7b56..caefe7eebc 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -1023,6 +1023,9 @@"wake_word": {"title": "Wake Word","description": "Activation phrase for voice mode. Type your own.",+ "activation_title": "Activate wake word",+ "activation_hint": "On: Jarvis is always listening for your word (needs a local model). Off: activate with a keyboard shortcut (push-to-talk).",+ "activation_saved": "Activation saved — restart to apply.","phrase_label": "Wake phrase","phrase_placeholder": "e.g. Jonas","engine_label": "Detection engine",@@ -1463,6 +1466,15 @@"reply_label": "Reply language"},"wake_word": {+ "choice_title": "How do you want to activate {name}?",+ "choice_body": "Pick whichever fits how you work — you can change this later in Settings.",+ "mode_wake_title": "Wake word",+ "mode_wake_body": "Say your own word any time — always listening. Needs a small local model for your exact word.",+ "mode_shortcut_title": "Keyboard shortcut",+ "mode_shortcut_body": "No wake word — hold a key to talk, release to send (push-to-talk).",+ "back_to_choice": "Back",+ "shortcut_note": "You'll activate {name} with a keyboard shortcut instead of a wake word. You can set up the exact key anytime in Settings → Wake Word.",+ "shortcut_cta": "Continue","title": "Pick your wake word","body": "Choose the word that wakes your assistant. \"Hey\" stays fixed — you pick the rest.","prefix": "Hey",@@ -1476,8 +1488,6 @@"cta": "Save wake word","saving": "Saving…","derived_name": "Your assistant will be called: {0}",- "recommended_cta": "Use \"Hey Jarvis\" — works instantly on any computer",- "instant_ok": "Works instantly — no download needed.","continue_anyway": "Continue anyway"},"api_keys": {diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex 364af440cc..f0409d558e 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -1022,6 +1022,9 @@"wake_word": {"title": "Palabra de activación","description": "Frase de activación para el modo de voz. Escribe la tuya.",+ "activation_title": "Activar palabra de activación",+ "activation_hint": "Activado: Jarvis escucha siempre tu palabra (necesita un modelo local). Desactivado: actívalo con un atajo de teclado (pulsar para hablar).",+ "activation_saved": "Activación guardada — reinicia para aplicar.","phrase_label": "Frase de activación","phrase_placeholder": "p. ej. Jonas","engine_label": "Motor de detección",@@ -1462,6 +1465,15 @@"reply_label": "Idioma de respuesta"},"wake_word": {+ "choice_title": "¿Cómo quieres activar a {name}?",+ "choice_body": "Elige lo que mejor se adapte a tu forma de trabajar — puedes cambiarlo después en Ajustes.",+ "mode_wake_title": "Palabra de activación",+ "mode_wake_body": "Di tu propia palabra en cualquier momento — {name} escucha todo el tiempo. Necesita un pequeño modelo local para tu palabra exacta.",+ "mode_shortcut_title": "Atajo de teclado",+ "mode_shortcut_body": "Sin palabra de activación — mantén pulsada una tecla para hablar y suéltala para enviar (pulsar para hablar).",+ "back_to_choice": "Atrás",+ "shortcut_note": "Activarás a {name} con un atajo de teclado en lugar de una palabra de activación. Puedes configurar la tecla exacta en cualquier momento en Ajustes → Palabra de activación.",+ "shortcut_cta": "Continuar","title": "Elige tu palabra de activación","body": "Elige la palabra que activa tu asistente. \"Hey\" queda fija — tú eliges el resto.","prefix": "Hey",@@ -1475,8 +1487,6 @@"cta": "Guardar palabra de activación","saving": "Guardando…","derived_name": "Tu asistente se llamará: {0}",- "recommended_cta": "Usar «Hey Jarvis» — funciona al instante en cualquier ordenador",- "instant_ok": "Funciona al instante — sin descargas.","continue_anyway": "Continuar de todos modos"},"api_keys": {diff --git a/jarvis/ui/web/frontend/src/views/SettingsView.tsx b/jarvis/ui/web/frontend/src/views/SettingsView.tsxindex c55b35c871..eb38c9a30e 100644--- a/jarvis/ui/web/frontend/src/views/SettingsView.tsx+++ b/jarvis/ui/web/frontend/src/views/SettingsView.tsx@@ -115,7 +115,7 @@ function SettingRow({ row }: { row: SettingRow }) {*/function WakeWordPanel() {const t = useT();- const { config, loading, error, saveWakeWord, refetch } = useWakeWord();+ const { config, loading, error, saveWakeWord, refetch, setWakeActivation } = useWakeWord();const pushToast = useEventStore((s) => s.pushToast);// In-app installer for the local speech pack (faster-whisper) that unlocks any// wake phrase. Refetch the wake config on success so the hint clears.@@ -127,6 +127,10 @@ function WakeWordPanel() {const [customModelPath, setCustomModelPath] = useState("");const [saving, setSaving] = useState(false);const [result, setResult] = useState<WakeWordSaveResult | null>(null);+ // The activation master switch (product rule 2026-07-04): on = always-on wake+ // word (needs a local model for the user's word), off = hotkey / push-to-talk.+ const [enabled, setEnabled] = useState(false);+ const [togglingActivation, setTogglingActivation] = useState(false);// Hydrate the form once the GET resolves (and whenever the config changes).useEffect(() => {@@ -135,8 +139,24 @@ function WakeWordPanel() {setEngine(config.engine || "auto");setSensitivity(config.sensitivity);setCustomModelPath(config.custom_model_path ?? "");+ // ?? false keeps the Switch controlled even if an older backend omits it.+ setEnabled(config.enabled ?? false);}, [config]);+ async function onToggleActivation(next: boolean) {+ setTogglingActivation(true);+ setEnabled(next); // optimistic+ try {+ await setWakeActivation(next);+ pushToast("info", t("settings_view.wake_word.activation_saved"));+ } catch (e) {+ setEnabled(!next); // revert on failure+ pushToast("error", (e as Error).message);+ } finally {+ setTogglingActivation(false);+ }+ }+const localWhisperAvailable = config?.local_whisper_available ?? true;const trimmedPhrase = phrase.trim();@@ -191,6 +211,20 @@ function WakeWordPanel() {{t("settings_view.wake_word.description")}</p>+ <div className="mt-3 flex items-center justify-between gap-4">+ <span className="text-xs font-medium">+ {t("settings_view.wake_word.activation_title")}+ </span>+ <Switch+ checked={enabled}+ disabled={loading || togglingActivation}+ onCheckedChange={onToggleActivation}+ />+ </div>+ <p className="mt-1 text-xs text-muted-foreground">+ {t("settings_view.wake_word.activation_hint")}+ </p>+{error && (<p className="mt-3 text-xs text-destructive">{error}</p>)}diff --git a/jarvis/ui/web/settings_routes.py b/jarvis/ui/web/settings_routes.pyindex 90de3556da..38cc98f174 100644--- a/jarvis/ui/web/settings_routes.py+++ b/jarvis/ui/web/settings_routes.py@@ -449,8 +449,10 @@ async def get_wake_word(request: Request) -> dict[str, object]:cfg = _config(request)ww = None+ enabled = Falseif cfg is not None and getattr(cfg, "trigger", None) is not None:ww = getattr(cfg.trigger, "wake_word", None)+ enabled = bool(getattr(cfg.trigger, "wake_word_enabled", False))if ww is None:ww = WakeWordConfig()return {@@ -462,6 +464,9 @@ async def get_wake_word(request: Request) -> dict[str, object]:"engines": list(WAKE_ENGINES),"instant_phrases": list(INSTANT_WAKE_PHRASES),"local_whisper_available": _local_whisper_available(),+ # The activation master switch: True = always-on wake word (needs a local+ # model), False = hotkey / push-to-talk only.+ "enabled": enabled,}@@ -559,6 +564,42 @@ async def put_wake_word(body: WakeWordBody, request: Request) -> dict[str, objec}+class WakeActivationBody(BaseModel):+ enabled: bool++[email protected]("/wake-word/activation")+async def set_wake_activation(body: WakeActivationBody, request: Request) -> dict[str, object]:+ """Turn the always-on wake word ON/OFF — the "how do you activate Jarvis"+ master switch (product rule 2026-07-04).++ ``True`` = always-on wake word, which REQUIRES a local model matching the+ user's own word (see ``resolve_wake_plan``); ``False`` = hotkey / push-to-talk+ only. This was previously settable only by hand-editing jarvis.toml (default+ False), so a fresh downloader could never enable their wake word in-app.++ Persisted to ``[trigger] wake_word_enabled``; takes effect on the next voice+ restart (the detector enable-flags are wired at pipeline construction), so+ ``restart_required`` is always True.+ """+ try:+ from jarvis.core import config_writer++ config_writer.set_wake_word_enabled(bool(body.enabled))+ except Exception as exc: # noqa: BLE001 — surface a clean 500, never a stack+ raise HTTPException(+ status_code=500, detail=f"Could not persist wake activation: {exc}"+ ) from exc+ # Best-effort in-memory update so a later cfg read agrees pre-restart.+ cfg = _config(request)+ if cfg is not None and getattr(cfg, "trigger", None) is not None:+ try:+ cfg.trigger.wake_word_enabled = bool(body.enabled)+ except Exception as exc: # noqa: BLE001 — frozen model is not an error+ log.debug("in-memory wake_word_enabled update skipped: %s", exc)+ return {"ok": True, "enabled": bool(body.enabled), "restart_required": True}++# ---------------------------------------------------------------------------# Push-to-talk hotkey (editable). GET current + safe suggestions; PUT to change.# Persisted to jarvis.toml [trigger].hotkey; applies on the next voice bootstrapdiff --git a/tests/unit/core/test_config_writer_wake_word.py b/tests/unit/core/test_config_writer_wake_word.pyindex b4e9959f6c..de5b286d69 100644--- a/tests/unit/core/test_config_writer_wake_word.py+++ b/tests/unit/core/test_config_writer_wake_word.py@@ -94,3 +94,17 @@ def test_set_wake_word_creates_section_if_missing(tmp_path: Path) -> None:ww = _load(f)["trigger"]["wake_word"]assert ww["phrase"] == "Computer"assert ww["engine"] == "stt_match"+++def test_set_wake_word_enabled_toggles_the_activation_switch(tmp_path: Path) -> None:+ # The activation master switch (product rule 2026-07-04): in-app on/off,+ # persisted to [trigger] wake_word_enabled, preserving sibling keys + comments.+ f = _write(tmp_path)+ config_writer.set_wake_word_enabled(True, path=f)+ trig = _load(f)["trigger"]+ assert trig["wake_word_enabled"] is True+ assert trig["single_turn_mode"] is False # sibling key untouched+ assert "keep this comment" in f.read_text(encoding="utf-8") # comment preserved+ # And it flips back off.+ config_writer.set_wake_word_enabled(False, path=f)+ assert _load(f)["trigger"]["wake_word_enabled"] is False