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.
- package/CHANGELOG.de.md +444 -419
- package/CHANGELOG.es.md +444 -419
- package/CHANGELOG.fr.md +444 -419
- package/CHANGELOG.it.md +444 -419
- package/CHANGELOG.ja.md +444 -419
- package/CHANGELOG.ko.md +444 -419
- package/CHANGELOG.md +965 -940
- package/CHANGELOG.pt.md +444 -419
- package/CHANGELOG.ru.md +444 -419
- package/CHANGELOG.zh.md +444 -419
- package/INSTALL.de.md +126 -126
- package/INSTALL.es.md +126 -126
- package/INSTALL.fr.md +126 -126
- package/INSTALL.it.md +126 -126
- package/INSTALL.ja.md +126 -126
- package/INSTALL.ko.md +126 -126
- package/INSTALL.md +122 -122
- package/INSTALL.pt.md +126 -126
- package/INSTALL.ru.md +126 -126
- package/INSTALL.zh.md +126 -126
- package/README.de.md +684 -684
- package/README.es.md +684 -684
- package/README.fr.md +684 -684
- package/README.it.md +684 -684
- package/README.ja.md +684 -684
- package/README.ko.md +684 -684
- package/README.md +680 -680
- package/README.pt.md +684 -684
- package/README.ru.md +684 -684
- package/README.zh.md +684 -684
- package/cordis.patch.yml +15 -15
- package/docs/refusals.md +90 -90
- package/docs/takeover.md +128 -128
- package/dsh.plugin.json +18 -18
- package/lib/config.js +275 -275
- package/lib/engine.js +252 -252
- package/lib/host-tools.js +365 -338
- package/lib/index.js +1275 -1249
- package/lib/peers-schemastery.js +23 -23
- package/lib/peers-tools.js +15 -15
- package/lib/proof-window.mjs +427 -427
- package/package.json +122 -122
- package/server.json +110 -110
- package/src/engine/decide.ps1 +356 -356
- package/src/engine/engine.ps1 +1208 -1208
- package/src/engine/hud.ps1 +411 -411
- package/src/engine/input-inject.ps1 +176 -176
- package/src/engine/overlay.ps1 +389 -389
- package/src/engine/takeover.ps1 +144 -144
- package/src/engine/win.ps1 +1881 -1881
- package/src/engine/worker.ps1 +310 -310
- package/src/schema/tools.json +533 -533
- 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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export type
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
export type
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
label
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
export
|
|
176
|
-
|
|
177
|
-
export const
|
|
178
|
-
export const
|
|
179
|
-
export
|
|
180
|
-
|
|
181
|
-
export const
|
|
182
|
-
export
|
|
183
|
-
|
|
184
|
-
export
|
|
185
|
-
export
|
|
186
|
-
export
|
|
187
|
-
export function
|
|
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 }>;
|