@burdenoff/ui-engine 2026.1203.1 → 2026.1204.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/README.md +20 -2
- package/dist/analyze/analyze.d.ts +10 -0
- package/dist/analyze/context.d.ts +25 -9
- package/dist/analyze/index.d.ts +3 -2
- package/dist/analyze/messages.d.ts +2 -0
- package/dist/analyze/rules/run-command-from-variable.d.ts +2 -0
- package/dist/analyze/rules/single-method-image-target.d.ts +7 -0
- package/dist/analyze/sensitive.d.ts +2 -2
- package/dist/analyze/types.d.ts +6 -2
- package/dist/analyze.js +4 -2
- package/dist/desk.d.ts +13 -0
- package/dist/desk.js +29 -0
- package/dist/dom-runtime.iife.js +1 -1
- package/dist/dom-runtime.js +2 -2
- package/dist/drivers/desk-backend.d.ts +40 -0
- package/dist/drivers/desk-driver.d.ts +41 -0
- package/dist/drivers/desk-errors.d.ts +19 -0
- package/dist/drivers/desk-tree.d.ts +28 -0
- package/dist/drivers/desk-wire.d.ts +237 -0
- package/dist/drivers/index.d.ts +3 -1
- package/dist/drivers.js +13 -10
- package/dist/heal.js +5 -5
- package/dist/index-0ps53dhe.js +85 -0
- package/dist/{index-qm9nd548.js → index-2q0hh6we.js} +4 -4
- package/dist/index-552x2bnm.js +56 -0
- package/dist/index-6m0chbhq.js +64 -0
- package/dist/{index-xdtanv9b.js → index-7gfzv5n8.js} +97 -54
- package/dist/{index-gvavb597.js → index-93hfbk5c.js} +10 -0
- package/dist/index-a8s39bse.js +920 -0
- package/dist/{index-g7724awk.js → index-axph39g0.js} +22 -0
- package/dist/index-b5a306v7.js +43 -0
- package/dist/index-bx4bsvg0.js +458 -0
- package/dist/{index-6h7ah1dw.js → index-cc49ykn5.js} +4 -4
- package/dist/{index-3hsp44k5.js → index-e557vzdd.js} +221 -36
- package/dist/{index-vnv9tp11.js → index-e7pgqd60.js} +2 -2
- package/dist/index-hdq3y007.js +246 -0
- package/dist/{index-zagmp5ya.js → index-n3nfhjrj.js} +2 -2
- package/dist/{index-rs3yzt5q.js → index-nmsg2wze.js} +4 -4
- package/dist/{index-zhbwhdya.js → index-q2jbva7c.js} +5 -3
- package/dist/{index-n7ah1jn7.js → index-rbem2yms.js} +16 -243
- package/dist/{index-mhv6a02p.js → index-reef7e8m.js} +1 -1
- package/dist/{index-y4j6zep8.js → index-wdbn4xjc.js} +6 -6
- package/dist/{index-pfdm8evf.js → index-x8fc4r4h.js} +115 -9
- package/dist/{index-yc0jgph6.js → index-yhzykhdj.js} +6 -43
- package/dist/{index-t55wvhvh.js → index-z2v8prer.js} +1 -61
- package/dist/index-zj3zhbac.js +1123 -0
- package/dist/{index-hw5npwsv.js → index-zpxk3fzd.js} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +162 -20
- package/dist/interpret/driver.d.ts +109 -18
- package/dist/interpret/errors.d.ts +7 -1
- package/dist/interpret/events.d.ts +5 -2
- package/dist/interpret/index.d.ts +4 -3
- package/dist/interpret/run.d.ts +28 -1
- package/dist/interpret.js +16 -9
- package/dist/script/adapters/recording-desktop.d.ts +52 -0
- package/dist/script/describe.d.ts +7 -2
- package/dist/script/desk-roles.d.ts +33 -0
- package/dist/script/desktop-capabilities.d.ts +125 -0
- package/dist/script/desktop-schema.d.ts +281 -0
- package/dist/script/desktop-types.d.ts +265 -0
- package/dist/script/fingerprint.d.ts +10 -1
- package/dist/script/hash.d.ts +9 -0
- package/dist/script/index.d.ts +14 -4
- package/dist/script/json-schema.d.ts +8 -0
- package/dist/script/parse.d.ts +29 -0
- package/dist/script/schema.d.ts +2098 -1
- package/dist/script/walk.d.ts +18 -4
- package/dist/script.js +118 -8
- package/dist/target/types.d.ts +10 -4
- package/dist/target.js +20 -16
- package/dist/testing.js +5 -3
- package/package.json +9 -3
- package/schema/ui-script-desktop-v1.schema.json +12181 -0
- package/dist/index-68x61c7a.js +0 -743
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The desktop UI script (RPA plan package P2-03a; desk contract v3; spec 05
|
|
3
|
+
* sections 3 and 6.1; decision OD-18).
|
|
4
|
+
*
|
|
5
|
+
* A desktop script is what a robot runs next to the screen through the desk
|
|
6
|
+
* `run` entry. It is a separate schema with its own hash
|
|
7
|
+
* (`DESKTOP_SCRIPT_SCHEMA_HASH`), so the web script schema and
|
|
8
|
+
* `UI_SCRIPT_SCHEMA_HASH` stay exactly as they are and the browser extension
|
|
9
|
+
* keeps reading web scripts unchanged.
|
|
10
|
+
*
|
|
11
|
+
* The desktop script holds every web and flow step of UI script v1, with
|
|
12
|
+
* targets that may also use the desktop methods (`uia`, `ax`, `atspi`,
|
|
13
|
+
* `image`, `ocr`), plus the desktop actions (applications and windows,
|
|
14
|
+
* control patterns, `get`, `runCommand`, the file steps and `releaseRobot`).
|
|
15
|
+
* It carries `surface: 'desktop'`, so neither parser accepts the other's
|
|
16
|
+
* scripts by mistake: the web schema refuses the unknown field, and the
|
|
17
|
+
* desktop schema needs it.
|
|
18
|
+
*
|
|
19
|
+
* Whether a desk can run a given desktop script is decided by
|
|
20
|
+
* `checkDesktopScriptForDesk` (`desktop-capabilities.ts`) against the desk's
|
|
21
|
+
* `capabilities()`.
|
|
22
|
+
*/
|
|
23
|
+
import type { UiCallStep, UiElementRef, UiExpression, UiExtractField, UiFocusWindowStep, UiForEachStep, UiIfStep, UiLogStep, UiRetryScopeStep, UiScript, UiScriptElement, UiSetStep, UiStepBase, UiTarget, UiTargetMethod, UiVerify, UiWebStep, UiWhileStep } from './types.js';
|
|
24
|
+
/** The value of `surface` that marks a desktop script. */
|
|
25
|
+
export declare const DESKTOP_SCRIPT_SURFACE = "desktop";
|
|
26
|
+
/** Which window a selector is scoped to (desk contract v3 section 4). Titles never take a regular expression. */
|
|
27
|
+
export interface UiSelectorWindow {
|
|
28
|
+
title?: string;
|
|
29
|
+
/** `exact` (default) or `wildcard` (`*` and `?`). */
|
|
30
|
+
titleMatch?: 'exact' | 'wildcard';
|
|
31
|
+
class?: string;
|
|
32
|
+
processName?: string;
|
|
33
|
+
}
|
|
34
|
+
/** One node of a selector path, from the window down to the element. */
|
|
35
|
+
export interface UiSelectorNode {
|
|
36
|
+
/** The platform's own role name: UIA ControlType ("Button"), AX role ("AXButton"), AT-SPI role ("push button"). */
|
|
37
|
+
role: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
/** UIA AutomationId or AX identifier. */
|
|
40
|
+
automationId?: string;
|
|
41
|
+
className?: string;
|
|
42
|
+
/** 0-based position among the siblings that match the node's other conditions. */
|
|
43
|
+
index?: number;
|
|
44
|
+
}
|
|
45
|
+
interface UiSelectorMethodBase {
|
|
46
|
+
/** The editor's on or off switch for this method. Absent means on. */
|
|
47
|
+
enabled?: boolean;
|
|
48
|
+
/** Windows exe name, macOS bundle id or X11 WM_CLASS. */
|
|
49
|
+
app?: string;
|
|
50
|
+
window?: UiSelectorWindow;
|
|
51
|
+
/** 1 to 32 nodes. Matched exactly on every condition by the desk (spec 05 section 3.3). */
|
|
52
|
+
path: UiSelectorNode[];
|
|
53
|
+
}
|
|
54
|
+
/** Strict selector through Windows UI Automation (desk selector platform `uia`). */
|
|
55
|
+
export interface UiUiaMethod extends UiSelectorMethodBase {
|
|
56
|
+
kind: 'uia';
|
|
57
|
+
}
|
|
58
|
+
/** Strict selector through the macOS Accessibility API (desk selector platform `ax`). */
|
|
59
|
+
export interface UiAxMethod extends UiSelectorMethodBase {
|
|
60
|
+
kind: 'ax';
|
|
61
|
+
}
|
|
62
|
+
/** Strict selector through Linux AT-SPI (desk selector platform `atspi`). */
|
|
63
|
+
export interface UiAtspiMethod extends UiSelectorMethodBase {
|
|
64
|
+
kind: 'atspi';
|
|
65
|
+
}
|
|
66
|
+
/** A screen region in pixels. */
|
|
67
|
+
export interface UiScreenRegion {
|
|
68
|
+
x: number;
|
|
69
|
+
y: number;
|
|
70
|
+
w: number;
|
|
71
|
+
h: number;
|
|
72
|
+
}
|
|
73
|
+
/** Image match on the masked screenshot (desk target kind `image`, the vision provider). */
|
|
74
|
+
export interface UiImageMethod {
|
|
75
|
+
kind: 'image';
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
/** PNG of the element, base64: at most 64 KiB decoded and 256 by 256 pixels. */
|
|
78
|
+
pngBase64: string;
|
|
79
|
+
/** Lowest accepted match, 0.5 to 1. Absent means 0.9. */
|
|
80
|
+
threshold?: number;
|
|
81
|
+
/** Where to search. Absent means the focused window. */
|
|
82
|
+
region?: UiScreenRegion;
|
|
83
|
+
/** Display scale when the image was recorded (1 = 100 percent). */
|
|
84
|
+
recordedScale?: number;
|
|
85
|
+
}
|
|
86
|
+
/** Text read from the screen's pixels (desk target kind `text` with the OCR source). */
|
|
87
|
+
export interface UiOcrMethod {
|
|
88
|
+
kind: 'ocr';
|
|
89
|
+
enabled?: boolean;
|
|
90
|
+
/** 1 to 256 characters. */
|
|
91
|
+
text: string;
|
|
92
|
+
/** Absent means `exact`. */
|
|
93
|
+
match?: 'exact' | 'contains';
|
|
94
|
+
/** Which occurrence (0 = the first). Absent means 0. */
|
|
95
|
+
occurrence?: number;
|
|
96
|
+
region?: UiScreenRegion;
|
|
97
|
+
}
|
|
98
|
+
/** The desktop target methods, appended after the web methods. */
|
|
99
|
+
export declare const UI_DESKTOP_TARGET_METHOD_KINDS: readonly ["uia", "ax", "atspi", "image", "ocr"];
|
|
100
|
+
export type DesktopUiOnlyTargetMethodKind = (typeof UI_DESKTOP_TARGET_METHOD_KINDS)[number];
|
|
101
|
+
export type DesktopUiOnlyTargetMethod = UiUiaMethod | UiAxMethod | UiAtspiMethod | UiImageMethod | UiOcrMethod;
|
|
102
|
+
/** A method of a desktop target: any web method, or a desktop method. */
|
|
103
|
+
export type DesktopUiTargetMethod = UiTargetMethod | DesktopUiOnlyTargetMethod;
|
|
104
|
+
export type DesktopUiTargetMethodKind = DesktopUiTargetMethod['kind'];
|
|
105
|
+
/** A desktop target: an ordered list of methods; the first that finds exactly one element is used. */
|
|
106
|
+
export interface DesktopUiTarget {
|
|
107
|
+
methods: DesktopUiTargetMethod[];
|
|
108
|
+
/** Web only: the frame and shadow-root chain. No desk resolves it today. */
|
|
109
|
+
frame?: string[];
|
|
110
|
+
}
|
|
111
|
+
export type DesktopUiTargetRef = DesktopUiTarget | UiElementRef;
|
|
112
|
+
/** A library element pinned by version; the worker fills its target when it compiles the script. */
|
|
113
|
+
export interface DesktopUiScriptElement extends Omit<UiScriptElement, 'target'> {
|
|
114
|
+
target?: DesktopUiTarget;
|
|
115
|
+
}
|
|
116
|
+
/** A web type with its targets widened to desktop targets (nested steps excluded). */
|
|
117
|
+
type OnDesk<T> = T extends UiTarget ? DesktopUiTarget : T extends UiExtractField ? OnDeskFields<T> : T extends UiVerify ? OnDeskFields<T> : T extends ReadonlyArray<infer E> ? Array<OnDesk<E>> : T;
|
|
118
|
+
type OnDeskFields<T> = {
|
|
119
|
+
[K in keyof T]: OnDesk<T[K]>;
|
|
120
|
+
};
|
|
121
|
+
export type DesktopUiStepBase = OnDeskFields<UiStepBase>;
|
|
122
|
+
export type DesktopUiVerify = OnDesk<UiVerify>;
|
|
123
|
+
export type DesktopUiExtractField = OnDesk<UiExtractField>;
|
|
124
|
+
/** The web steps of UI script v1, with desktop targets. */
|
|
125
|
+
export type DesktopUiWebStep = OnDeskFields<UiWebStep>;
|
|
126
|
+
export type DesktopUiFocusWindowStep = OnDeskFields<UiFocusWindowStep>;
|
|
127
|
+
/** Open an application registered on the machine (never a path or a command line). Desk action `open_app`. */
|
|
128
|
+
export interface UiOpenAppStep extends DesktopUiStepBase {
|
|
129
|
+
action: 'openApp';
|
|
130
|
+
/** Windows exe name or Start menu entry, macOS bundle id, or a `.desktop` file name. */
|
|
131
|
+
app: string;
|
|
132
|
+
/** An argument vector, never passed through a shell. At most 16. */
|
|
133
|
+
args?: UiExpression[];
|
|
134
|
+
/** Wait until a window with this title is open. */
|
|
135
|
+
waitForTitle?: string;
|
|
136
|
+
}
|
|
137
|
+
/** Close an application politely (no forced kill). Desk action `close_app`. */
|
|
138
|
+
export interface UiCloseAppStep extends DesktopUiStepBase {
|
|
139
|
+
action: 'closeApp';
|
|
140
|
+
app: string;
|
|
141
|
+
title?: string;
|
|
142
|
+
}
|
|
143
|
+
/** Restore, minimise or maximise a window. Desk action `window_state`. */
|
|
144
|
+
export interface UiWindowStateStep extends DesktopUiStepBase {
|
|
145
|
+
action: 'windowState';
|
|
146
|
+
app: string;
|
|
147
|
+
title?: string;
|
|
148
|
+
state: 'normal' | 'minimized' | 'maximized';
|
|
149
|
+
}
|
|
150
|
+
/** List the open windows, optionally of one application; `saveAs` keeps the list. Desk action `list_windows`. */
|
|
151
|
+
export interface UiListWindowsStep extends DesktopUiStepBase {
|
|
152
|
+
action: 'listWindows';
|
|
153
|
+
app?: string;
|
|
154
|
+
}
|
|
155
|
+
/** Press a control through its own pattern, without moving the pointer. Desk action `invoke`. */
|
|
156
|
+
export interface UiInvokeStep extends DesktopUiStepBase {
|
|
157
|
+
action: 'invoke';
|
|
158
|
+
target: DesktopUiTargetRef;
|
|
159
|
+
}
|
|
160
|
+
/** Replace a control's value through its value pattern. Never a secret (`typeSecret` is). Desk action `set_value`. */
|
|
161
|
+
export interface UiSetValueStep extends DesktopUiStepBase {
|
|
162
|
+
action: 'setValue';
|
|
163
|
+
target: DesktopUiTargetRef;
|
|
164
|
+
value: UiExpression;
|
|
165
|
+
}
|
|
166
|
+
/** Switch a toggle on or off; absent `state` flips it. Desk action `toggle`. */
|
|
167
|
+
export interface UiToggleStep extends DesktopUiStepBase {
|
|
168
|
+
action: 'toggle';
|
|
169
|
+
target: DesktopUiTargetRef;
|
|
170
|
+
state?: 'on' | 'off';
|
|
171
|
+
}
|
|
172
|
+
/** Expand or collapse a tree node, menu or combo box. Absent means `expanded`. Desk action `expand`. */
|
|
173
|
+
export interface UiExpandStep extends DesktopUiStepBase {
|
|
174
|
+
action: 'expand';
|
|
175
|
+
target: DesktopUiTargetRef;
|
|
176
|
+
state?: 'expanded' | 'collapsed';
|
|
177
|
+
}
|
|
178
|
+
/** What a `get` step reads (desk contract v3 section 5). */
|
|
179
|
+
export declare const UI_DESKTOP_GET_WHAT: readonly ["text", "value", "name", "state", "bounds", "attributes"];
|
|
180
|
+
export type DesktopUiGetWhat = (typeof UI_DESKTOP_GET_WHAT)[number];
|
|
181
|
+
/** Read a control's text, value, name, state, bounds or attributes; `saveAs` keeps it. Desk action `get`. */
|
|
182
|
+
export interface UiGetStep extends DesktopUiStepBase {
|
|
183
|
+
action: 'get';
|
|
184
|
+
target: DesktopUiTargetRef;
|
|
185
|
+
what: DesktopUiGetWhat;
|
|
186
|
+
/** With `what: 'attributes'`: at most 32 names. */
|
|
187
|
+
attributes?: string[];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Run a program or a script inside the desk's workspace folder (desk action
|
|
191
|
+
* `shell`). Allowed only when the pool or grant and the machine allow shell
|
|
192
|
+
* steps (`SHELL_NOT_ALLOWED` otherwise; document 26 DR5b).
|
|
193
|
+
*/
|
|
194
|
+
export interface UiRunCommandStep extends DesktopUiStepBase {
|
|
195
|
+
action: 'runCommand';
|
|
196
|
+
command: UiExpression;
|
|
197
|
+
/** A folder relative to the workspace folder. Absent means the workspace folder. */
|
|
198
|
+
cwd?: string;
|
|
199
|
+
}
|
|
200
|
+
/** Read a file inside the workspace folder as text; `saveAs` keeps it. Desk action `read_file`. */
|
|
201
|
+
export interface UiFileReadStep extends DesktopUiStepBase {
|
|
202
|
+
action: 'fileRead';
|
|
203
|
+
/** A path relative to the workspace folder. */
|
|
204
|
+
path: UiExpression;
|
|
205
|
+
/** At most 10 MiB. Absent means 1 MiB. */
|
|
206
|
+
maxBytes?: number;
|
|
207
|
+
}
|
|
208
|
+
/** Write text to a file inside the workspace folder (a shell-gated step). Desk action `write_file`. */
|
|
209
|
+
export interface UiFileWriteStep extends DesktopUiStepBase {
|
|
210
|
+
action: 'fileWrite';
|
|
211
|
+
path: UiExpression;
|
|
212
|
+
content: UiExpression;
|
|
213
|
+
}
|
|
214
|
+
/** Copy a file inside the workspace folder (a shell-gated step): desk actions `read_file` then `write_file`. */
|
|
215
|
+
export interface UiFileCopyStep extends DesktopUiStepBase {
|
|
216
|
+
action: 'fileCopy';
|
|
217
|
+
from: UiExpression;
|
|
218
|
+
to: UiExpression;
|
|
219
|
+
}
|
|
220
|
+
/** List a folder inside the workspace folder. Desk contract v3 has no action for it yet (`UNSUPPORTED_ON_DESK`). */
|
|
221
|
+
export interface UiFileListStep extends DesktopUiStepBase {
|
|
222
|
+
action: 'fileList';
|
|
223
|
+
/** Absent means the workspace folder. */
|
|
224
|
+
path?: UiExpression;
|
|
225
|
+
}
|
|
226
|
+
/** Delete a file inside the workspace folder (a shell-gated step). Desk contract v3 has no action for it yet. */
|
|
227
|
+
export interface UiFileDeleteStep extends DesktopUiStepBase {
|
|
228
|
+
action: 'fileDelete';
|
|
229
|
+
path: UiExpression;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* End the run's robot reservation when the script finishes (the Release
|
|
233
|
+
* robot step inside a script). Only the last top-level step. It needs nothing
|
|
234
|
+
* from the desk: the service releases the reservation when the job finishes.
|
|
235
|
+
*/
|
|
236
|
+
export interface UiReleaseRobotStep extends DesktopUiStepBase {
|
|
237
|
+
action: 'releaseRobot';
|
|
238
|
+
}
|
|
239
|
+
export type DesktopUiOnlyStep = UiOpenAppStep | UiCloseAppStep | UiWindowStateStep | UiListWindowsStep | UiInvokeStep | UiSetValueStep | UiToggleStep | UiExpandStep | UiGetStep | UiRunCommandStep | UiFileReadStep | UiFileWriteStep | UiFileCopyStep | UiFileListStep | UiFileDeleteStep | UiReleaseRobotStep;
|
|
240
|
+
export interface DesktopUiIfStep extends OnDeskFields<Omit<UiIfStep, 'then' | 'else'>> {
|
|
241
|
+
then: DesktopUiStep[];
|
|
242
|
+
else?: DesktopUiStep[];
|
|
243
|
+
}
|
|
244
|
+
export interface DesktopUiForEachStep extends OnDeskFields<Omit<UiForEachStep, 'steps'>> {
|
|
245
|
+
steps: DesktopUiStep[];
|
|
246
|
+
}
|
|
247
|
+
export interface DesktopUiWhileStep extends OnDeskFields<Omit<UiWhileStep, 'steps'>> {
|
|
248
|
+
steps: DesktopUiStep[];
|
|
249
|
+
}
|
|
250
|
+
export interface DesktopUiRetryScopeStep extends OnDeskFields<Omit<UiRetryScopeStep, 'steps'>> {
|
|
251
|
+
steps: DesktopUiStep[];
|
|
252
|
+
}
|
|
253
|
+
export type DesktopUiFlowStep = DesktopUiIfStep | DesktopUiForEachStep | DesktopUiWhileStep | DesktopUiRetryScopeStep | OnDeskFields<UiSetStep | UiLogStep | UiCallStep>;
|
|
254
|
+
export type DesktopUiStep = DesktopUiWebStep | DesktopUiFocusWindowStep | DesktopUiOnlyStep | DesktopUiFlowStep;
|
|
255
|
+
export type DesktopUiStepAction = DesktopUiStep['action'];
|
|
256
|
+
/** The desktop actions, in schema order (after the web actions and `focusWindow`). */
|
|
257
|
+
export declare const UI_DESKTOP_ONLY_ACTIONS: readonly ["openApp", "closeApp", "windowState", "listWindows", "invoke", "setValue", "toggle", "expand", "get", "runCommand", "fileRead", "fileWrite", "fileCopy", "fileList", "fileDelete", "releaseRobot"];
|
|
258
|
+
/** A desktop UI script, version 1. */
|
|
259
|
+
export interface DesktopUiScript extends Omit<UiScript, 'elements' | 'steps' | 'cleanup'> {
|
|
260
|
+
surface: typeof DESKTOP_SCRIPT_SURFACE;
|
|
261
|
+
elements?: Record<string, DesktopUiScriptElement>;
|
|
262
|
+
steps: DesktopUiStep[];
|
|
263
|
+
cleanup?: DesktopUiStep[];
|
|
264
|
+
}
|
|
265
|
+
export {};
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import type { DesktopUiStep, DesktopUiTargetRef } from './desktop-types.js';
|
|
1
2
|
import type { UiRoleMethod, UiStep, UiStepAction, UiTargetRef } from './types.js';
|
|
2
3
|
/** The Stewards saved-step action each recordable script action corresponds to. */
|
|
3
4
|
export declare const RECORDING_ACTION_OF: Partial<Record<UiStepAction, string>>;
|
|
4
5
|
/** The single accessibility method of an inline target, when that is all the target holds. */
|
|
5
|
-
export declare function soleRoleMethod(ref: UiTargetRef | undefined): UiRoleMethod | undefined;
|
|
6
|
+
export declare function soleRoleMethod(ref: UiTargetRef | DesktopUiTargetRef | undefined): UiRoleMethod | undefined;
|
|
7
|
+
type AnyStep = UiStep | DesktopUiStep;
|
|
6
8
|
/** The fingerprint of a step (lower-case hex sha256). */
|
|
7
9
|
export declare function uiStepFingerprint(step: UiStep): string;
|
|
10
|
+
/** The fingerprint of a desktop step: the same rules as `uiStepFingerprint`. */
|
|
11
|
+
export declare function desktopStepFingerprint(step: DesktopUiStep): string;
|
|
12
|
+
/** The fingerprint of a web or desktop step (used by the parser for both script kinds). */
|
|
13
|
+
export declare function fingerprintOf(step: AnyStep): string;
|
|
8
14
|
/** The step with its fingerprint set. Call it after editing a step's target. */
|
|
9
15
|
export declare function withFingerprint<S extends UiStep>(step: S): S;
|
|
16
|
+
/** The desktop step with its fingerprint set. */
|
|
17
|
+
export declare function withDesktopFingerprint<S extends DesktopUiStep>(step: S): S;
|
|
18
|
+
export {};
|
package/dist/script/hash.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
export declare const UI_SCRIPT_SCHEMA_HASH = "e6860649ad1cba906fb704ce4b62b3ea4380203e6628c809571602f4d0947884";
|
|
2
|
+
/**
|
|
3
|
+
* The desktop script schema hash: SHA-256 of the canonical JSON of
|
|
4
|
+
* `schema/ui-script-desktop-v1.schema.json` (decision OD-18). A desk lists it
|
|
5
|
+
* in `capabilities().scriptSchemaHashes`, a `desk.run` request carries it as
|
|
6
|
+
* `schemaHash`, and wspace-workflow-svc adds it to `acceptedSchemaHashes`
|
|
7
|
+
* (P2-03s) before any consumer dispatches desktop scripts. It is separate
|
|
8
|
+
* from `UI_SCRIPT_SCHEMA_HASH`, so desktop changes never move the web hash.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DESKTOP_SCRIPT_SCHEMA_HASH = "a1c55895922b0389e04931ba4a2b4f6f9c487e553890ff987ba4527cf9897fce";
|
|
2
11
|
/** The schema hash of a JSON Schema document (the same function the constant was computed with). */
|
|
3
12
|
export declare function schemaHashOf(jsonSchema: unknown): string;
|
package/dist/script/index.d.ts
CHANGED
|
@@ -3,16 +3,24 @@
|
|
|
3
3
|
* `types.ts` for the format, `parse.ts` for validation, `capabilities.ts` for
|
|
4
4
|
* what a desk must support, `adapters/` for the conversions from and to the
|
|
5
5
|
* existing step vocabularies, and `describe.ts` for step descriptions.
|
|
6
|
+
*
|
|
7
|
+
* The desktop script (plan P2-03a) is `desktop-types.ts`, validated by
|
|
8
|
+
* `parseDesktopUiScript` against its own schema and hash
|
|
9
|
+
* (`DESKTOP_SCRIPT_SCHEMA_HASH`), and checked against a desk's capabilities
|
|
10
|
+
* by `checkDesktopScriptForDesk` (`desktop-capabilities.ts`).
|
|
6
11
|
*/
|
|
7
12
|
export * from './types.js';
|
|
8
13
|
export * from './limits.js';
|
|
14
|
+
export * from './desktop-types.js';
|
|
9
15
|
export { ELEMENT_KEY_PATTERN, NAME_PATTERN, STEP_ID_PATTERN, uiExpressionSchema, uiScriptRegistry, uiScriptSchema, uiStepSchema, uiTargetMethodSchema, uiTargetRefSchema, uiTargetSchema, } from './schema.js';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
16
|
+
export { DEFAULT_DESK_FILE_BYTES, MAX_DESK_COORDINATE, MAX_DESK_FILE_BYTES, MAX_DESK_GET_ATTRIBUTES, MAX_DESK_IMAGE_BASE64, MAX_DESK_IMAGE_BYTES, MAX_DESK_IMAGE_PIXELS, MAX_DESK_OPEN_APP_ARGS, MAX_DESK_PATH_LENGTH, MAX_DESK_RECORDED_SCALE, MAX_DESK_SELECTOR_INDEX, MAX_DESK_SELECTOR_PATH, MAX_DESK_SELECTOR_STRING, MAX_DESK_SET_VALUE, MAX_DESK_TEXT_OCCURRENCE, MAX_DESK_TEXT_TARGET, desktopUiScriptRegistry, desktopUiScriptSchema, desktopUiStepSchema, desktopUiTargetMethodSchema, desktopUiTargetRefSchema, desktopUiTargetSchema, } from './desktop-schema.js';
|
|
17
|
+
export { type ParseUiScriptOptions, UI_EXPRESSION_ARITY, UiScriptError, type UiScriptErrorCode, isApplicationName, isWorkspaceRelativePath, parseDesktopUiScript, parseUiScript, safeParseDesktopUiScript, safeParseUiScript, } from './parse.js';
|
|
18
|
+
export { RECORDING_ACTION_OF, desktopStepFingerprint, uiStepFingerprint, withDesktopFingerprint, withFingerprint, } from './fingerprint.js';
|
|
12
19
|
export { canonicalJson } from './canonical.js';
|
|
13
|
-
export { UI_SCRIPT_SCHEMA_HASH, schemaHashOf } from './hash.js';
|
|
14
|
-
export { UI_SCRIPT_SCHEMA_TITLE, uiScriptJsonSchema } from './json-schema.js';
|
|
20
|
+
export { DESKTOP_SCRIPT_SCHEMA_HASH, UI_SCRIPT_SCHEMA_HASH, schemaHashOf } from './hash.js';
|
|
21
|
+
export { UI_DESKTOP_SCRIPT_SCHEMA_TITLE, UI_SCRIPT_SCHEMA_TITLE, desktopUiScriptJsonSchema, uiScriptJsonSchema, } from './json-schema.js';
|
|
15
22
|
export { CAPABILITY_IDS, SCRIPT_CAPABILITY, missingCapabilities, requiredCapabilities } from './capabilities.js';
|
|
23
|
+
export { DESKTOP_DESK_CONTRACT_VERSION, DESK_ACTION_NAMES, DESK_SELECTOR_PLATFORM_NAMES, COMMAND_INTERPRETER_APPS, DESK_SHELL_ACTIONS, DESK_TARGET_KIND_NAMES, type DeskActionName, type DeskCapabilitiesLike, type DeskFeature, type DeskNeed, type DeskSelectorPlatformName, type DeskShellAction, type DeskShellStep, type DeskShortfall, type DeskTargetKindName, type DesktopDeskCheck, type DesktopDeskCheckOptions, checkDesktopScriptForDesk, checkDesktopScriptShell, deskFeaturesOfMethod, deskHasFeature, desktopScriptDeskNeeds, desktopShellSteps, isCommandInterpreterApp, } from './desktop-capabilities.js';
|
|
16
24
|
export { type WalkedStep, childBlocks, countSteps, stepAtPath, stepExpressions, stepTargets, visitExpression, walkSteps, } from './walk.js';
|
|
17
25
|
export { type StepDescription, UI_SCRIPT_STEP_KEY_PREFIX, UI_SCRIPT_STEP_MESSAGES, type UiScriptStepMessageKey, type UiScriptStepMessageName, describeExpression, describeStep, describeTarget, stepMessageKey, } from './describe.js';
|
|
18
26
|
export { BROWSER_STEP_ACTIONS, type BrowserActionField, type BrowserActionStep, type BrowserStepAction, } from './adapters/browser-action-contract.js';
|
|
@@ -20,4 +28,6 @@ export { fromBrowserActionSteps } from './adapters/from-browser-action.js';
|
|
|
20
28
|
export { type LowerOptions, toBrowserActionSteps } from './adapters/to-browser-action.js';
|
|
21
29
|
export { fromRemoteBrowserSteps, targetFromPlaywrightSelector } from './adapters/from-remote-browser.js';
|
|
22
30
|
export { fromRecording, toRecording } from './adapters/recording.js';
|
|
31
|
+
export { type FromRecordingForDeskOptions, desktopTargetOfRecordedTarget, fromRecordingForDesk, selectorMethodOfRecordedTarget, } from './adapters/recording-desktop.js';
|
|
32
|
+
export { type DeskRolePlatform, platformRole, rolesMatch } from './desk-roles.js';
|
|
23
33
|
export { COMPUTER_USE_ACTIONS, COMPUTER_USE_DEFAULT_WAIT_MS, COMPUTER_USE_MAX_WAIT_MS, COMPUTER_USE_SKIP_REASONS, type ComputerUseAction, type ComputerUseActionRecord, type ComputerUseConversion, type ComputerUseProposedElement, type ComputerUseSkipReason, type ComputerUseSkippedAction, type ComputerUseUiTarget, DEFAULT_LOGIN_SECRET_REFS, MAX_COMPUTER_USE_ACTIONS, type ScriptFromComputerUseOptions, scriptFromComputerUseActions, targetFromUiFingerprint, } from './adapters/from-computer-use.js';
|
|
@@ -2,3 +2,11 @@
|
|
|
2
2
|
export declare const UI_SCRIPT_SCHEMA_TITLE = "FluidGrids UI script v1";
|
|
3
3
|
/** The JSON Schema (draft 2020-12) of UI script v1, as accepted on input. */
|
|
4
4
|
export declare function uiScriptJsonSchema(): Record<string, unknown>;
|
|
5
|
+
/** The title the committed desktop JSON Schema carries. */
|
|
6
|
+
export declare const UI_DESKTOP_SCRIPT_SCHEMA_TITLE = "FluidGrids desktop UI script v1";
|
|
7
|
+
/**
|
|
8
|
+
* The JSON Schema (draft 2020-12) of the desktop UI script, as accepted on
|
|
9
|
+
* input. Committed as `schema/ui-script-desktop-v1.schema.json`; its hash is
|
|
10
|
+
* `DESKTOP_SCRIPT_SCHEMA_HASH`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function desktopUiScriptJsonSchema(): Record<string, unknown>;
|
package/dist/script/parse.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DesktopUiScript } from './desktop-types.js';
|
|
1
2
|
import type { UiExpressionOp, UiScript } from './types.js';
|
|
2
3
|
export type UiScriptErrorCode = 'INVALID_SCRIPT' | 'SCRIPT_TOO_LARGE' | 'TOO_MANY_STEPS' | 'DUPLICATE_STEP_ID' | 'UNKNOWN_ELEMENT' | 'UNKNOWN_INPUT' | 'FINGERPRINT_MISMATCH' | 'CREDENTIAL_IN_SCRIPT' | 'UNRESOLVED';
|
|
3
4
|
/** A script that cannot be used. `path` names the step (see `walk.ts`) or the field at fault. */
|
|
@@ -29,3 +30,31 @@ export declare function safeParseUiScript(value: unknown, options?: ParseUiScrip
|
|
|
29
30
|
success: false;
|
|
30
31
|
error: UiScriptError;
|
|
31
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Parse a stored desktop script (an object, or its JSON text) and check it.
|
|
35
|
+
* Returns the script unchanged; throws `UiScriptError`. A web script (no
|
|
36
|
+
* `surface: 'desktop'`) is refused with `INVALID_SCRIPT` at `surface`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseDesktopUiScript(value: unknown, options?: ParseUiScriptOptions): DesktopUiScript;
|
|
39
|
+
/** `parseDesktopUiScript` without throwing. */
|
|
40
|
+
export declare function safeParseDesktopUiScript(value: unknown, options?: ParseUiScriptOptions): {
|
|
41
|
+
success: true;
|
|
42
|
+
script: DesktopUiScript;
|
|
43
|
+
} | {
|
|
44
|
+
success: false;
|
|
45
|
+
error: UiScriptError;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Whether a path stays inside the desk's workspace folder as written:
|
|
49
|
+
* relative, no `..` segment, no drive letter, home or network prefix, no
|
|
50
|
+
* control character. The desk checks again after resolving symbolic links
|
|
51
|
+
* (document 26 DR5); this refuses an obviously escaping literal early.
|
|
52
|
+
*/
|
|
53
|
+
export declare function isWorkspaceRelativePath(path: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* An application name is a registered name or id, never a path or a command
|
|
56
|
+
* line (desk contract v3 section 5): no path separator, no `..`, no shell
|
|
57
|
+
* metacharacter, no control character (the desk's own rule, plus the
|
|
58
|
+
* metacharacters as defence in depth).
|
|
59
|
+
*/
|
|
60
|
+
export declare function isApplicationName(app: string): boolean;
|