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:32)
Ruben Lütke3a1a304acb52
diff --git a/jarvis/plugins/tool/hotkey.py b/jarvis/plugins/tool/hotkey.pyindex cfeafdfd90..7a0c621947 100644--- a/jarvis/plugins/tool/hotkey.py+++ b/jarvis/plugins/tool/hotkey.py@@ -18,188 +18,29 @@ from typing import Anyfrom jarvis.core.protocols import ExecutionContext, ToolResult-# Virtual-key codes — excerpt from Microsoft's "Virtual Key Codes" docs.-# See https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes-# We map both lowercase aliases ("ctrl") and the official names-# ("control"); for letters/digits we compute the VK on the fly.-_VK_TABLE: dict[str, int] = {- # Modifier- "ctrl": 0x11, "control": 0x11,- "shift": 0x10,- "alt": 0x12, "menu": 0x12,- "win": 0x5B, "windows": 0x5B, "lwin": 0x5B,- "rwin": 0x5C,- # Function + control keys- "esc": 0x1B, "escape": 0x1B,- "enter": 0x0D, "return": 0x0D,- "tab": 0x09,- "space": 0x20, "spacebar": 0x20,- "backspace": 0x08, "back": 0x08,- "delete": 0x2E, "del": 0x2E,- "insert": 0x2D, "ins": 0x2D,- "home": 0x24, "end": 0x23,- "pageup": 0x21, "pgup": 0x21,- "pagedown": 0x22, "pgdn": 0x22,- "left": 0x25, "up": 0x26, "right": 0x27, "down": 0x28,- "capslock": 0x14,- # F-keys- **{f"f{i}": 0x6F + i for i in range(1, 13)}, # F1 = 0x70 ... F12 = 0x7B- # Numpad- "numpad0": 0x60, "numpad1": 0x61, "numpad2": 0x62, "numpad3": 0x63,- "numpad4": 0x64, "numpad5": 0x65, "numpad6": 0x66, "numpad7": 0x67,- "numpad8": 0x68, "numpad9": 0x69,- "multiply": 0x6A, "add": 0x6B, "subtract": 0x6D,- "decimal": 0x6E, "divide": 0x6F,-}---def _resolve_vk(key: str) -> int | None:- """Returns the virtual-key code for a key name, or None."""- k = key.strip().lower()- if not k:- return None- if k in _VK_TABLE:- return _VK_TABLE[k]- if len(k) == 1:- # A-Z (0x41-0x5A) and 0-9 (0x30-0x39) — VK == ASCII value.- if "a" <= k <= "z":- return ord(k.upper())- if "0" <= k <= "9":- return ord(k)- return None---def _expand_combo_keys(keys: list[str]) -> list[str]:- """Split combined hotkey strings like ``"ctrl+v"`` into ``["ctrl", "v"]``.-- LLM callers (notably the screenshot-only Computer-Use loop) frequently emit- a whole shortcut as ONE token — ``"ctrl+v"``, ``"ctrl+shift+t"`` — instead- of the documented list form. Without this, ``_resolve_vk`` looks up a key- literally named "ctrl+v", fails, and the paste/shortcut never fires (live- failure 2026-06-16: three ``ctrl+v`` rejections sank a Discord-post mission).-- '+' is the canonical separator. A token is only split when EVERY resulting- part resolves to a known key; otherwise it is kept verbatim so a literal- '+' key (or an unknown combo) still surfaces the normal "Unbekannte Taste"- error instead of silently vanishing.- """- out: list[str] = []- for token in keys:- t = token.strip()- if "+" in t and len(t) > 1:- parts = [p.strip() for p in t.split("+") if p.strip()]- if len(parts) >= 2 and all(_resolve_vk(p) is not None for p in parts):- out.extend(parts)- continue- out.append(token)- return out+# Key-name resolution + combined-token expansion ("ctrl+v" -> ["ctrl", "v"])+# live in the shared CU v2 Windows backend; re-exported here so callers and+# tests keep their import path. The vocabulary is unchanged.+from jarvis.cu.actuate.windows import ( # noqa: E402+ expand_combo_keys as _expand_combo_keys,+ resolve_vk as _resolve_vk,+)def _send_hotkey_windows(keys: list[str]) -> None:"""Sends a key combination as a Win32 SendInput sequence.- Order: all keys DOWN one after another, then UP in reverse order.- This is the canonical hotkey choreography — modern apps interpret- it as being pressed simultaneously.+ Order: all keys DOWN one after another, then UP in reverse order — the+ canonical hotkey choreography. Delegates to the shared CU v2 Windows+ backend (correct 40-byte INPUT sizing, extended-key flags, thread DPI+ pin); the key vocabulary is identical."""if os.name != "nt":raise RuntimeError("Native hotkey input is only available on Windows")- import ctypes- from ctypes import wintypes-- INPUT_KEYBOARD = 1- KEYEVENTF_KEYUP = 0x0002- KEYEVENTF_EXTENDEDKEY = 0x0001- ULONG_PTR = wintypes.WPARAM-- # Extended keys (E0 prefix). Without KEYEVENTF_EXTENDEDKEY a standalone tap- # of these is rejected / misrouted by Windows. Main Enter (0x0D) is NOT- # extended; numpad Enter would be, but we map "enter" to the main key.- _EXTENDED_VKS = {- 0x5B, 0x5C, # lwin, rwin- 0x25, 0x26, 0x27, 0x28, # left, up, right, down- 0x2D, 0x2E, # insert, delete- 0x24, 0x23, # home, end- 0x21, 0x22, # pageup, pagedown- 0x6F, # divide (numpad /)- }-- class KEYBDINPUT(ctypes.Structure):- _fields_ = (- ("wVk", wintypes.WORD),- ("wScan", wintypes.WORD),- ("dwFlags", wintypes.DWORD),- ("time", wintypes.DWORD),- ("dwExtraInfo", ULONG_PTR),- )-- class MOUSEINPUT(ctypes.Structure):- _fields_ = (- ("dx", wintypes.LONG),- ("dy", wintypes.LONG),- ("mouseData", wintypes.DWORD),- ("dwFlags", wintypes.DWORD),- ("time", wintypes.DWORD),- ("dwExtraInfo", ULONG_PTR),- )-- # CRITICAL: the union MUST contain the largest member (MOUSEINPUT) so that- # ``ctypes.sizeof(INPUT)`` equals the real Win32 ``INPUT`` size (40 bytes on- # x64). The previous version declared only ``ki``, giving sizeof(INPUT)=32;- # ``SendInput`` then received cbSize=32, rejected every event (returned 0),- # and surfaced as a misleading "WinError 0 / Falscher Parameter" (the # i18n-allow (quotes the literal Win32 error text on a German-locale machine)- # German-locale Windows text for "incorrect parameter"). This made- # the native hotkey path fail for EVERY key (enter, win, ctrl+...) on x64.- class INPUT_UNION(ctypes.Union):- _fields_ = (("mi", MOUSEINPUT), ("ki", KEYBDINPUT))+ from jarvis.cu.actuate.windows import WindowsActuator # noqa: PLC0415- class INPUT(ctypes.Structure):- _fields_ = (("type", wintypes.DWORD), ("union", INPUT_UNION))-- # use_last_error=True so ctypes.get_last_error() returns the real GetLastError- # from SendInput (the old ``ctypes.windll`` path left it at 0 -> bogus error).- user32 = ctypes.WinDLL("user32", use_last_error=True)- send_input = user32.SendInput- send_input.argtypes = (wintypes.UINT, ctypes.POINTER(INPUT), ctypes.c_int)- send_input.restype = wintypes.UINT-- vk_codes: list[int] = []- for k in keys:- vk = _resolve_vk(k)- if vk is None:- raise ValueError(f"Unknown key: {k!r}")- vk_codes.append(vk)-- def _flags(vk: int, *, keyup: bool) -> int:- flags = KEYEVENTF_KEYUP if keyup else 0- if vk in _EXTENDED_VKS:- flags |= KEYEVENTF_EXTENDEDKEY- return flags-- # DOWN events: in the given order- down_events = [- INPUT(- type=INPUT_KEYBOARD,- union=INPUT_UNION(ki=KEYBDINPUT(vk, 0, _flags(vk, keyup=False), 0, ULONG_PTR(0))),- )- for vk in vk_codes- ]- # UP events: in reverse order- up_events = [- INPUT(- type=INPUT_KEYBOARD,- union=INPUT_UNION(ki=KEYBDINPUT(vk, 0, _flags(vk, keyup=True), 0, ULONG_PTR(0))),- )- for vk in reversed(vk_codes)- ]-- all_events = down_events + up_events- arr = (INPUT * len(all_events))(*all_events)- sent = send_input(len(all_events), arr, ctypes.sizeof(INPUT))- if sent != len(all_events):- err = ctypes.get_last_error()- raise ctypes.WinError(err if err else None)+ WindowsActuator().key_combo(keys)class HotkeyTool:@@ -273,23 +114,16 @@ class HotkeyTool:error=f"Hotkey '{'+'.join(keys_str)}' 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"- ),- )- try:- # pyautogui.hotkey takes individual string args, not a list- pyautogui.hotkey(*keys_str)+ actuator = get_actuator()+ await asyncio.to_thread(actuator.key_combo, keys_str)return ToolResult(success=True,- output=f"Hotkey sent (pyautogui): {'+'.join(keys_str)}",+ output=f"Hotkey sent ({actuator.name}): {'+'.join(keys_str)}",)+ 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/scroll.py b/jarvis/plugins/tool/scroll.pyindex 60810893be..e29601c4de 100644--- a/jarvis/plugins/tool/scroll.py+++ b/jarvis/plugins/tool/scroll.py@@ -44,10 +44,10 @@ def _notch_for(direction: str, amount: int) -> int:def _scroll_windows(direction: str, amount: int, x: int | None, y: int | None) -> int:"""Scroll via Win32 ``SendInput``; returns the signed wheel delta transmitted.- If both ``x`` and ``y`` are given, the cursor is moved there first via- ``SetCursorPos`` so the wheel event targets that region/window. The struct- layout mirrors ``click.py`` so that ``ctypes.sizeof(INPUT) == 40`` on x64- (the cbSize bug class).+ Delegates to the shared CU v2 Windows backend. If both ``x`` and ``y``+ are given, the wheel event is prefixed with an ABSOLUTE virtual-desktop+ move (negative-origin monitors included) — an upgrade over the previous+ ``SetCursorPos``, which is unreliable across the primary boundary."""if os.name != "nt":raise RuntimeError("Native scrolling is only available on Windows")@@ -58,71 +58,18 @@ def _scroll_windows(direction: str, amount: int, x: int | None, y: int | None) -f"Unknown direction: {direction!r}. Allowed: up/down/left/right")- import ctypes- from ctypes import wintypes+ from jarvis.cu.actuate.windows import WindowsActuator # noqa: PLC0415- INPUT_MOUSE = 0- ULONG_PTR = wintypes.WPARAM+ WindowsActuator().scroll(direction_l, amount, x=x, y=y)+ return _notch_for(direction_l, amount)- 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- set_cursor = user32.SetCursorPos- set_cursor.argtypes = (ctypes.c_int, ctypes.c_int)- set_cursor.restype = wintypes.BOOL- send_input = user32.SendInput- send_input.argtypes = (wintypes.UINT, ctypes.POINTER(INPUT), ctypes.c_int)- send_input.restype = wintypes.UINT-- # Move the cursor to the target first, so the wheel event hits that window.- if x is not None and y is not None:- if not set_cursor(int(x), int(y)):- raise ctypes.WinError(ctypes.get_last_error())-- notch = _notch_for(direction_l, amount)- flag = _MOUSEEVENTF_HWHEEL if direction_l in ("left", "right") else _MOUSEEVENTF_WHEEL-- # mouseData is a DWORD; transmit the signed delta as its unsigned two's-complement- # representation so negative wheel deltas (down/left) arrive correctly.- mouse_data = ctypes.c_long(notch).value & 0xFFFFFFFF-- event = INPUT(- type=INPUT_MOUSE,- union=INPUT_UNION(mi=MOUSEINPUT(0, 0, mouse_data, flag, 0, ULONG_PTR(0))),- )- arr = (INPUT * 1)(event)- sent = send_input(1, arr, ctypes.sizeof(INPUT))- if sent != 1:- raise ctypes.WinError(ctypes.get_last_error())- return notch+def _scroll_posix(direction: str, amount: int, x: int | None, y: int | None) -> int:+ """Cross-platform scroll via the actuate backend (pynput preferred)."""+ from jarvis.cu.actuate import get_actuator-def _scroll_pyautogui(direction: str, amount: int, x: int | None, y: int | None) -> int:- """Cross-platform fallback via pyautogui; returns the signed wheel delta."""- import pyautogui-- notch = _notch_for(direction.lower(), amount)- if x is not None and y is not None:- pyautogui.moveTo(x, y)- if direction.lower() in ("left", "right"):- pyautogui.hscroll(notch)- else:- pyautogui.scroll(notch)- return notch+ get_actuator().scroll(direction.lower(), amount, x=x, y=y)+ return _notch_for(direction.lower(), amount)class ScrollTool:@@ -208,20 +155,15 @@ class ScrollTool:error=f"Scroll {direction} by {amount} failed: {exc}",)+ from jarvis.cu.actuate import ActuationUnavailable+try:- await asyncio.to_thread(_scroll_pyautogui, direction, amount, x, y)+ await asyncio.to_thread(_scroll_posix, direction, amount, x, y)return ToolResult(success=True,output=f"Scrolled {direction} by {amount}",)- except ImportError as exc:- return ToolResult(- success=False,- output=None,- error=(- f"Platform is not Windows ({os.name}) and pyautogui is missing: "- f"{exc}. pip install pyautogui"- ),- )+ 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/type_text.py b/jarvis/plugins/tool/type_text.pyindex 63ec98e406..598de838f5 100644--- a/jarvis/plugins/tool/type_text.py+++ b/jarvis/plugins/tool/type_text.py@@ -80,49 +80,18 @@ def _build_windows_input_types() -> Any:def _send_text_windows(text: str, delay_s: float) -> None:- """Sends Unicode text to the active Windows window via SendInput."""+ """Sends Unicode text to the active Windows window via SendInput.++ Delegates to the shared CU v2 Windows backend, which adds the thread DPI+ pin and correct UTF-16 surrogate-pair handling for astral-plane+ characters (emoji) on top of the proven KEYEVENTF_UNICODE path.+ """if os.name != "nt":raise RuntimeError("Native text input without pyautogui is only available on Windows")- import ctypes+ from jarvis.cu.actuate.windows import WindowsActuator # noqa: PLC0415- t = _build_windows_input_types()- INPUT, KEYBDINPUT, INPUT_UNION = t.INPUT, t.KEYBDINPUT, t.INPUT_UNION-- # use_last_error=True so ``ctypes.get_last_error()`` reflects SendInput's real- # Win32 error (ctypes.windll does NOT track it -> misleading error codes).- user32 = ctypes.WinDLL("user32", use_last_error=True)- send_input = user32.SendInput- send_input.argtypes = (ctypes.c_uint, ctypes.POINTER(INPUT), ctypes.c_int)- send_input.restype = ctypes.c_uint-- for char in text:- code = ord(char)- events = (INPUT * 2)(- INPUT(- type=t.INPUT_KEYBOARD,- union=INPUT_UNION(- ki=KEYBDINPUT(0, code, t.KEYEVENTF_UNICODE, 0, t.ULONG_PTR(0)),- ),- ),- INPUT(- type=t.INPUT_KEYBOARD,- union=INPUT_UNION(- ki=KEYBDINPUT(- 0,- code,- t.KEYEVENTF_UNICODE | t.KEYEVENTF_KEYUP,- 0,- t.ULONG_PTR(0),- ),- ),- ),- )- sent = send_input(2, events, ctypes.sizeof(INPUT))- if sent != 2:- raise ctypes.WinError(ctypes.get_last_error())- if delay_s > 0:- time.sleep(delay_s)+ WindowsActuator().type_text(text, delay_s=delay_s)class TypeTextTool:@@ -167,16 +136,36 @@ class TypeTextTool:"native Unicode SendInput failed, falling back to pyautogui: %r",native_exc,)+ # A second SendInput attempt would fail identically, so the+ # Windows fallback stays pyautogui (a DIFFERENT input mechanism).+ try:+ import pyautogui # noqa: PLC0415+ except Exception as exc: # noqa: BLE001+ return ToolResult(+ success=False,+ output=None,+ error=f"text input unavailable: pyautogui import failed: {exc}",+ )+ try:+ await asyncio.to_thread(pyautogui.typewrite, text, interval=delay_s)+ return ToolResult(success=True, output=f"Typed {len(text)} chars")+ except Exception as exc: # noqa: BLE001+ return ToolResult(success=False, output=None, error=str(exc))++ from jarvis.cu.actuate import ActuationUnavailable, get_actuator+try:- import pyautogui- except Exception as exc: # noqa: BLE001+ actuator = get_actuator()+ await asyncio.to_thread(actuator.type_text, text, delay_s=delay_s)+ return ToolResult(+ success=True,+ output=f"Typed {len(text)} chars ({actuator.name})",+ )+ except ActuationUnavailable as exc:return ToolResult(success=False,output=None,- error=f"text input unavailable: pyautogui import failed: {exc}",+ error=f"text input unavailable: {exc}",)- try:- pyautogui.typewrite(text, interval=delay_s)- return ToolResult(success=True, output=f"Typed {len(text)} chars")except Exception as exc: # noqa: BLE001return ToolResult(success=False, output=None, error=str(exc))diff --git a/marketing/launch/github-setup.md b/marketing/launch/github-setup.mdnew file mode 100644index 0000000000..5db657d625--- /dev/null+++ b/marketing/launch/github-setup.md@@ -0,0 +1,60 @@+# GitHub launch setup — manual steps++Everything in this file must be clicked by a maintainer; none of it can (or+should) be automated. Order doesn't matter.++## 1. Social preview image++The rendered card lives at **`assets/brand/social-preview.png`** (1280×640,+~230 KB — within GitHub's 1 MB limit). Source: `assets/brand/social-preview.html`,+re-render with+`powershell assets/brand/render.ps1 -In social-preview.html -Out social-preview.png -W 1280 -H 640 -Scale 2`+(then downscale the 2× shot to 1280×640).++Where to set it: **github.com/PersonalJarvis/PersonalJarvis → Settings →+General → Social preview → Edit → Upload an image**. This image appears in+every link preview (X, Discord, Slack, HN comments) — set it *before* the+launch posts go out.++## 2. Repository topics++Settings → General → Topics (the gear next to "About"). Suggested set+(GitHub allows 20; these 16 cover search + discovery):++```+voice-assistant ai-agent ai-assistant jarvis voice-control+speech-recognition agents multi-agent llm automation+self-hosted privacy computer-use mcp whisper python+```++Also in the About box: set the description to the hero one-liner+("Talk to your computer — and watch it do the work. Open-source, privacy-first+voice agent.") and the website to the Discord invite or project site.++## 3. Good first issues++Create the issues from `marketing/launch/good-first-issues.md` (sanity-check+each against current `main` first), label them `good first issue` + an area+label — the CONTRIBUTING badge already links to that label filter.++## 4. Optional: native video player in the README++GitHub renders committed GIFs inline (that's what ships now), but a *native+video player* only works with GitHub-uploaded assets: edit the README **in the+GitHub web editor**, drag `assets/video/personal-jarvis-demo.mp4` into the+editor, and it uploads to `github.com/user-attachments/...` and embeds a real+player with sound. If you do that, replace the GIF `<img>` + MP4 link with the+generated attachment URL. Purely optional — the GIF autoplays and needs no click.++## 5. Posting the launch drafts++- `show-hn.md` — post text + prepared answers.+- `reddit-r-localllama.md`, `reddit-r-selfhosted.md` — one per subreddit; keep+ a few hours apart so comments can be answered properly.+- `x-thread.md` — attach the video to tweet 1. For best X quality upload the+ 4K master (render lives at `jarvis-promo-video/out/readme-hero-4k.mp4`;+ re-render with `npx remotion render src/index.ts PersonalJarvisReadme+ out/readme-hero-4k.mp4 --scale 2 --crf 16` inside `jarvis-promo-video/`).++Nothing in `marketing/launch/` is published automatically — every post needs a+human click, deliberately.diff --git a/marketing/launch/hero-one-liners.md b/marketing/launch/hero-one-liners.mdindex 28af17aad1..dd79bd7f07 100644--- a/marketing/launch/hero-one-liners.md+++ b/marketing/launch/hero-one-liners.md@@ -15,8 +15,8 @@ reused in German-language posts.> **Talk to your computer — and watch it do the work: an open-source,> privacy-first voice agent with full command of your PC.**-*German:* „Sprich mit deinem Computer — und sieh zu, wie er die Arbeit macht:-ein quelloffener, privacy-first Sprachagent mit vollem Zugriff auf deinen PC."+*German:* „Sprich mit deinem Computer — und sieh zu, wie er die Arbeit macht: <!-- i18n-allow: requested German translation of the hero line -->+ein quelloffener, privacy-first Sprachagent mit vollem Zugriff auf deinen PC." <!-- i18n-allow: requested German translation of the hero line -->**Why recommended:** it tells a complete stranger in one breath what happens(you talk, the machine acts), what it is (open source, privacy-first), and the@@ -29,16 +29,16 @@ on the film's slogan, which is cryptic without the video context.> **Your computer, on voice command: an open-source AI butler that answers,> acts, and ships real work — private by design.**-*German:* „Dein Computer aufs Wort: ein quelloffener KI-Butler, der antwortet,-handelt und echte Arbeit abliefert — privat by design."+*German:* „Dein Computer aufs Wort: ein quelloffener KI-Butler, der antwortet, <!-- i18n-allow: requested German translation of the hero line -->+handelt und echte Arbeit abliefert — privat by design." <!-- i18n-allow: requested German translation of the hero line -->## Variant 3 — the slogan> **You talk. It ships. The privacy-first voice butler for your PC — open> source, provider-agnostic, built in Germany.**-*German:* „Du sprichst. Es liefert. Der Privacy-first-Sprachbutler für deinen-PC — Open Source, anbieterunabhängig, gebaut in Deutschland."+*German:* „Du sprichst. Es liefert. Der Privacy-first-Sprachbutler für deinen <!-- i18n-allow: requested German translation of the hero line -->+PC — Open Source, anbieterunabhängig, gebaut in Deutschland." <!-- i18n-allow: requested German translation of the hero line -->---