Skip to main content
Glama
README.md
# DesktopOS — AI-to-Windows Bridge

An MCP server for Windows that gives AI agents a **persistent PowerShell session**, real desktop perception & input injection, and **Playwright-powered browser automation**.

The core difference from "spawn a new PowerShell for every command": after `cd`, the directory persists. Environment variables persist. venv state persists. The agent works like a human at a terminal — continuously, not from zero on every call.

---

## Status

| Phase | Scope | Status |
|---|---|---|
| Shell Worker | Persistent session, verified execution, self-healing | ✅ Done |
| Perception | Dual-channel (Win32 window tree + screen capture, cross-validated) | ✅ Done |
| Execution | Real input injection (click/type/key/scroll, Chinese-safe) | ✅ Done |
| Browser automation | **Playwright engine** (replaces the former UIA element tree + hand-rolled CDP) | ✅ Done |
| Memory layer | Operation timeline + dHash window index + reference resolution | ✅ Done |
| Diagnoser | Rule-based error triage wired into every tool failure | ✅ Done |
| MCP wrapping + open source | 33 tools over stdio | ✅ Done |

---

## Quick Start

**Requirements**: Windows 10/11 + Node ≥ 22. A Chromium-based browser (Edge/Chrome preinstalled on Windows works out of the box).

```bash
git clone https://github.com/boring-hong/desktopos.git
cd desktopos

npm install
npm test          # 327 assertions, all green before anything ships
npm start         # run as an MCP server (stdio)
```

`npm test` really spawns PowerShell, really launches a headless browser, and really moves your mouse (read-only actions). Not mocks.

### Register with an MCP client

Merge this into your client config (template: `examples/mcp-config.json`):

```json
"desktopos": {
  "type": "stdio",
  "command": "node",
  "args": ["C:/path/to/desktopos/src/mcp-server/index.js"],
  "cwd": "C:/path/to/desktopos"
}
```

- DSH: `C:\Users\<you>\.dsh\dsh-mcp-manager.json`
- Claude Desktop: `%APPDATA%\Claude\claude_desktop_config.json`
- Cursor: `%USERPROFILE%\.cursor\mcp.json`

Whichever file already exists is the one to edit. Use forward slashes to dodge JSON backslash escaping. Restart the client afterwards.

> **First time?** Read [`docs/QUICKSTART.md`](docs/QUICKSTART.md) — a five-minute one-pager with copy-paste client config, a one-minute self-check, typical usage, and known limits.
>
> **Want to judge whether it's trustworthy?** Read [`docs/REVIEW.md`](docs/REVIEW.md) — review guide with a 5-minute verification path, directory navigation, known boundaries, and security notes.

---

## Exposed Tools

| Tool | What it does |
|---|---|
| `shell_exec` | Run a command in the persistent session |
| `shell_cd` | Change working directory (**Chinese paths supported**) |
| `shell_cwd` | Get current directory |
| `shell_env_set` / `shell_env_get` | Environment variables that persist across calls |
| `shell_exec_verified` | Execute + independently verify the result + retry with backoff (self-healing) |
| `shell_reset` | Restart the PowerShell session when it goes sideways |
| `desktop_list_windows` | Structure channel: enumerate windows (title/process/rect/focus/minimized) |
| `desktop_screenshot` | Vision channel: screen capture, PNG/JPEG (`maxWidth` / `format` control payload size) |
| `desktop_perceive` | Dual-channel + cross-validation (the core capability) |
| `desktop_cursor` | Read mouse position (read-only) |
| `desktop_move` | Move the mouse (no click) |
| `desktop_click` | Click / double-click / right-click (optional `verify` + `verifyRegion`) |
| `desktop_type` | Type text, **Chinese-safe** (clipboard + Ctrl+V) |
| `desktop_key` | Key combos like `ctrl+c` / `alt+tab` |
| `desktop_scroll` | Mouse wheel |
| `desktop_focus_window` | Bring a window to the foreground (restores if minimized) |
| `pw_launch` | Launch (or reuse) a Playwright-driven Chromium instance |
| `pw_navigate` | Navigate the current page |
| `pw_snapshot` | **Aria snapshot (YAML) of the page — every interactable node carries a `[ref=eN]`** |
| `pw_click` | Click by `ref` (most reliable), or by name/role fallback |
| `pw_type` | Type text — native Unicode, Chinese/emoji lossless, no clipboard involved |
| `pw_press` | Key combos to the page |
| `pw_evaluate` | Run JavaScript in the page, return JSON |
| `pw_screenshot` | Page-level screenshot (optional full-page) |
| `pw_wait` | Wait for text / selector / fixed ms |
| `pw_tabs` | List or switch browser tabs |
| `pw_close` | Close the browser, clean up the throwaway profile |
| `memory_recall` | Resolve a reference ("that window from before" / "WeChat") into coordinates |
| `memory_timeline` | Recent operation timeline |
| `memory_stats` / `memory_clear` | Index stats / wipe |
| `desktop_diagnose` | Translate any error text into "why + what to do + can it auto-fix" |

