dsh-windows-parallel-mcp 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.de.md +13 -1
- package/CHANGELOG.es.md +13 -1
- package/CHANGELOG.fr.md +13 -1
- package/CHANGELOG.it.md +13 -1
- package/CHANGELOG.ja.md +13 -1
- package/CHANGELOG.ko.md +13 -1
- package/CHANGELOG.md +131 -1
- package/CHANGELOG.pt.md +13 -1
- package/CHANGELOG.ru.md +13 -1
- package/CHANGELOG.zh.md +13 -1
- package/README.de.md +111 -1
- package/README.es.md +111 -1
- package/README.fr.md +111 -1
- package/README.it.md +111 -1
- package/README.ja.md +111 -1
- package/README.ko.md +111 -1
- package/README.md +111 -1
- package/README.pt.md +111 -1
- package/README.ru.md +111 -1
- package/README.zh.md +111 -1
- package/dsh.plugin.json +3 -3
- package/lib/mcp-server.mjs +350 -0
- package/package.json +12 -2
- package/server.json +110 -0
- package/src/schema/tools.json +18 -1
package/README.ja.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
> エージェントが**自分の** Windows ウィンドウを操作するための DSH プラグインです。既定では静默、要求があれば可視化します。ウィンドウがウィンドウメッセージを受け付ける場合、フォーカスは一切奪われません。UI Automation 経由でしか届かない場合、フォーカスは一度だけ有界なフラッシュで移り自動で戻ります。明示的にテイクオーバーを要求した場合、カーソルは操作点へ移動し常に復元され、HUD が三つの中断手段を提供します。それ以外はコードと理由を添えて拒否します。
|
|
6
6
|
|
|
7
7
|
> **English canonical text follows.** The localized summary above is the orientation; the text below is the authoritative specification (structure, commands and numbers are identical across all 10 languages).
|
|
8
|
-
> **Current release: 0.
|
|
8
|
+
> **Current release: 0.8.1** — this document describes the contract as of that version. What
|
|
9
9
|
> changed in it, and in every version before it, is in [CHANGELOG.md](CHANGELOG.md), newest first.
|
|
10
10
|
|
|
11
11
|
A DSH plugin that lets an agent drive **its own** Windows windows — quietly by default, and visibly
|
|
@@ -15,6 +15,11 @@ explicitly ask for the takeover tier, the cursor moves to the point and is alway
|
|
|
15
15
|
HUD that can stop it three ways. Everywhere else it refuses, with a code and a reason — never with
|
|
16
16
|
silence: every refusal carries a code from a closed set of seventeen and the next step.
|
|
17
17
|
|
|
18
|
+
**It ships in two forms over one engine, and 0.8.0 did not replace the first one.** Inside DSH it is a
|
|
19
|
+
plugin (`apply()` on the host half, PowerShell sidecar underneath). Outside it, the same package is an
|
|
20
|
+
MCP server over stdio (`bin: wpm-mcp`), whose tool list is generated from the same contract file — see
|
|
21
|
+
"The second form" below.
|
|
22
|
+
|
|
18
23
|
**The takeover tier defaults off, and that is structural.** The cursor is only ever moved because you
|
|
19
24
|
opened `takeoverAllowed` **and** asked for it on the call (`takeover:true`), so an upgrade cannot
|
|
20
25
|
start moving your cursor by itself. Keyboard injection lives inside that tier only, only when asked
|
|
@@ -368,6 +373,51 @@ failed`) rather than swallowed: a log that looks complete and is not is worse th
|
|
|
368
373
|
is missing lines. This is the only artifact that survives a call, and it is the one thing that can
|
|
369
374
|
answer "what did the agent do to this machine" after the fact.
|
|
370
375
|
|
|
376
|
+
## The second form: MCP over stdio (0.8.0)
|
|
377
|
+
|
|
378
|
+
The same plugin is also an MCP server, and it is the same code rather than a re-implementation of it.
|
|
379
|
+
`lib/mcp-server.mjs` registers the tool by calling the very `apply()` the DSH host calls, and forwards
|
|
380
|
+
`tools/call` into the same `toRequest()` / gate order / `format()` path, so the eleven actions, the
|
|
381
|
+
seventeen refusal codes, the policy ceiling and the audit line are identical in both forms. That is why
|
|
382
|
+
the engine files were not touched to add it: a second implementation of a permission is a permission
|
|
383
|
+
that can be reached around by using the other copy.
|
|
384
|
+
|
|
385
|
+
**One tool, not eleven.** `tools/list` exposes `wpm` with an `action` discriminator, generated from
|
|
386
|
+
`src/schema/tools.json` — one `oneOf` branch per action, whose `properties`, `required` and
|
|
387
|
+
`additionalProperties` are that action's declaration copied field for field. Nothing in the server
|
|
388
|
+
spells out an action name, a parameter name or a code, and `scripts/check-mcp-schema.mjs` is the reason
|
|
389
|
+
that stays true: it starts the real server, reads what a client would read, and compares it to the file.
|
|
390
|
+
Its self-test mutates both sides on purpose — four edits to the generator must turn the gate red, and two
|
|
391
|
+
edits to the *contract* (rename a parameter, flip `additionalProperties`) must stay green AND move,
|
|
392
|
+
because an arm that only breaks the generator cannot tell a generated schema from a transcribed one that
|
|
393
|
+
happens to agree today.
|
|
394
|
+
|
|
395
|
+
**Settings come from the environment, never from the call.** `WPM_POLICY`, `WPM_TAKEOVER_ALLOWED`,
|
|
396
|
+
`WPM_APP_LAUNCH_ALLOWED`, `WPM_APP_LAUNCH_ALLOW` and the rest of the `WPM_*` set are read at start-up
|
|
397
|
+
and only if present — the defaults stay in `lib/index.js`, because a second copy of a default is a
|
|
398
|
+
default that drifts. A client that could raise its own ceiling or add itself to the launch whitelist
|
|
399
|
+
would make the authorization model decorative, which is the same reason the DSH form reads settings
|
|
400
|
+
from the profile rather than from the prompt.
|
|
401
|
+
|
|
402
|
+
**A picture is attached as pixels, because a path is not portable.** The DSH form renders the screenshot
|
|
403
|
+
file it wrote; a caller on the other end of a pipe cannot open it, so `tools/call` returns the PNG as
|
|
404
|
+
base64 `image` content alongside the text. The text is never replaced by it — `screenRect`, `scale`,
|
|
405
|
+
`identity`, `frame` and `captureBackend` stay in the first block, and across the DSH bridge, where a
|
|
406
|
+
host that cannot accept image input projects the picture into a text diagnostic, those numbers still
|
|
407
|
+
arrive. `WPM_MCP_NO_IMAGE=1` opts out.
|
|
408
|
+
|
|
409
|
+
**Refusals survive the trip.** A refused call comes back with `isError` and the code as the first token
|
|
410
|
+
of the text, unsoftened. Over the DSH bridge the refusal is re-raised as an error whose message is that
|
|
411
|
+
text, so `policy_denied` still reads as `policy_denied` at the far end — asserted, not assumed, in
|
|
412
|
+
`test/mcp-bridge.mjs`, which drives the SDK and the bridge code the host actually ships.
|
|
413
|
+
|
|
414
|
+
**The transport is the only new attack surface, and it is a pipe.** JSON-RPC 2.0 over stdin/stdout with
|
|
415
|
+
Node built-ins and zero dependencies: one JSON object per line, replies keyed by `id` because the worker
|
|
416
|
+
is asynchronous, notifications answered with nothing, a non-JSON line answered with `-32700` and a null
|
|
417
|
+
`id` without killing the loop, an unknown method answered `-32601` without killing the loop, and stdin
|
|
418
|
+
closing meaning "dispose the sidecar and exit 0". Everything that is not a protocol line goes to stderr
|
|
419
|
+
— `console.log` in the plugin half would otherwise print into the JSON stream and corrupt it.
|
|
420
|
+
|
|
371
421
|
## What it does not do
|
|
372
422
|
|
|
373
423
|
- **No mouse injection.** `MOUSEEVENTF_*`, `mouse_event` and `keybd_event` are banned in every
|
|
@@ -381,6 +431,10 @@ answer "what did the agent do to this machine" after the fact.
|
|
|
381
431
|
- **No OCR / Set-of-Marks / pixel fallback.** Not part of this claim, and already done well elsewhere.
|
|
382
432
|
- **No watchdog.** The restore is one-shot and happens inline. A watchdog that keeps chasing the
|
|
383
433
|
foreground would fight you.
|
|
434
|
+
- **No HTTP, no SSE, no OAuth, no TLS.** Two forms exist and neither has a network face: in-process for
|
|
435
|
+
DSH, stdio for MCP. "No network surface" is not a hardening claim, it is the absence of one — there is
|
|
436
|
+
nothing to authenticate against, nothing to listen on, and nothing that keeps running when the caller
|
|
437
|
+
goes away.
|
|
384
438
|
- **Terminals are still refused** (`terminal_no_door`), and now for a measured reason. The 0.2.0 plan
|
|
385
439
|
was to drive one by typing into it; two probes say otherwise on this host: 242 `KEYEVENTF_UNICODE`
|
|
386
440
|
events with the terminal in the foreground and Enter sent produced nothing, and a scan-code arm
|
|
@@ -401,6 +455,29 @@ call, not at plugin load.
|
|
|
401
455
|
`engines.dsh` is an explicit two-sided range. There is no runtime version probing and no silent
|
|
402
456
|
degradation.
|
|
403
457
|
|
|
458
|
+
Since 0.8.0 the same package is also an MCP server, and nothing about the install above changes — the
|
|
459
|
+
two forms are parallel entries, not a migration:
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
# stdio, configured by the environment of whoever starts it
|
|
463
|
+
WPM_POLICY=balanced npx dsh-windows-parallel-mcp # via bin: wpm-mcp
|
|
464
|
+
# or, from a checkout
|
|
465
|
+
node lib/mcp-server.mjs
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Point any MCP client at that command; `server.json` (shipped in the tarball) is the MCP Registry
|
|
469
|
+
manifest for it, with the namespace `io.github.drscrewdriver/dsh-windows-parallel-mcp` and the npm
|
|
470
|
+
package as its ownership proof. A DSH profile can bridge it instead of loading the plugin directly
|
|
471
|
+
(`@deepseek-ai/dsh-mcp-client`, stdio transport), which registers the tool as `mcp__<serverName>__wpm`;
|
|
472
|
+
`test/mcp-bridge.mjs` drives that bridge with the host's own client SDK and tool-definition code.
|
|
473
|
+
|
|
474
|
+
**The manifest is validated, not guessed.** `server.json` is checked against the Registry's own JSON
|
|
475
|
+
Schema (2025-12-11) and `test/schema-test.mjs` keeps the limits in the gate: `description` at most 100
|
|
476
|
+
characters, `title` at most 100, a reverse-DNS `name`, one concrete version rather than a range,
|
|
477
|
+
`_meta` under 4 KB, and every environment variable declared that the server actually reads. The reason
|
|
478
|
+
those lines exist is that 0.8.0 shipped an 800-character `description` and the validator refused it: a
|
|
479
|
+
manifest a registry rejects is a form nobody can install from a listing, and 0.8.1 is that correction.
|
|
480
|
+
|
|
404
481
|
## Typed surface
|
|
405
482
|
|
|
406
483
|
`types/index.d.ts` is written by hand, not emitted from an implementation. It covers the whole
|
|
@@ -561,6 +638,33 @@ unmeasured end-to-end and is stated as such in [docs/refusals.md](docs/refusals.
|
|
|
561
638
|
unchanged whitelist file list: adding `launch`/`window` did not open a door to `MOUSEEVENTF_*`,
|
|
562
639
|
`mouse_event` or `keybd_event`.
|
|
563
640
|
|
|
641
|
+
### 0.8.0's measurements
|
|
642
|
+
|
|
643
|
+
- **A hand-written JSON-RPC loop over stdio is enough** (the 0.8.0 prerequisite probe): `initialize`,
|
|
644
|
+
`tools/list` and `tools/call` all answer, an unknown method returns `-32601` and the process survives
|
|
645
|
+
it, a notification produces no reply line, two requests in flight are matchable by id, a non-JSON line
|
|
646
|
+
does not kill the transport, and closing stdin exits 0. Fifteen assertions, zero dependencies —
|
|
647
|
+
`@modelcontextprotocol/sdk` is not needed and is not used.
|
|
648
|
+
- **The host's SDK is the stricter judge than our own harness.** `test/mcp-bridge.mjs` connects
|
|
649
|
+
`@modelcontextprotocol/client` 2.2.0 (the version the DSH install ships) to our server and validates
|
|
650
|
+
the shapes we emit. Its negotiation throws when the server answers with a protocol revision the
|
|
651
|
+
client does not list, which is why `PROTOCOL_VERSIONS` in `lib/mcp-server.mjs` is checked against that
|
|
652
|
+
SDK's constants (latest `2025-11-25`) rather than guessed from a document.
|
|
653
|
+
- **A picture the host cannot display still delivers its numbers.** Across the bridge with no attachment
|
|
654
|
+
store mounted, a `screenshot` call does not throw: the bridge projects the image block into an
|
|
655
|
+
`[image unavailable: …]` text diagnostic and the `screenRect` / `scale` / `identity` / `frame` /
|
|
656
|
+
`captureBackend` line arrives regardless. Attaching pixels by default is safe because of that
|
|
657
|
+
measurement, not in spite of it.
|
|
658
|
+
- **`tools/list` follows the contract file, in both directions.** Renaming `caretPosition` in
|
|
659
|
+
`src/schema/tools.json` changes what the running server reports, and flipping one
|
|
660
|
+
`additionalProperties` changes it too — both are gate arms (`scripts/check-mcp-schema.mjs --self-test`),
|
|
661
|
+
so the claim "generated, not copied" is exercised rather than asserted in prose.
|
|
662
|
+
- **The install artifact is what was tested.** The 0.7.0 release was smoked from the unpacked tarball
|
|
663
|
+
(`npm pack` → unpack → drive the policy ceiling, both launch gates, the clipboard length-not-payload
|
|
664
|
+
rule and the audit rows: 17 assertions) and that run found two things the working tree could not show:
|
|
665
|
+
the `clipboard` headline does not name which op ran, and the launch gate is only observable once the
|
|
666
|
+
ceiling lets the call reach it. Both are recorded rather than papered over.
|
|
667
|
+
|
|
564
668
|
## Verifying the copy you actually installed
|
|
565
669
|
|
|
566
670
|
Every test above imports the repository checkout, so a package that installs to the wrong place or ships
|
|
@@ -569,6 +673,12 @@ drives the **installed** copy: it lists a real window, runs a takeover click, as
|
|
|
569
673
|
`takeover=on cursorRestored=true abortChord=…`, and checks that the HUD is torn down afterwards. Run once
|
|
570
674
|
against the desktop profile after installing, as the last step of a release.
|
|
571
675
|
|
|
676
|
+
The stdio form has the same discipline: unpack the tarball and start `lib/mcp-server.mjs` from the
|
|
677
|
+
unpacked directory (not from the checkout). `scripts/check-mcp-schema.mjs` and `test/mcp-bridge.mjs` both
|
|
678
|
+
spawn the server by path, so pointing them at the unpacked copy is the whole procedure. The 0.7.0 tag
|
|
679
|
+
was pushed after that run; a release that skips it is asserting that the shipped bytes work by
|
|
680
|
+
showing that the source does.
|
|
681
|
+
|
|
572
682
|
## License
|
|
573
683
|
|
|
574
684
|
MIT
|
package/README.ko.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
> 에이전트가 **자신의** Windows 창을 조작하도록 하는 DSH 플러그인입니다. 기본은 조용히, 요청 시에는 눈에 보이게 동작합니다. 창이 창 메시지를 받으면 포커스를 전혀 빼앗지 않고, UI Automation으로만 도달 가능하면 포커스가 한 번의 제한된 플래시로 이동한 뒤 자동 복구됩니다. 테이크오버를 명시적으로 요청하면 커서가 동작 지점으로 이동해 항상 복원되며 HUD가 세 가지 중단 수단을 제공합니다. 그 밖의 경우에는 코드와 이유를 붙여 거부합니다.
|
|
6
6
|
|
|
7
7
|
> **English canonical text follows.** The localized summary above is the orientation; the text below is the authoritative specification (structure, commands and numbers are identical across all 10 languages).
|
|
8
|
-
> **Current release: 0.
|
|
8
|
+
> **Current release: 0.8.1** — this document describes the contract as of that version. What
|
|
9
9
|
> changed in it, and in every version before it, is in [CHANGELOG.md](CHANGELOG.md), newest first.
|
|
10
10
|
|
|
11
11
|
A DSH plugin that lets an agent drive **its own** Windows windows — quietly by default, and visibly
|
|
@@ -15,6 +15,11 @@ explicitly ask for the takeover tier, the cursor moves to the point and is alway
|
|
|
15
15
|
HUD that can stop it three ways. Everywhere else it refuses, with a code and a reason — never with
|
|
16
16
|
silence: every refusal carries a code from a closed set of seventeen and the next step.
|
|
17
17
|
|
|
18
|
+
**It ships in two forms over one engine, and 0.8.0 did not replace the first one.** Inside DSH it is a
|
|
19
|
+
plugin (`apply()` on the host half, PowerShell sidecar underneath). Outside it, the same package is an
|
|
20
|
+
MCP server over stdio (`bin: wpm-mcp`), whose tool list is generated from the same contract file — see
|
|
21
|
+
"The second form" below.
|
|
22
|
+
|
|
18
23
|
**The takeover tier defaults off, and that is structural.** The cursor is only ever moved because you
|
|
19
24
|
opened `takeoverAllowed` **and** asked for it on the call (`takeover:true`), so an upgrade cannot
|
|
20
25
|
start moving your cursor by itself. Keyboard injection lives inside that tier only, only when asked
|
|
@@ -368,6 +373,51 @@ failed`) rather than swallowed: a log that looks complete and is not is worse th
|
|
|
368
373
|
is missing lines. This is the only artifact that survives a call, and it is the one thing that can
|
|
369
374
|
answer "what did the agent do to this machine" after the fact.
|
|
370
375
|
|
|
376
|
+
## The second form: MCP over stdio (0.8.0)
|
|
377
|
+
|
|
378
|
+
The same plugin is also an MCP server, and it is the same code rather than a re-implementation of it.
|
|
379
|
+
`lib/mcp-server.mjs` registers the tool by calling the very `apply()` the DSH host calls, and forwards
|
|
380
|
+
`tools/call` into the same `toRequest()` / gate order / `format()` path, so the eleven actions, the
|
|
381
|
+
seventeen refusal codes, the policy ceiling and the audit line are identical in both forms. That is why
|
|
382
|
+
the engine files were not touched to add it: a second implementation of a permission is a permission
|
|
383
|
+
that can be reached around by using the other copy.
|
|
384
|
+
|
|
385
|
+
**One tool, not eleven.** `tools/list` exposes `wpm` with an `action` discriminator, generated from
|
|
386
|
+
`src/schema/tools.json` — one `oneOf` branch per action, whose `properties`, `required` and
|
|
387
|
+
`additionalProperties` are that action's declaration copied field for field. Nothing in the server
|
|
388
|
+
spells out an action name, a parameter name or a code, and `scripts/check-mcp-schema.mjs` is the reason
|
|
389
|
+
that stays true: it starts the real server, reads what a client would read, and compares it to the file.
|
|
390
|
+
Its self-test mutates both sides on purpose — four edits to the generator must turn the gate red, and two
|
|
391
|
+
edits to the *contract* (rename a parameter, flip `additionalProperties`) must stay green AND move,
|
|
392
|
+
because an arm that only breaks the generator cannot tell a generated schema from a transcribed one that
|
|
393
|
+
happens to agree today.
|
|
394
|
+
|
|
395
|
+
**Settings come from the environment, never from the call.** `WPM_POLICY`, `WPM_TAKEOVER_ALLOWED`,
|
|
396
|
+
`WPM_APP_LAUNCH_ALLOWED`, `WPM_APP_LAUNCH_ALLOW` and the rest of the `WPM_*` set are read at start-up
|
|
397
|
+
and only if present — the defaults stay in `lib/index.js`, because a second copy of a default is a
|
|
398
|
+
default that drifts. A client that could raise its own ceiling or add itself to the launch whitelist
|
|
399
|
+
would make the authorization model decorative, which is the same reason the DSH form reads settings
|
|
400
|
+
from the profile rather than from the prompt.
|
|
401
|
+
|
|
402
|
+
**A picture is attached as pixels, because a path is not portable.** The DSH form renders the screenshot
|
|
403
|
+
file it wrote; a caller on the other end of a pipe cannot open it, so `tools/call` returns the PNG as
|
|
404
|
+
base64 `image` content alongside the text. The text is never replaced by it — `screenRect`, `scale`,
|
|
405
|
+
`identity`, `frame` and `captureBackend` stay in the first block, and across the DSH bridge, where a
|
|
406
|
+
host that cannot accept image input projects the picture into a text diagnostic, those numbers still
|
|
407
|
+
arrive. `WPM_MCP_NO_IMAGE=1` opts out.
|
|
408
|
+
|
|
409
|
+
**Refusals survive the trip.** A refused call comes back with `isError` and the code as the first token
|
|
410
|
+
of the text, unsoftened. Over the DSH bridge the refusal is re-raised as an error whose message is that
|
|
411
|
+
text, so `policy_denied` still reads as `policy_denied` at the far end — asserted, not assumed, in
|
|
412
|
+
`test/mcp-bridge.mjs`, which drives the SDK and the bridge code the host actually ships.
|
|
413
|
+
|
|
414
|
+
**The transport is the only new attack surface, and it is a pipe.** JSON-RPC 2.0 over stdin/stdout with
|
|
415
|
+
Node built-ins and zero dependencies: one JSON object per line, replies keyed by `id` because the worker
|
|
416
|
+
is asynchronous, notifications answered with nothing, a non-JSON line answered with `-32700` and a null
|
|
417
|
+
`id` without killing the loop, an unknown method answered `-32601` without killing the loop, and stdin
|
|
418
|
+
closing meaning "dispose the sidecar and exit 0". Everything that is not a protocol line goes to stderr
|
|
419
|
+
— `console.log` in the plugin half would otherwise print into the JSON stream and corrupt it.
|
|
420
|
+
|
|
371
421
|
## What it does not do
|
|
372
422
|
|
|
373
423
|
- **No mouse injection.** `MOUSEEVENTF_*`, `mouse_event` and `keybd_event` are banned in every
|
|
@@ -381,6 +431,10 @@ answer "what did the agent do to this machine" after the fact.
|
|
|
381
431
|
- **No OCR / Set-of-Marks / pixel fallback.** Not part of this claim, and already done well elsewhere.
|
|
382
432
|
- **No watchdog.** The restore is one-shot and happens inline. A watchdog that keeps chasing the
|
|
383
433
|
foreground would fight you.
|
|
434
|
+
- **No HTTP, no SSE, no OAuth, no TLS.** Two forms exist and neither has a network face: in-process for
|
|
435
|
+
DSH, stdio for MCP. "No network surface" is not a hardening claim, it is the absence of one — there is
|
|
436
|
+
nothing to authenticate against, nothing to listen on, and nothing that keeps running when the caller
|
|
437
|
+
goes away.
|
|
384
438
|
- **Terminals are still refused** (`terminal_no_door`), and now for a measured reason. The 0.2.0 plan
|
|
385
439
|
was to drive one by typing into it; two probes say otherwise on this host: 242 `KEYEVENTF_UNICODE`
|
|
386
440
|
events with the terminal in the foreground and Enter sent produced nothing, and a scan-code arm
|
|
@@ -401,6 +455,29 @@ call, not at plugin load.
|
|
|
401
455
|
`engines.dsh` is an explicit two-sided range. There is no runtime version probing and no silent
|
|
402
456
|
degradation.
|
|
403
457
|
|
|
458
|
+
Since 0.8.0 the same package is also an MCP server, and nothing about the install above changes — the
|
|
459
|
+
two forms are parallel entries, not a migration:
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
# stdio, configured by the environment of whoever starts it
|
|
463
|
+
WPM_POLICY=balanced npx dsh-windows-parallel-mcp # via bin: wpm-mcp
|
|
464
|
+
# or, from a checkout
|
|
465
|
+
node lib/mcp-server.mjs
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Point any MCP client at that command; `server.json` (shipped in the tarball) is the MCP Registry
|
|
469
|
+
manifest for it, with the namespace `io.github.drscrewdriver/dsh-windows-parallel-mcp` and the npm
|
|
470
|
+
package as its ownership proof. A DSH profile can bridge it instead of loading the plugin directly
|
|
471
|
+
(`@deepseek-ai/dsh-mcp-client`, stdio transport), which registers the tool as `mcp__<serverName>__wpm`;
|
|
472
|
+
`test/mcp-bridge.mjs` drives that bridge with the host's own client SDK and tool-definition code.
|
|
473
|
+
|
|
474
|
+
**The manifest is validated, not guessed.** `server.json` is checked against the Registry's own JSON
|
|
475
|
+
Schema (2025-12-11) and `test/schema-test.mjs` keeps the limits in the gate: `description` at most 100
|
|
476
|
+
characters, `title` at most 100, a reverse-DNS `name`, one concrete version rather than a range,
|
|
477
|
+
`_meta` under 4 KB, and every environment variable declared that the server actually reads. The reason
|
|
478
|
+
those lines exist is that 0.8.0 shipped an 800-character `description` and the validator refused it: a
|
|
479
|
+
manifest a registry rejects is a form nobody can install from a listing, and 0.8.1 is that correction.
|
|
480
|
+
|
|
404
481
|
## Typed surface
|
|
405
482
|
|
|
406
483
|
`types/index.d.ts` is written by hand, not emitted from an implementation. It covers the whole
|
|
@@ -561,6 +638,33 @@ unmeasured end-to-end and is stated as such in [docs/refusals.md](docs/refusals.
|
|
|
561
638
|
unchanged whitelist file list: adding `launch`/`window` did not open a door to `MOUSEEVENTF_*`,
|
|
562
639
|
`mouse_event` or `keybd_event`.
|
|
563
640
|
|
|
641
|
+
### 0.8.0's measurements
|
|
642
|
+
|
|
643
|
+
- **A hand-written JSON-RPC loop over stdio is enough** (the 0.8.0 prerequisite probe): `initialize`,
|
|
644
|
+
`tools/list` and `tools/call` all answer, an unknown method returns `-32601` and the process survives
|
|
645
|
+
it, a notification produces no reply line, two requests in flight are matchable by id, a non-JSON line
|
|
646
|
+
does not kill the transport, and closing stdin exits 0. Fifteen assertions, zero dependencies —
|
|
647
|
+
`@modelcontextprotocol/sdk` is not needed and is not used.
|
|
648
|
+
- **The host's SDK is the stricter judge than our own harness.** `test/mcp-bridge.mjs` connects
|
|
649
|
+
`@modelcontextprotocol/client` 2.2.0 (the version the DSH install ships) to our server and validates
|
|
650
|
+
the shapes we emit. Its negotiation throws when the server answers with a protocol revision the
|
|
651
|
+
client does not list, which is why `PROTOCOL_VERSIONS` in `lib/mcp-server.mjs` is checked against that
|
|
652
|
+
SDK's constants (latest `2025-11-25`) rather than guessed from a document.
|
|
653
|
+
- **A picture the host cannot display still delivers its numbers.** Across the bridge with no attachment
|
|
654
|
+
store mounted, a `screenshot` call does not throw: the bridge projects the image block into an
|
|
655
|
+
`[image unavailable: …]` text diagnostic and the `screenRect` / `scale` / `identity` / `frame` /
|
|
656
|
+
`captureBackend` line arrives regardless. Attaching pixels by default is safe because of that
|
|
657
|
+
measurement, not in spite of it.
|
|
658
|
+
- **`tools/list` follows the contract file, in both directions.** Renaming `caretPosition` in
|
|
659
|
+
`src/schema/tools.json` changes what the running server reports, and flipping one
|
|
660
|
+
`additionalProperties` changes it too — both are gate arms (`scripts/check-mcp-schema.mjs --self-test`),
|
|
661
|
+
so the claim "generated, not copied" is exercised rather than asserted in prose.
|
|
662
|
+
- **The install artifact is what was tested.** The 0.7.0 release was smoked from the unpacked tarball
|
|
663
|
+
(`npm pack` → unpack → drive the policy ceiling, both launch gates, the clipboard length-not-payload
|
|
664
|
+
rule and the audit rows: 17 assertions) and that run found two things the working tree could not show:
|
|
665
|
+
the `clipboard` headline does not name which op ran, and the launch gate is only observable once the
|
|
666
|
+
ceiling lets the call reach it. Both are recorded rather than papered over.
|
|
667
|
+
|
|
564
668
|
## Verifying the copy you actually installed
|
|
565
669
|
|
|
566
670
|
Every test above imports the repository checkout, so a package that installs to the wrong place or ships
|
|
@@ -569,6 +673,12 @@ drives the **installed** copy: it lists a real window, runs a takeover click, as
|
|
|
569
673
|
`takeover=on cursorRestored=true abortChord=…`, and checks that the HUD is torn down afterwards. Run once
|
|
570
674
|
against the desktop profile after installing, as the last step of a release.
|
|
571
675
|
|
|
676
|
+
The stdio form has the same discipline: unpack the tarball and start `lib/mcp-server.mjs` from the
|
|
677
|
+
unpacked directory (not from the checkout). `scripts/check-mcp-schema.mjs` and `test/mcp-bridge.mjs` both
|
|
678
|
+
spawn the server by path, so pointing them at the unpacked copy is the whole procedure. The 0.7.0 tag
|
|
679
|
+
was pushed after that run; a release that skips it is asserting that the shipped bytes work by
|
|
680
|
+
showing that the source does.
|
|
681
|
+
|
|
572
682
|
## License
|
|
573
683
|
|
|
574
684
|
MIT
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# dsh-windows-parallel-mcp
|
|
2
2
|
|
|
3
3
|
**English** · [中文](README.zh.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [Italiano](README.it.md) · [Español](README.es.md) · [Português](README.pt.md) · [Русский](README.ru.md)
|
|
4
|
-
> **Current release: 0.
|
|
4
|
+
> **Current release: 0.8.1** — this document describes the contract as of that version. What
|
|
5
5
|
> changed in it, and in every version before it, is in [CHANGELOG.md](CHANGELOG.md), newest first.
|
|
6
6
|
|
|
7
7
|
A DSH plugin that lets an agent drive **its own** Windows windows — quietly by default, and visibly
|
|
@@ -11,6 +11,11 @@ explicitly ask for the takeover tier, the cursor moves to the point and is alway
|
|
|
11
11
|
HUD that can stop it three ways. Everywhere else it refuses, with a code and a reason — never with
|
|
12
12
|
silence: every refusal carries a code from a closed set of seventeen and the next step.
|
|
13
13
|
|
|
14
|
+
**It ships in two forms over one engine, and 0.8.0 did not replace the first one.** Inside DSH it is a
|
|
15
|
+
plugin (`apply()` on the host half, PowerShell sidecar underneath). Outside it, the same package is an
|
|
16
|
+
MCP server over stdio (`bin: wpm-mcp`), whose tool list is generated from the same contract file — see
|
|
17
|
+
"The second form" below.
|
|
18
|
+
|
|
14
19
|
**The takeover tier defaults off, and that is structural.** The cursor is only ever moved because you
|
|
15
20
|
opened `takeoverAllowed` **and** asked for it on the call (`takeover:true`), so an upgrade cannot
|
|
16
21
|
start moving your cursor by itself. Keyboard injection lives inside that tier only, only when asked
|
|
@@ -364,6 +369,51 @@ failed`) rather than swallowed: a log that looks complete and is not is worse th
|
|
|
364
369
|
is missing lines. This is the only artifact that survives a call, and it is the one thing that can
|
|
365
370
|
answer "what did the agent do to this machine" after the fact.
|
|
366
371
|
|
|
372
|
+
## The second form: MCP over stdio (0.8.0)
|
|
373
|
+
|
|
374
|
+
The same plugin is also an MCP server, and it is the same code rather than a re-implementation of it.
|
|
375
|
+
`lib/mcp-server.mjs` registers the tool by calling the very `apply()` the DSH host calls, and forwards
|
|
376
|
+
`tools/call` into the same `toRequest()` / gate order / `format()` path, so the eleven actions, the
|
|
377
|
+
seventeen refusal codes, the policy ceiling and the audit line are identical in both forms. That is why
|
|
378
|
+
the engine files were not touched to add it: a second implementation of a permission is a permission
|
|
379
|
+
that can be reached around by using the other copy.
|
|
380
|
+
|
|
381
|
+
**One tool, not eleven.** `tools/list` exposes `wpm` with an `action` discriminator, generated from
|
|
382
|
+
`src/schema/tools.json` — one `oneOf` branch per action, whose `properties`, `required` and
|
|
383
|
+
`additionalProperties` are that action's declaration copied field for field. Nothing in the server
|
|
384
|
+
spells out an action name, a parameter name or a code, and `scripts/check-mcp-schema.mjs` is the reason
|
|
385
|
+
that stays true: it starts the real server, reads what a client would read, and compares it to the file.
|
|
386
|
+
Its self-test mutates both sides on purpose — four edits to the generator must turn the gate red, and two
|
|
387
|
+
edits to the *contract* (rename a parameter, flip `additionalProperties`) must stay green AND move,
|
|
388
|
+
because an arm that only breaks the generator cannot tell a generated schema from a transcribed one that
|
|
389
|
+
happens to agree today.
|
|
390
|
+
|
|
391
|
+
**Settings come from the environment, never from the call.** `WPM_POLICY`, `WPM_TAKEOVER_ALLOWED`,
|
|
392
|
+
`WPM_APP_LAUNCH_ALLOWED`, `WPM_APP_LAUNCH_ALLOW` and the rest of the `WPM_*` set are read at start-up
|
|
393
|
+
and only if present — the defaults stay in `lib/index.js`, because a second copy of a default is a
|
|
394
|
+
default that drifts. A client that could raise its own ceiling or add itself to the launch whitelist
|
|
395
|
+
would make the authorization model decorative, which is the same reason the DSH form reads settings
|
|
396
|
+
from the profile rather than from the prompt.
|
|
397
|
+
|
|
398
|
+
**A picture is attached as pixels, because a path is not portable.** The DSH form renders the screenshot
|
|
399
|
+
file it wrote; a caller on the other end of a pipe cannot open it, so `tools/call` returns the PNG as
|
|
400
|
+
base64 `image` content alongside the text. The text is never replaced by it — `screenRect`, `scale`,
|
|
401
|
+
`identity`, `frame` and `captureBackend` stay in the first block, and across the DSH bridge, where a
|
|
402
|
+
host that cannot accept image input projects the picture into a text diagnostic, those numbers still
|
|
403
|
+
arrive. `WPM_MCP_NO_IMAGE=1` opts out.
|
|
404
|
+
|
|
405
|
+
**Refusals survive the trip.** A refused call comes back with `isError` and the code as the first token
|
|
406
|
+
of the text, unsoftened. Over the DSH bridge the refusal is re-raised as an error whose message is that
|
|
407
|
+
text, so `policy_denied` still reads as `policy_denied` at the far end — asserted, not assumed, in
|
|
408
|
+
`test/mcp-bridge.mjs`, which drives the SDK and the bridge code the host actually ships.
|
|
409
|
+
|
|
410
|
+
**The transport is the only new attack surface, and it is a pipe.** JSON-RPC 2.0 over stdin/stdout with
|
|
411
|
+
Node built-ins and zero dependencies: one JSON object per line, replies keyed by `id` because the worker
|
|
412
|
+
is asynchronous, notifications answered with nothing, a non-JSON line answered with `-32700` and a null
|
|
413
|
+
`id` without killing the loop, an unknown method answered `-32601` without killing the loop, and stdin
|
|
414
|
+
closing meaning "dispose the sidecar and exit 0". Everything that is not a protocol line goes to stderr
|
|
415
|
+
— `console.log` in the plugin half would otherwise print into the JSON stream and corrupt it.
|
|
416
|
+
|
|
367
417
|
## What it does not do
|
|
368
418
|
|
|
369
419
|
- **No mouse injection.** `MOUSEEVENTF_*`, `mouse_event` and `keybd_event` are banned in every
|
|
@@ -377,6 +427,10 @@ answer "what did the agent do to this machine" after the fact.
|
|
|
377
427
|
- **No OCR / Set-of-Marks / pixel fallback.** Not part of this claim, and already done well elsewhere.
|
|
378
428
|
- **No watchdog.** The restore is one-shot and happens inline. A watchdog that keeps chasing the
|
|
379
429
|
foreground would fight you.
|
|
430
|
+
- **No HTTP, no SSE, no OAuth, no TLS.** Two forms exist and neither has a network face: in-process for
|
|
431
|
+
DSH, stdio for MCP. "No network surface" is not a hardening claim, it is the absence of one — there is
|
|
432
|
+
nothing to authenticate against, nothing to listen on, and nothing that keeps running when the caller
|
|
433
|
+
goes away.
|
|
380
434
|
- **Terminals are still refused** (`terminal_no_door`), and now for a measured reason. The 0.2.0 plan
|
|
381
435
|
was to drive one by typing into it; two probes say otherwise on this host: 242 `KEYEVENTF_UNICODE`
|
|
382
436
|
events with the terminal in the foreground and Enter sent produced nothing, and a scan-code arm
|
|
@@ -397,6 +451,29 @@ call, not at plugin load.
|
|
|
397
451
|
`engines.dsh` is an explicit two-sided range. There is no runtime version probing and no silent
|
|
398
452
|
degradation.
|
|
399
453
|
|
|
454
|
+
Since 0.8.0 the same package is also an MCP server, and nothing about the install above changes — the
|
|
455
|
+
two forms are parallel entries, not a migration:
|
|
456
|
+
|
|
457
|
+
```bash
|
|
458
|
+
# stdio, configured by the environment of whoever starts it
|
|
459
|
+
WPM_POLICY=balanced npx dsh-windows-parallel-mcp # via bin: wpm-mcp
|
|
460
|
+
# or, from a checkout
|
|
461
|
+
node lib/mcp-server.mjs
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
Point any MCP client at that command; `server.json` (shipped in the tarball) is the MCP Registry
|
|
465
|
+
manifest for it, with the namespace `io.github.drscrewdriver/dsh-windows-parallel-mcp` and the npm
|
|
466
|
+
package as its ownership proof. A DSH profile can bridge it instead of loading the plugin directly
|
|
467
|
+
(`@deepseek-ai/dsh-mcp-client`, stdio transport), which registers the tool as `mcp__<serverName>__wpm`;
|
|
468
|
+
`test/mcp-bridge.mjs` drives that bridge with the host's own client SDK and tool-definition code.
|
|
469
|
+
|
|
470
|
+
**The manifest is validated, not guessed.** `server.json` is checked against the Registry's own JSON
|
|
471
|
+
Schema (2025-12-11) and `test/schema-test.mjs` keeps the limits in the gate: `description` at most 100
|
|
472
|
+
characters, `title` at most 100, a reverse-DNS `name`, one concrete version rather than a range,
|
|
473
|
+
`_meta` under 4 KB, and every environment variable declared that the server actually reads. The reason
|
|
474
|
+
those lines exist is that 0.8.0 shipped an 800-character `description` and the validator refused it: a
|
|
475
|
+
manifest a registry rejects is a form nobody can install from a listing, and 0.8.1 is that correction.
|
|
476
|
+
|
|
400
477
|
## Typed surface
|
|
401
478
|
|
|
402
479
|
`types/index.d.ts` is written by hand, not emitted from an implementation. It covers the whole
|
|
@@ -557,6 +634,33 @@ unmeasured end-to-end and is stated as such in [docs/refusals.md](docs/refusals.
|
|
|
557
634
|
unchanged whitelist file list: adding `launch`/`window` did not open a door to `MOUSEEVENTF_*`,
|
|
558
635
|
`mouse_event` or `keybd_event`.
|
|
559
636
|
|
|
637
|
+
### 0.8.0's measurements
|
|
638
|
+
|
|
639
|
+
- **A hand-written JSON-RPC loop over stdio is enough** (the 0.8.0 prerequisite probe): `initialize`,
|
|
640
|
+
`tools/list` and `tools/call` all answer, an unknown method returns `-32601` and the process survives
|
|
641
|
+
it, a notification produces no reply line, two requests in flight are matchable by id, a non-JSON line
|
|
642
|
+
does not kill the transport, and closing stdin exits 0. Fifteen assertions, zero dependencies —
|
|
643
|
+
`@modelcontextprotocol/sdk` is not needed and is not used.
|
|
644
|
+
- **The host's SDK is the stricter judge than our own harness.** `test/mcp-bridge.mjs` connects
|
|
645
|
+
`@modelcontextprotocol/client` 2.2.0 (the version the DSH install ships) to our server and validates
|
|
646
|
+
the shapes we emit. Its negotiation throws when the server answers with a protocol revision the
|
|
647
|
+
client does not list, which is why `PROTOCOL_VERSIONS` in `lib/mcp-server.mjs` is checked against that
|
|
648
|
+
SDK's constants (latest `2025-11-25`) rather than guessed from a document.
|
|
649
|
+
- **A picture the host cannot display still delivers its numbers.** Across the bridge with no attachment
|
|
650
|
+
store mounted, a `screenshot` call does not throw: the bridge projects the image block into an
|
|
651
|
+
`[image unavailable: …]` text diagnostic and the `screenRect` / `scale` / `identity` / `frame` /
|
|
652
|
+
`captureBackend` line arrives regardless. Attaching pixels by default is safe because of that
|
|
653
|
+
measurement, not in spite of it.
|
|
654
|
+
- **`tools/list` follows the contract file, in both directions.** Renaming `caretPosition` in
|
|
655
|
+
`src/schema/tools.json` changes what the running server reports, and flipping one
|
|
656
|
+
`additionalProperties` changes it too — both are gate arms (`scripts/check-mcp-schema.mjs --self-test`),
|
|
657
|
+
so the claim "generated, not copied" is exercised rather than asserted in prose.
|
|
658
|
+
- **The install artifact is what was tested.** The 0.7.0 release was smoked from the unpacked tarball
|
|
659
|
+
(`npm pack` → unpack → drive the policy ceiling, both launch gates, the clipboard length-not-payload
|
|
660
|
+
rule and the audit rows: 17 assertions) and that run found two things the working tree could not show:
|
|
661
|
+
the `clipboard` headline does not name which op ran, and the launch gate is only observable once the
|
|
662
|
+
ceiling lets the call reach it. Both are recorded rather than papered over.
|
|
663
|
+
|
|
560
664
|
## Verifying the copy you actually installed
|
|
561
665
|
|
|
562
666
|
Every test above imports the repository checkout, so a package that installs to the wrong place or ships
|
|
@@ -565,6 +669,12 @@ drives the **installed** copy: it lists a real window, runs a takeover click, as
|
|
|
565
669
|
`takeover=on cursorRestored=true abortChord=…`, and checks that the HUD is torn down afterwards. Run once
|
|
566
670
|
against the desktop profile after installing, as the last step of a release.
|
|
567
671
|
|
|
672
|
+
The stdio form has the same discipline: unpack the tarball and start `lib/mcp-server.mjs` from the
|
|
673
|
+
unpacked directory (not from the checkout). `scripts/check-mcp-schema.mjs` and `test/mcp-bridge.mjs` both
|
|
674
|
+
spawn the server by path, so pointing them at the unpacked copy is the whole procedure. The 0.7.0 tag
|
|
675
|
+
was pushed after that run; a release that skips it is asserting that the shipped bytes work by
|
|
676
|
+
showing that the source does.
|
|
677
|
+
|
|
568
678
|
## License
|
|
569
679
|
|
|
570
680
|
MIT
|
package/README.pt.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
> Um plugin DSH que permite a um agente controlar **as suas próprias** janelas Windows — silencioso por padrão, visível sob demanda. Quando uma janela aceita mensagens do Windows, o foco nunca é roubado. Quando apenas a Automação de UI a alcança, o foco sofre um único lampejo limitado, revertido automaticamente. Quando você solicita explicitamente o modo takeover, o cursor move-se para o ponto de ação e é sempre restaurado, com um HUD que oferece três formas de interrupção. Em todos os outros casos, recusa com um código e um motivo.
|
|
6
6
|
|
|
7
7
|
> **English canonical text follows.** The localized summary above is the orientation; the text below is the authoritative specification (structure, commands and numbers are identical across all 10 languages).
|
|
8
|
-
> **Current release: 0.
|
|
8
|
+
> **Current release: 0.8.1** — this document describes the contract as of that version. What
|
|
9
9
|
> changed in it, and in every version before it, is in [CHANGELOG.md](CHANGELOG.md), newest first.
|
|
10
10
|
|
|
11
11
|
A DSH plugin that lets an agent drive **its own** Windows windows — quietly by default, and visibly
|
|
@@ -15,6 +15,11 @@ explicitly ask for the takeover tier, the cursor moves to the point and is alway
|
|
|
15
15
|
HUD that can stop it three ways. Everywhere else it refuses, with a code and a reason — never with
|
|
16
16
|
silence: every refusal carries a code from a closed set of seventeen and the next step.
|
|
17
17
|
|
|
18
|
+
**It ships in two forms over one engine, and 0.8.0 did not replace the first one.** Inside DSH it is a
|
|
19
|
+
plugin (`apply()` on the host half, PowerShell sidecar underneath). Outside it, the same package is an
|
|
20
|
+
MCP server over stdio (`bin: wpm-mcp`), whose tool list is generated from the same contract file — see
|
|
21
|
+
"The second form" below.
|
|
22
|
+
|
|
18
23
|
**The takeover tier defaults off, and that is structural.** The cursor is only ever moved because you
|
|
19
24
|
opened `takeoverAllowed` **and** asked for it on the call (`takeover:true`), so an upgrade cannot
|
|
20
25
|
start moving your cursor by itself. Keyboard injection lives inside that tier only, only when asked
|
|
@@ -368,6 +373,51 @@ failed`) rather than swallowed: a log that looks complete and is not is worse th
|
|
|
368
373
|
is missing lines. This is the only artifact that survives a call, and it is the one thing that can
|
|
369
374
|
answer "what did the agent do to this machine" after the fact.
|
|
370
375
|
|
|
376
|
+
## The second form: MCP over stdio (0.8.0)
|
|
377
|
+
|
|
378
|
+
The same plugin is also an MCP server, and it is the same code rather than a re-implementation of it.
|
|
379
|
+
`lib/mcp-server.mjs` registers the tool by calling the very `apply()` the DSH host calls, and forwards
|
|
380
|
+
`tools/call` into the same `toRequest()` / gate order / `format()` path, so the eleven actions, the
|
|
381
|
+
seventeen refusal codes, the policy ceiling and the audit line are identical in both forms. That is why
|
|
382
|
+
the engine files were not touched to add it: a second implementation of a permission is a permission
|
|
383
|
+
that can be reached around by using the other copy.
|
|
384
|
+
|
|
385
|
+
**One tool, not eleven.** `tools/list` exposes `wpm` with an `action` discriminator, generated from
|
|
386
|
+
`src/schema/tools.json` — one `oneOf` branch per action, whose `properties`, `required` and
|
|
387
|
+
`additionalProperties` are that action's declaration copied field for field. Nothing in the server
|
|
388
|
+
spells out an action name, a parameter name or a code, and `scripts/check-mcp-schema.mjs` is the reason
|
|
389
|
+
that stays true: it starts the real server, reads what a client would read, and compares it to the file.
|
|
390
|
+
Its self-test mutates both sides on purpose — four edits to the generator must turn the gate red, and two
|
|
391
|
+
edits to the *contract* (rename a parameter, flip `additionalProperties`) must stay green AND move,
|
|
392
|
+
because an arm that only breaks the generator cannot tell a generated schema from a transcribed one that
|
|
393
|
+
happens to agree today.
|
|
394
|
+
|
|
395
|
+
**Settings come from the environment, never from the call.** `WPM_POLICY`, `WPM_TAKEOVER_ALLOWED`,
|
|
396
|
+
`WPM_APP_LAUNCH_ALLOWED`, `WPM_APP_LAUNCH_ALLOW` and the rest of the `WPM_*` set are read at start-up
|
|
397
|
+
and only if present — the defaults stay in `lib/index.js`, because a second copy of a default is a
|
|
398
|
+
default that drifts. A client that could raise its own ceiling or add itself to the launch whitelist
|
|
399
|
+
would make the authorization model decorative, which is the same reason the DSH form reads settings
|
|
400
|
+
from the profile rather than from the prompt.
|
|
401
|
+
|
|
402
|
+
**A picture is attached as pixels, because a path is not portable.** The DSH form renders the screenshot
|
|
403
|
+
file it wrote; a caller on the other end of a pipe cannot open it, so `tools/call` returns the PNG as
|
|
404
|
+
base64 `image` content alongside the text. The text is never replaced by it — `screenRect`, `scale`,
|
|
405
|
+
`identity`, `frame` and `captureBackend` stay in the first block, and across the DSH bridge, where a
|
|
406
|
+
host that cannot accept image input projects the picture into a text diagnostic, those numbers still
|
|
407
|
+
arrive. `WPM_MCP_NO_IMAGE=1` opts out.
|
|
408
|
+
|
|
409
|
+
**Refusals survive the trip.** A refused call comes back with `isError` and the code as the first token
|
|
410
|
+
of the text, unsoftened. Over the DSH bridge the refusal is re-raised as an error whose message is that
|
|
411
|
+
text, so `policy_denied` still reads as `policy_denied` at the far end — asserted, not assumed, in
|
|
412
|
+
`test/mcp-bridge.mjs`, which drives the SDK and the bridge code the host actually ships.
|
|
413
|
+
|
|
414
|
+
**The transport is the only new attack surface, and it is a pipe.** JSON-RPC 2.0 over stdin/stdout with
|
|
415
|
+
Node built-ins and zero dependencies: one JSON object per line, replies keyed by `id` because the worker
|
|
416
|
+
is asynchronous, notifications answered with nothing, a non-JSON line answered with `-32700` and a null
|
|
417
|
+
`id` without killing the loop, an unknown method answered `-32601` without killing the loop, and stdin
|
|
418
|
+
closing meaning "dispose the sidecar and exit 0". Everything that is not a protocol line goes to stderr
|
|
419
|
+
— `console.log` in the plugin half would otherwise print into the JSON stream and corrupt it.
|
|
420
|
+
|
|
371
421
|
## What it does not do
|
|
372
422
|
|
|
373
423
|
- **No mouse injection.** `MOUSEEVENTF_*`, `mouse_event` and `keybd_event` are banned in every
|
|
@@ -381,6 +431,10 @@ answer "what did the agent do to this machine" after the fact.
|
|
|
381
431
|
- **No OCR / Set-of-Marks / pixel fallback.** Not part of this claim, and already done well elsewhere.
|
|
382
432
|
- **No watchdog.** The restore is one-shot and happens inline. A watchdog that keeps chasing the
|
|
383
433
|
foreground would fight you.
|
|
434
|
+
- **No HTTP, no SSE, no OAuth, no TLS.** Two forms exist and neither has a network face: in-process for
|
|
435
|
+
DSH, stdio for MCP. "No network surface" is not a hardening claim, it is the absence of one — there is
|
|
436
|
+
nothing to authenticate against, nothing to listen on, and nothing that keeps running when the caller
|
|
437
|
+
goes away.
|
|
384
438
|
- **Terminals are still refused** (`terminal_no_door`), and now for a measured reason. The 0.2.0 plan
|
|
385
439
|
was to drive one by typing into it; two probes say otherwise on this host: 242 `KEYEVENTF_UNICODE`
|
|
386
440
|
events with the terminal in the foreground and Enter sent produced nothing, and a scan-code arm
|
|
@@ -401,6 +455,29 @@ call, not at plugin load.
|
|
|
401
455
|
`engines.dsh` is an explicit two-sided range. There is no runtime version probing and no silent
|
|
402
456
|
degradation.
|
|
403
457
|
|
|
458
|
+
Since 0.8.0 the same package is also an MCP server, and nothing about the install above changes — the
|
|
459
|
+
two forms are parallel entries, not a migration:
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
# stdio, configured by the environment of whoever starts it
|
|
463
|
+
WPM_POLICY=balanced npx dsh-windows-parallel-mcp # via bin: wpm-mcp
|
|
464
|
+
# or, from a checkout
|
|
465
|
+
node lib/mcp-server.mjs
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Point any MCP client at that command; `server.json` (shipped in the tarball) is the MCP Registry
|
|
469
|
+
manifest for it, with the namespace `io.github.drscrewdriver/dsh-windows-parallel-mcp` and the npm
|
|
470
|
+
package as its ownership proof. A DSH profile can bridge it instead of loading the plugin directly
|
|
471
|
+
(`@deepseek-ai/dsh-mcp-client`, stdio transport), which registers the tool as `mcp__<serverName>__wpm`;
|
|
472
|
+
`test/mcp-bridge.mjs` drives that bridge with the host's own client SDK and tool-definition code.
|
|
473
|
+
|
|
474
|
+
**The manifest is validated, not guessed.** `server.json` is checked against the Registry's own JSON
|
|
475
|
+
Schema (2025-12-11) and `test/schema-test.mjs` keeps the limits in the gate: `description` at most 100
|
|
476
|
+
characters, `title` at most 100, a reverse-DNS `name`, one concrete version rather than a range,
|
|
477
|
+
`_meta` under 4 KB, and every environment variable declared that the server actually reads. The reason
|
|
478
|
+
those lines exist is that 0.8.0 shipped an 800-character `description` and the validator refused it: a
|
|
479
|
+
manifest a registry rejects is a form nobody can install from a listing, and 0.8.1 is that correction.
|
|
480
|
+
|
|
404
481
|
## Typed surface
|
|
405
482
|
|
|
406
483
|
`types/index.d.ts` is written by hand, not emitted from an implementation. It covers the whole
|
|
@@ -561,6 +638,33 @@ unmeasured end-to-end and is stated as such in [docs/refusals.md](docs/refusals.
|
|
|
561
638
|
unchanged whitelist file list: adding `launch`/`window` did not open a door to `MOUSEEVENTF_*`,
|
|
562
639
|
`mouse_event` or `keybd_event`.
|
|
563
640
|
|
|
641
|
+
### 0.8.0's measurements
|
|
642
|
+
|
|
643
|
+
- **A hand-written JSON-RPC loop over stdio is enough** (the 0.8.0 prerequisite probe): `initialize`,
|
|
644
|
+
`tools/list` and `tools/call` all answer, an unknown method returns `-32601` and the process survives
|
|
645
|
+
it, a notification produces no reply line, two requests in flight are matchable by id, a non-JSON line
|
|
646
|
+
does not kill the transport, and closing stdin exits 0. Fifteen assertions, zero dependencies —
|
|
647
|
+
`@modelcontextprotocol/sdk` is not needed and is not used.
|
|
648
|
+
- **The host's SDK is the stricter judge than our own harness.** `test/mcp-bridge.mjs` connects
|
|
649
|
+
`@modelcontextprotocol/client` 2.2.0 (the version the DSH install ships) to our server and validates
|
|
650
|
+
the shapes we emit. Its negotiation throws when the server answers with a protocol revision the
|
|
651
|
+
client does not list, which is why `PROTOCOL_VERSIONS` in `lib/mcp-server.mjs` is checked against that
|
|
652
|
+
SDK's constants (latest `2025-11-25`) rather than guessed from a document.
|
|
653
|
+
- **A picture the host cannot display still delivers its numbers.** Across the bridge with no attachment
|
|
654
|
+
store mounted, a `screenshot` call does not throw: the bridge projects the image block into an
|
|
655
|
+
`[image unavailable: …]` text diagnostic and the `screenRect` / `scale` / `identity` / `frame` /
|
|
656
|
+
`captureBackend` line arrives regardless. Attaching pixels by default is safe because of that
|
|
657
|
+
measurement, not in spite of it.
|
|
658
|
+
- **`tools/list` follows the contract file, in both directions.** Renaming `caretPosition` in
|
|
659
|
+
`src/schema/tools.json` changes what the running server reports, and flipping one
|
|
660
|
+
`additionalProperties` changes it too — both are gate arms (`scripts/check-mcp-schema.mjs --self-test`),
|
|
661
|
+
so the claim "generated, not copied" is exercised rather than asserted in prose.
|
|
662
|
+
- **The install artifact is what was tested.** The 0.7.0 release was smoked from the unpacked tarball
|
|
663
|
+
(`npm pack` → unpack → drive the policy ceiling, both launch gates, the clipboard length-not-payload
|
|
664
|
+
rule and the audit rows: 17 assertions) and that run found two things the working tree could not show:
|
|
665
|
+
the `clipboard` headline does not name which op ran, and the launch gate is only observable once the
|
|
666
|
+
ceiling lets the call reach it. Both are recorded rather than papered over.
|
|
667
|
+
|
|
564
668
|
## Verifying the copy you actually installed
|
|
565
669
|
|
|
566
670
|
Every test above imports the repository checkout, so a package that installs to the wrong place or ships
|
|
@@ -569,6 +673,12 @@ drives the **installed** copy: it lists a real window, runs a takeover click, as
|
|
|
569
673
|
`takeover=on cursorRestored=true abortChord=…`, and checks that the HUD is torn down afterwards. Run once
|
|
570
674
|
against the desktop profile after installing, as the last step of a release.
|
|
571
675
|
|
|
676
|
+
The stdio form has the same discipline: unpack the tarball and start `lib/mcp-server.mjs` from the
|
|
677
|
+
unpacked directory (not from the checkout). `scripts/check-mcp-schema.mjs` and `test/mcp-bridge.mjs` both
|
|
678
|
+
spawn the server by path, so pointing them at the unpacked copy is the whole procedure. The 0.7.0 tag
|
|
679
|
+
was pushed after that run; a release that skips it is asserting that the shipped bytes work by
|
|
680
|
+
showing that the source does.
|
|
681
|
+
|
|
572
682
|
## License
|
|
573
683
|
|
|
574
684
|
MIT
|