@burdenoff/ui-engine 2026.1202.2 → 2026.1204.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.
Files changed (42) hide show
  1. package/README.md +2 -0
  2. package/dist/analyze.js +1 -1
  3. package/dist/dom-runtime.iife.js +1 -1
  4. package/dist/dom-runtime.js +1 -1
  5. package/dist/drivers.js +9 -9
  6. package/dist/heal.js +4 -4
  7. package/dist/{index-yc0jgph6.js → index-0tfzfxx9.js} +5 -0
  8. package/dist/{index-8w31tpfq.js → index-3r2y0mnc.js} +4 -4
  9. package/dist/index-5pv673wd.js +1122 -0
  10. package/dist/{index-pfdm8evf.js → index-8eb4xd1j.js} +433 -2
  11. package/dist/{index-6h7ah1dw.js → index-9xgz8dxt.js} +1 -1
  12. package/dist/{index-g7724awk.js → index-axph39g0.js} +22 -0
  13. package/dist/{index-xdtanv9b.js → index-dwp10g62.js} +1 -1
  14. package/dist/{index-qg9yfr7r.js → index-n7ah1jn7.js} +144 -3
  15. package/dist/{index-qm9nd548.js → index-ptrmf779.js} +3 -3
  16. package/dist/{index-3hsp44k5.js → index-vpm1gnmy.js} +6 -6
  17. package/dist/{index-rs3yzt5q.js → index-wnch00m6.js} +4 -4
  18. package/dist/{index-70vm0qz8.js → index-zagmp5ya.js} +1 -1
  19. package/dist/{index-hw5npwsv.js → index-zpxk3fzd.js} +1 -1
  20. package/dist/index.js +105 -11
  21. package/dist/interpret/errors.d.ts +7 -1
  22. package/dist/interpret.js +5 -5
  23. package/dist/script/desktop-capabilities.d.ts +120 -0
  24. package/dist/script/desktop-schema.d.ts +279 -0
  25. package/dist/script/desktop-types.d.ts +265 -0
  26. package/dist/script/fingerprint.d.ts +10 -1
  27. package/dist/script/hash.d.ts +9 -0
  28. package/dist/script/index.d.ts +12 -4
  29. package/dist/script/json-schema.d.ts +8 -0
  30. package/dist/script/parse.d.ts +29 -0
  31. package/dist/script/schema.d.ts +2098 -1
  32. package/dist/script/walk.d.ts +18 -4
  33. package/dist/script.js +99 -5
  34. package/dist/target/container.d.ts +47 -0
  35. package/dist/target/index.d.ts +1 -0
  36. package/dist/target/methods.d.ts +2 -0
  37. package/dist/target/types.d.ts +18 -1
  38. package/dist/target.js +19 -1
  39. package/dist/testing.js +2 -2
  40. package/package.json +4 -2
  41. package/schema/ui-script-desktop-v1.schema.json +12181 -0
  42. package/dist/index-68x61c7a.js +0 -743
@@ -4,26 +4,40 @@
4
4
  * top-level step, `"2.then.0"` the first step of its `then` block, and
5
5
  * `"cleanup.0"` the first clean-up step. The interpreter's step ranges and
6
6
  * the step events use the same paths.
7
+ *
8
+ * Every function also takes a desktop script or step (`desktop-types.ts`),
9
+ * with the desktop fields included, and returns desktop types for it.
7
10
  */
11
+ import type { DesktopUiScript, DesktopUiStep, DesktopUiTargetRef } from './desktop-types.js';
8
12
  import type { UiExpression, UiScript, UiStep, UiTargetRef } from './types.js';
13
+ type AnyStep = UiStep | DesktopUiStep;
14
+ type AnyScript = Pick<UiScript, 'steps' | 'cleanup'> | Pick<DesktopUiScript, 'steps' | 'cleanup'>;
9
15
  /** The nested blocks of a step, by block name. */
10
16
  export declare function childBlocks(step: UiStep): Array<[string, UiStep[]]>;
17
+ export declare function childBlocks(step: DesktopUiStep): Array<[string, DesktopUiStep[]]>;
18
+ export declare function childBlocks(step: AnyStep): Array<[string, AnyStep[]]>;
11
19
  /** One step with where it sits. */