Typical shell flow:

```
shell_cd   → <some directory with Chinese characters>
shell_exec → git status          ← runs in that same directory
```

Self-healing flow (never trust a command's own exit code — verify for real):

```
shell_exec_verified
  command: New-Item -ItemType Directory -Path 'D:\新目录' -Force | Out-Null
  expect : { "isDir": "D:\\新目录" }
  retries: 2
```

`expect` supports: `pathExists` / `pathNotExists` / `isDir` / `isFile` / `fileContains:[path, text]` / `cwd`.
Verification goes through Node's `fs` (native UTF-8 paths), not through the shell — equally reliable on Chinese paths.

Browser flow (the Playwright loop):

```
pw_launch  { url: "https://example.com" }   → browser up
pw_snapshot {}                              → YAML with refs: button "Sign in" [ref=e5]
pw_click   { ref: "e5" }                    → click it, no coordinates involved
pw_type    { text: "你好世界", ref: "e3" }   → type into a textbox, lossless
pw_evaluate{ expression: "document.title" } → ask the page anything
pw_close   {}                               → done
```

---

## Tool-surface trimming (for multi-server setups)

**The problem isn't having many tools — it's that overlaps go unarbitrated.**

Mainstream MCP clients only toggle whole servers, not individual tools. Install another desktop-automation server alongside a browser-automation server, and a fair share of this server's 33 tools now answer the same question twice: two ways to "click that control", three ways to "take a screenshot". The model guesses every call, and guess-error rate scales with overlap. This degradation is real once you install enough servers.

Can't fix the client, so fix it server-side: **trim the overlapping part at startup and the decision point disappears.**

```bash
# by group
DESKTOPOS_TOOLS=shell,diagnose node src/mcp-server/index.js

# by tool name, mixable
DESKTOPOS_TOOLS=shell_exec,shell_cd,desktop_perceive node src/mcp-server/index.js

# or exclusion (exclude wins)
DESKTOPOS_TOOLS=shell,desktop DESKTOPOS_TOOLS_EXCLUDE=desktop_screenshot

# CLI equivalents
node src/mcp-server/index.js --only=shell,diagnose
```

Groups:

| Group | Tools | When to trim |
|---|---|---|
| `shell` | shell_exec / _verified / _cd / _cwd / _env_get / _env_set / _reset | Almost never — the most irreplaceable part |
| `desktop` | list_windows / perceive / screenshot / cursor / move / click / type / key / scroll / focus_window | When you already run another desktop automation |
| `pw` | pw_launch / navigate / snapshot / click / type / press / evaluate / screenshot / wait / tabs / close | When you already run the official Playwright MCP |
| `memory` | memory_* | When you don't need desktop state memory |
| `diagnose` | desktop_diagnose | Pure knowledge; keep it |

Three behavioral guarantees (covered by `test/toolfilter.test.js`):

1. **No filter set = everything exposed** — the default OSS experience stays intact;
2. After trimming, `tools/list` only contains the selected tools;
3. **Call-time enforcement too** — trimming only `tools/list` is not enough: the client's tool table may be cached, and the model may remember old names. Those calls must be rejected, not silently executed.

### Companion: overlap audit

Trimming is human judgment, so there's a script that quantifies "overlap" into numbers:

```bash
npm run audit:overlap
```

It connects to every MCP server in your config, pulls each `tools/list`, and outputs cross-server near-duplicate pairs by name and description similarity. Use it as a candidate list, not a verdict:

- Same name, different semantics is common (`windows-mcp/Click` clicks OS windows; `playwright/browser_click` clicks page DOM elements — those should not merge);
- Mixed Chinese/English descriptions make description-similarity unreliable — name similarity + human judgment is all you get;
- It only sees MCP servers, not client-native tools (built-in shell, file I/O), so real overlap is larger than the reported number.

**Run it every time you install a new server.** That's the entire reason this script exists.

---

## Self-healing: the diagnoser

Earlier self-healing was half-built: execute → verify → retry. But "retry" is meaningless for most failures: a mistyped command fails ten more times. The missing step was **understanding why it failed**.

Every failure now goes through a rule-based diagnoser that produces:

```
category    failure class (access-denied / cmd-not-found / missing-parent / ...)
reason      plain-language explanation
hint        actionable hint
suggestion  concrete next step (command or tool call)
retryable   whether retrying-as-is makes any sense
fix         auto-fix command, when a safe one exists
```

**`retryable` is the key judgment here.** Most AI desktop tools blindly retry on failure. "Access denied", "command not found", "bad parameter" — retrying those a thousand times is wasted time. The diagnoser says so directly and points at the real next action.

### Auto-fix has boundaries

Only **purely additive** fixes run by default (currently one class: creating a missing parent directory). Everything else requires explicit opt-in. Two hard constraints:

1. The parent must actually not exist — otherwise the target itself is missing and creating the parent is pointless;
2. The command must be a creating verb — building a directory for a `Get-ChildItem` read fabricates a path that shouldn't exist. That's not healing, that's hallucinating.

Real example (green in tests):

```
New-Item -ItemType File -Path '...\a\b\x.txt'      ← parent a\b missing
  ↓ diagnose: missing-parent (retry is meaningful)
  ↓ auto-fix: New-Item -ItemType Directory -Path '...\a\b' -Force
  ↓ re-run, verification passes, file really exists
```

### Rules deliberately avoid LLMs

Pure string matching: millisecond latency, testable, regression-proof. The cost is only known categories get covered — on a miss it honestly says "unclassified" and passes the raw error through so the rule table can grow.

Covered: encoding corruption / file locks / access denied / command not found / parameter errors / type conversion / syntax errors / timeouts / target exists / path missing / missing parent / element not found / ambiguous element / window minimized / invalid handle / browser not launched.

**Every tool error carries a diagnosis automatically** — not just shell. It's hooked in the MCP catch-all.

---

## Architecture

```
Node (MCP Server, stdio)
   ├─ HTTP 127.0.0.1:<random> ──▶ PowerShell 5.1 workers (shell / sensor / actor)
   │     header: X-DOS-Token: <random per process>   one long-lived runspace each
   │     body:   { command: base64(UTF-8) }          → Win32 / screen capture / input injection
   └─ playwright-core ──▶ Chromium (ms-playwright cache or system Edge/Chrome)
         persistent context, aria snapshots, aria-ref locators
```

### Why even a loopback port must authenticate

"Bound to 127.0.0.1" **does not** mean private. The attack path is concrete:

1. A malicious page calls `fetch('http://127.0.0.1:<port>/exec', { method: 'POST', body: '<json>' })`;
2. The default `Content-Type: text/plain` is a **CORS-safelisted value** — this is a "simple request", **no preflight**, the browser sends it directly;
3. The response is unreadable (CORS blocks it), but **the side effect already happened**. The port is random but only has ~16k candidates — a page blind-scans them in seconds.

Conclusion: without auth, visiting any web page hands your PowerShell, mouse, and keyboard to it.

Current design:

- Node generates a 32-byte random token per worker, passed to PowerShell via argv;
- Every request must carry `X-DOS-Token`; mismatch → 403;
- Any request with an `Origin` header → 403 (our own Node client never sends one).

The linchpin is the **custom header**: not safelisted, so cross-site requests must preflight, and the browser blocks them outright. Regression tests in `test/resilience.test.js` cover cross-site Origin + text/plain, missing token, wrong token, correct token.

> The token travels via argv, readable by other local processes — but an attacker with local code execution doesn't need our token. Outside the threat model.

### Why not stdin pipes + markers

The first implementation was `powershell.exe -Command -`: write commands to stdin, detect command end via a marker string. Four unavoidable pits (all confirmed by measurement):

1. **Encoding**: `powershell.exe` decodes piped stdin with `[Console]::InputEncoding` — **CP936/GB2312** on Chinese Windows. UTF-8 bytes from Node become mojibake → Chinese paths 100% broken. Measured: `InputEncoding : gb2312 (codepage 936)`.
2. **Stream interleaving**: stdout and stderr interleave; markers drown in command output or get falsely matched by residual buffers.
3. **Process exit**: terminating errors make PowerShell `exit(1)` — the marker never arrives.
4. **Error loss**: `Invoke-Expression` doesn't reliably merge non-terminating errors into the caller's error stream.

Fixes:

- **HTTP transport**: commands base64-encoded in the body, responses explicitly written as UTF-8 bytes — console encoding is never touched;
- **Scriptblock dot-sourcing + redirection** (`. $sb 2>&1`): captures non-terminating errors while keeping variables/cwd in the same runspace.

`worker.ps1` is deliberately **pure ASCII**; all non-ASCII data travels as base64 — which also sidesteps PowerShell's default ANSI decoding of `.ps1` files.

> **War story: watch out for AMSI when editing these `.ps1` files.**
> Adding JPEG quality parameters to `perception.ps1` (`ImageCodecInfo::GetImageEncoders()` + `EncoderParameters`) made Windows Defender classify the whole script as "contains malicious content" and refuse to run it. The snippet alone was fine; combined with "screen capture + base64 + HttpListener" it tripped a composition heuristic. The plain `ImageFormat::Jpeg` overload passes. Test before committing any "capture-then-encode" code.

---

## Recovering from a wedged session

A PowerShell 5.1 runspace is single-threaded: one stuck command (an interactive prompt, an `npm install` without `-y`, a hanging network call) blocks `GetContext()` forever — every subsequent request times out.

The early `stop()` awaited a `/shutdown` with **no timeout** — the peer was already wedged, so the escape hatch hung too, and `shell_reset` never returned. Restarting the MCP client was the only way out.

Current layering:

| Layer | Mechanism |
|---|---|
| Command | Timeout throws; **hard-restarts the worker automatically**, then replays remembered cwd + env vars |
| Request | `_request` has its own timeout (command timeout + 5s) — no layer can hang the one above it |
| Stop | Short timeout (1.5s) graceful shutdown, **then unconditional kill and wait for real exit** |
| Start | The **startup promise** is cached; concurrent callers share one spawn (`_spawnOnce` retries up to 3 times) |

So the cost of one wedged command is "restart + state replay", not "the whole session is dead". To be precise about the cost: variables not recorded via `shell_env_set`, and non-cwd runscape state (function definitions, imported modules) do get lost. `test/resilience.test.js` verifies cwd and `shell_env_set` variables survive.

---

## Dual-channel perception

Most AI desktop tools do "screenshot → OCR → guess". Wrong architecture. Here, two channels run side by side:

| Channel | Implementation | Output |
|---|---|---|
| Structure | Win32 P/Invoke: `EnumWindows` / `GetWindowRect` / `GetWindowText` / `GetForegroundWindow` | handle, title, process, PID, rect, focus, minimized |
| Vision | `System.Drawing` full-screen capture, per-window pixel std-dev sampling | whether that region actually renders content |

**Cross-validation**: a window the structure channel calls "visible" must, in the vision channel, (1) intersect the screen and (2) actually contain rendered content. Otherwise it's flagged inconsistent, with three causes:

```
minimized  parked by Windows at -32000/-21333 coordinates
offscreen  outside the screen
blank      no content in region (e.g. 1x1 hidden windows)
```

Measured on this machine: 17 windows, 5 consistent, 12 inconsistent (8 minimized / 2 offscreen / 2 blank). The key fact: `IsWindowVisible` returns true for minimized windows — **window-list-only perception misjudges; the two channels must check each other**.

---

## Execution layer (UI actor)

Real input injection: `focus` / `move` / `click` / `scroll` / `type` / `key`.

**Chinese input** is a pit: `SendKeys` doesn't support Unicode and silently mangles CJK. Typing goes through the **clipboard (`SetText`, full Unicode) + Ctrl+V** — same project-wide principle: non-ASCII never travels naked through shell/console encoding.

**Built-in verification**: any action can request `verify`, capturing before/after screenshots and returning a sampled `diffRatio`. "Act → verify" is infrastructure, not something every caller reassembles.

Verification can be **region-scoped**: `verifyRegion: { x, y, w, h }` (usually the target window's rect). Without it you compare the full screen — and full-screen comparison answers "did anything on screen change", not "did MY action change the thing I acted on". A ticking clock or blinking caret will count as a change. The response carries `scope: "region" | "screen"` so the strength of the conclusion is visible.

Typical loop:

```
desktop_perceive                          → target window handle + rect
desktop_click {x, y, verify, verifyRegion → click it, compare only within that window
              : <rect>}
desktop_screenshot                        → eyeball confirmation
```

> ⚠️ Clicks and typing really steal your mouse and keyboard focus.
> Automated tests only cover read-only / side-effect-free actions (cursor / move). Real click / type / key: use `test/_dbg-actor.js` manually or call via MCP explicitly.

```bash
node test/_dbg-actor.js cursor
node test/_dbg-actor.js click 500 300        # really clicks; 5s built-in countdown
node test/_dbg-actor.js type "中文输入测试"
```

---

## Browser automation (Playwright engine)

v0.3 replaced the two former browser paths — a hand-rolled CDP client and the UIA element tree — with one **Playwright engine** (`src/playwright/`). Why:

- UIA is blind inside Chromium/Electron apps (measured: 0 elements enumerated on an Electron app);
- The hand-rolled CDP worked, but every capability (AX tree, click, typing, screenshots) meant hand-assembling protocol messages;
- Playwright ships all of it, maintained by Microsoft, and adds auto-waiting, strict locators, and retry semantics we'd otherwise reimplement poorly.

### The ref-based interaction loop

The engine follows the same layout as the official Microsoft Playwright MCP — not a copy, but the same core insight: **locate by stable `ref`, not by coordinates**.

1. `pw_snapshot` captures an aria snapshot in `mode: "ai"` — a YAML outline of the page where every interactable node carries a `[ref=eN]`;
2. Pass that `ref` to `pw_click` / `pw_type` — the internal `aria-ref` selector engine resolves it to the exact element;
3. No ref? Name/role fallback still works (fuzzy match against role names, labels, placeholders, and visible text — Chinese-friendly).

Refs stay valid across calls until the page navigates; on a stale ref the tool says so and points at `pw_snapshot` for a fresh one.

### Design notes

- **Persistent context, throwaway profile.** Each launch gets a unique user-data-dir under `~/.desktopos/`, deleted on close — no profile-lock fights with your running browser. Pass `userDataDir` explicitly to keep logins.
- **Browser resolution order**: local `ms-playwright` cache → system Edge → system Chrome → Playwright's own lookup. `npx playwright-core install chromium` pre-installs if you want a pinned browser.
- **Chinese input is native.** `fill()`/keyboard events go through Unicode directly — no clipboard, no IME, no layout issues.
- One engine instance per server; `pw_launch` reuses a live browser instead of spawning another.

---

## Memory layer

Solves the most painful part of agents operating a computer: **not remembering what was done or seen**. With it, references like "click that button from before" resolve.

Three parts:

| Part | Implementation |
|---|---|
| Operation log | One timestamped entry per perceive / act / shell call |
| Feature index | **8×8 dHash (difference hash)** of windows — real "screenshot → vector", re-recognizable by Hamming distance |
| Context manager | Focus window history / navigation stack |

Persisted at `~/.desktopos/memory.json`, surviving process restarts.

Measured:

```
"刚才那个窗口"  -> 微信 [WeChat]        (853,509)   matched by recency
"explorer"      -> Program Manager      (854,534)   matched by keyword
"Excel"         -> exists but minimized — restore first via desktop_focus_window (handle 68036)
```

The last line is the key design: **distinguishing "really absent" from "present but minimized"**. Calling it "not found" would mislead the agent, so the response carries an actionable hint + the handle.

The perceptual hash is an 8×8 grayscale **difference hash** — no ML model involved, still re-recognizes windows after moves and resizes.

> Why not aHash: aHash only records "brighter or darker than average", discarding all gradient direction and color. Measured on 33 local windows, aHash computed the **exact same** 64-bit fingerprint (distance 0) for File Explorer and an unrelated web page; `findByHash` exists precisely to turn "that window from before" into coordinates — a wrong match means a real click on the wrong target. With dHash, 105 window pairs measured: only 2 at distance 0 (both flat small windows), 98 pairs > 12. Enough separation.
>
> Even so, the hash is a **weak signal**: `findByHash(hash, { expect: { title, process } })` should cross-check title/process before trusting a match; default threshold tightened from 10 to 6. Identical hashes on solid-color/blank regions are expected degradation.

---

## Test coverage

`npm test` = 6 encoding guard + 13 shell worker + 15 resilience/security + 13 tool filtering + 20 perception + 11 actor + 128 diagnoser + 38 memory + **10 Playwright engine** + 73 MCP end-to-end — **327 assertions**.

The Playwright block is **true end-to-end**: really launches a headless Chromium, really types Chinese into a textbox via ref, really clicks, asserts the DOM actually changed, checks the screenshot is a valid PNG. Auto-SKIPs (not fails) if no browser is available.

**Resilience/security (`resilience.test.js`)** covers three classes of real past incidents:

- **Auth**: cross-site Origin + text/plain, missing token, wrong token → 403; correct token executes
- **Wedge recovery**: session auto-recovers after command timeout; cwd and `shell_env_set` variables replayed; `stop()` returns in bounded time even when wedged
- **Concurrent cold start**: 5 concurrent `start()` spawns exactly one process
- **Request body cap**: 5 MB body → 413, not an unbounded `ReadToEnd()`

**Encoding guard (ascii-guard)**: enforces pure-ASCII `.ps1` files. PowerShell 5.1 reads BOM-less `.ps1` as ANSI/CP936; a stray Chinese comment decodes to mojibake and silently corrupts the next line (this once broke an entire `$min = if (...) {...}` line, producing JSON like `"minimized":,`). This test is the enforcement arm of that rule.

Key regression points:

- `cd` into a Chinese-character path (`...\代码\desktopos`) — the old design always broke here
- Chinese window titles round-trip through perception with no U+FFFD
- Directory/env persistence across MCP calls
- Non-terminating errors, terminating errors, and native-command stderr all captured
- Session stays alive after errors (no hangs)
- Cross-validation self-consistent: consistent + inconsistent = total, matching the boolean fields
- Clicking a nonexistent element returns `isError` and **mis-clicks nothing**
- Diagnoser's `retryable: false` verdicts **actually stop retries** (not just in the hint text)
- `C:\Users\Administrator\...` paths don't get misdiagnosed as access-denied
- Every tool the dispatcher handles is declared in `tools/list` (otherwise the agent can't see it)

### Debug tools (not tests)

- `test/_dbg-exec.js` — inspect command output/error/exitCode one by one
- `test/_dbg-perception.js` — print dual-channel details and timings
- `test/_dbg-actor.js` — manually trigger real click / type / key (excluded from automated tests)
- `test/_dbg-pw3.js` — minimal Playwright engine interaction loop

---

## File layout

```
src/
├── mcp-server/index.js      MCP server (stdio transport, 33 tools)
├── http-worker/index.js     Shared transport for the three PS workers: token auth / layered timeouts / port retries / unconditional kill
├── verifier/index.js        Execute→verify→diagnose→fix→retry (self-healing loop, retryable wired)
├── diagnoser/index.js       Error diagnoser: rule table, produces reason/hint/suggestion/fix
├── playwright/index.js      Playwright engine: persistent context, aria snapshots, aria-ref locators, name/role fallback
├── sensor/
│   ├── index.js             Node side: perception worker wrapper (listWindows/screenshot/perceive)
│   └── perception.ps1       PowerShell side: structure channel + vision channel + cross-validation + dHash
├── actor/
│   ├── index.js             Node side: actor worker wrapper (focus/click/type/key/scroll)
│   └── actor.ps1            PowerShell side: Win32 input injection + region-scoped screenshot diffing
├── memory/index.js          Memory layer: op log / feature index / context stacks
└── shell-worker/
    ├── index.js             Node side: session wrapper + auto-restart and state replay after wedges
    └── worker.ps1           PowerShell side: HttpListener + token check + execution engine
test/
├── ascii-guard.test.js      .ps1 pure-ASCII guard (encoding regression)
├── shell-worker.test.js     Shell worker unit/integration
├── resilience.test.js       Auth / wedge recovery / concurrent singleton / body cap
├── perception.test.js       Dual-channel perception
├── actor.test.js            UI actor (safe subset)
├── diagnoser.test.js        Diagnoser: classification + real self-healing integration
├── memory.test.js           Memory layer (temp storage, never touches real memory)
├── playwright.test.js       Playwright engine end-to-end (headless)
├── mcp-e2e.test.js          Full MCP protocol end-to-end
├── _dbg-*.js                Manual debug tools (not in npm test)
└── _probe-*.js              Review-period repro scripts (not in npm test)
```

---

## License

MIT — see [LICENSE](LICENSE).

TDQS

A3.5/5.0

Scored across 33 tools

Disambiguation4/5

The tool set is large but mostly split into clearly explained channels: persistent shell, window/UIA perception, CDP browser control, and memory. There is still meaningful overlap between shell_exec/shell_exec_verified/shell_cd, desktop_elements/desktop_cdp_elements, and desktop_click/desktop_click_element/desktop_cdp_click, though descriptions give guidance on when to use each.

Naming Consistency4/5

Almost all tools use snake_case with subsystem prefixes (shell_, desktop_, memory_), which makes grouping predictable. Minor deviations exist: some names are verb_noun (desktop_list_windows, shell_env_get) while others are noun-only or verb-only (shell_cwd, shell_reset, memory_timeline).

Tool Count3/5

33 tools is heavy for one server and exceeds the comfortable range, but it is spread across several genuinely distinct subsystems (shell, UIA desktop, CDP browser, memory, diagnostics). It is borderline: more than ideal, but not arbitrary bloat.

Completeness4/5

Coverage is strong for a desktop automation agent: persistent shell with env/CD, verified execution, window enumeration/perception, mouse/keyboard, UIA element interaction, full CDP lifecycle, memory recall, and diagnostics. Gaps remain for window manipulation (move/resize/close), richer mouse actions (right-click/double-click/drag), and file-level operations, but core workflows are covered.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues