Skip to content

A personal assistant that lives on your desktop, remembers what matters, and can use your Mac for you.

TypeScript

feat(ui): Windows texts for computer control, and its Windows 10 2004 floor

Marcelito7c5f9fc6b445
diff --git a/README.md b/README.md
index 520ccad..6d47f44 100644
--- a/README.md
+++ b/README.md
@@ -146,7 +146,7 @@ A small Node daemon starts the agent engine (Gentle Shell, `gentle-shell --mode
- **Your data:** `~/.gentle-dot` (mode 0700): sessions, settings, the access key (`token`), and the engine's own home and workspace. Point the assistant at a folder of yours with `GENTLE_DOT_WORKSPACE` or `"workspace"` in `~/.gentle-dot/config.json`.
- **Memory:** your global Engram (`~/.engram`, port 7437), project `gentle-dot`; `GENTLE_DOT_ENGRAM=private` gives the assistant a memory of its own.
- **Connectors:** the daemon alone writes `~/.gentle-dot/connectors.json` and the engine's `mcp.json`, and puts them back if anything else changes them. `connectors.json` is signed with a key kept in the Keychain; if it was changed while Gentle Dot was closed, it is set aside and you are told.
-- **Screenshots:** each model call carries only the latest one; earlier ones become one-line log entries, which keeps long control sessions fast.
+- **Screenshots:** each model call carries only the latest one; earlier ones become one-line log entries, which keeps long control sessions fast. On Windows, computer control needs Windows 10 version 2004 (build 19041) or newer to exclude Gentle Dot's windows from screenshots.
<div align="right"><a href="#top">Back to top</a></div>
diff --git a/docs/design.md b/docs/design.md
index 249b6c2..375bb68 100644
--- a/docs/design.md
+++ b/docs/design.md
@@ -165,9 +165,9 @@ Every daemon message carries `seq` (monotonic per connection) so the UI can dete
The UI shows one endless chat: no conversations list, no new conversation, and the header shows the assistant (the rose glyph and "Gentle Dot"). The code and protocol for several conversations stay behind `features.conversations` (`GENTLE_DOT_CONVERSATIONS=1`); with it off, the UI also ignores the menu bar's `dot://new-conversation`. The daemon rotates the session underneath when it grows (§7), and `history` / `get_earlier` read through the chain of session files, so earlier messages, including those before any compaction, stay reachable with "Show earlier".
-### Computer control (macOS, S24)
+### Computer control (macOS and Windows, S24)
-The assistant can see the screen and operate apps through a built-in MCP server that the desktop app serves. macOS only (L59); the web page and a VPS never offer it.
+The assistant can see the screen and operate apps through a built-in MCP server that the desktop app serves. macOS (L59) and Windows (S24.10); Linux, the web page and a VPS never offer it.
- S24.1 Helper: native Rust inside the Tauri app (`apps/desktop/src-tauri`), never in the daemon or the engine. It serves MCP (JSON-RPC 2.0 over streamable HTTP) on `http://127.0.0.1:<random port>/mcp` and requires `Authorization: Bearer <key>`, a fresh random key per app launch.
- S24.2 Tools: `screenshot`, `click`, `move`, `drag`, `scroll`, `type`, `key`, `open_app`, `list_apps`, `wait`, each with an optional `intent`. Screenshots of the display under the pointer are downscaled to a long edge of 1280 px; coordinates are pixels of the latest screenshot; actions return a fresh one; Gentle Dot's own windows are left out.
@@ -185,6 +185,13 @@ The assistant can see the screen and operate apps through a built-in MCP server
- Working edge: a separate non-fading layer lights a thin neon line along the top edge of the controlled display, with a light traveling along it like the light on the rose's strokes, during a prepared tool call, not for the entire 30-minute authorization. No text or logo. With "Reduce motion" the edge stays lit and the traveling light is left out. The overlay covers the controlled display before a call starts, even before its first action mark. An internal `computer://working {active, operationId}` event targets only the glow; a matching rendered-readiness acknowledgement (`computer_working_ready`, granted only to the glow window) is required before the interactive windows are temporarily hidden. Stale acknowledgements or queued preparation cannot hide windows after cancellation. The working edge clears when the call or session ends.
- Guards and screenshots: the overlay is a Gentle Dot window covering the display, so pointer-owner resolution skips it by its window number (`kCGWindowNumber`) and nothing else. The panel and the Dot still resolve to Gentle Dot and are refused. When the system-wide Accessibility hit test lands on the overlay while another app owns the window under the point, the risk check hit-tests that app's own element instead (`AXUIElementCreateApplication`). Screenshots leave the overlay out with every other window of our process (ScreenCaptureKit `excludingWindows`). The overlay is on screen for the whole session, so it is in the capture's window list before it draws anything.
+- S24.10 Windows: the helper uses the same session and guards, with Windows-specific input, screenshots, app discovery and UI Automation.
+ - The panic shortcut is Alt+Shift+Esc; the panel says "Controlling your PC", and Connectors shows no macOS permission rows.
+ - Screenshots require Windows 10 version 2004 (build 19041) or newer for `WDA_EXCLUDEFROMCAPTURE`. The Dot and panel are excluded during a session and restored after it ends; the glow and dialogs remain excluded.
+ - Keyboard input to an elevated app is refused: "{app} runs as administrator, so Gentle Dot cannot send it keys."
+ - `open_app` resolves names through Start menu shortcuts and App Paths, not PATH; it refuses unsafe targets and checks the resolved executable against the blocklist.
+ - UI Automation failures are fail-closed: if any element in an ancestor chain is unreadable, the entire chain is unreadable and asks for confirmation. A default-button scan cut short is also unreadable.
+
Why enforcement lives in the app: everything inside the engine, and the daemon's WebSocket, is within the agent's reach (it has a shell, and with the daemon's access key it could answer its own approval cards, L49). The session grant, panic stop, blocklist, rate limit, and risky-action confirmations therefore run in the helper, behind native dialogs the agent cannot answer, and the in-engine guard adds nothing for these tools. macOS also attributes Accessibility and Screen Recording to the app that holds them, Gentle Dot.app. The key in `mcp.json` only reaches the helper, which still asks the user before anything happens.
### Voice (S30)
diff --git a/docs/install.md b/docs/install.md
index 9f20712..92a0670 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -82,7 +82,7 @@ The command stages the runtime (`build/runtime/darwin-arm64`), signs the runtime
## Windows
-Requirements: Windows 10 or 11, 64-bit (x64).
+Requirements: Windows 10 or 11, 64-bit (x64). Computer control screenshots require Windows 10 version 2004 (build 19041) or newer: excluding Gentle Dot's windows from captures requires `WDA_EXCLUDEFROMCAPTURE`.
### Install
@@ -94,7 +94,7 @@ If Gentle Dot is running, the installer says **Gentle Dot is running! Click OK t
### First open
-Open **Gentle Dot** from the Start menu. The first open needs the network once: the engine installs its companion packages. Computer control and voice input are not available on Windows yet.
+Open **Gentle Dot** from the Start menu. The first open needs the network once: the engine installs its companion packages. The computer-control emergency stop is **Alt+Shift+Esc**. Voice input is not available on Windows yet.
### Where data lives
diff --git a/packages/ui/src/components/Computer.tsx b/packages/ui/src/components/Computer.tsx
index bd812a5..8b154df 100644
--- a/packages/ui/src/components/Computer.tsx
+++ b/packages/ui/src/components/Computer.tsx
@@ -7,6 +7,7 @@ import {
type ComputerYolo,
timeLeft,
} from "../computer.ts";
+import { isWindows } from "../shortcut.ts";
/** Computer control in the desktop panel (S24.5, S24.6); the web page never gets it. */
export interface ComputerControls {
@@ -30,8 +31,8 @@ const PERMISSIONS: [ComputerPermission, string][] = [
export const DEBUG_BUILD_NOTE =
"Debug builds lose these permissions on every rebuild because macOS ties them to the app's signature; grant them again after updating.";
-const YOLO_NOTE =
- "Yolo mode lets the assistant send, pay, delete, and submit without asking you first. It turns itself off after 1 hour or when the app quits; Stop and ⌥⇧Esc still work.";
+const yoloNote = (windows: boolean) =>
+ `Yolo mode lets the assistant send, pay, delete, and submit without asking you first. It turns itself off after 1 hour or when the app quits; Stop and ${windows ? "Alt+Shift+Esc" : "⌥⇧Esc"} still work.`;
const NO_IMAGES_NOTE =
"The current model does not accept images, so the assistant cannot see your screen. Choose a model that does in Profiles.";
@@ -52,7 +53,10 @@ export function ComputerBanner({ session, yolo, stop }: ComputerBannerProps) {
return (
<section className="computer-banner" aria-label="Computer control">
<span className="computer-banner-light" aria-hidden="true" />
- <span>Controlling your Mac{left}</span>
+ <span>
+ Controlling your {isWindows() ? "PC" : "Mac"}
+ {left}
+ </span>
{yolo ? (
<span className="chip computer-yolo-chip" title="Risky actions run without asking you first">
Yolo
@@ -71,9 +75,10 @@ interface ComputerEntryProps {
controls: ComputerControls;
}
-/** The built-in Computer connector: the macOS permissions it needs and how to grant them. */
+/** The built-in Computer connector: the macOS permissions it needs and how to grant them (Windows asks for none). */
export function ComputerEntry({ info, controls }: ComputerEntryProps) {
const { permissions, requestPermission, yolo, setYolo } = controls;
+ const windows = isWindows();
const [granted, setGranted] = useState<ComputerPermissions>();
const check = useCallback(() => {
permissions().then(setGranted, () => setGranted(undefined));
@@ -92,37 +97,49 @@ export function ComputerEntry({ info, controls }: ComputerEntryProps) {
<p className="connector-note">{info.sends}</p>
</>
) : null}
- <ul className="computer-permissions">
- {PERMISSIONS.map(([kind, label]) => {
- const allowed = granted?.[kind] === true;
- const id = `computer-permission-${kind}`;
- return (
- <li key={kind} aria-labelledby={id}>
- <span id={id}>{label}</span>
- <span className={`chip ${allowed ? "connector-connected" : "connector-needs_setup"}`}>
- {granted === undefined ? "Checking…" : allowed ? "Allowed" : "Not allowed"}
- </span>
- {granted !== undefined && !allowed ? (
- <button
- type="button"
- className="primary"
- aria-label={`Grant ${label}`}
- onClick={() => {
- requestPermission(kind).then(check, check);
- }}
- >
- Grant
- </button>
- ) : null}
- </li>
- );
- })}
- </ul>
- <div className="provider-actions">
- <button type="button" onClick={check}>
- Check again
- </button>
- </div>
+ {windows ? (
+ <p className="connector-note">Windows asks for no permission for computer control.</p>
+ ) : null}
+ {windows ? null : (
+ <ul className="computer-permissions">
+ {PERMISSIONS.map(([kind, label]) => {
+ const allowed = granted?.[kind] === true;
+ const id = `computer-permission-${kind}`;
+ return (
+ <li key={kind} aria-labelledby={id}>
+ <span id={id}>{label}</span>
+ <span className={`chip ${allowed ? "connector-connected" : "connector-needs_setup"}`}>
+ {granted === undefined ? "Checking…" : allowed ? "Allowed" : "Not allowed"}
+ </span>
+ {granted !== undefined && !allowed ? (
+ <button
+ type="button"
+ className="primary"
+ aria-label={`Grant ${label}`}
+ onClick={() => {
+ requestPermission(kind).then(check, check);
+ }}
+ >
+ Grant
+ </button>
+ ) : null}
+ </li>
+ );
+ })}
+ </ul>
+ )}
+ {windows ? null : (
+ <div className="provider-actions">
+ <button type="button" onClick={check}>
+ Check again
+ </button>
+ </div>
+ )}
+ {windows && granted?.screenshotsSupported === false ? (
+ <p className="connector-note computer-warning">
+ Computer control needs Windows 10 version 2004 (build 19041) or newer for screenshots.
+ </p>
+ ) : null}
<div className="computer-yolo">
<span id="computer-yolo-label">Yolo mode</span>
<button
@@ -138,8 +155,8 @@ export function ComputerEntry({ info, controls }: ComputerEntryProps) {
<span className="switch-knob" aria-hidden="true" />
</button>
</div>
- <p className="connector-note">{YOLO_NOTE}</p>
- <p className="connector-note">{DEBUG_BUILD_NOTE}</p>
+ <p className="connector-note">{yoloNote(windows)}</p>
+ {windows ? null : <p className="connector-note">{DEBUG_BUILD_NOTE}</p>}
{info?.noImages ? <p className="connector-note computer-warning">{NO_IMAGES_NOTE}</p> : null}
</li>
);
diff --git a/packages/ui/src/components/DotSurface.tsx b/packages/ui/src/components/DotSurface.tsx
index 89abe24..ecd7bcc 100644
--- a/packages/ui/src/components/DotSurface.tsx
+++ b/packages/ui/src/components/DotSurface.tsx
@@ -1,6 +1,7 @@
import type { AgentState } from "@gentle-dot/protocol";
import { useRef } from "react";
import { Rose, type RoseMood } from "../rose/Rose.tsx";
+import { isWindows } from "../shortcut.ts";
const LABELS: Record<AgentState, string> = {
starting: "starting",
@@ -46,7 +47,7 @@ export function DotSurface({
}: DotSurfaceProps) {
const press = useRef<{ x: number; y: number; dragging: boolean } | undefined>(undefined);
const state = connected ? agentState : "restarting";
- const label = inControl ? "controlling your Mac" : LABELS[state];
+ const label = inControl ? `controlling your ${isWindows() ? "PC" : "Mac"}` : LABELS[state];
return (
<button
diff --git a/packages/ui/src/components/SettingsPanel.tsx b/packages/ui/src/components/SettingsPanel.tsx
index 0d92666..14943e7 100644
--- a/packages/ui/src/components/SettingsPanel.tsx
+++ b/packages/ui/src/components/SettingsPanel.tsx
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
import {
formatShortcut,
isMac,
+ isWindows,
loadShortcut,
recordKey,
type ShortcutInfo,
@@ -149,7 +150,7 @@ export function SettingsPanel({ close }: { close: () => void }) {
</button>
</section>
- <section className="provider-section" aria-labelledby="settings-voice-language">
+ <section className="provider-section" aria-labelledby="settings-voice-language" hidden={isWindows()}>
<h3 id="settings-voice-language">Voice language</h3>
<p className="muted">
The language macOS speech listens in. The local voice model detects it by itself.
diff --git a/packages/ui/src/computer.ts b/packages/ui/src/computer.ts
index 06cc2a6..5d00457 100644
--- a/packages/ui/src/computer.ts
+++ b/packages/ui/src/computer.ts
@@ -14,9 +14,10 @@ export interface ComputerEndpoint {
export interface ComputerPermissions {
accessibility: boolean;
screenRecording: boolean;
+ screenshotsSupported?: boolean;
}
-export type ComputerPermission = keyof ComputerPermissions;
+export type ComputerPermission = "accessibility" | "screenRecording";
/** A control session the user allowed; `endsAt` in milliseconds since the epoch. */
export interface ComputerSession {
diff --git a/packages/ui/src/shortcut.ts b/packages/ui/src/shortcut.ts
index 0368299..1162db4 100644
--- a/packages/ui/src/shortcut.ts
+++ b/packages/ui/src/shortcut.ts
@@ -20,6 +20,11 @@ export function isMac(userAgent: string = navigator.userAgent): boolean {
return /Mac|iPhone|iPad/.test(userAgent);
}
+/** WebView2 says Windows in its user agent. */
+export function isWindows(userAgent: string = navigator.userAgent): boolean {
+ return /Windows/.test(userAgent);
+}
+
type Modifier = "Ctrl" | "Alt" | "Shift" | "Super";
/** The macOS order of modifiers (⌃⌥⇧⌘), also used for the accelerator the app saves. */
diff --git a/packages/ui/test/computer.test.tsx b/packages/ui/test/computer.test.tsx
index 189b283..12a1c30 100644
--- a/packages/ui/test/computer.test.tsx
+++ b/packages/ui/test/computer.test.tsx
@@ -12,7 +12,7 @@ const KEY = "s3cr3t-Computer-Key-0123456789abcdef";
const h = vi.hoisted(() => ({
tauri: true,
endpoint: null as unknown,
- permissions: { accessibility: false, screenRecording: true },
+ permissions: { accessibility: false, screenRecording: true, screenshotsSupported: true },
status: { active: false } as unknown,
invoke: vi.fn(),
send: vi.fn(),
@@ -92,7 +92,7 @@ async function emitState(payload: unknown) {
beforeEach(() => {
h.tauri = true;
h.endpoint = { url: HELPER, token: KEY };
- h.permissions = { accessibility: false, screenRecording: true };
+ h.permissions = { accessibility: false, screenRecording: true, screenshotsSupported: true };
h.status = { active: false };
h.listeners.clear();
h.send = vi.fn();
@@ -189,7 +189,7 @@ describe("the Computer entry in Connectors (S24.5)", () => {
expect(h.invoke).toHaveBeenCalledWith("computer_request_permission", { kind: "accessibility" });
await waitFor(() => expect(invoked("computer_permissions").length).toBe(checks + 1));
- h.permissions = { accessibility: true, screenRecording: true };
+ h.permissions = { accessibility: true, screenRecording: true, screenshotsSupported: true };
await userEvent.click(within(entry).getByRole("button", { name: "Check again" }));
await waitFor(() => expect(accessibility).toHaveTextContent("Allowed"));
expect(accessibility).not.toHaveTextContent("Not allowed");
@@ -197,7 +197,7 @@ describe("the Computer entry in Connectors (S24.5)", () => {
});
it("asks for Screen Recording with its own kind", async () => {
- h.permissions = { accessibility: true, screenRecording: false };
+ h.permissions = { accessibility: true, screenRecording: false, screenshotsSupported: true };
h.state = connectorsOpen([computerEntry()]);
await renderApp("?surface=panel");
const recording = await screen.findByRole("listitem", { name: "Screen Recording" });
@@ -270,6 +270,40 @@ describe("while the assistant controls the Mac (S24.6)", () => {
});
});
+describe("on Windows", () => {
+ beforeEach(() => {
+ vi.spyOn(navigator, "userAgent", "get").mockReturnValue("Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
+ });
+ afterEach(() => vi.restoreAllMocks());
+
+ it("shows Windows guidance without macOS permissions", async () => {
+ h.state = connectorsOpen([computerEntry()]);
+ await renderApp("?surface=panel");
+ const entry = await screen.findByRole("listitem", { name: "Computer" });
+ expect(
+ within(entry).getByText("Windows asks for no permission for computer control."),
+ ).toBeInTheDocument();
+ expect(within(entry).queryByText("Accessibility")).toBeNull();
+ expect(within(entry).queryByText("Screen Recording")).toBeNull();
+ expect(within(entry).queryByRole("button", { name: "Check again" })).toBeNull();
+ expect(within(entry).queryByText(DEBUG_NOTE)).toBeNull();
+ expect(within(entry).getByText(/Stop and Alt\+Shift\+Esc still work/)).toBeInTheDocument();
+ });
+
+ it("explains unsupported screenshots require Windows 10 version 2004 or newer", async () => {
+ h.permissions.screenshotsSupported = false;
+ h.state = connectorsOpen([computerEntry()]);
+ await renderApp("?surface=panel");
+ expect(await screen.findByText(/Windows 10 version 2004/)).toBeInTheDocument();
+ });
+
+ it("names the PC in the session banner", async () => {
+ h.status = { active: true };
+ await renderApp("?surface=panel");
+ expect(await screen.findByText("Controlling your PC")).toBeInTheDocument();
+ });
+});
+
describe("yolo mode (S24.9)", () => {
const yoloSwitch = async () => {
const entry = await screen.findByRole("listitem", { name: "Computer" });
diff --git a/packages/ui/test/dot.test.tsx b/packages/ui/test/dot.test.tsx
index 3527949..8ca84b9 100644
--- a/packages/ui/test/dot.test.tsx
+++ b/packages/ui/test/dot.test.tsx
@@ -118,6 +118,13 @@ describe("DotSurface", () => {
if (state !== "needs_you") expect(screen.queryByText("!")).toBeNull();
});
+ it("names the PC while controlling Windows", () => {
+ const agent = vi.spyOn(navigator, "userAgent", "get").mockReturnValue("Windows NT 10.0");
+ render(<DotSurface agentState="working" connected toggle={vi.fn()} startDrag={vi.fn()} inControl yolo />);
+ expect(screen.getByRole("button")).toHaveAccessibleName("Gentle Dot: controlling your PC, yolo mode on");
+ agent.mockRestore();
+ });
+
it("shows a restarting rose while disconnected", () => {
const { dot } = setup("working", false);
expect(dot).toHaveAccessibleName("Gentle Dot: restarting");
diff --git a/packages/ui/test/settings.test.tsx b/packages/ui/test/settings.test.tsx
index 8543ca7..0d9d53e 100644
--- a/packages/ui/test/settings.test.tsx
+++ b/packages/ui/test/settings.test.tsx
@@ -189,6 +189,11 @@ describe("the Settings screen (S33.1)", () => {
});
describe("voice language (S30.6)", () => {
+ it("does not offer macOS voice language on Windows", async () => {
+ vi.spyOn(navigator, "userAgent", "get").mockReturnValue("Windows NT 10.0");
+ await openSettings();
+ expect(screen.queryByRole("combobox", { name: "Voice language" })).toBeNull();
+ });
it("defaults to the system language and remembers the one chosen for macOS speech", async () => {
await openSettings();
const picker = screen.getByRole("combobox", { name: "Voice language" });