12
- export interface WalkedStep {
13
- step: UiStep;
20
+ export interface WalkedStep<S extends AnyStep = UiStep> {
21
+ step: S;
14
22
  path: string;
15
23
  /** Flow blocks around the step (0 for a top-level or clean-up step). */
16
24
  depth: number;
17
25
  }
18
26
  /** Every step of a script in document order: the main steps, then the clean-up block. */
19
27
  export declare function walkSteps(script: Pick<UiScript, 'steps' | 'cleanup'>): Generator<WalkedStep>;
28
+ export declare function walkSteps(script: Pick<DesktopUiScript, 'steps' | 'cleanup'>): Generator<WalkedStep<DesktopUiStep>>;
29
+ export declare function walkSteps(script: AnyScript): Generator<WalkedStep<AnyStep>>;
20
30
  /** Total steps in a script, nested blocks and the clean-up block included. */
21
- export declare function countSteps(script: Pick<UiScript, 'steps' | 'cleanup'>): number;
31
+ export declare function countSteps(script: AnyScript): number;
22
32
  /** The step at a path, or undefined. */
23
33
  export declare function stepAtPath(script: Pick<UiScript, 'steps' | 'cleanup'>, path: string): UiStep | undefined;
34
+ export declare function stepAtPath(script: Pick<DesktopUiScript, 'steps' | 'cleanup'>, path: string): DesktopUiStep | undefined;
24
35
  /** Every target reference a step holds, with the field it sits in (the step's own blocks excluded). */
25
36
  export declare function stepTargets(step: UiStep): Array<[string, UiTargetRef]>;
37
+ export declare function stepTargets(step: DesktopUiStep): Array<[string, DesktopUiTargetRef]>;
38
+ export declare function stepTargets(step: AnyStep): Array<[string, UiTargetRef | DesktopUiTargetRef]>;
26
39
  /** Every expression a step holds, with the field it sits in (the step's own blocks excluded). */
27
- export declare function stepExpressions(step: UiStep): Array<[string, UiExpression]>;
40
+ export declare function stepExpressions(step: AnyStep): Array<[string, UiExpression]>;
28
41
  /** Calls `visit` on an expression and every expression inside it, with its depth (the root is 1). */
29
42
  export declare function visitExpression(expression: UiExpression, visit: (node: UiExpression, depth: number) => void, depth?: number): void;
43
+ export {};
package/dist/script.js CHANGED
@@ -1,4 +1,8 @@
1
1
  import {
2
+ DESKTOP_SCRIPT_SURFACE2,
3
+ UI_DESKTOP_TARGET_METHOD_KINDS2,
4
+ UI_DESKTOP_GET_WHAT2,
5
+ UI_DESKTOP_ONLY_ACTIONS2,
2
6
  uiScriptRegistry2,
3
7
  NAME_PATTERN2,
4
8
  STEP_ID_PATTERN2,
@@ -9,21 +13,64 @@ import {
9
13
  uiTargetRefSchema2,
10
14
  uiStepSchema2,
11
15
  uiScriptSchema2,
16
+ MAX_DESK_SELECTOR_STRING2,
17
+ MAX_DESK_SELECTOR_PATH2,
18
+ MAX_DESK_SELECTOR_INDEX2,
19
+ MAX_DESK_IMAGE_BYTES2,
20
+ MAX_DESK_IMAGE_PIXELS2,
21
+ MAX_DESK_IMAGE_BASE642,
22
+ MAX_DESK_TEXT_TARGET2,
23
+ MAX_DESK_TEXT_OCCURRENCE2,
24
+ MAX_DESK_RECORDED_SCALE2,
25
+ MAX_DESK_COORDINATE2,
26
+ MAX_DESK_OPEN_APP_ARGS2,
27
+ MAX_DESK_GET_ATTRIBUTES2,
28
+ MAX_DESK_FILE_BYTES2,
29
+ DEFAULT_DESK_FILE_BYTES2,
30
+ MAX_DESK_PATH_LENGTH2,
31
+ desktopUiScriptRegistry2,
32
+ desktopUiTargetMethodSchema2,
33
+ desktopUiTargetSchema2,
34
+ desktopUiTargetRefSchema2,
35
+ desktopUiStepSchema2,
36
+ desktopUiScriptSchema2,
12
37
  canonicalJson2,
13
38
  RECORDING_ACTION_OF2,
14
39
  uiStepFingerprint2,
40
+ desktopStepFingerprint2,
15
41
  withFingerprint2,
42
+ withDesktopFingerprint2,
16
43
  UiScriptError2,
17
44
  UI_EXPRESSION_ARITY2,
18
45
  parseUiScript2,
19
- safeParseUiScript2
20
- } from "./index-68x61c7a.js";
46
+ safeParseUiScript2,
47
+ parseDesktopUiScript2,
48
+ safeParseDesktopUiScript2,
49
+ isWorkspaceRelativePath2,
50
+ isApplicationName2
51
+ } from "./index-5pv673wd.js";
21
52
  import"./index-dcs2pe49.js";
22
53
  import {
23
54
  UI_SCRIPT_SCHEMA_HASH2,
55
+ DESKTOP_SCRIPT_SCHEMA_HASH2,
24
56
  schemaHashOf2,
25
57
  UI_SCRIPT_SCHEMA_TITLE2,
26
58
  uiScriptJsonSchema2,
59
+ UI_DESKTOP_SCRIPT_SCHEMA_TITLE2,
60
+ desktopUiScriptJsonSchema2,
61
+ DESKTOP_DESK_CONTRACT_VERSION2,
62
+ DESK_ACTION_NAMES2,
63
+ DESK_TARGET_KIND_NAMES2,
64
+ DESK_SELECTOR_PLATFORM_NAMES2,
65
+ DESK_SHELL_ACTIONS2,
66
+ COMMAND_INTERPRETER_APPS2,
67
+ isCommandInterpreterApp2,
68
+ deskFeaturesOfMethod2,
69
+ deskHasFeature2,
70
+ desktopScriptDeskNeeds2,
71
+ desktopShellSteps2,
72
+ checkDesktopScriptShell2,
73
+ checkDesktopScriptForDesk2,
27
74
  BROWSER_STEP_ACTIONS2,
28
75
  fromBrowserActionSteps2,
29
76
  toBrowserActionSteps2,
@@ -39,7 +86,7 @@ import {
39
86
  COMPUTER_USE_SKIP_REASONS2,
40
87
  targetFromUiFingerprint2,
41
88
  scriptFromComputerUseActions2
42
- } from "./index-pfdm8evf.js";
89
+ } from "./index-8eb4xd1j.js";
43
90
  import"./index-5xqsjeqj.js";
44
91
  import {
45
92
  UI_SCRIPT_STEP_KEY_PREFIX2,
@@ -54,7 +101,7 @@ import {
54
101
  SCRIPT_CAPABILITY2,
55
102
  requiredCapabilities2,
56
103
  missingCapabilities2
57
- } from "./index-hw5npwsv.js";
104
+ } from "./index-zpxk3fzd.js";
58
105
  import {
59
106
  UI_SCRIPT_VERSION2,
60
107
  MAX_SCRIPT_STEPS2,
@@ -105,21 +152,44 @@ import {
105
152
  stepTargets2,
106
153
  stepExpressions2,
107
154
  visitExpression2
108
- } from "./index-g7724awk.js";
155
+ } from "./index-axph39g0.js";
109
156
  export {
110
157
  BROWSER_STEP_ACTIONS2 as BROWSER_STEP_ACTIONS,
111
158
  CAPABILITY_IDS2 as CAPABILITY_IDS,
159
+ COMMAND_INTERPRETER_APPS2 as COMMAND_INTERPRETER_APPS,
112
160
  COMPUTER_USE_ACTIONS2 as COMPUTER_USE_ACTIONS,
113
161
  COMPUTER_USE_DEFAULT_WAIT_MS2 as COMPUTER_USE_DEFAULT_WAIT_MS,
114
162
  COMPUTER_USE_MAX_WAIT_MS2 as COMPUTER_USE_MAX_WAIT_MS,
115
163
  COMPUTER_USE_SKIP_REASONS2 as COMPUTER_USE_SKIP_REASONS,
164
+ DEFAULT_DESK_FILE_BYTES2 as DEFAULT_DESK_FILE_BYTES,
116
165
  DEFAULT_LOGIN_SECRET_REFS2 as DEFAULT_LOGIN_SECRET_REFS,
166
+ DESKTOP_DESK_CONTRACT_VERSION2 as DESKTOP_DESK_CONTRACT_VERSION,
167
+ DESKTOP_SCRIPT_SCHEMA_HASH2 as DESKTOP_SCRIPT_SCHEMA_HASH,
168
+ DESKTOP_SCRIPT_SURFACE2 as DESKTOP_SCRIPT_SURFACE,
169
+ DESK_ACTION_NAMES2 as DESK_ACTION_NAMES,
170
+ DESK_SELECTOR_PLATFORM_NAMES2 as DESK_SELECTOR_PLATFORM_NAMES,
171
+ DESK_SHELL_ACTIONS2 as DESK_SHELL_ACTIONS,
172
+ DESK_TARGET_KIND_NAMES2 as DESK_TARGET_KIND_NAMES,
117
173
  ELEMENT_KEY_PATTERN2 as ELEMENT_KEY_PATTERN,
118
174
  LEGACY_MAX_BROWSER_STEPS2 as LEGACY_MAX_BROWSER_STEPS,
119
175
  LEGACY_MAX_STEPS_BYTES2 as LEGACY_MAX_STEPS_BYTES,
120
176
  LEGACY_MAX_STEP_TIMEOUT_MS2 as LEGACY_MAX_STEP_TIMEOUT_MS,
121
177
  MAX_COMPUTER_USE_ACTIONS2 as MAX_COMPUTER_USE_ACTIONS,
122
178
  MAX_DELAY_MS2 as MAX_DELAY_MS,
179
+ MAX_DESK_COORDINATE2 as MAX_DESK_COORDINATE,
180
+ MAX_DESK_FILE_BYTES2 as MAX_DESK_FILE_BYTES,
181
+ MAX_DESK_GET_ATTRIBUTES2 as MAX_DESK_GET_ATTRIBUTES,
182
+ MAX_DESK_IMAGE_BASE642 as MAX_DESK_IMAGE_BASE64,
183
+ MAX_DESK_IMAGE_BYTES2 as MAX_DESK_IMAGE_BYTES,
184
+ MAX_DESK_IMAGE_PIXELS2 as MAX_DESK_IMAGE_PIXELS,
185
+ MAX_DESK_OPEN_APP_ARGS2 as MAX_DESK_OPEN_APP_ARGS,
186
+ MAX_DESK_PATH_LENGTH2 as MAX_DESK_PATH_LENGTH,
187
+ MAX_DESK_RECORDED_SCALE2 as MAX_DESK_RECORDED_SCALE,
188
+ MAX_DESK_SELECTOR_INDEX2 as MAX_DESK_SELECTOR_INDEX,
189
+ MAX_DESK_SELECTOR_PATH2 as MAX_DESK_SELECTOR_PATH,
190
+ MAX_DESK_SELECTOR_STRING2 as MAX_DESK_SELECTOR_STRING,
191
+ MAX_DESK_TEXT_OCCURRENCE2 as MAX_DESK_TEXT_OCCURRENCE,
192
+ MAX_DESK_TEXT_TARGET2 as MAX_DESK_TEXT_TARGET,
123
193
  MAX_EXPRESSION_DEPTH2 as MAX_EXPRESSION_DEPTH,
124
194
  MAX_EXPRESSION_ITEMS2 as MAX_EXPRESSION_ITEMS,
125
195
  MAX_EXTRACT_FIELDS2 as MAX_EXTRACT_FIELDS,
@@ -152,6 +222,10 @@ export {
152
222
  STEP_ID_PATTERN2 as STEP_ID_PATTERN,
153
223
  UI_ANCHOR_RELATIONS2 as UI_ANCHOR_RELATIONS,
154
224
  UI_DESKTOP_ACTIONS2 as UI_DESKTOP_ACTIONS,
225
+ UI_DESKTOP_GET_WHAT2 as UI_DESKTOP_GET_WHAT,
226
+ UI_DESKTOP_ONLY_ACTIONS2 as UI_DESKTOP_ONLY_ACTIONS,
227
+ UI_DESKTOP_SCRIPT_SCHEMA_TITLE2 as UI_DESKTOP_SCRIPT_SCHEMA_TITLE,
228
+ UI_DESKTOP_TARGET_METHOD_KINDS2 as UI_DESKTOP_TARGET_METHOD_KINDS,
155
229
  UI_EXPRESSION_ARITY2 as UI_EXPRESSION_ARITY,
156
230
  UI_EXPRESSION_OPS2 as UI_EXPRESSION_OPS,
157
231
  UI_FLOW_ACTIONS2 as UI_FLOW_ACTIONS,
@@ -166,18 +240,37 @@ export {
166
240
  UI_WEB_ACTIONS2 as UI_WEB_ACTIONS,
167
241
  UiScriptError2 as UiScriptError,
168
242
  canonicalJson2 as canonicalJson,
243
+ checkDesktopScriptForDesk2 as checkDesktopScriptForDesk,
244
+ checkDesktopScriptShell2 as checkDesktopScriptShell,
169
245
  childBlocks2 as childBlocks,
170
246
  countSteps2 as countSteps,
171
247
  describeExpression2 as describeExpression,
172
248
  describeStep2 as describeStep,
173
249
  describeTarget2 as describeTarget,
250
+ deskFeaturesOfMethod2 as deskFeaturesOfMethod,
251
+ deskHasFeature2 as deskHasFeature,
252
+ desktopScriptDeskNeeds2 as desktopScriptDeskNeeds,
253
+ desktopShellSteps2 as desktopShellSteps,
254
+ desktopStepFingerprint2 as desktopStepFingerprint,
255
+ desktopUiScriptJsonSchema2 as desktopUiScriptJsonSchema,
256
+ desktopUiScriptRegistry2 as desktopUiScriptRegistry,
257
+ desktopUiScriptSchema2 as desktopUiScriptSchema,
258
+ desktopUiStepSchema2 as desktopUiStepSchema,
259
+ desktopUiTargetMethodSchema2 as desktopUiTargetMethodSchema,
260
+ desktopUiTargetRefSchema2 as desktopUiTargetRefSchema,
261
+ desktopUiTargetSchema2 as desktopUiTargetSchema,
174
262
  fromBrowserActionSteps2 as fromBrowserActionSteps,
175
263
  fromRecording2 as fromRecording,
176
264
  fromRemoteBrowserSteps2 as fromRemoteBrowserSteps,
265
+ isApplicationName2 as isApplicationName,
266
+ isCommandInterpreterApp2 as isCommandInterpreterApp,
267
+ isWorkspaceRelativePath2 as isWorkspaceRelativePath,
177
268
  jsonByteLength2 as jsonByteLength,
178
269
  missingCapabilities2 as missingCapabilities,
270
+ parseDesktopUiScript2 as parseDesktopUiScript,
179
271
  parseUiScript2 as parseUiScript,
180
272
  requiredCapabilities2 as requiredCapabilities,
273
+ safeParseDesktopUiScript2 as safeParseDesktopUiScript,
181
274
  safeParseUiScript2 as safeParseUiScript,
182
275
  schemaHashOf2 as schemaHashOf,
183
276
  scriptFromComputerUseActions2 as scriptFromComputerUseActions,
@@ -200,5 +293,6 @@ export {
200
293
  uiTargetSchema2 as uiTargetSchema,
201
294
  visitExpression2 as visitExpression,
202
295
  walkSteps2 as walkSteps,
296
+ withDesktopFingerprint2 as withDesktopFingerprint,
203
297
  withFingerprint2 as withFingerprint
204
298
  };
@@ -0,0 +1,47 @@
1
+ import { type ElementStateProbe, type WebSearchRoot } from './dom.js';
2
+ import { type WebCandidateContainer } from './types.js';
3
+ /** Most ancestors looked at for a candidate's container. */
4
+ export declare const MAX_CONTAINER_DEPTH = 12;
5
+ /** Most container proposals checked on the page for one candidate; each check runs the anchor method once. */
6
+ export declare const MAX_CONTAINER_CHECKS = 3;
7
+ /** Most checks for all the candidates of one resolution together. */
8
+ export declare const MAX_CONTAINER_CHECKS_PER_RESOLUTION = 8;
9
+ /**
10
+ * Time, in milliseconds, after which no further check starts in one resolution.
11
+ * An ambiguous target is polled until its wait runs out, and every poll
12
+ * resolves it again, so the extra work per poll must stay small on large pages.
13
+ */
14
+ export declare const CONTAINER_TIME_BUDGET_MS = 25;
15
+ /** Pages with more elements under the search root get no containers: one check would scan them all. */
16
+ export declare const MAX_CONTAINER_PAGE_ELEMENTS = 5000;
17
+ /** Roles of elements that group content under a name, so `inside` that name says where an element is. */
18
+ export declare const CONTAINER_ROLES: Set<string>;
19
+ /**
20
+ * What the candidates of one resolution share: the answers of the checks run
21
+ * so far (two candidates often walk past the same ancestors), the checks left
22
+ * and the time limit. A budget is valid for one root, one state and one moment
23
+ * of the page; never keep it across resolutions.
24
+ */
25
+ export interface ContainerBudget {
26
+ /** Elements an `inside` check found, by anchor and role. */
27
+ answers: Map<string, Element[]>;
28
+ /** Checks that may still run, for all candidates together. */
29
+ checksLeft: number;
30
+ /** The clock (milliseconds) and the time after which no check starts. */
31
+ now: () => number;
32
+ deadline: number;
33
+ }
34
+ /** A fresh budget for one resolution. */
35
+ export declare function createContainerBudget(now?: () => number): ContainerBudget;
36
+ /**
37
+ * The nearest container of an ambiguous candidate that tells it apart from
38
+ * every other element: an `inside` anchor on it, with the candidate's role,
39
+ * finds exactly this element. Undefined when the candidate has no role or is
40
+ * sensitive, and when no container within `MAX_CONTAINER_DEPTH` ancestors
41
+ * does so with the checks the budget allows (`MAX_CONTAINER_CHECKS` for this
42
+ * candidate, the rest of the resolution's checks and time). An answer already
43
+ * in the budget is used without counting as a check.
44
+ */
45
+ export declare function describeContainer(element: Element, root: WebSearchRoot, keep: (element: Element) => boolean, probe?: ElementStateProbe, budget?: ContainerBudget): WebCandidateContainer | undefined;
46
+ /** True when the search root is small enough for containers to be described. */
47
+ export declare function containersAllowed(root: WebSearchRoot): boolean;
@@ -9,6 +9,7 @@ export { MAX_COMPARED_TEXT, clip, containsText, editDistance, normaliseText, sam
9
9
  export { MAX_NAME_LENGTH, MAX_VISIBLE_TEXT, type TextProbe, accessibleName, isTypedContent, labelName, matchesRoleAndName, roleOf, visibleText, } from './aria.js';
10
10
  export { type ElementStateProbe, SENSITIVE_MARKERS, type WebSearchRoot, elementRect, elementsUnder, isElementEnabled, isElementVisible, isSecretFieldName, isSensitiveElement, parentAcrossShadow, } from './dom.js';
11
11
  export { ANCHOR_MARGIN_PX, DEFAULT_FUZZY_THRESHOLD, FUZZY_MARGIN, INTERACTIVE_ROLES, MAX_XPATH_RESULTS, type MethodMatch, type ScoredElement, matchMethod, relationDistance, } from './methods.js';
12
+ export { CONTAINER_ROLES, CONTAINER_TIME_BUDGET_MS, type ContainerBudget, MAX_CONTAINER_CHECKS, MAX_CONTAINER_CHECKS_PER_RESOLUTION, MAX_CONTAINER_DEPTH, MAX_CONTAINER_PAGE_ELEMENTS, containersAllowed, createContainerBudget, describeContainer, } from './container.js';
12
13
  export { type ResolveWebTargetOptions, type WebFrameEntry, type WebTargetMatches, describeCandidate, enterFrames, resolveAllWebTargets, resolveWebTarget, } from './resolve.js';
13
14
  export { DEFAULT_SNAPSHOT_MAX_NODES, type HydratedSnapshot, MAX_SNAPSHOT_DEPTH, MAX_SNAPSHOT_TEXT, type SerializeTreeSnapshotOptions, UI_TREE_SNAPSHOT_VERSION, type UiTreeSnapshot, type UiTreeSnapshotChild, type UiTreeSnapshotNode, hydrateTreeSnapshot, serializeTreeSnapshot, snapshotUrl, } from './snapshot.js';
14
15
  export { MASKED_MARKER, MAX_MASKED_PATHS, type MaskSnapshotOptions, type MaskedSnapshot, maskSnapshot, } from './snapshot-mask.js';
@@ -46,6 +46,8 @@ export interface MatchContext {
46
46
  /** The resolver's state filter. A text hit that fails it does not hide a matching ancestor. */
47
47
  keep?: (element: Element) => boolean;
48
48
  }
49
+ /** True for an element that titles the container it sits in (the `inside` relation's heading rule). */
50
+ export declare function isHeadingLike(element: Element): boolean;
49
51
  /** Distance from the anchor to the element along the relation, or null when the element is not in that relation. */
50
52
  export declare function relationDistance(relation: UiAnchorMethod['relation'], anchor: WebRect, element: WebRect): number | null;
51
53
  /** Run one method under the root. */
@@ -4,7 +4,7 @@
4
4
  * Everything a resolution reports is plain JSON (no element references), so the
5
5
  * DOM runtime can hand it across an isolated-world or CDP boundary unchanged.
6
6
  */
7
- import type { UiTargetMethodKind } from '../script/types.js';
7
+ import type { UiAnchor, UiTargetMethodKind } from '../script/types.js';
8
8
  /** Bounds in CSS pixels, relative to the top viewport (frame offsets added). */
9
9
  export interface WebRect {
10
10
  x: number;
@@ -46,6 +46,18 @@ export interface WebMethodAttempt {
46
46
  /** Elements the method matched in the required state. */
47
47
  matches: number;
48
48
  }
49
+ /**
50
+ * The nearest labelled container or landmark around an ambiguous candidate that
51
+ * tells it apart (BOFF-17588): the anchor method
52
+ * `{ kind: 'anchor', anchor, relation: 'inside', role: <the candidate's role> }`
53
+ * found exactly this candidate on the page the resolution ran on.
54
+ */
55
+ export interface WebCandidateContainer {
56
+ /** The anchor of the `inside` method: the container's role and name, or the text of the heading that titles it. */
57
+ anchor: UiAnchor;
58
+ /** The container element's own role, for display (`region`, `form`, `group`, ...); '' when it has none. */
59
+ role: string;
60
+ }
49
61
  /** One element a method matched, as an ambiguity report lists it. */
50
62
  export interface WebCandidate {
51
63
  role: string;
@@ -56,6 +68,11 @@ export interface WebCandidate {
56
68
  method: UiTargetMethodKind;
57
69
  /** The position of that method in the target. */
58
70
  methodIndex: number;
71
+ /**
72
+ * Only on `ELEMENT_AMBIGUOUS` candidates, and only when one was found: the container an `inside` anchor can name
73
+ * so that the target matches this candidate alone. Absent on every other report and on older engines.
74
+ */
75
+ container?: WebCandidateContainer;
59
76
  }
60
77
  /** Why the frame and shadow-root chain could not be followed. */
61
78
  export interface WebFrameProblem {
package/dist/target.js CHANGED
@@ -30,6 +30,15 @@ import {
30
30
  INTERACTIVE_ROLES2,
31
31
  relationDistance2,
32
32
  matchMethod2,
33
+ MAX_CONTAINER_DEPTH2,
34
+ MAX_CONTAINER_CHECKS2,
35
+ MAX_CONTAINER_CHECKS_PER_RESOLUTION2,
36
+ CONTAINER_TIME_BUDGET_MS2,
37
+ MAX_CONTAINER_PAGE_ELEMENTS2,
38
+ CONTAINER_ROLES2,
39
+ createContainerBudget2,
40
+ describeContainer2,
41
+ containersAllowed2,
33
42
  enterFrames2,
34
43
  describeCandidate2,
35
44
  resolveWebTarget2,
@@ -40,7 +49,7 @@ import {
40
49
  MAX_SNAPSHOT_TEXT2,
41
50
  serializeTreeSnapshot2,
42
51
  hydrateTreeSnapshot2
43
- } from "./index-qg9yfr7r.js";
52
+ } from "./index-n7ah1jn7.js";
44
53
  import {
45
54
  MAX_NAME_LENGTH3,
46
55
  MAX_VISIBLE_TEXT2,
@@ -72,6 +81,8 @@ import {
72
81
  } from "./index-t55wvhvh.js";
73
82
  export {
74
83
  ANCHOR_MARGIN_PX2 as ANCHOR_MARGIN_PX,
84
+ CONTAINER_ROLES2 as CONTAINER_ROLES,
85
+ CONTAINER_TIME_BUDGET_MS2 as CONTAINER_TIME_BUDGET_MS,
75
86
  DEFAULT_FUZZY_THRESHOLD2 as DEFAULT_FUZZY_THRESHOLD,
76
87
  DEFAULT_SNAPSHOT_MAX_NODES2 as DEFAULT_SNAPSHOT_MAX_NODES,
77
88
  FUZZY_MARGIN2 as FUZZY_MARGIN,
@@ -80,6 +91,10 @@ export {
80
91
  MAX_CANDIDATES2 as MAX_CANDIDATES,
81
92
  MAX_CANDIDATE_NAME2 as MAX_CANDIDATE_NAME,
82
93
  MAX_COMPARED_TEXT2 as MAX_COMPARED_TEXT,
94
+ MAX_CONTAINER_CHECKS2 as MAX_CONTAINER_CHECKS,
95
+ MAX_CONTAINER_CHECKS_PER_RESOLUTION2 as MAX_CONTAINER_CHECKS_PER_RESOLUTION,
96
+ MAX_CONTAINER_DEPTH2 as MAX_CONTAINER_DEPTH,
97
+ MAX_CONTAINER_PAGE_ELEMENTS2 as MAX_CONTAINER_PAGE_ELEMENTS,
83
98
  MAX_MASKED_PATHS2 as MAX_MASKED_PATHS,
84
99
  MAX_NAME_LENGTH3 as MAX_NAME_LENGTH,
85
100
  MAX_SNAPSHOT_DEPTH2 as MAX_SNAPSHOT_DEPTH,
@@ -96,8 +111,11 @@ export {
96
111
  accessibleName2 as accessibleName,
97
112
  attributeOf2 as attributeOf,
98
113
  clip2 as clip,
114
+ containersAllowed2 as containersAllowed,
99
115
  containsText2 as containsText,
116
+ createContainerBudget2 as createContainerBudget,
100
117
  describeCandidate2 as describeCandidate,
118
+ describeContainer2 as describeContainer,
101
119
  editDistance2 as editDistance,
102
120
  elementRect2 as elementRect,
103
121
  elementsUnder2 as elementsUnder,
package/dist/testing.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createDomDriver2
3
- } from "./index-8w31tpfq.js";
3
+ } from "./index-3r2y0mnc.js";
4
4
  import {
5
5
  UiDriverError2,
6
6
  createVirtualClock2
7
- } from "./index-yc0jgph6.js";
7
+ } from "./index-0tfzfxx9.js";
8
8
 
9
9
  // src/testing/fixtures/ambiguous.ts
10
10
  var AMBIGUOUS_HTML = `<!doctype html>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@burdenoff/ui-engine",
3
- "version": "2026.1202.2",
4
- "description": "Shared, browser-safe UI automation engine: recordings, capture-time masking, target resolution, replay, the UI script v1 contract, the multi-method web target resolver and DOM runtime, the UI script interpreter, the UI script analyzer and UI step healing for FluidGrids RPA and BotManor Stewards.",
3
+ "version": "2026.1204.1",
4
+ "description": "Shared, browser-safe UI automation engine: recordings, capture-time masking, target resolution, replay, the UI script v1 contract, the multi-method web target resolver and DOM runtime, the UI script interpreter, the UI script analyzer, UI step healing and the desktop script schema with its desk capability check for FluidGrids RPA and BotManor Stewards.",
5
5
  "license": "MIT",
6
6
  "author": "Burdenoff Consultancy Services Pvt. Ltd.",
7
7
  "repository": {
@@ -67,6 +67,7 @@
67
67
  "import": "./dist/testing.js"
68
68
  },
69
69
  "./schema/ui-script-v1.schema.json": "./schema/ui-script-v1.schema.json",
70
+ "./schema/ui-script-desktop-v1.schema.json": "./schema/ui-script-desktop-v1.schema.json",
70
71
  "./package.json": "./package.json"
71
72
  },
72
73
  "files": [
@@ -99,6 +100,7 @@
99
100
  "devDependencies": {
100
101
  "@burdenoff/toolchain": "2026.1123.1",
101
102
  "@types/bun": "^1.4.4",
103
+ "@vibecontrols/plugin-sdk": "2026.1203.4",
102
104
  "eslint": "^9.39.5",
103
105
  "happy-dom": "21.0.4",
104
106
  "typescript": "6.0.3",