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(onboarding): starter plans — one key sets up every surface, every saved key is checked, and an 'all lights green' note fires once
rubenluetke10-beep6aee380af0d0
diff --git a/docs/product/personalize-and-connect/providers-and-api-keys.md b/docs/product/personalize-and-connect/providers-and-api-keys.mdindex 58a7f7677c..345cbed096 100644--- a/docs/product/personalize-and-connect/providers-and-api-keys.md+++ b/docs/product/personalize-and-connect/providers-and-api-keys.md@@ -166,6 +166,37 @@ Only a genuinely different second key raises a question:Nothing is written until you answer. Areas that keep their own key show it as**Key saved**; areas served by the shared key show the covered note.+### Starter plans (first run)++The first-run guide opens with **How do you want to start?** A starter plan+is one voice mode plus a provider for every part that mode needs, all on one+provider family:++| Plan | Mode | Keys | What it sets |+|---|---|---|---|+| **Pipeline with Gemini** (recommended) | Pipeline | Gemini | Brain, tool model, agents, voice out, voice in |+| Realtime with Gemini | Realtime | Gemini | Gemini Live, plus the Pipeline parts as fallback |+| Gemini + OpenAI | Realtime | Gemini, OpenAI | OpenAI Realtime speaks; Gemini thinks, plans and runs the agents |+| Pick everything myself | — | any | The full provider list, as before |++Choosing a plan narrows the key list to the families it needs. The moment+every key is saved, the guide points each part at that key and pins the voice+mode — nothing else to click. Parts that could not be applied are listed and+can be fixed later here.++### Every saved key is checked++Saving a key runs the card's live test right away (the same probe as the+**Test** button) and reports the answer as a short note — a wrong or empty key+is caught when it is pasted, not on the first spoken turn.++### The "all lights green" note++Once every part the active mode needs answers — Pipeline: brain, tool model,+voice out, voice in; Realtime: live voice, tool model, agents — a one-time+note appears (inside the guide, or above the top bar later). It shows exactly+once per install; **Let's go** dismisses it for good.+Brain and Computer Use changes apply to the next request. Voice input appliesto the next transcription. Voice output switches the running Pipeline when itcan, otherwise the saved choice is used when speech starts again. Activating adiff --git a/jarvis/setup/starter_plans.py b/jarvis/setup/starter_plans.pynew file mode 100644index 0000000000..de61d0d4c3--- /dev/null+++ b/jarvis/setup/starter_plans.py@@ -0,0 +1,121 @@+"""Starter plans — "one key and you are done" setups for the first run.++A starter plan names a voice mode and the provider for every surface that+mode needs, all served by ONE provider family (or two). Choosing a plan in+onboarding filters the key list down to the families it needs; once every+family key is saved, the frontend applies the plan through the ordinary+switch routes (brain / tool model / agents / tts / stt / realtime / voice+mode), so nothing here duplicates the switch logic — a plan is data.++Provider ids are the catalog ids from ``jarvis.ui.web.provider_spec``; a+unit test pins every id to an existing spec of the right tier so a renamed+provider fails the build instead of a fresh install.+"""++from __future__ import annotations++from dataclasses import dataclass, field++#: Sections the section-health rollup must report ``ok`` for before a mode+#: counts as "ready": Pipeline = brain + tool model + voice out + voice in,+#: Realtime = live voice + tool model + agents.+READY_SECTIONS_BY_MODE: dict[str, tuple[str, ...]] = {+ "pipeline": ("brain", "computer-use", "tts", "stt"),+ "realtime": ("realtime", "computer-use", "subagents"),+}+++@dataclass(frozen=True, slots=True)+class StarterPlan:+ id: str+ label: str+ summary: str+ mode: str # "pipeline" | "realtime"+ #: Provider families whose primary key the plan needs (config families).+ key_families: tuple[str, ...]+ #: Surface → provider id. Applied in this order by the frontend.+ assignments: dict[str, str] = field(default_factory=dict)+ recommended: bool = False+++STARTER_PLANS: tuple[StarterPlan, ...] = (+ StarterPlan(+ id="gemini-pipeline",+ label="Pipeline with Gemini",+ summary=(+ "One Google Gemini key runs everything: thinking, the tool model, "+ "the agents, voice in and voice out."+ ),+ mode="pipeline",+ key_families=("gemini",),+ assignments={+ "brain": "gemini",+ "computer-use": "gemini",+ "subagent": "gemini",+ "tts": "gemini-flash-tts",+ "stt": "gemini-api",+ },+ recommended=True,+ ),+ StarterPlan(+ id="gemini-realtime",+ label="Realtime with Gemini",+ summary=(+ "One Google Gemini key, spoken live: Gemini Live answers in real "+ "time; tool model and agents run on the same key."+ ),+ mode="realtime",+ key_families=("gemini",),+ assignments={+ "brain": "gemini",+ "computer-use": "gemini",+ "subagent": "gemini",+ "tts": "gemini-flash-tts",+ "stt": "gemini-api",+ "realtime": "gemini-live",+ },+ ),+ StarterPlan(+ id="gemini-openai-realtime",+ label="Gemini + OpenAI",+ summary=(+ "Two keys, both engines covered: OpenAI Realtime speaks live, "+ "Gemini thinks, plans and runs the agents — and the Pipeline "+ "engine stays ready as a fallback."+ ),+ mode="realtime",+ key_families=("gemini", "openai"),+ assignments={+ "brain": "gemini",+ "computer-use": "gemini",+ "subagent": "gemini",+ "tts": "gemini-flash-tts",+ "stt": "gemini-api",+ "realtime": "openai-realtime",+ },+ ),+)++#: The escape hatch: no assignments, the full provider list, no auto-apply.+CUSTOM_PLAN_ID = "custom"+++def get_plan(plan_id: str) -> StarterPlan | None:+ for plan in STARTER_PLANS:+ if plan.id == plan_id:+ return plan+ return None+++def plan_ready_sections(mode: str) -> tuple[str, ...]:+ return READY_SECTIONS_BY_MODE.get(mode, ())+++__all__ = [+ "CUSTOM_PLAN_ID",+ "READY_SECTIONS_BY_MODE",+ "STARTER_PLANS",+ "StarterPlan",+ "get_plan",+ "plan_ready_sections",+]diff --git a/jarvis/setup/state.py b/jarvis/setup/state.pyindex 6d09d30a05..ba9a5f5999 100644--- a/jarvis/setup/state.py+++ b/jarvis/setup/state.py@@ -215,6 +215,10 @@ _ONBOARDING_KEYS = ("terms_accepted_at","terms_version","wake_word_acknowledged_at",+ # Starter plan chosen in onboarding + the one-time "all set" moment. Both+ # belong to the first run, so an onboarding reset clears them too.+ "starter_plan",+ "ready_celebrated_at",)@@ -296,6 +300,25 @@ def mark_onboarding_complete(path: Path | None = None) -> None:_merge_state({"onboarding_completed_at": _now_iso()}, path)+def set_starter_plan(plan_id: str, path: Path | None = None) -> None:+ _merge_state({"starter_plan": plan_id}, path)+++def get_starter_plan(path: Path | None = None) -> str | None:+ value = load_setup_state(path).get("starter_plan")+ return value if isinstance(value, str) and value else None+++def mark_ready_celebrated(path: Path | None = None) -> None:+ """Record that the one-time "everything answered" moment was shown."""+ _merge_state({"ready_celebrated_at": _now_iso()}, path)+++def is_ready_celebrated(path: Path | None = None) -> bool:+ value = load_setup_state(path).get("ready_celebrated_at")+ return isinstance(value, str) and bool(value)++def reset_onboarding(path: Path | None = None) -> list[str]:"""Remove all onboarding keys from the state file. Returns the removed keys."""s = load_setup_state(path)diff --git a/jarvis/ui/web/frontend/src/App.tsx b/jarvis/ui/web/frontend/src/App.tsxindex cd463b6b23..7dbdca6ea0 100644--- a/jarvis/ui/web/frontend/src/App.tsx+++ b/jarvis/ui/web/frontend/src/App.tsx@@ -16,6 +16,7 @@ import { PaneResizer } from "@/components/layout/PaneResizer";import { useResizablePane } from "@/hooks/useResizablePane";import { TopBar } from "@/components/layout/TopBar";import { PermissionsAlertBanner } from "@/components/layout/PermissionsAlertBanner";+import { ReadyCelebration } from "@/components/ReadyCelebration";import { InputIsolationBanner } from "@/components/layout/InputIsolationBanner";import { VoiceWarmingBanner } from "@/components/layout/VoiceWarmingBanner";import { MainView } from "@/components/layout/MainView";@@ -383,6 +384,9 @@ export default function App() {<InputIsolationBanner /><TopBar /><VoiceWarmingBanner />+ {/* The one-time "all lights green" note — the first time every+ section of the active voice mode answers. Never again after. */}+ <ReadyCelebration /><SectionStage visualization={visualizationActive}><MainView /></SectionStage>diff --git a/jarvis/ui/web/frontend/src/components/ApiKeyForm.tsx b/jarvis/ui/web/frontend/src/components/ApiKeyForm.tsxindex 340f73d021..ab7178cc06 100644--- a/jarvis/ui/web/frontend/src/components/ApiKeyForm.tsx+++ b/jarvis/ui/web/frontend/src/components/ApiKeyForm.tsx@@ -4,6 +4,8 @@ import { Button } from "@/components/ui/button";import {deleteSecret,postSecret,+ testProvider,+ type ProviderTestResult,type SecretSaveResult,type SecretSaveScope,} from "@/hooks/useProviders";@@ -44,6 +46,13 @@ interface ApiKeyFormProps {* silently disables those surfaces too.*/sharedWith?: string[];+ /**+ * When set, every successful save is followed by the provider's live test+ * (the same probe as the card's Test button) and its verdict lands as a+ * toast + a `jarvis:provider-tested` event — so a wrong key is caught the+ * moment it is pasted, not on the first spoken turn.+ */+ testAfterSave?: { id: string; label: string; section: string; active: boolean };onChanged?: () => void;/*** Called after a key has been saved successfully.@@ -77,7 +86,7 @@ function announceSecretChange(secretKey: string, action: "set" | "delete") {* existing value. Writes directly to POST /api/secrets/{key}; the value* never leaves the frontend again after submit (read-only flag in the backend).*/-export function ApiKeyForm({ secretKey, dashboardUrl, configured, credentialHelp, effectiveConfigured, coveredNote, sharedWith, onChanged, onSavedActivate }: ApiKeyFormProps) {+export function ApiKeyForm({ secretKey, dashboardUrl, configured, credentialHelp, effectiveConfigured, coveredNote, sharedWith, testAfterSave, onChanged, onSavedActivate }: ApiKeyFormProps) {const t = useT();const [value, setValue] = useState("");const [pending, setPending] = useState(false);@@ -116,6 +125,7 @@ export function ApiKeyForm({ secretKey, dashboardUrl, configured, credentialHelpfor (const slot of new Set([secretKey, ...(result?.written ?? [])])) {announceSecretChange(slot, "set");}+ if (testAfterSave) void verifySavedKey(testAfterSave);} catch (e) {pushToast("error", `${t("common.save_failed")}: ${(e as Error).message}`);} finally {@@ -123,6 +133,42 @@ export function ApiKeyForm({ secretKey, dashboardUrl, configured, credentialHelp}}+ async function verifySavedKey(target: NonNullable<ApiKeyFormProps["testAfterSave"]>) {+ let verdict: ProviderTestResult;+ try {+ verdict = await testProvider(target.id);+ } catch (e) {+ verdict = {+ provider: target.id,+ status: "error",+ detail: (e as Error).message,+ latency_ms: 0,+ integration_ok: false,+ };+ }+ window.dispatchEvent(+ new CustomEvent("jarvis:provider-tested", {+ detail: {+ section: target.section,+ provider: target.id,+ provider_label: target.label,+ active: target.active,+ result: verdict,+ },+ }),+ );+ if (verdict.status === "ok") {+ pushToast("success", t("apikeys_view.key_verified_toast").replace("{0}", target.label));+ } else {+ pushToast(+ "warning",+ t("apikeys_view.key_check_failed_toast")+ .replace("{0}", target.label)+ .replace("{1}", verdict.detail || verdict.status),+ );+ }+ }+async function handleDelete() {// A slot that other tiers also read (one OpenAI key backs Brain, STT,// TTS and the Tool Model) never dies on a single click: first clickdiff --git a/jarvis/ui/web/frontend/src/components/ReadyCelebration.test.tsx b/jarvis/ui/web/frontend/src/components/ReadyCelebration.test.tsxnew file mode 100644index 0000000000..c4efc655f4--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/ReadyCelebration.test.tsx@@ -0,0 +1,50 @@+/**+ * The "all lights green" note shows exactly once: when readiness is true and+ * the backend has not recorded the moment yet. "Let's go" records it.+ */+import { afterEach, describe, expect, it, vi } from "vitest";+import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";++vi.mock("@/i18n", () => ({ useT: () => (key: string) => key }));++const state = vi.hoisted(() => ({+ readiness: { mode: "pipeline", required: [], sections: {}, ready: false, celebrated: false, starter_plan: null },+ markReadyCelebrated: vi.fn(async () => undefined),+}));+vi.mock("@/hooks/useStarterPlans", () => ({+ getReadiness: async () => state.readiness,+ markReadyCelebrated: state.markReadyCelebrated,+}));++import { ReadyCelebration } from "./ReadyCelebration";++afterEach(() => {+ cleanup();+ state.markReadyCelebrated.mockClear();+});++describe("ReadyCelebration", () => {+ it("stays silent while something is not ready", async () => {+ state.readiness = { ...state.readiness, ready: false, celebrated: false };+ render(<ReadyCelebration />);+ await new Promise((r) => setTimeout(r, 10));+ expect(screen.queryByTestId("ready-celebration")).toBeNull();+ });++ it("stays silent once the moment was already recorded", async () => {+ state.readiness = { ...state.readiness, ready: true, celebrated: true };+ render(<ReadyCelebration />);+ await new Promise((r) => setTimeout(r, 10));+ expect(screen.queryByTestId("ready-celebration")).toBeNull();+ });++ it("shows once everything answers, and 'go' records it", async () => {+ state.readiness = { ...state.readiness, ready: true, celebrated: false };+ render(<ReadyCelebration inline />);+ await screen.findByTestId("ready-celebration");+ expect(screen.getByText("ready_note.title")).toBeDefined();+ fireEvent.click(screen.getByRole("button", { name: "ready_note.go" }));+ await waitFor(() => expect(state.markReadyCelebrated).toHaveBeenCalledTimes(1));+ expect(screen.queryByTestId("ready-celebration")).toBeNull();+ });+});diff --git a/jarvis/ui/web/frontend/src/components/ReadyCelebration.tsx b/jarvis/ui/web/frontend/src/components/ReadyCelebration.tsxnew file mode 100644index 0000000000..52f0e82967--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/ReadyCelebration.tsx@@ -0,0 +1,113 @@+import { useCallback, useEffect, useRef, useState } from "react";+import { Sparkles, X } from "lucide-react";+import { Button } from "@/components/ui/button";+import { getReadiness, markReadyCelebrated, type ReadinessResponse } from "@/hooks/useStarterPlans";+import { useT } from "@/i18n";+import { cn } from "@/lib/utils";++/**+ * The one-time "all lights green" note.+ *+ * Shown exactly once: the first time every section the active voice mode+ * needs answers `ok` in the section-health rollup (Pipeline: brain, tool+ * model, voice out, voice in — Realtime: live voice, tool model, agents).+ * The backend remembers the moment, so it never reappears — not after a+ * restart, not when a key is rotated later. Inline inside onboarding, a+ * banner above the top bar afterwards; same component, same truth.+ */+const REFRESH_EVENTS = [+ "jarvis:secret-configured",+ "jarvis:brain-switched",+ "jarvis:tts-switched",+ "jarvis:stt-switched",+ "jarvis:realtime-switched",+ "jarvis:computer-use-switched",+ "jarvis:subagent-switched",+ "jarvis:agent-switched",+ "jarvis:provider-tested",+ "jarvis:provider-config-changed",+];++export function ReadyCelebration({ inline = false }: { inline?: boolean }) {+ const t = useT();+ const [state, setState] = useState<ReadinessResponse | null>(null);+ const [dismissed, setDismissed] = useState(false);+ const version = useRef(0);++ const reload = useCallback(async (refresh: boolean) => {+ const mine = ++version.current;+ try {+ const next = await getReadiness(refresh);+ if (mine === version.current) setState(next);+ } catch {+ // Advisory only — a failed probe simply shows nothing.+ }+ }, []);++ useEffect(() => {+ void reload(false);+ let timer: number | undefined;+ const onChange = () => {+ window.clearTimeout(timer);+ // The section-health refresh runs real probes; collapse bursts.+ timer = window.setTimeout(() => void reload(true), 600);+ };+ REFRESH_EVENTS.forEach((e) => window.addEventListener(e, onChange));+ return () => {+ ++version.current;+ window.clearTimeout(timer);+ REFRESH_EVENTS.forEach((e) => window.removeEventListener(e, onChange));+ };+ }, [reload]);++ const visible = Boolean(state?.ready && !state?.celebrated) && !dismissed;+ if (!visible || !state) return null;++ async function acknowledge() {+ setDismissed(true);+ try {+ await markReadyCelebrated();+ } catch {+ // Worst case the note shows once more after a restart.+ }+ }++ const modeLabel =+ state.mode === "realtime"+ ? t("ready_note.mode_realtime")+ : t("ready_note.mode_pipeline");++ return (+ <div+ role="status"+ data-testid="ready-celebration"+ className={cn(+ "flex items-start gap-3 border-primary/60 bg-primary/[0.06] text-foreground",+ inline+ ? "rounded-control border px-4 py-3"+ : "border-b px-5 py-2.5",+ )}+ >+ <Sparkles aria-hidden className="mt-0.5 h-4 w-4 shrink-0 text-primary" />+ <div className="min-w-0 flex-1 space-y-0.5">+ <p className="text-sm font-medium">{t("ready_note.title")}</p>+ <p className="text-[13px] leading-relaxed text-muted-foreground">+ {t("ready_note.body").replace("{0}", modeLabel)}+ </p>+ </div>+ <Button size="sm" onClick={() => void acknowledge()} className="h-8 shrink-0 rounded-control">+ {t("ready_note.go")}+ </Button>+ {!inline && (+ <button+ type="button"+ onClick={() => void acknowledge()}+ aria-label={t("common.close")}+ className="shrink-0 text-muted-foreground hover:text-foreground"+ >+ <X className="h-4 w-4" />+ </button>+ )}+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/onboarding/steps/ApiKeysStep.test.tsx b/jarvis/ui/web/frontend/src/components/onboarding/steps/ApiKeysStep.test.tsxindex 305ac35567..a93bc663c4 100644--- a/jarvis/ui/web/frontend/src/components/onboarding/steps/ApiKeysStep.test.tsx+++ b/jarvis/ui/web/frontend/src/components/onboarding/steps/ApiKeysStep.test.tsx@@ -37,8 +37,39 @@ vi.mock("@/components/ApiKeyForm", () => ({</div>),}));+// Starter plans: the catalog a test hands in, plus spies on select/apply.+const plansState = vi.hoisted(() => ({+ plans: [] as unknown[],+ selected: null as string | null,+ fail: false,+ selectStarterPlan: vi.fn(async () => undefined),+ applyStarterPlan: vi.fn(async () => ({ applied: ["brain"], failed: [], modeSet: true })),+}));+vi.mock("@/hooks/useStarterPlans", () => ({+ getStarterPlans: async () => {+ if (plansState.fail) throw new Error("HTTP 404");+ return { plans: plansState.plans, selected: plansState.selected, custom_id: "custom" };+ },+ selectStarterPlan: plansState.selectStarterPlan,+ applyStarterPlan: plansState.applyStarterPlan,+}));+vi.mock("@/components/ReadyCelebration", () => ({+ ReadyCelebration: () => <div data-testid="ready-celebration-stub" />,+}));++import { ApiKeysStep, planKeysComplete, providersForPlan, startableProviders } from "./ApiKeysStep";-import { ApiKeysStep, startableProviders } from "./ApiKeysStep";+const GEMINI_PLAN = {+ id: "gemini-pipeline",+ label: "Pipeline with Gemini",+ summary: "One key.",+ mode: "pipeline" as const,+ recommended: true,+ assignments: { brain: "gemini", tts: "gemini-flash-tts" },+ key_slots: [{ family: "gemini", slot: "gemini_api_key", label: "Google Gemini", present: false }],+ keys_complete: false,+ ready_sections: ["brain", "computer-use", "tts", "stt"],+};afterEach(() => {cleanup();@@ -48,8 +79,16 @@ afterEach(() => {providersState.error = null;providersState.refetch.mockClear();providersState.switchBrainProvider.mockClear();+ plansState.plans = [];+ plansState.selected = null;+ plansState.fail = true;+ plansState.selectStarterPlan.mockClear();+ plansState.applyStarterPlan.mockClear();});+// The legacy tests below describe the "custom" path: no plan catalog.+plansState.fail = true;+function provider(overrides: Partial<ProviderDescriptor>): ProviderDescriptor {return {id: "x",@@ -194,6 +233,65 @@ it("probes through the backend, activates local, pins pipeline, and unlocks Contexpect(props.setSummary).toHaveBeenLastCalledWith("onboarding.api_keys.summary_local");});+it("providersForPlan keeps only the cards whose primary slot the plan needs", () => {+ const gemini = provider({ id: "gemini", label: "Google Gemini", secret_keys: ["gemini_api_key"], secrets_set: { gemini_api_key: false } });+ const other = provider({ id: "b", label: "B" });+ expect(providersForPlan(GEMINI_PLAN, [gemini, other]).map((p) => p.id)).toEqual(["gemini"]);+ expect(providersForPlan(null, [gemini, other]).map((p) => p.id)).toEqual(["gemini", "b"]);+ expect(planKeysComplete(GEMINI_PLAN, [gemini, other])).toBe(false);+ const saved = { ...gemini, secrets_set: { gemini_api_key: true } };+ expect(planKeysComplete(GEMINI_PLAN, [saved, other])).toBe(true);+});++it("preselects the recommended plan, filters the list to its key, and applies the plan once the key is in", async () => {+ plansState.fail = false;+ plansState.plans = [GEMINI_PLAN];+ providersState.providers = [+ provider({ id: "gemini", label: "Google Gemini", secret_keys: ["gemini_api_key"], secrets_set: { gemini_api_key: false } }),+ provider({ id: "b", label: "B" }),+ ];+ stubFetch(null);+ renderStep();++ const row = await screen.findByTestId("onboarding-plan-gemini-pipeline");+ expect(row.getAttribute("aria-checked")).toBe("true");+ await waitFor(() => expect(screen.getByTestId("form-gemini_api_key")).toBeDefined());+ expect(screen.queryByTestId("form-X_API_KEY")).toBeNull();+ expect(plansState.applyStarterPlan).not.toHaveBeenCalled();++ // The catalog refresh reports the key — the plan is applied without any+ // further click, and the brain auto-switch stays out of the plan's way.+ providersState.providers = [+ provider({ id: "gemini", label: "Google Gemini", secret_keys: ["gemini_api_key"], secrets_set: { gemini_api_key: true }, configured: true }),+ ];+ cleanup();+ const props = renderStep();+ await screen.findByTestId("onboarding-plan-applied");+ expect(plansState.applyStarterPlan).toHaveBeenCalledTimes(1);+ expect(plansState.selectStarterPlan).toHaveBeenCalledWith("gemini-pipeline");+ expect(screen.getByTestId("ready-celebration-stub")).toBeDefined();+ expect((screen.getByTestId("onboarding-primary") as HTMLButtonElement).disabled).toBe(false);+ // The i18n mock echoes keys, so the plan label falls back to the catalog text.+ expect(props.setSummary).toHaveBeenLastCalledWith("Pipeline with Gemini · Google Gemini");+});++it("'pick everything myself' restores the full list and the local path", async () => {+ plansState.fail = false;+ plansState.plans = [GEMINI_PLAN];+ providersState.providers = [+ provider({ id: "gemini", label: "Google Gemini", secret_keys: ["gemini_api_key"], secrets_set: { gemini_api_key: false } }),+ provider({ id: "b", label: "B" }),+ ];+ stubFetch(null);+ renderStep();+ await screen.findByTestId("onboarding-plan-custom");+ expect(screen.queryByText("onboarding.api_keys.local_title")).toBeNull();+ fireEvent.click(screen.getByTestId("onboarding-plan-custom"));+ await waitFor(() => expect(screen.getByTestId("onboarding-provider-b")).toBeDefined());+ expect(screen.getByText("onboarding.api_keys.local_title")).toBeDefined();+ expect(plansState.selectStarterPlan).toHaveBeenCalledWith("custom");+});+it("with Ollama running but empty, explains the missing model and shows no activate button", async () => {stubFetch({ source: "live", models: [] });renderStep();diff --git a/jarvis/ui/web/frontend/src/components/onboarding/steps/ApiKeysStep.tsx b/jarvis/ui/web/frontend/src/components/onboarding/steps/ApiKeysStep.tsxindex 40840bae0c..ba7c63fc16 100644--- a/jarvis/ui/web/frontend/src/components/onboarding/steps/ApiKeysStep.tsx+++ b/jarvis/ui/web/frontend/src/components/onboarding/steps/ApiKeysStep.tsx@@ -7,12 +7,49 @@ import {useProviders,type ProviderDescriptor,} from "@/hooks/useProviders";+import {+ applyStarterPlan,+ getStarterPlans,+ selectStarterPlan,+ type ApplyPlanOutcome,+ type StarterPlan,+} from "@/hooks/useStarterPlans";+import { ReadyCelebration } from "@/components/ReadyCelebration";import { setLocalMode } from "@/lib/localMode";import { putVoiceMode } from "@/lib/voiceEngineMode";import { useT } from "@/i18n";import { cn } from "@/lib/utils";import type { StepProps } from "../OnboardingFlow";-import { StatusLine, StepFooter, StepSection } from "../primitives";+import { ChoiceRow, StatusLine, StepFooter, StepSection } from "../primitives";++/** The "I'll pick everything myself" choice; mirrors the backend's custom id. */+const CUSTOM_PLAN = "custom";++/**+ * The providers a plan asks a key for: the brain card whose primary slot is+ * the plan's family slot. One key per family (2026-08-24), so one card per+ * family is all the plan ever needs to show. Exported for tests.+ */+export function providersForPlan(+ plan: StarterPlan | null,+ startable: ProviderDescriptor[],+): ProviderDescriptor[] {+ if (!plan) return startable;+ const slots = new Set(plan.key_slots.map((s) => s.slot));+ return startable.filter((p) => {+ const slot = primarySlot(p);+ return slot !== null && slots.has(slot);+ });+}++/** Every key the plan needs is saved (dedicated or covered by the family). */+export function planKeysComplete(plan: StarterPlan, startable: ProviderDescriptor[]): boolean {+ const cards = providersForPlan(plan, startable);+ return (+ plan.key_slots.length > 0 &&+ plan.key_slots.every((s) => cards.some((p) => primarySlot(p) === s.slot && slotEffective(p)))+ );+}/** How many providers are open before the "show more" fold. */const FOLD_AFTER = 4;@@ -188,15 +225,76 @@ export function ApiKeysStep({ goNext, goBack, skip, setSummary }: StepProps) {const [expanded, setExpanded] = useState(false);const [localActive, setLocalActive] = useState(false);- const startable = useMemo(() => startableProviders(providers), [providers]);- const visible = expanded ? startable : startable.slice(0, FOLD_AFTER);+ // Starter plans: "one key and you are done". The recommended plan is+ // preselected; "custom" shows the whole catalog exactly as before.+ const [plans, setPlans] = useState<StarterPlan[]>([]);+ const [planId, setPlanId] = useState<string | null>(null);+ const [applying, setApplying] = useState(false);+ const [applied, setApplied] = useState<{ id: string; outcome: ApplyPlanOutcome } | null>(null);++ useEffect(() => {+ let cancelled = false;+ (async () => {+ try {+ const res = await getStarterPlans();+ if (cancelled) return;+ setPlans(res.plans);+ setPlanId(+ (current) =>+ current ?? res.selected ?? res.plans.find((p) => p.recommended)?.id ?? CUSTOM_PLAN,+ );+ } catch {+ // No plan catalog (older backend) — the full list still works.+ if (!cancelled) setPlanId((current) => current ?? CUSTOM_PLAN);+ }+ })();+ return () => {+ cancelled = true;+ };+ }, []);++ const plan = useMemo(+ () => (planId && planId !== CUSTOM_PLAN ? (plans.find((p) => p.id === planId) ?? null) : null),+ [plans, planId],+ );++ const allStartable = useMemo(() => startableProviders(providers), [providers]);+ const startable = useMemo(() => providersForPlan(plan, allStartable), [plan, allStartable]);+ const visible = expanded || plan ? startable : startable.slice(0, FOLD_AFTER);const hidden = startable.length - visible.length;const configured = startable.filter(slotEffective);const hasKey = configured.length > 0;+ const planComplete = plan ? planKeysComplete(plan, allStartable) : false;+ const planApplied = Boolean(plan && applied?.id === plan.id);+ // Once every key the plan needs is saved, point every surface at it —+ // brain, tool model, agents, voice out, voice in, live voice, mode. Runs+ // once per plan; a re-render never re-applies.useEffect(() => {- if (hasKey) {+ if (!plan || !planComplete || applying || applied?.id === plan.id) return;+ let cancelled = false;+ setApplying(true);+ (async () => {+ try {+ await selectStarterPlan(plan.id).catch(() => undefined);+ const outcome = await applyStarterPlan(plan);+ if (!cancelled) setApplied({ id: plan.id, outcome });+ } finally {+ if (!cancelled) setApplying(false);+ void refetch();+ }+ })();+ return () => {+ cancelled = true;+ };+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [plan?.id, planComplete]);++ useEffect(() => {+ if (plan && planApplied) {+ setSummary(`${planLabel(plan)} · ${configured.map((p) => p.label).join(" · ")}`);+ } else if (hasKey) {setSummary(configured.map((p) => p.label).join(" · "));} else if (localActive) {setSummary(t("onboarding.api_keys.summary_local"));@@ -205,7 +303,7 @@ export function ApiKeysStep({ goNext, goBack, skip, setSummary }: StepProps) {}// configured is derived from startable; its labels are what we render.// eslint-disable-next-line react-hooks/exhaustive-deps- }, [hasKey, localActive, configured.map((p) => p.id).join(","), setSummary, t]);+ }, [hasKey, localActive, planApplied, configured.map((p) => p.id).join(","), setSummary, t]);// Open the first row by default so a fresh install shows an input, not a// list of closed doors. Once anything is configured, everything stays shut.@@ -214,6 +312,23 @@ export function ApiKeysStep({ goNext, goBack, skip, setSummary }: StepProps) {// eslint-disable-next-line react-hooks/exhaustive-deps}, [startable.length, hasKey]);+ function planLabel(p: StarterPlan): string {+ const key = `onboarding.plans.${p.id.replace(/-/g, "_")}_label`;+ const translated = t(key);+ return translated === key ? p.label : translated;+ }+ function planSummary(p: StarterPlan): string {+ const key = `onboarding.plans.${p.id.replace(/-/g, "_")}_summary`;+ const translated = t(key);+ return translated === key ? p.summary : translated;+ }++ async function choosePlan(id: string) {+ setPlanId(id);+ setOpen(null);+ await selectStarterPlan(id).catch(() => undefined);+ }+const activateIfNone = (p: ProviderDescriptor) => {const anyActive = startable.some((q) => q.active);if (anyActive) return;@@ -229,6 +344,30 @@ export function ApiKeysStep({ goNext, goBack, skip, setSummary }: StepProps) {return (<div className="space-y-8">+ {plans.length > 0 && (+ <StepSection label={t("onboarding.api_keys.plan_label")}>+ <div className="space-y-2" role="radiogroup" data-testid="onboarding-plan-picker">+ {plans.map((p) => (+ <ChoiceRow+ key={p.id}+ selected={planId === p.id}+ title={p.recommended ? `${planLabel(p)} — ${t("onboarding.api_keys.recommended")}` : planLabel(p)}+ body={planSummary(p)}+ onSelect={() => void choosePlan(p.id)}+ testId={`onboarding-plan-${p.id}`}+ />+ ))}+ <ChoiceRow+ selected={planId === CUSTOM_PLAN}+ title={t("onboarding.api_keys.plan_custom_title")}+ body={t("onboarding.api_keys.plan_custom_body")}+ onSelect={() => void choosePlan(CUSTOM_PLAN)}+ testId="onboarding-plan-custom"+ />+ </div>+ </StepSection>+ )}+<StepSection label={t("onboarding.api_keys.providers_label")}>{loading && startable.length === 0 ? (<p className="text-[13px] text-muted-foreground">{t("onboarding.api_keys.loading")}</p>@@ -296,8 +435,17 @@ export function ApiKeysStep({ goNext, goBack, skip, setSummary }: StepProps) {credentialHelp={p.credential_help}coveredNote={p.credential_note ?? null}sharedWith={p.secret_shared_with?.[slot] ?? []}+ testAfterSave={{+ id: p.id,+ label: p.label,+ section: p.tier,+ active: p.active,+ }}onChanged={() => void refetch()}- onSavedActivate={() => activateIfNone(p)}+ onSavedActivate={() => {+ // A plan takes over activation for every surface.+ if (!plan) activateIfNone(p);+ }}/></div>)}@@ -324,9 +472,28 @@ export function ApiKeysStep({ goNext, goBack, skip, setSummary }: StepProps) {{t("onboarding.api_keys.show_less")}</button>)}+ {plan && applying && (+ <StatusLine tone="muted" testId="onboarding-plan-applying">+ {t("onboarding.api_keys.plan_applying").replace("{0}", planLabel(plan))}+ </StatusLine>+ )}+ {plan && planApplied && applied && applied.outcome.failed.length === 0 && (+ <StatusLine tone="ok" testId="onboarding-plan-applied">+ {t("onboarding.api_keys.plan_applied").replace("{0}", planLabel(plan))}+ </StatusLine>+ )}+ {plan && planApplied && applied && applied.outcome.failed.length > 0 && (+ <StatusLine tone="warning" testId="onboarding-plan-partial">+ {t("onboarding.api_keys.plan_partial").replace(+ "{0}",+ applied.outcome.failed.map((f) => `${f.surface}: ${f.error}`).join(" · "),+ )}+ </StatusLine>+ )}+ {plan && planApplied && <ReadyCelebration inline />}</StepSection>- <LocalPath onActivated={() => setLocalActive(true)} />+ {!plan && <LocalPath onActivated={() => setLocalActive(true)} />}<p className="text-[13px] leading-relaxed text-muted-foreground">{t("onboarding.api_keys.security_note")}diff --git a/jarvis/ui/web/frontend/src/hooks/useStarterPlans.ts b/jarvis/ui/web/frontend/src/hooks/useStarterPlans.tsnew file mode 100644index 0000000000..848c01e38a--- /dev/null+++ b/jarvis/ui/web/frontend/src/hooks/useStarterPlans.ts@@ -0,0 +1,131 @@+/**+ * Starter plans ("one key and you are done") and the readiness note.+ *+ * A plan is data from the backend catalog: a voice mode plus one provider per+ * surface, all on one or two key families. Applying it means calling the+ * ordinary switch routes in order — nothing here knows how a switch works.+ */+import { putVoiceMode } from "@/lib/voiceEngineMode";+import {+ switchBrainProvider,+ switchComputerUseProvider,+ switchRealtimeProvider,+ switchSttProvider,+ switchSubagentProvider,+ switchTtsProvider,+} from "@/hooks/useProviders";++export interface StarterPlanKeySlot {+ family: string;+ slot: string;+ label: string;+ present: boolean;+}++export interface StarterPlan {+ id: string;+ label: string;+ summary: string;+ mode: "pipeline" | "realtime";+ recommended: boolean;+ assignments: Record<string, string>;+ key_slots: StarterPlanKeySlot[];+ keys_complete: boolean;+ ready_sections: string[];+}++export interface StarterPlansResponse {+ plans: StarterPlan[];+ selected: string | null;+ custom_id: string;+}++export interface ReadinessResponse {+ mode: "pipeline" | "realtime";+ required: string[];+ sections: Record<string, { status: string; reason?: string; detail?: string }>;+ ready: boolean;+ celebrated: boolean;+ starter_plan: string | null;+}++async function json<T>(res: Response): Promise<T> {+ if (!res.ok) {+ const body = await res.json().catch(() => ({}));+ throw new Error(body.detail ?? `HTTP ${res.status}`);+ }+ return (await res.json()) as T;+}++export async function getStarterPlans(): Promise<StarterPlansResponse> {+ return json(await fetch("/api/setup/starter-plans", { cache: "no-store" }));+}++export async function selectStarterPlan(planId: string): Promise<void> {+ await json(await fetch(`/api/setup/starter-plans/${encodeURIComponent(planId)}`, { method: "POST" }));+}++export async function getReadiness(refresh = false): Promise<ReadinessResponse> {+ return json(+ await fetch(`/api/setup/readiness${refresh ? "?refresh=true" : ""}`, { cache: "no-store" }),+ );+}++export async function markReadyCelebrated(): Promise<void> {+ await json(await fetch("/api/setup/readiness/celebrated", { method: "POST" }));+}++/** Surfaces in the order a plan is applied; the voice mode goes last. */+const APPLY_ORDER = ["brain", "computer-use", "subagent", "tts", "stt", "realtime"] as const;++export interface ApplyPlanOutcome {+ applied: string[];+ failed: { surface: string; error: string }[];+ modeSet: boolean;+}++/**+ * Point every surface of the plan at its provider, then pin the voice mode.+ * One surface failing does not stop the others — the readiness note only+ * appears once everything answers, so a partial apply stays visible.+ */+export async function applyStarterPlan(plan: StarterPlan): Promise<ApplyPlanOutcome> {+ const out: ApplyPlanOutcome = { applied: [], failed: [], modeSet: false };+ for (const surface of APPLY_ORDER) {+ const provider = plan.assignments[surface];+ if (!provider) continue;+ try {+ switch (surface) {+ case "brain":+ await switchBrainProvider(provider);+ break;+ case "computer-use":+ await switchComputerUseProvider(provider);+ break;+ case "subagent":+ await switchSubagentProvider(provider);+ break;+ case "tts":+ await switchTtsProvider(provider);+ break;+ case "stt":+ await switchSttProvider(provider);+ break;+ case "realtime":+ await switchRealtimeProvider(provider);+ break;+ }+ out.applied.push(surface);+ } catch (e) {+ out.failed.push({ surface, error: e instanceof Error ? e.message : String(e) });+ }+ }+ try {+ await putVoiceMode(plan.mode);+ out.modeSet = true;+ } catch (e) {+ out.failed.push({ surface: "voice-mode", error: e instanceof Error ? e.message : String(e) });+ }+ window.dispatchEvent(new CustomEvent("jarvis:provider-config-changed"));+ return out;+}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 837a6965a1..1e7125e13c 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -1838,7 +1838,9 @@"switch_done_realtime": "Realtime → {0}","experimental_note": "Beta: Dieser Anbieter ist noch nicht fertig und nutzt ein instabiles Protokoll, das sich ohne Vorankündigung ändern kann. Wenn es nicht startet, endet das Gespräch.","experimental_consent": "Bevor du das aktivierst: Dieser Anbieter ist noch im Beta-Stadium und nutzt eine experimentelle, instabile Route, die sich ohne Vorankündigung ändern kann. Wenn sie ausfällt, endet das Gespräch, statt von selbst auf einen anderen Anbieter zu wechseln. Fortfahren?",- "trademark_notice": "Anbieter- und Dienstnamen sowie Logos sind Marken ihrer jeweiligen Inhaber und werden nur gezeigt, um die verbindbaren Integrationen zu benennen. Eine Verbindung oder Empfehlung ist damit nicht gemeint."+ "trademark_notice": "Anbieter- und Dienstnamen sowie Logos sind Marken ihrer jeweiligen Inhaber und werden nur gezeigt, um die verbindbaren Integrationen zu benennen. Eine Verbindung oder Empfehlung ist damit nicht gemeint.",+ "key_verified_toast": "{0} hat geantwortet — der Schlüssel funktioniert.",+ "key_check_failed_toast": "{0} hat nicht geantwortet: {1}"},"apikeys_test": {"button": "Testen",@@ -2723,7 +2725,13 @@"later": "Später — Schlüssel in den Einstellungen hinzufügen","later_hint": "Chat und Sprache bleiben aus, bis ein Schlüssel gespeichert ist.","summary_none": "Noch kein Schlüssel",- "summary_local": "Lokal · Ollama"+ "summary_local": "Lokal · Ollama",+ "plan_label": "Wie willst du starten?",+ "plan_custom_title": "Alles selbst auswählen",+ "plan_custom_body": "Die komplette Provider-Liste — jeden Teil einzeln wählen.",+ "plan_applying": "Richte alles für {0} ein…",+ "plan_applied": "{0} ist eingerichtet: Denken, Tool-Modell, Agenten und Stimme zeigen alle auf deinen Schlüssel.",+ "plan_partial": "Das meiste ist eingerichtet; das hier hat nicht geklappt: {0}. Du kannst es später unter API-Keys nachholen."},"permissions": {"privacy_note": "Diese Abfragen kommen von macOS. Der Installer kann sie nicht still genehmigen, und {name} umgeht die Systemeinstellungen nie. Die Schlüsselbund-Abfrage beim App-Start bedeutet nur, dass deine API-Schlüssel verschlüsselt im macOS-Schlüsselbund gespeichert werden — sie verlassen deinen Mac nie.",@@ -2779,6 +2787,14 @@"start_cta": "{name} starten","starting": "Startet…","start_failed": "Die Einrichtung konnte nicht abgeschlossen werden. Prüfe, ob die App läuft, und versuche es erneut."+ },+ "plans": {+ "gemini_pipeline_label": "Pipeline mit Gemini",+ "gemini_pipeline_summary": "Ein Google-Gemini-Schlüssel für alles: Denken, Tool-Modell, Agenten, Stimme rein und raus.",+ "gemini_realtime_label": "Realtime mit Gemini",+ "gemini_realtime_summary": "Ein Google-Gemini-Schlüssel, live gesprochen: Gemini Live antwortet in Echtzeit; Tool-Modell und Agenten laufen über denselben Schlüssel.",+ "gemini_openai_realtime_label": "Gemini + OpenAI",+ "gemini_openai_realtime_summary": "Zwei Schlüssel, beide Engines abgedeckt: OpenAI Realtime spricht live, Gemini denkt, plant und steuert die Agenten — und die Pipeline bleibt als Reserve bereit."}},"language_select": {@@ -5253,5 +5269,12 @@"empty": "In dieser Sitzung wurde nichts aufgezeichnet.","read_only": "Eine gesprochene Unterhaltung. Sprich weiter, um sie fortzusetzen.","continue": "Per Sprache fortsetzen"+ },+ "ready_note": {+ "title": "Alle Lichter grün.",+ "body": "Denken, Werkzeuge, Agenten und {0} haben beim ersten Versuch geantwortet. Sag dein Wake-Word — oder tipp einfach los.",+ "go": "Los geht's",+ "mode_realtime": "Live-Stimme",+ "mode_pipeline": "Stimme rein und raus"}}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex 58ab8017f6..09c661effa 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -1838,7 +1838,9 @@"switch_done_dictation": "Dictation wording → {0}","switch_done_realtime": "Realtime → {0}","experimental_note": "Beta: this provider is not finished yet and uses an unstable protocol that can change without notice. If it cannot start, the call stops.",- "experimental_consent": "Before you turn this on: this provider is still in beta and uses an experimental, unstable route that can change without notice. If it breaks, the call stops instead of switching to another provider on its own. Continue?"+ "experimental_consent": "Before you turn this on: this provider is still in beta and uses an experimental, unstable route that can change without notice. If it breaks, the call stops instead of switching to another provider on its own. Continue?",+ "key_verified_toast": "{0} answered — the key works.",+ "key_check_failed_toast": "{0} did not answer: {1}"},"apikeys_test": {"button": "Test",@@ -2723,7 +2725,13 @@"later": "Later — add a key in Settings","later_hint": "Chat and voice stay off until a key is saved.","summary_none": "No key yet",- "summary_local": "Local · Ollama"+ "summary_local": "Local · Ollama",+ "plan_label": "How do you want to start?",+ "plan_custom_title": "Pick everything myself",+ "plan_custom_body": "The full provider list — choose each part on its own.",+ "plan_applying": "Setting everything up for {0}…",+ "plan_applied": "{0} is set up: thinking, tool model, agents and voice all point at your key.",+ "plan_partial": "Most of it is set; this did not apply: {0}. You can fix it later under API Keys."},"permissions": {"privacy_note": "These prompts come from macOS. The installer cannot silently approve them, and {name} never bypasses System Settings. The Keychain prompt at app start only means your API keys are being saved encrypted in the macOS Keychain — they never leave your Mac.",@@ -2779,6 +2787,14 @@"start_cta": "Start {name}","starting": "Starting…","start_failed": "Could not finish setup. Check that the app is running, then try again."+ },+ "plans": {+ "gemini_pipeline_label": "Pipeline with Gemini",+ "gemini_pipeline_summary": "One Google Gemini key runs everything: thinking, the tool model, the agents, voice in and voice out.",+ "gemini_realtime_label": "Realtime with Gemini",+ "gemini_realtime_summary": "One Google Gemini key, spoken live: Gemini Live answers in real time; tool model and agents run on the same key.",+ "gemini_openai_realtime_label": "Gemini + OpenAI",+ "gemini_openai_realtime_summary": "Two keys, both engines covered: OpenAI Realtime speaks live, Gemini thinks, plans and runs the agents — and the Pipeline engine stays ready as a fallback."}},"language_select": {@@ -5253,5 +5269,12 @@"empty": "Nothing was recorded in this session.","read_only": "A spoken conversation. Continue it by talking.","continue": "Continue by voice"+ },+ "ready_note": {+ "title": "All lights green.",+ "body": "Thinking, tools, agents and {0} all answered on the first try. Say your wake word — or just start typing.",+ "go": "Let's go",+ "mode_realtime": "live voice",+ "mode_pipeline": "voice in and out"}}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex f4ed6034c0..abebd38ddb 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -1836,7 +1836,9 @@"switch_done_realtime": "Realtime → {0}","experimental_note": "Beta: este proveedor todavía no está terminado y usa un protocolo inestable que puede cambiar sin aviso. Si no puede iniciarse, la llamada se detiene.","experimental_consent": "Antes de activarlo: este proveedor todavía está en beta y usa una ruta experimental e inestable que puede cambiar sin aviso. Si falla, la llamada se detiene en lugar de cambiar por su cuenta a otro proveedor. ¿Continuar?",- "trademark_notice": "Los nombres y logotipos de proveedores y servicios son marcas de sus respectivos titulares y se muestran únicamente para identificar las integraciones que puedes conectar. No implican afiliación ni respaldo."+ "trademark_notice": "Los nombres y logotipos de proveedores y servicios son marcas de sus respectivos titulares y se muestran únicamente para identificar las integraciones que puedes conectar. No implican afiliación ni respaldo.",+ "key_verified_toast": "{0} ha respondido — la clave funciona.",+ "key_check_failed_toast": "{0} no ha respondido: {1}"},"apikeys_test": {"button": "Probar",@@ -2721,7 +2723,13 @@"later": "Más tarde — añadir una clave en Ajustes","later_hint": "El chat y la voz permanecen desactivados hasta que se guarde una clave.","summary_none": "Aún sin clave",- "summary_local": "Local · Ollama"+ "summary_local": "Local · Ollama",+ "plan_label": "¿Cómo quieres empezar?",+ "plan_custom_title": "Elegir todo yo mismo",+ "plan_custom_body": "La lista completa de proveedores — elige cada parte por separado.",+ "plan_applying": "Configurando todo para {0}…",+ "plan_applied": "{0} está configurado: pensar, modelo de herramientas, agentes y voz apuntan a tu clave.",+ "plan_partial": "Casi todo está listo; esto no se aplicó: {0}. Puedes arreglarlo después en Claves API."},"permissions": {"privacy_note": "Estas solicitudes vienen de macOS. El instalador no puede aprobarlas en silencio y {name} nunca se salta los Ajustes del Sistema. La solicitud del Llavero al iniciar solo significa que tus claves API se guardan cifradas en el Llavero de macOS — nunca salen de tu Mac.",@@ -2777,6 +2785,14 @@"start_cta": "Iniciar {name}","starting": "Iniciando…","start_failed": "No se pudo terminar la configuración. Comprueba que la aplicación esté en marcha e inténtalo de nuevo."+ },+ "plans": {+ "gemini_pipeline_label": "Pipeline con Gemini",+ "gemini_pipeline_summary": "Una clave de Google Gemini lo hace todo: pensar, el modelo de herramientas, los agentes, voz de entrada y salida.",+ "gemini_realtime_label": "Realtime con Gemini",+ "gemini_realtime_summary": "Una clave de Google Gemini, hablada en vivo: Gemini Live responde en tiempo real; el modelo de herramientas y los agentes usan la misma clave.",+ "gemini_openai_realtime_label": "Gemini + OpenAI",+ "gemini_openai_realtime_summary": "Dos claves, ambos motores cubiertos: OpenAI Realtime habla en vivo, Gemini piensa, planifica y dirige los agentes — y el Pipeline queda listo como reserva."}},"language_select": {@@ -5251,5 +5267,12 @@"empty": "No se grabó nada en esta sesión.","read_only": "Una conversación hablada. Continúala hablando.","continue": "Continuar por voz"+ },+ "ready_note": {+ "title": "Todo en verde.",+ "body": "Pensar, herramientas, agentes y {0} han respondido a la primera. Di tu palabra de activación — o simplemente empieza a escribir.",+ "go": "Vamos",+ "mode_realtime": "voz en vivo",+ "mode_pipeline": "voz de entrada y salida"}}diff --git a/jarvis/ui/web/server.py b/jarvis/ui/web/server.pyindex 982456fd99..cee6920295 100644--- a/jarvis/ui/web/server.py+++ b/jarvis/ui/web/server.py@@ -362,6 +362,7 @@ class WebServer:from .friends_routes import router as friends_routerfrom .frontier_routes import router as frontier_routerfrom .grok_build_routes import router as grok_build_router+ from .local_models_routes import router as local_models_routerfrom .marketplace_publish_routes import router as marketplace_publish_routerfrom .marketplace_routes import router as marketplace_routerfrom .mcp_routes import router as mcp_router@@ -389,6 +390,7 @@ class WebServer:from .setup_routes import router as setup_routerfrom .skills_routes import router as skills_routerfrom .socials_routes import router as socials_router+ from .starter_plan_routes import router as starter_plan_routerfrom .sub_agents_routes import router as sub_agents_routerfrom .tasks_routes import router as tasks_routerfrom .telephony_routes import router as telephony_router@@ -415,10 +417,19 @@ class WebServer:app.include_router(mcp_router)app.include_router(tools_router)app.include_router(tool_model_router)+ # Jarvis' OWN tools, offered outwards over MCP so an agent-chat session+ # drives Jarvis instead of a bare workspace. Key-gated like the rest of+ # the Control API; mounted raw because the transport streams.+ from jarvis.ui.web.mcp_server_routes import build_mcp_asgi_app++ app.mount("/api/control/mcp", build_mcp_asgi_app())# Event-loop diagnostics (read-only) — names the owner of an AP-20# cancellation busy-loop from inside the loop; see diagnostics_routes.app.include_router(diagnostics_router)app.include_router(provider_router)+ # Local models section: inventory / unload / delete behind the+ # pull-capable card (same capability gate as the pull routes).+ app.include_router(local_models_router)app.include_router(antigravity_router)app.include_router(claude_router)app.include_router(grok_build_router)@@ -437,6 +448,8 @@ class WebServer:# Share-safe cross-device setup report (read-only) — names why THIS# install behaves differently from another device (CLAUDE.md §3 triage).app.include_router(setup_report_router)+ # Starter plans + the one-time "all set" readiness note.+ app.include_router(starter_plan_router)# Frontier auto-switch modal API (GET pending / POST ack) + Self-Mod# read/restore API. Both were the last route modules left unmounted; the# 404 on /api/frontier/pending silently broke the desktop auto-switch@@ -2368,6 +2381,12 @@ class WebServer:assert_bind_safe(host, _control_key.get_control_key())resolved_port = port if port is not None else self.cfg.ui.admin_api_port+ # The one place the effective port is known: a dev instance offsets+ # it at runtime while sharing jarvis.toml, so reading the config+ # would point an in-process caller at the LIVE app's port.+ from jarvis.core import runtime_refs as _runtime_refs++ _runtime_refs.set_api_base_url(f"http://127.0.0.1:{resolved_port}")config = uvicorn.Config(app=self.app,host=host,diff --git a/jarvis/ui/web/starter_plan_routes.py b/jarvis/ui/web/starter_plan_routes.pynew file mode 100644index 0000000000..507c94bfc4--- /dev/null+++ b/jarvis/ui/web/starter_plan_routes.py@@ -0,0 +1,151 @@+"""Starter plans and the "ready" moment (``/api/setup``).++Own module on purpose: ``setup_routes.py`` is the Obsidian setup wizard and+shares the ``/api/setup`` prefix.++ GET /api/setup/starter-plans → plans + which of their keys are saved+ POST /api/setup/starter-plans/{id} → remember the plan the user picked+ GET /api/setup/readiness → is the active voice mode fully set up?+ POST /api/setup/readiness/celebrated → the one-time "all set" note was shown++Readiness reuses the section-health rollup (the real per-tier probes) instead+of a second opinion: "ready" means every section the mode needs reports+``ok``. Reads fail open — a broken probe reports not-ready, never a 5xx.+"""++from __future__ import annotations++import logging+from pathlib import Path+from typing import Any++from fastapi import APIRouter, HTTPException, Request++from jarvis.core import config as cfg_mod+from jarvis.setup import state as st+from jarvis.setup.starter_plans import (+ CUSTOM_PLAN_ID,+ STARTER_PLANS,+ get_plan,+ plan_ready_sections,+)++log = logging.getLogger(__name__)++router = APIRouter(prefix="/api/setup", tags=["setup"])++# Tests redirect the state file; production resolves the default.+_STATE_PATH_OVERRIDE: Path | None = None+++def _path() -> Path | None:+ return _STATE_PATH_OVERRIDE+++def _family_label(family: str) -> str:+ from .provider_spec import get_spec++ spec = get_spec(family)+ return spec.label if spec else family+++def _key_slots(families: tuple[str, ...]) -> list[dict[str, Any]]:+ slots: list[dict[str, Any]] = []+ for family in families:+ slot = cfg_mod.secret_family_primary_slot(family)+ if slot is None:+ continue+ try:+ present = bool(cfg_mod.get_provider_secret(family))+ except Exception as exc: # noqa: BLE001 — a locked keyring reads as "no key"+ log.debug("starter-plan key probe failed for %s: %s", family, exc)+ present = False+ slots.append(+ {"family": family, "slot": slot, "label": _family_label(family), "present": present}+ )+ return slots++[email protected]("/starter-plans")+async def list_starter_plans() -> dict[str, Any]:+ plans = []+ for plan in STARTER_PLANS:+ slots = _key_slots(plan.key_families)+ plans.append(+ {+ "id": plan.id,+ "label": plan.label,+ "summary": plan.summary,+ "mode": plan.mode,+ "recommended": plan.recommended,+ "assignments": dict(plan.assignments),+ "key_slots": slots,+ "keys_complete": bool(slots) and all(s["present"] for s in slots),+ "ready_sections": list(plan_ready_sections(plan.mode)),+ }+ )+ return {"plans": plans, "selected": st.get_starter_plan(_path()), "custom_id": CUSTOM_PLAN_ID}++[email protected]("/starter-plans/{plan_id}")+async def select_starter_plan(plan_id: str) -> dict[str, Any]:+ if plan_id != CUSTOM_PLAN_ID and get_plan(plan_id) is None:+ raise HTTPException(status_code=404, detail=f"Unknown starter plan: {plan_id}")+ st.set_starter_plan(plan_id, _path())+ return {"ok": True, "selected": plan_id}+++def _voice_mode(request: Request) -> str:+ cfg = getattr(request.app.state, "config", None) or getattr(request.app.state, "cfg", None)+ mode = str(getattr(getattr(cfg, "voice", None), "mode", "") or "").strip().lower()+ return mode if mode in ("pipeline", "realtime") else "realtime"++[email protected]("/readiness")+async def readiness(request: Request, refresh: bool = False) -> dict[str, Any]:+ """Whether every section the active voice mode needs answers ``ok``.++ ``celebrated`` tells the UI whether the one-time note was already shown;+ the UI shows it exactly once, when ``ready`` first turns true.+ """+ mode = _voice_mode(request)+ required = plan_ready_sections(mode)+ sections: dict[str, Any] = {}+ try:+ from . import provider_routes++ snapshot = await provider_routes.section_health(request, refresh=refresh)+ raw = getattr(snapshot, "sections", None) or {}+ for name in required:+ entry = raw.get(name)+ if entry is None:+ sections[name] = {"status": "unknown", "reason": "missing", "detail": ""}+ elif hasattr(entry, "model_dump"):+ sections[name] = entry.model_dump()+ elif isinstance(entry, dict):+ sections[name] = entry+ else:+ sections[name] = {"status": str(getattr(entry, "status", "unknown"))}+ except Exception as exc: # noqa: BLE001 — readiness is advisory, never a 5xx+ log.debug("readiness: section health unavailable (%s)", exc)+ sections = {+ name: {"status": "unknown", "reason": "error", "detail": ""} for name in required+ }+ ready = bool(required) and all(sections[name].get("status") == "ok" for name in required)+ return {+ "mode": mode,+ "required": list(required),+ "sections": sections,+ "ready": ready,+ "celebrated": st.is_ready_celebrated(_path()),+ "starter_plan": st.get_starter_plan(_path()),+ }++[email protected]("/readiness/celebrated")+async def mark_celebrated() -> dict[str, Any]:+ st.mark_ready_celebrated(_path())+ return {"ok": True}+++__all__ = ["router"]diff --git a/tests/integration/test_starter_plan_routes.py b/tests/integration/test_starter_plan_routes.pynew file mode 100644index 0000000000..d99bcd5bcc--- /dev/null+++ b/tests/integration/test_starter_plan_routes.py@@ -0,0 +1,116 @@+"""``/api/setup`` — starter plans and the readiness note."""+from __future__ import annotations++from collections.abc import Iterator++import pytest+from fastapi.testclient import TestClient++from jarvis.core import config as cfg_mod+from jarvis.core.bus import EventBus+from jarvis.core.config import JarvisConfig+from jarvis.ui.web import provider_routes, starter_plan_routes+from jarvis.ui.web.server import WebServer+++def state_path(tmp_path, monkeypatch) -> Iterator[None]:+ monkeypatch.setattr(starter_plan_routes, "_STATE_PATH_OVERRIDE", tmp_path / "setup_state.json")+ yield+++def secrets(monkeypatch) -> dict[str, str]:+ data: dict[str, str] = {}+ monkeypatch.setattr(cfg_mod, "get_secret", lambda key, env_fallback=None: data.get(key))+ return data+++def server() -> WebServer:+ cfg = JarvisConfig()+ cfg.ui.dev_mode = True+ srv = WebServer(cfg, bus=EventBus())+ srv.app.state.cfg = cfg+ srv.app.state.config = cfg+ return srv+++class _Snapshot:+ def __init__(self, sections: dict[str, dict[str, str]]) -> None:+ self.sections = sections+++def _all_ok(names: tuple[str, ...]) -> _Snapshot:+ return _Snapshot({n: {"status": "ok", "reason": "ok", "detail": ""} for n in names})+++def test_starter_plans_report_which_keys_exist(server, state_path, secrets) -> None:+ secrets["gemini_api_key"] = "AIza-1"+ with TestClient(server.app) as client:+ body = client.get("/api/setup/starter-plans").json()+ plans = {p["id"]: p for p in body["plans"]}+ assert plans["gemini-pipeline"]["recommended"] is True+ assert plans["gemini-pipeline"]["keys_complete"] is True+ assert plans["gemini-pipeline"]["key_slots"][0]["slot"] == "gemini_api_key"+ two = plans["gemini-openai-realtime"]+ assert two["keys_complete"] is False+ assert [s["present"] for s in two["key_slots"]] == [True, False]+ assert body["selected"] is None+++def test_select_starter_plan_persists_and_rejects_unknown(server, state_path) -> None:+ with TestClient(server.app) as client:+ assert client.post("/api/setup/starter-plans/nope").status_code == 404+ assert client.post("/api/setup/starter-plans/gemini-pipeline").json()["selected"] == (+ "gemini-pipeline"+ )+ assert client.post("/api/setup/starter-plans/custom").status_code == 200+ assert client.get("/api/setup/starter-plans").json()["selected"] == "custom"+++def test_readiness_follows_the_active_mode_and_celebrates_once(+ server, state_path, monkeypatch+) -> None:+ server.cfg.voice.mode = "pipeline"++ async def fake_health(request, refresh=False):+ return _all_ok(("brain", "computer-use", "tts", "stt", "realtime", "subagents"))++ monkeypatch.setattr(provider_routes, "section_health", fake_health)+ with TestClient(server.app) as client:+ body = client.get("/api/setup/readiness").json()+ assert body["mode"] == "pipeline"+ assert body["required"] == ["brain", "computer-use", "tts", "stt"]+ assert body["ready"] is True and body["celebrated"] is False+ assert client.post("/api/setup/readiness/celebrated").json()["ok"] is True+ assert client.get("/api/setup/readiness").json()["celebrated"] is True+++def test_readiness_is_false_when_a_required_section_is_not_ok(+ server, state_path, monkeypatch+) -> None:+ server.cfg.voice.mode = "realtime"++ async def fake_health(request, refresh=False):+ snap = _all_ok(("realtime", "computer-use"))+ snap.sections["subagents"] = {"status": "needs_setup", "reason": "x", "detail": ""}+ return snap++ monkeypatch.setattr(provider_routes, "section_health", fake_health)+ with TestClient(server.app) as client:+ body = client.get("/api/setup/readiness").json()+ assert body["required"] == ["realtime", "computer-use", "subagents"]+ assert body["ready"] is False+ assert body["sections"]["subagents"]["status"] == "needs_setup"+++def test_readiness_fails_open_when_health_probe_breaks(server, state_path, monkeypatch) -> None:+ async def boom(request, refresh=False):+ raise RuntimeError("probe exploded")++ monkeypatch.setattr(provider_routes, "section_health", boom)+ with TestClient(server.app) as client:+ resp = client.get("/api/setup/readiness")+ assert resp.status_code == 200+ assert resp.json()["ready"] is Falsediff --git a/tests/unit/setup/test_starter_plans.py b/tests/unit/setup/test_starter_plans.pynew file mode 100644index 0000000000..f4bad722f3--- /dev/null+++ b/tests/unit/setup/test_starter_plans.py@@ -0,0 +1,81 @@+"""Starter plans must only name providers that exist, in the tier they claim.++BUG-008 shape: the plan catalog and the provider catalog are two lists of the+same ids. A renamed provider must fail here, not on someone's first run.+"""+from __future__ import annotations++import pytest++from jarvis.core import config as cfg+from jarvis.setup import state as st+from jarvis.setup.starter_plans import (+ READY_SECTIONS_BY_MODE,+ STARTER_PLANS,+ get_plan,+ plan_ready_sections,+)+from jarvis.ui.web.provider_spec import get_spec++_SURFACE_TIER = {+ "brain": "brain",+ "computer-use": "brain",+ "subagent": "brain",+ "tts": "tts",+ "stt": "stt",+ "realtime": "realtime",+}++[email protected]("plan", STARTER_PLANS, ids=lambda p: p.id)+def test_plan_assignments_point_at_real_providers_of_the_right_tier(plan) -> None:+ assert plan.mode in READY_SECTIONS_BY_MODE+ for surface, provider_id in plan.assignments.items():+ spec = get_spec(provider_id)+ assert spec is not None, f"{plan.id}: unknown provider {provider_id!r} for {surface}"+ assert spec.tier == _SURFACE_TIER[surface], (+ f"{plan.id}: {provider_id} is a {spec.tier} provider, {surface} needs "+ f"{_SURFACE_TIER[surface]}"+ )+ if surface in ("brain", "computer-use"):+ assert spec.brain_switchable is not False++[email protected]("plan", STARTER_PLANS, ids=lambda p: p.id)+def test_plan_key_families_have_a_primary_slot(plan) -> None:+ for family in plan.key_families:+ assert cfg.secret_family_primary_slot(family), f"{plan.id}: {family} has no key slot"+++def test_realtime_plans_assign_a_realtime_provider() -> None:+ for plan in STARTER_PLANS:+ if plan.mode == "realtime":+ assert "realtime" in plan.assignments, plan.id+++def test_every_ready_section_is_a_known_section_health_key() -> None:+ from jarvis.ui.web.provider_routes import _SECTION_HEALTH_KEYS++ for sections in READY_SECTIONS_BY_MODE.values():+ for name in sections:+ assert name in _SECTION_HEALTH_KEYS, name+++def test_exactly_one_recommended_plan() -> None:+ assert sum(1 for p in STARTER_PLANS if p.recommended) == 1+ assert get_plan("gemini-pipeline") is not None+ assert plan_ready_sections("pipeline") == ("brain", "computer-use", "tts", "stt")+ assert plan_ready_sections("nope") == ()+++def test_state_roundtrip_and_reset(tmp_path) -> None:+ p = tmp_path / "setup_state.json"+ assert st.get_starter_plan(p) is None+ assert st.is_ready_celebrated(p) is False+ st.set_starter_plan("gemini-pipeline", p)+ st.mark_ready_celebrated(p)+ assert st.get_starter_plan(p) == "gemini-pipeline"+ assert st.is_ready_celebrated(p) is True+ removed = st.reset_onboarding(p)+ assert "starter_plan" in removed and "ready_celebrated_at" in removed+ assert st.get_starter_plan(p) is None