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
chore: auto-save WIP via Claude stop-hook safety net (2026-07-02 09:29)
Ruben Lütkecaac794c8ba3
diff --git a/README.md b/README.mdindex e891cf912b..042101fd6c 100644--- a/README.md+++ b/README.md@@ -13,7 +13,15 @@</p><p align="center">- <b>A voice-driven meta-orchestrator that turns one spoken request into a fleet of self-checking AI agents.</b>+ <b>Talk to your computer — and watch it do the work: an open-source, privacy-first voice agent with full command of your PC.</b>+</p>++<p align="center">+ <img src="assets/video/personal-jarvis-demo.gif" alt="Demo: a spoken command delegates real work to an agent, which edits the code, runs the tests, and opens the pull request" width="860" />+</p>++<p align="center">+ <b><a href="assets/video/personal-jarvis-demo.mp4">▶ Watch the full 60-second demo with sound</a></b></p>---diff --git a/desktop-ttu-baseline.json b/desktop-ttu-baseline.jsonnew file mode 100644index 0000000000..331db337fc--- /dev/null+++ b/desktop-ttu-baseline.json@@ -0,0 +1,39 @@+{+ "path": "desktop (_run_backend, GUI-free driver)",+ "runs": 3,+ "python": "C:\\Program Files\\Python311\\python.exe",+ "vault_pages": 84,+ "median_wall_ms": 1346.8,+ "median_boot_ready_ms": 112.8,+ "median_bind_wall_ms": 1032.2,+ "median_voice_ready_wall_ms": 6381.8,+ "voice_ready_wall_ms_runs": [+ 6381.8,+ 6932.9,+ 6050.2+ ],+ "median_voice_usable_wall_ms": 12059.3,+ "voice_usable_wall_ms_runs": [+ 12059.3,+ 12190.8,+ 10777.6+ ],+ "wall_ms_runs": [+ 1346.8,+ 1427.5,+ 1315.9+ ],+ "boot_ready_ms_runs": [+ 122.8,+ 112.8,+ 106.7+ ],+ "phase_medians_ms": {+ "db_pre_webserver": 2884.6,+ "db_webserver_ctor": 1654.7,+ "uvicorn_serve": 0.0+ },+ "anchor": "spawn -> /api/health responds 200 (= DesktopApp._wait_for_backend success = window creation point)",+ "secondary_anchor": "median_bind_wall_ms = spawn -> BOOT_READY print (bootstrap bind; may precede a responsive health endpoint)",+ "ttu_anchor": "spawn -> VOICE_USABLE_MS print (VoiceBootStatus ready=True: wake model warmed + VAD + TTS client up \u2014 the honest time-to-usable anchor; VOICE_READY_MS = pipeline task started is secondary)"+}\ No newline at end of filediff --git a/desktop-ttu-latest.json b/desktop-ttu-latest.jsonnew file mode 100644index 0000000000..331db337fc--- /dev/null+++ b/desktop-ttu-latest.json@@ -0,0 +1,39 @@+{+ "path": "desktop (_run_backend, GUI-free driver)",+ "runs": 3,+ "python": "C:\\Program Files\\Python311\\python.exe",+ "vault_pages": 84,+ "median_wall_ms": 1346.8,+ "median_boot_ready_ms": 112.8,+ "median_bind_wall_ms": 1032.2,+ "median_voice_ready_wall_ms": 6381.8,+ "voice_ready_wall_ms_runs": [+ 6381.8,+ 6932.9,+ 6050.2+ ],+ "median_voice_usable_wall_ms": 12059.3,+ "voice_usable_wall_ms_runs": [+ 12059.3,+ 12190.8,+ 10777.6+ ],+ "wall_ms_runs": [+ 1346.8,+ 1427.5,+ 1315.9+ ],+ "boot_ready_ms_runs": [+ 122.8,+ 112.8,+ 106.7+ ],+ "phase_medians_ms": {+ "db_pre_webserver": 2884.6,+ "db_webserver_ctor": 1654.7,+ "uvicorn_serve": 0.0+ },+ "anchor": "spawn -> /api/health responds 200 (= DesktopApp._wait_for_backend success = window creation point)",+ "secondary_anchor": "median_bind_wall_ms = spawn -> BOOT_READY print (bootstrap bind; may precede a responsive health endpoint)",+ "ttu_anchor": "spawn -> VOICE_USABLE_MS print (VoiceBootStatus ready=True: wake model warmed + VAD + TTS client up \u2014 the honest time-to-usable anchor; VOICE_READY_MS = pipeline task started is secondary)"+}\ No newline at end of filediff --git a/jarvis/brain/factory.py b/jarvis/brain/factory.pyindex 688de4380e..bf28135b7f 100644--- a/jarvis/brain/factory.py+++ b/jarvis/brain/factory.py@@ -1112,6 +1112,7 @@ def _phase2_full_brain(native_cu=native_cu,monitor=getattr(cu_cfg, "monitor", "primary"),main_monitor=getattr(cu_cfg, "main_monitor", "primary"),+ coordinate_space=getattr(cu_cfg, "coordinate_space", "auto"),))# Hot-reload: refresh the live context's step_budget / timeout /# replan knobs on ConfigReloaded so a voice-tunable changediff --git a/jarvis/core/config.py b/jarvis/core/config.pyindex 3f84654649..13a0b26a39 100644--- a/jarvis/core/config.py+++ b/jarvis/core/config.py@@ -1503,12 +1503,14 @@ class ComputerUseConfig(BaseModel):# 300_000 (no change); lowering it -- with the cu_bench harness as proof --# shrinks the vision payload for faster inference, at some grounding risk.image_max_bytes: int = Field(default=300_000, ge=20_000, le=2_000_000)- # L7 (CU speed): per-screenshot longest-side pixel cap sent to the model.- # Default keeps 2048 (no change). Vision models resample to ~1568 px- # internally, so lowering this -- with the cu_bench harness as proof -- ships- # fewer pixels for faster encode + upload + image-token ingest, at some- # grounding risk on tiny controls. 0 disables the dimension cap entirely.- image_max_dimension: int = Field(default=2048, ge=0, le=8192)+ # L7 (CU speed + grounding): per-screenshot longest-side pixel cap sent to+ # the model. Default 1366 — vision models ground small controls MORE+ # reliably on frames near the XGA/WXGA band than on raw 2K/4K captures+ # (provider guidance: downscale yourself, do not rely on API-side+ # resizing), and the smaller payload cuts encode + upload + image-token+ # latency. Raise it only with the cu_bench harness as proof. 0 disables+ # the dimension cap entirely.+ image_max_dimension: int = Field(default=1366, ge=0, le=8192)# L8 (CU speed): multiplier on the loop's fixed settle waits (pre-type and# post-click-verify pauses). Default keeps 1.0 (no change: every settle is# byte-for-byte the legacy duration); lower it -- with the cu_bench harnessdiff --git a/jarvis/cu/actuate/windows.py b/jarvis/cu/actuate/windows.pyindex 2ba619136d..e133be05b2 100644--- a/jarvis/cu/actuate/windows.py+++ b/jarvis/cu/actuate/windows.py@@ -255,6 +255,24 @@ class WindowsActuator(Actuator):events.append(self._mouse_input(0, 0, 0, _MOUSE_FLAGS_UP[b]))self._send(events)+ def click_at_cursor(self, *, button: str = "left", double: bool = False) -> None:+ """Press+release at the CURRENT cursor position (no positioning).++ For callers that already positioned the cursor themselves (e.g. the+ visible glide animation) and only need the button events.+ """+ b = button.lower()+ if b not in _MOUSE_FLAGS_DOWN:+ raise ValueError(+ f"Unknown mouse button: {button!r}. Allowed: left/right/middle",+ )+ with input_space():+ events = []+ for _ in range(2 if double else 1):+ events.append(self._mouse_input(0, 0, 0, _MOUSE_FLAGS_DOWN[b]))+ events.append(self._mouse_input(0, 0, 0, _MOUSE_FLAGS_UP[b]))+ self._send(events)+def drag(self, x1: int, y1: int, x2: int, y2: int, *, duration_s: float = 0.4,) -> None:diff --git a/jarvis/harness/computer_use_context.py b/jarvis/harness/computer_use_context.pyindex 5e051dfc9b..5ca54f47c4 100644--- a/jarvis/harness/computer_use_context.py+++ b/jarvis/harness/computer_use_context.py@@ -76,6 +76,11 @@ class ComputerUseContext:# Which screen is "the main monitor" when monitor="primary"# ([computer_use].main_monitor): "primary" | "largest" | explicit id.main_monitor: str = "primary"+ # CU v2: coordinate space the model's click coordinates are parsed in+ # ([computer_use].coordinate_space): "auto" | "normalized_1000" |+ # "image_pixels". "auto" resolves per provider (capability first, family+ # metadata second) — see jarvis/cu/conventions.py.+ coordinate_space: str = "auto"_CONTEXT: ComputerUseContext | None = Nonediff --git a/jarvis/plugins/harness/computer_use.py b/jarvis/plugins/harness/computer_use.pyindex fb3c678f26..f53ea97cc3 100644--- a/jarvis/plugins/harness/computer_use.py+++ b/jarvis/plugins/harness/computer_use.py@@ -32,27 +32,33 @@ _TIMEOUT_EXIT_CODE = 124def _resolve_run_cu_loop():"""Select the Computer-Use engine per ``[computer_use].engine`` (reversible).- ``"current"`` (default) -> the maintained engine; ``"june13"`` -> the frozen- 2026-06-10 / 352a784f snapshot kept as a known-good fallback. Read PER- MISSION so a config flip applies on the next mission (no restart needed).- Logs the live engine — INFO for ``june13`` (the unusual state) so it is never- ambiguous which version is running. Never raises: a config-read problem falls- back to the maintained engine.+ ``"v2"`` (default) -> the rebuilt perceive->act->verify engine+ (``jarvis/cu/engine.py``). Legacy fallbacks stay selectable: ``"current"``+ = the last maintained legacy loop, ``"june13"`` / ``"stable"`` = frozen+ known-good snapshots. Read PER MISSION so a config flip applies on the+ next mission (no restart needed). Logs the live engine — INFO for every+ non-default choice so it is never ambiguous which version is running.+ Never raises: a config-read problem falls back to the default engine."""try:from jarvis.core.config import load_config # noqa: PLC0415cu = getattr(load_config(), "computer_use", None)- engine = str(getattr(cu, "engine", "current") or "current")+ engine = str(getattr(cu, "engine", "v2") or "v2")except Exception: # noqa: BLE001 — a config read must never break a mission- engine = "current"+ engine = "v2"+ if engine == "v2":+ from jarvis.cu.engine import run_cu_loop as _loop # noqa: PLC0415++ _log.debug("[cu] ENGINE = v2 (rebuilt perceive->act->verify engine)")+ return _loopif engine == "june13":from jarvis.harness.screenshot_only_loop_june13 import ( # noqa: PLC0415run_cu_loop as _loop,)_log.info("[cu] ENGINE = june13 (frozen 2026-06-10 / 352a784f). "- "Revert with [computer_use].engine = current.",+ "Revert with [computer_use].engine = v2.",)return _loopif engine == "stable":@@ -64,13 +70,16 @@ def _resolve_run_cu_loop():)_log.info("[cu] ENGINE = stable (frozen pre-Wave-1 snapshot). "- "Revert with [computer_use].engine = current.",+ "Revert with [computer_use].engine = v2.",)return _loopfrom jarvis.harness.screenshot_only_loop import ( # noqa: PLC0415run_cu_loop as _loop,)- _log.debug("[cu] ENGINE = current")+ _log.info(+ "[cu] ENGINE = current (legacy maintained loop). "+ "The default engine is v2 ([computer_use].engine = v2).",+ )return _loopdiff --git a/jarvis/plugins/tool/click.py b/jarvis/plugins/tool/click.pyindex 450508e45d..bdb382e56c 100644--- a/jarvis/plugins/tool/click.py+++ b/jarvis/plugins/tool/click.py@@ -1,8 +1,13 @@"""click tool: simulates mouse clicks at a screen coordinate.-Win32-native via ``SetCursorPos`` + ``SendInput`` (mouse event). Falls back-to ``pyautogui.click`` if Win32 isn't available — so tests run on Linux/Mac-even though real clicks only work on Windows.+Windows-native input dispatch now delegates to the shared CU v2 actuation+backend (``jarvis/cu/actuate/windows.py``): absolute virtual-desktop+positioning via SendInput (negative-origin monitors included) inside the+per-monitor thread DPI pin, so clicks stay on target on mixed-DPI desktops+even after pywebview flips the process DPI awareness. On macOS/Linux the+tool uses the platform backend from ``jarvis/cu/actuate`` (pynput preferred,+pyautogui fallback) instead of raw pyautogui, which clamps multi-monitor+coordinates.Risk tier: ``monitor`` — mouse clicks are often not reversible (buttons,form submits, file operations). A toast notification is shown, no approval@@ -16,58 +21,15 @@ from typing import Anyfrom jarvis.control.cursor_motion import glide_os_cursorfrom jarvis.core.protocols import ExecutionContext, ToolResult+from jarvis.cu.actuate.windows import (+ _MOUSE_FLAGS_DOWN,+ normalize_virtualdesk as _normalize_virtualdesk, # noqa: F401 — re-export (tests + callers)+)from jarvis.overlay.virtual_cursor import get_virtual_cursor-# Mouse-button mapping for Win32 (see MOUSEEVENTF_* flags).-_MOUSE_FLAGS_DOWN: dict[str, int] = {- "left": 0x0002, # MOUSEEVENTF_LEFTDOWN- "right": 0x0008, # MOUSEEVENTF_RIGHTDOWN- "middle": 0x0020, # MOUSEEVENTF_MIDDLEDOWN-}-_MOUSE_FLAGS_UP: dict[str, int] = {- "left": 0x0004, # MOUSEEVENTF_LEFTUP- "right": 0x0010, # MOUSEEVENTF_RIGHTUP- "middle": 0x0040, # MOUSEEVENTF_MIDDLEUP-}--# Absolute virtual-desktop positioning flags. A click positioned this way lands-# on its exact target on EVERY monitor — including one LEFT of primary (negative-# virtual-desktop X) — decoupled from SetCursorPos, which returns 0 / lands wrong-# when the cursor crosses the primary boundary (the "CU clicks void on the left-# monitor" bug). The coordinates are 0..65535 normalized over the whole virtual-# desktop, so the negative origin is folded into the normalization.-_MOUSEEVENTF_MOVE = 0x0001-_MOUSEEVENTF_ABSOLUTE = 0x8000-_MOUSEEVENTF_VIRTUALDESK = 0x4000-_ABS_MOVE_FLAGS = _MOUSEEVENTF_MOVE | _MOUSEEVENTF_ABSOLUTE | _MOUSEEVENTF_VIRTUALDESK---def _normalize_virtualdesk(- x: int, y: int, vx: int, vy: int, vw: int, vh: int-) -> tuple[int, int]:- """Map an absolute virtual-desktop pixel ``(x, y)`` to the 0..65535 space- ``MOUSEEVENTF_ABSOLUTE | VIRTUALDESK`` expects, given the virtual-screen- bounds (origin ``vx,vy``, size ``vw x vh`` — ``vx``/``vy`` may be negative).- Pure + clamped; the offset by the virtual origin is what makes a monitor left- of primary (x < 0) come out as a valid positive coordinate."""- dw = max(1, vw - 1)- dh = max(1, vh - 1)- nx = min(65535, max(0, round((int(x) - vx) * 65535 / dw)))- ny = min(65535, max(0, round((int(y) - vy) * 65535 / dh)))- return nx, ny---def _virtualdesk_abs(x: int, y: int) -> tuple[int, int]:- """:func:`_normalize_virtualdesk` against the live virtual-screen metrics."""- import ctypes-- gsm = ctypes.windll.user32.GetSystemMetrics- # SM_XVIRTUALSCREEN=76, SM_YVIRTUALSCREEN=77, SM_CXVIRTUALSCREEN=78, SM_CYVIRTUALSCREEN=79- return _normalize_virtualdesk(x, y, gsm(76), gsm(77), gsm(78), gsm(79))-def _send_click(button: str, double: bool, abs_xy: tuple[int, int] | None = None) -> None:- """Press a mouse button via Win32 SendInput.+ """Press a mouse button via the shared Windows SendInput backend.When ``abs_xy`` is given the input stream is prefixed with an ABSOLUTEvirtual-desktop move to that pixel, so the click lands exactly there on any@@ -75,67 +37,13 @@ def _send_click(button: str, double: bool, abs_xy: tuple[int, int] | None = Nonecursor. Without it, the click fires at the current cursor position (the legacybehaviour; positioning done beforehand by :func:`glide_os_cursor`)."""- button_l = button.lower()- if button_l not in _MOUSE_FLAGS_DOWN:- raise ValueError(f"Unknown mouse button: {button!r}. Allowed: left/right/middle")-- import ctypes- from ctypes import wintypes-- INPUT_MOUSE = 0- ULONG_PTR = wintypes.WPARAM-- class MOUSEINPUT(ctypes.Structure):- _fields_ = (- ("dx", wintypes.LONG),- ("dy", wintypes.LONG),- ("mouseData", wintypes.DWORD),- ("dwFlags", wintypes.DWORD),- ("time", wintypes.DWORD),- ("dwExtraInfo", ULONG_PTR),- )-- class INPUT_UNION(ctypes.Union):- _fields_ = (("mi", MOUSEINPUT),)-- class INPUT(ctypes.Structure):- _fields_ = (("type", wintypes.DWORD), ("union", INPUT_UNION))-- user32 = ctypes.windll.user32- send_input = user32.SendInput- send_input.argtypes = (wintypes.UINT, ctypes.POINTER(INPUT), ctypes.c_int)- send_input.restype = wintypes.UINT-- flag_down = _MOUSE_FLAGS_DOWN[button_l]- flag_up = _MOUSE_FLAGS_UP[button_l]- n_clicks = 2 if double else 1+ from jarvis.cu.actuate.windows import WindowsActuator # noqa: PLC0415- events: list[INPUT] = []+ actuator = WindowsActuator()if abs_xy is not None:- nx, ny = _virtualdesk_abs(abs_xy[0], abs_xy[1])- events.append(- INPUT(- type=INPUT_MOUSE,- union=INPUT_UNION(mi=MOUSEINPUT(nx, ny, 0, _ABS_MOVE_FLAGS, 0, ULONG_PTR(0))),- )- )- for _ in range(n_clicks):- events.append(- INPUT(- type=INPUT_MOUSE,- union=INPUT_UNION(mi=MOUSEINPUT(0, 0, 0, flag_down, 0, ULONG_PTR(0))),- )- )- events.append(- INPUT(- type=INPUT_MOUSE,- union=INPUT_UNION(mi=MOUSEINPUT(0, 0, 0, flag_up, 0, ULONG_PTR(0))),- )- )- arr = (INPUT * len(events))(*events)- sent = send_input(len(events), arr, ctypes.sizeof(INPUT))- if sent != len(events):- raise ctypes.WinError(ctypes.get_last_error())+ actuator.click(int(abs_xy[0]), int(abs_xy[1]), button=button, double=double)+ else:+ actuator.click_at_cursor(button=button, double=double)def _click_windows(x: int, y: int, button: str, double: bool) -> None:@@ -227,23 +135,21 @@ class ClickTool:error=f"Click at ({x},{y}) failed: {exc}",)+ from jarvis.cu.actuate import ActuationUnavailable, get_actuator+try:- import pyautogui- except ImportError as exc:- return ToolResult(- success=False,- output=None,- error=(- f"Platform is not Windows ({os.name}) and pyautogui is missing: {exc}. "- "pip install pyautogui"- ),+ actuator = get_actuator()+ await asyncio.to_thread(+ actuator.click, x, y, button=button, double=double,)- try:- clicks = 2 if double else 1- pyautogui.click(x=x, y=y, clicks=clicks, button=button)return ToolResult(success=True,- output=f"{'Double-' if double else ''}click (pyautogui) at ({x},{y})",+ output=(+ f"{'Double-' if double else ''}click ({actuator.name}) "+ f"at ({x},{y})"+ ),)+ except ActuationUnavailable as exc:+ return ToolResult(success=False, output=None, error=str(exc))except Exception as exc: # noqa: BLE001return ToolResult(success=False, output=None, error=str(exc))diff --git a/jarvis/plugins/tool/computer_use_tool.py b/jarvis/plugins/tool/computer_use_tool.pyindex b46d68389a..b16d6050bc 100644--- a/jarvis/plugins/tool/computer_use_tool.py+++ b/jarvis/plugins/tool/computer_use_tool.py@@ -148,6 +148,13 @@ class ComputerUseTool:# Strong refs so background missions are never garbage-collected# mid-flight (same pattern as BrainManager._cu_background_tasks).self._background_tasks: set[asyncio.Task[None]] = set()+ # Double-dispatch gate (CU v2): the SAME voice request occasionally+ # dispatches twice (documented in computer_use_context.py), so two+ # overlapping missions typed the same URL twice. While a mission for+ # a goal is still running, a second dispatch of the SAME goal is+ # absorbed into the running one (the user still gets ONE ack and ONE+ # completion announcement). A DIFFERENT goal still runs concurrently.+ self._active_goals: dict[str, asyncio.Task[None]] = {}async def execute(self, args: dict[str, Any], ctx: ExecutionContext) -> ToolResult:goal = (args.get("goal") or "").strip()@@ -172,11 +179,26 @@ class ComputerUseTool:},ctx,)+ goal_key = " ".join(goal.split()).casefold()+ running = self._active_goals.get(goal_key)+ if running is not None and not running.done():+ log.info(+ "computer_use: duplicate dispatch of an already-running goal "+ "absorbed (%.60s)", goal,+ )+ return ToolResult(+ success=True,+ output=action_phrase("cu_dispatch_ack", _ctx_output_language(ctx)),+ )task = asyncio.create_task(self._run_background(goal, ctx), name="computer-use-tool-background",)self._background_tasks.add(task)task.add_done_callback(self._background_tasks.discard)+ self._active_goals[goal_key] = task+ task.add_done_callback(+ lambda t, key=goal_key: self._active_goals.pop(key, None),+ )# suppress_response=True (class attr) → tool_use_loop takes this output# VERBATIM and stops, so there is no second iteration to echo an# internal instruction. Speak the pre-existing, localized dispatch ACK