dsh-windows-parallel-mcp 0.8.2 → 0.9.0-rc.2

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.
Files changed (53) hide show
  1. package/CHANGELOG.de.md +444 -419
  2. package/CHANGELOG.es.md +444 -419
  3. package/CHANGELOG.fr.md +444 -419
  4. package/CHANGELOG.it.md +444 -419
  5. package/CHANGELOG.ja.md +444 -419
  6. package/CHANGELOG.ko.md +444 -419
  7. package/CHANGELOG.md +965 -940
  8. package/CHANGELOG.pt.md +444 -419
  9. package/CHANGELOG.ru.md +444 -419
  10. package/CHANGELOG.zh.md +444 -419
  11. package/INSTALL.de.md +126 -126
  12. package/INSTALL.es.md +126 -126
  13. package/INSTALL.fr.md +126 -126
  14. package/INSTALL.it.md +126 -126
  15. package/INSTALL.ja.md +126 -126
  16. package/INSTALL.ko.md +126 -126
  17. package/INSTALL.md +122 -122
  18. package/INSTALL.pt.md +126 -126
  19. package/INSTALL.ru.md +126 -126
  20. package/INSTALL.zh.md +126 -126
  21. package/README.de.md +684 -684
  22. package/README.es.md +684 -684
  23. package/README.fr.md +684 -684
  24. package/README.it.md +684 -684
  25. package/README.ja.md +684 -684
  26. package/README.ko.md +684 -684
  27. package/README.md +680 -680
  28. package/README.pt.md +684 -684
  29. package/README.ru.md +684 -684
  30. package/README.zh.md +684 -684
  31. package/cordis.patch.yml +15 -15
  32. package/docs/refusals.md +90 -90
  33. package/docs/takeover.md +128 -128
  34. package/dsh.plugin.json +18 -18
  35. package/lib/config.js +275 -275
  36. package/lib/engine.js +252 -252
  37. package/lib/host-tools.js +365 -338
  38. package/lib/index.js +1275 -1249
  39. package/lib/peers-schemastery.js +23 -23
  40. package/lib/peers-tools.js +15 -15
  41. package/lib/proof-window.mjs +427 -427
  42. package/package.json +122 -122
  43. package/server.json +110 -110
  44. package/src/engine/decide.ps1 +356 -356
  45. package/src/engine/engine.ps1 +1208 -1208
  46. package/src/engine/hud.ps1 +411 -411
  47. package/src/engine/input-inject.ps1 +176 -176
  48. package/src/engine/overlay.ps1 +389 -389
  49. package/src/engine/takeover.ps1 +144 -144
  50. package/src/engine/win.ps1 +1881 -1881
  51. package/src/engine/worker.ps1 +310 -310
  52. package/src/schema/tools.json +533 -533
  53. package/types/index.d.ts +190 -187
package/types/index.d.ts CHANGED
@@ -1,187 +1,190 @@
1
- // Type declarations for dsh-windows-parallel-mcp (public API surface).
2
- // Mirrors lib/index.js + lib/host-tools.js + src/schema/tools.json (v0.7.0).
3
-
4
- export type WpmAction =
5
- | 'windows' | 'click' | 'type' | 'focus' | 'status'
6
- | 'snapshot' | 'screenshot' | 'preview'
7
- // 0.7.0: three desktop actions. They are gated by SETTINGS, not by the target's doors -- which is why
8
- // they take no channel, cost no tier of their own, and produce no proof window.
9
- | 'launch' | 'clipboard' | 'window';
10
-
11
- /** clipboard's `op`. */
12
- export type WpmClipboardOp = 'read' | 'write';
13
- /** window's `op`. There is no 'all windows' value, and that is the contract, not an omission. */
14
- export type WpmWindowOp = 'minimize' | 'restore' | 'move' | 'resize' | 'topmost';
15
-
16
- /** The single authorization ceiling in settings; lib/policy.js holds the ladder it is read against. */
17
- export type WpmPolicy = 'readonly' | 'quiet' | 'balanced' | 'full';
18
-
19
- /**
20
- * WHO REPORTED THE SUCCESS. The first three name a messenger, not a degree of confidence (see the
21
- * `effect` block in lib/index.js). `readback-verified` is the fourth and the only one that is about the
22
- * application rather than about the call: the value was read back after the settle window and equals
23
- * what the control's own measurements predicted. A masked field never reaches it (readback=unavailable)
24
- * and a reformatted value never reaches it (readbackMismatch=true) -- the engine does not upgrade on
25
- * "the call came back".
26
- */
27
- export type WpmEffect =
28
- | 'unverified' | 'reported-by-send' | 'reported-by-pattern' | 'readback-verified';
29
-
30
- /** Where the caret sits before the message door types. `idle` touches nothing. */
31
- export type WpmCaretPosition = 'idle' | 'start' | 'end';
32
-
33
- export type RefusalCode =
34
- | 'no_hwnd' | 'paused' | 'elevated_target' | 'unreachable'
35
- | 'uia_tree_empty' | 'uia_probe_failed' | 'terminal_no_door' | 'needs_facts'
36
- | 'takeover_unavailable' | 'keyinject_unavailable' | 'action_failed'
37
- | 'restore_failed' | 'takeover_aborted' | 'stale_ref'
38
- // 0.7.0. What separates these three from the fourteen above is the NEXT STEP: each names a SETTING,
39
- // so retrying the same call is the wrong response and changing the setting is the right one.
40
- | 'app_launch_denied' | 'policy_denied' | 'user_active';
41
-
42
- export type KeyInputMode = 'none' | 'inject';
43
-
44
- /** Coordinate space of a click's x/y. `image` means image pixels from a `screenshot`. */
45
- export type WpmPointSpace = 'screen' | 'image';
46
-
47
- /** Frame source of a captured screenRect. `dwm` is the DWM extended frame; `win32` is the fallback. */
48
- export type WpmFrameSource = 'dwm' | 'win32';
49
-
50
- /**
51
- * WHICH CAPTURE PATH produced a screenshot. `bitblt` is the cheap GDI path (measured 16-21ms against
52
- * 22-33ms for the other); `gdiplus` is `Graphics.CopyFromScreen`, either the explicit choice or the
53
- * fallback after BitBlt was refused. The two are measured equivalent on a still scene, but they are not
54
- * the same call and the field is never omitted -- a path that changed silently is the failure mode this
55
- * repo has already been caught by once with `frame`.
56
- */
57
- export type WpmCaptureBackend = 'bitblt' | 'gdiplus';
58
-
59
- export interface WpmWindow {
60
- hwnd: string; title: string; class: string; pid: number;
61
- rect: { left: number; top: number; right: number; bottom: number };
62
- }
63
-
64
- /** One numbered element in a `snapshot` frame. */
65
- export interface WpmSnapshotElement {
66
- label: number;
67
- controlType: string;
68
- name: string;
69
- automationId: string;
70
- rect: { left: number; top: number; right: number; bottom: number };
71
- patterns: string[];
72
- }
73
-
74
- /** One delivered screenshot, with the mapping that makes its pixels addressable. */
75
- export interface WpmShot {
76
- file: string;
77
- shotId: string;
78
- screenRect: { left: number; top: number; right: number; bottom: number };
79
- imageSize: { width: number; height: number };
80
- /** image pixels per screen pixel; 1 when identity. screen = rect + round(image / scale). */
81
- scale: number;
82
- identity: boolean;
83
- frame: WpmFrameSource;
84
- captureBackend?: WpmCaptureBackend;
85
- dpiAware: boolean;
86
- }
87
-
88
- export interface WpmArgs {
89
- action: WpmAction;
90
- hwnd?: string;
91
- x?: number;
92
- y?: number;
93
- text?: string;
94
- elementName?: string;
95
- replace?: boolean;
96
- caretPosition?: WpmCaretPosition;
97
- settleMs?: number;
98
- takeover?: boolean;
99
- takeoverMaxMs?: number;
100
- keyInput?: KeyInputMode;
101
- // ---- 0.5.0: snapshot / screenshot / preview / label addressing ----
102
- space?: WpmPointSpace;
103
- shotId?: string;
104
- label?: number;
105
- snapId?: string;
106
- maxElements?: number;
107
- interactableOnly?: boolean;
108
- sinceSnapId?: string;
109
- intent?: string;
110
- fullScreen?: boolean;
111
- maxWidth?: number;
112
- // ---- 0.7.0: launch / clipboard / window ----
113
- target?: string;
114
- args?: string;
115
- waitMs?: number;
116
- op?: WpmClipboardOp | WpmWindowOp;
117
- /** clipboard only: which format to read or write. */
118
- format?: 'text' | 'image';
119
- width?: number;
120
- height?: number;
121
- /** The caller's explicit override of the idle check; recorded in the audit log as `forced`. */
122
- forceUserActive?: boolean;
123
- }
124
-
125
- export interface WpmResult {
126
- text?: string;
127
- refusal?: RefusalCode;
128
- channel?: string;
129
- tier?: string;
130
- effect?: WpmEffect;
131
- proof?: 'pass' | 'fail' | 'inconclusive';
132
- focusTaken?: boolean;
133
- takeover?: 'on' | 'off';
134
- cursorMoved?: boolean;
135
- cursorRestored?: boolean;
136
- takeoverMs?: number;
137
- abortChord?: string;
138
- keysInjected?: boolean;
139
- injectedChars?: number;
140
- // ---- snapshot ----
141
- snapId?: string;
142
- elements?: WpmSnapshotElement[];
143
- count?: number;
144
- truncated?: boolean;
145
- frameCheck?: 'pass' | 'fail';
146
- intent?: string;
147
- // ---- screenshot ----
148
- shotId?: string;
149
- file?: string;
150
- screenRect?: { left: number; top: number; right: number; bottom: number };
151
- imageSize?: { width: number; height: number };
152
- scale?: number;
153
- identity?: boolean;
154
- frame?: WpmFrameSource;
155
- captureBackend?: WpmCaptureBackend;
156
- captureNote?: string;
157
- dpiAware?: boolean;
158
- // ---- preview ----
159
- preview?: { x: number; y: number; name: string; controlType: string; automationId: string };
160
- // ---- 0.7.0 desktop results ----
161
- pid?: number;
162
- processName?: string;
163
- waitedMs?: number;
164
- clipFormat?: 'text' | 'image';
165
- clipId?: string;
166
- resultChars?: number;
167
- [key: string]: unknown;
168
- }
169
-
170
- export interface WpmExec { signal?: AbortSignal; [key: string]: unknown; }
171
-
172
- export interface WpmTool { execute(args: WpmArgs, exec?: WpmExec): Promise<WpmResult>; }
173
-
174
- export const name: 'windows-parallel';
175
- export const inject: readonly ['tools'];
176
- export const Config: unknown;
177
- export const configSource: string;
178
- export const toolHelperSource: string;
179
- export function apply(ctx: Record<string, unknown>, config?: Record<string, unknown>): void;
180
-
181
- export const TOOL_NAME: 'wpm';
182
- export const ACTIONS: readonly WpmAction[];
183
- export const PARAMETERS: Record<string, { type: string; enum?: readonly string[]; required?: boolean; description: string }>;
184
- export function parametersToJsonSchema(spec?: Record<string, unknown>): Record<string, unknown>;
185
- export function validateArguments(schema: Record<string, unknown>, args: WpmArgs): boolean | string;
186
- export function localDefineTool(options: Record<string, unknown>): WpmTool;
187
- export function resolveDefineTool(): Promise<{ defineTool: (o: Record<string, unknown>) => WpmTool; source: string }>;
1
+ // Type declarations for dsh-windows-parallel-mcp (public API surface).
2
+ // Mirrors lib/index.js + lib/host-tools.js + src/schema/tools.json (v0.7.0).
3
+
4
+ export type WpmAction =
5
+ | 'windows' | 'click' | 'type' | 'focus' | 'status'
6
+ | 'snapshot' | 'screenshot' | 'preview'
7
+ // 0.7.0: three desktop actions. They are gated by SETTINGS, not by the target's doors -- which is why
8
+ // they take no channel, cost no tier of their own, and produce no proof window.
9
+ | 'launch' | 'clipboard' | 'window';
10
+
11
+ /** clipboard's `op`. */
12
+ export type WpmClipboardOp = 'read' | 'write';
13
+ /** window's `op`. There is no 'all windows' value, and that is the contract, not an omission. */
14
+ export type WpmWindowOp = 'minimize' | 'restore' | 'move' | 'resize' | 'topmost';
15
+
16
+ /** The single authorization ceiling in settings; lib/policy.js holds the ladder it is read against. */
17
+ export type WpmPolicy = 'readonly' | 'quiet' | 'balanced' | 'full';
18
+
19
+ /**
20
+ * WHO REPORTED THE SUCCESS. The first three name a messenger, not a degree of confidence (see the
21
+ * `effect` block in lib/index.js). `readback-verified` is the fourth and the only one that is about the
22
+ * application rather than about the call: the value was read back after the settle window and equals
23
+ * what the control's own measurements predicted. A masked field never reaches it (readback=unavailable)
24
+ * and a reformatted value never reaches it (readbackMismatch=true) -- the engine does not upgrade on
25
+ * "the call came back".
26
+ */
27
+ export type WpmEffect =
28
+ | 'unverified' | 'reported-by-send' | 'reported-by-pattern' | 'readback-verified';
29
+
30
+ /** Where the caret sits before the message door types. `idle` touches nothing. */
31
+ export type WpmCaretPosition = 'idle' | 'start' | 'end';
32
+
33
+ export type RefusalCode =
34
+ | 'no_hwnd' | 'paused' | 'elevated_target' | 'unreachable'
35
+ | 'uia_tree_empty' | 'uia_probe_failed' | 'terminal_no_door' | 'needs_facts'
36
+ | 'takeover_unavailable' | 'keyinject_unavailable' | 'action_failed'
37
+ | 'restore_failed' | 'takeover_aborted' | 'stale_ref'
38
+ // 0.7.0. What separates these three from the fourteen above is the NEXT STEP: each names a SETTING,
39
+ // so retrying the same call is the wrong response and changing the setting is the right one.
40
+ | 'app_launch_denied' | 'policy_denied' | 'user_active'
41
+ // 0.9.0. The caller sent a value outside the declared bounds (or a fraction where an integer was
42
+ // declared); the pre-0.9.0 behavior was a silent clamp/round, which is what this code replaces.
43
+ | 'invalid_argument';
44
+
45
+ export type KeyInputMode = 'none' | 'inject';
46
+
47
+ /** Coordinate space of a click's x/y. `image` means image pixels from a `screenshot`. */
48
+ export type WpmPointSpace = 'screen' | 'image';
49
+
50
+ /** Frame source of a captured screenRect. `dwm` is the DWM extended frame; `win32` is the fallback. */
51
+ export type WpmFrameSource = 'dwm' | 'win32';
52
+
53
+ /**
54
+ * WHICH CAPTURE PATH produced a screenshot. `bitblt` is the cheap GDI path (measured 16-21ms against
55
+ * 22-33ms for the other); `gdiplus` is `Graphics.CopyFromScreen`, either the explicit choice or the
56
+ * fallback after BitBlt was refused. The two are measured equivalent on a still scene, but they are not
57
+ * the same call and the field is never omitted -- a path that changed silently is the failure mode this
58
+ * repo has already been caught by once with `frame`.
59
+ */
60
+ export type WpmCaptureBackend = 'bitblt' | 'gdiplus';
61
+
62
+ export interface WpmWindow {
63
+ hwnd: string; title: string; class: string; pid: number;
64
+ rect: { left: number; top: number; right: number; bottom: number };
65
+ }
66
+
67
+ /** One numbered element in a `snapshot` frame. */
68
+ export interface WpmSnapshotElement {
69
+ label: number;
70
+ controlType: string;
71
+ name: string;
72
+ automationId: string;
73
+ rect: { left: number; top: number; right: number; bottom: number };
74
+ patterns: string[];
75
+ }
76
+
77
+ /** One delivered screenshot, with the mapping that makes its pixels addressable. */
78
+ export interface WpmShot {
79
+ file: string;
80
+ shotId: string;
81
+ screenRect: { left: number; top: number; right: number; bottom: number };
82
+ imageSize: { width: number; height: number };
83
+ /** image pixels per screen pixel; 1 when identity. screen = rect + round(image / scale). */
84
+ scale: number;
85
+ identity: boolean;
86
+ frame: WpmFrameSource;
87
+ captureBackend?: WpmCaptureBackend;
88
+ dpiAware: boolean;
89
+ }
90
+
91
+ export interface WpmArgs {
92
+ action: WpmAction;
93
+ hwnd?: string;
94
+ x?: number;
95
+ y?: number;
96
+ text?: string;
97
+ elementName?: string;
98
+ replace?: boolean;
99
+ caretPosition?: WpmCaretPosition;
100
+ settleMs?: number;
101
+ takeover?: boolean;
102
+ takeoverMaxMs?: number;
103
+ keyInput?: KeyInputMode;
104
+ // ---- 0.5.0: snapshot / screenshot / preview / label addressing ----
105
+ space?: WpmPointSpace;
106
+ shotId?: string;
107
+ label?: number;
108
+ snapId?: string;
109
+ maxElements?: number;
110
+ interactableOnly?: boolean;
111
+ sinceSnapId?: string;
112
+ intent?: string;
113
+ fullScreen?: boolean;
114
+ maxWidth?: number;
115
+ // ---- 0.7.0: launch / clipboard / window ----
116
+ target?: string;
117
+ args?: string;
118
+ waitMs?: number;
119
+ op?: WpmClipboardOp | WpmWindowOp;
120
+ /** clipboard only: which format to read or write. */
121
+ format?: 'text' | 'image';
122
+ width?: number;
123
+ height?: number;
124
+ /** The caller's explicit override of the idle check; recorded in the audit log as `forced`. */
125
+ forceUserActive?: boolean;
126
+ }
127
+
128
+ export interface WpmResult {
129
+ text?: string;
130
+ refusal?: RefusalCode;
131
+ channel?: string;
132
+ tier?: string;
133
+ effect?: WpmEffect;
134
+ proof?: 'pass' | 'fail' | 'inconclusive';
135
+ focusTaken?: boolean;
136
+ takeover?: 'on' | 'off';
137
+ cursorMoved?: boolean;
138
+ cursorRestored?: boolean;
139
+ takeoverMs?: number;
140
+ abortChord?: string;
141
+ keysInjected?: boolean;
142
+ injectedChars?: number;
143
+ // ---- snapshot ----
144
+ snapId?: string;
145
+ elements?: WpmSnapshotElement[];
146
+ count?: number;
147
+ truncated?: boolean;
148
+ frameCheck?: 'pass' | 'fail';
149
+ intent?: string;
150
+ // ---- screenshot ----
151
+ shotId?: string;
152
+ file?: string;
153
+ screenRect?: { left: number; top: number; right: number; bottom: number };
154
+ imageSize?: { width: number; height: number };
155
+ scale?: number;
156
+ identity?: boolean;
157
+ frame?: WpmFrameSource;
158
+ captureBackend?: WpmCaptureBackend;
159
+ captureNote?: string;
160
+ dpiAware?: boolean;
161
+ // ---- preview ----
162
+ preview?: { x: number; y: number; name: string; controlType: string; automationId: string };
163
+ // ---- 0.7.0 desktop results ----
164
+ pid?: number;
165
+ processName?: string;
166
+ waitedMs?: number;
167
+ clipFormat?: 'text' | 'image';
168
+ clipId?: string;
169
+ resultChars?: number;
170
+ [key: string]: unknown;
171
+ }
172
+
173
+ export interface WpmExec { signal?: AbortSignal; [key: string]: unknown; }
174
+
175
+ export interface WpmTool { execute(args: WpmArgs, exec?: WpmExec): Promise<WpmResult>; }
176
+
177
+ export const name: 'windows-parallel';
178
+ export const inject: readonly ['tools'];
179
+ export const Config: unknown;
180
+ export const configSource: string;
181
+ export const toolHelperSource: string;
182
+ export function apply(ctx: Record<string, unknown>, config?: Record<string, unknown>): void;
183
+
184
+ export const TOOL_NAME: 'wpm';
185
+ export const ACTIONS: readonly WpmAction[];
186
+ export const PARAMETERS: Record<string, { type: string; enum?: readonly string[]; required?: boolean; description: string }>;
187
+ export function parametersToJsonSchema(spec?: Record<string, unknown>): Record<string, unknown>;
188
+ export function validateArguments(schema: Record<string, unknown>, args: WpmArgs): boolean | string;
189
+ export function localDefineTool(options: Record<string, unknown>): WpmTool;
190
+ export function resolveDefineTool(): Promise<{ defineTool: (o: Record<string, unknown>) => WpmTool; source: string }>;