@burdenoff/ui-engine 2026.1127.4 → 2026.1129.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/README.md +68 -4
- package/dist/analyze/analyze.d.ts +19 -0
- package/dist/analyze/context.d.ts +40 -0
- package/dist/analyze/index.d.ts +10 -0
- package/dist/analyze/messages.d.ts +46 -0
- package/dist/analyze/rules/fixed-wait.d.ts +6 -0
- package/dist/analyze/rules/hardware-input.d.ts +2 -0
- package/dist/analyze/rules/heal-consequential.d.ts +2 -0
- package/dist/analyze/rules/index.d.ts +3 -0
- package/dist/analyze/rules/inline-target.d.ts +2 -0
- package/dist/analyze/rules/masked-value.d.ts +8 -0
- package/dist/analyze/rules/no-cleanup.d.ts +2 -0
- package/dist/analyze/rules/plain-text-secret.d.ts +2 -0
- package/dist/analyze/rules/popup-handler-loop.d.ts +2 -0
- package/dist/analyze/rules/rule.d.ts +15 -0
- package/dist/analyze/rules/secret-origin.d.ts +7 -0
- package/dist/analyze/rules/sensitive-screenshot.d.ts +2 -0
- package/dist/analyze/rules/single-method-target.d.ts +2 -0
- package/dist/analyze/rules/unknown-variable.d.ts +2 -0
- package/dist/analyze/rules/unused-value.d.ts +2 -0
- package/dist/analyze/sensitive.d.ts +14 -0
- package/dist/analyze/types.d.ts +89 -0
- package/dist/analyze.d.ts +2 -0
- package/dist/analyze.js +26 -0
- package/dist/dom-runtime.iife.js +1 -1
- package/dist/dom-runtime.js +2 -2
- package/dist/drivers.js +13 -9
- package/dist/heal/answer.d.ts +26 -0
- package/dist/heal/consequence.d.ts +74 -0
- package/dist/heal/index.d.ts +19 -0
- package/dist/heal/modes.d.ts +25 -0
- package/dist/heal/popup-limits.d.ts +11 -0
- package/dist/heal/popup.d.ts +48 -0
- package/dist/heal/question.d.ts +41 -0
- package/dist/heal/target-from-node.d.ts +9 -0
- package/dist/heal/types.d.ts +134 -0
- package/dist/heal/verify-rules.d.ts +19 -0
- package/dist/heal/verify.d.ts +52 -0
- package/dist/heal.d.ts +2 -0
- package/dist/heal.js +106 -0
- package/dist/index-20bbwwc9.js +37 -0
- package/dist/{index-pm13mvvc.js → index-2g060ryg.js} +3 -196
- package/dist/index-6h7ah1dw.js +328 -0
- package/dist/{index-h88y5qgv.js → index-6kva2gvd.js} +6 -4
- package/dist/{index-ct2xctrq.js → index-70vm0qz8.js} +2 -2
- package/dist/{index-3f1j8386.js → index-8w31tpfq.js} +38 -19
- package/dist/{index-zzhysbkj.js → index-eff47v1g.js} +436 -20
- package/dist/{index-3jymbm5t.js → index-g7724awk.js} +1 -92
- package/dist/index-gvavb597.js +195 -0
- package/dist/index-hw5npwsv.js +63 -0
- package/dist/{index-ycs2bz1a.js → index-mhv6a02p.js} +11 -166
- package/dist/index-p5823rpv.js +0 -0
- package/dist/{index-5k26keah.js → index-qg9yfr7r.js} +16 -67
- package/dist/{index-895kscx3.js → index-qmv3ar39.js} +7 -5
- package/dist/index-t55wvhvh.js +229 -0
- package/dist/{index-77pcz6n3.js → index-vnv9tp11.js} +4 -2
- package/dist/index-w9jc25y9.js +306 -0
- package/dist/index-xdtanv9b.js +843 -0
- package/dist/{index-vg8r40y7.js → index-yc0jgph6.js} +7 -0
- package/dist/index-zhbwhdya.js +407 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +156 -26
- package/dist/interpret/driver.d.ts +14 -0
- package/dist/interpret/errors.d.ts +11 -2
- package/dist/interpret/events.d.ts +4 -0
- package/dist/interpret/run.d.ts +33 -0
- package/dist/interpret.js +5 -4
- package/dist/script.js +29 -23
- package/dist/target/index.d.ts +2 -0
- package/dist/target/roles.d.ts +11 -0
- package/dist/target/snapshot-mask.d.ts +49 -0
- package/dist/target/snapshot-tree.d.ts +65 -0
- package/dist/target/snapshot-url.d.ts +6 -0
- package/dist/target/snapshot.d.ts +1 -6
- package/dist/target.js +55 -13
- package/dist/testing.js +2 -2
- package/package.json +11 -3
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { UiTreeSnapshot, UiTreeSnapshotNode } from './snapshot.js';
|
|
2
|
+
/** The path of the root element. */
|
|
3
|
+
export declare const SNAPSHOT_ROOT_PATH = "/";
|
|
4
|
+
/** Longest node path accepted. */
|
|
5
|
+
export declare const MAX_SNAPSHOT_PATH_LENGTH = 1024;
|
|
6
|
+
/** Most elements a walk visits; a snapshot holds at most 5,000 nodes by default. */
|
|
7
|
+
export declare const MAX_SNAPSHOT_WALK = 100000;
|
|
8
|
+
/** Longest name or text the snapshot readers return. */
|
|
9
|
+
export declare const MAX_SNAPSHOT_NAME = 200;
|
|
10
|
+
/** How an element was reached from its parent: as a child, a shadow child, or a frame's document element. */
|
|
11
|
+
export type SnapshotEdge = 'root' | 'c' | 's' | 'f';
|
|
12
|
+
/** One element of a snapshot, with where it sits. */
|
|
13
|
+
export interface SnapshotEntry {
|
|
14
|
+
node: UiTreeSnapshotNode;
|
|
15
|
+
path: string;
|
|
16
|
+
edge: SnapshotEdge;
|
|
17
|
+
parent: SnapshotEntry | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The search root the element belongs to: `/` for the top document, the
|
|
20
|
+
* frame document element's path for a frame, `<host path>#shadow` for a
|
|
21
|
+
* shadow root. Selectors and uniqueness are judged within one scope.
|
|
22
|
+
*/
|
|
23
|
+
scope: string;
|
|
24
|
+
/** Position in document order (the walk order). */
|
|
25
|
+
order: number;
|
|
26
|
+
}
|
|
27
|
+
/** True for a path of the node path grammar. */
|
|
28
|
+
export declare function isSnapshotPath(path: unknown): path is string;
|
|
29
|
+
/** Every element of a snapshot in document order: an element, its children, its shadow children, then its frame. */
|
|
30
|
+
export declare function walkSnapshot(snapshot: Pick<UiTreeSnapshot, 'root'>): SnapshotEntry[];
|
|
31
|
+
/** The element at a path, or undefined when the path is not valid or names no element. */
|
|
32
|
+
export declare function snapshotNodeAt(snapshot: Pick<UiTreeSnapshot, 'root'>, path: string): UiTreeSnapshotNode | undefined;
|
|
33
|
+
/** The value of an attribute of a snapshot element, or undefined. */
|
|
34
|
+
export declare function attributeOf(node: UiTreeSnapshotNode, name: string): string | undefined;
|
|
35
|
+
/** The element itself carries a sensitive marker. */
|
|
36
|
+
export declare function hasSnapshotMarker(node: UiTreeSnapshotNode): boolean;
|
|
37
|
+
/** The element or an ancestor (across shadow roots and frames) carries a sensitive marker. */
|
|
38
|
+
export declare function isMarkedInSnapshot(entry: SnapshotEntry): boolean;
|
|
39
|
+
/** True for an element whose own `contenteditable` makes it editable (anything but "false"). */
|
|
40
|
+
export declare function isSnapshotEditingHost(node: UiTreeSnapshotNode): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* True when a snapshot element holds or shows data that must not leave the
|
|
43
|
+
* desk: a password, one-time-code, card or secret field, anything inside
|
|
44
|
+
* such a field, and anything marked sensitive (itself or an ancestor).
|
|
45
|
+
*/
|
|
46
|
+
export declare function isSensitiveSnapshotEntry(entry: SnapshotEntry): boolean;
|
|
47
|
+
/** The visible text of an element: its texts and its visible descendants' (shadow content included, frames not). */
|
|
48
|
+
export declare function snapshotText(node: UiTreeSnapshotNode, max?: number): string;
|
|
49
|
+
/** The role of a snapshot element: the first token of `role`, else the implicit role, else ''. */
|
|
50
|
+
export declare function snapshotRole(entry: SnapshotEntry): string;
|
|
51
|
+
/** Index of a scope: the elements of each scope, and its ids. */
|
|
52
|
+
export interface SnapshotIndex {
|
|
53
|
+
entries: SnapshotEntry[];
|
|
54
|
+
byPath: Map<string, SnapshotEntry>;
|
|
55
|
+
/** Elements by scope, in document order. */
|
|
56
|
+
byScope: Map<string, SnapshotEntry[]>;
|
|
57
|
+
}
|
|
58
|
+
/** Walk a snapshot once and index it by path and by scope. */
|
|
59
|
+
export declare function indexSnapshot(snapshot: Pick<UiTreeSnapshot, 'root'>): SnapshotIndex;
|
|
60
|
+
/** The accessible name of a snapshot element, as far as a snapshot allows. Sensitive elements have no name. */
|
|
61
|
+
export declare function snapshotName(entry: SnapshotEntry, index: SnapshotIndex, max?: number): string;
|
|
62
|
+
/** The frame and shadow hosts an element sits in, outermost first (the iframe or host elements). */
|
|
63
|
+
export declare function snapshotHosts(entry: SnapshotEntry): SnapshotEntry[];
|
|
64
|
+
/** How many frames (not shadow roots) an element sits in. */
|
|
65
|
+
export declare function snapshotFrameDepth(entry: SnapshotEntry): number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A URL as a snapshot keeps it: http(s) and relative URLs only, without user
|
|
3
|
+
* information, query or fragment, cut after a reset-style path segment, and
|
|
4
|
+
* with recognisable credentials replaced. Anything else is dropped (null).
|
|
5
|
+
*/
|
|
6
|
+
export declare function snapshotUrl(raw: string): string | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ElementStateProbe } from './dom.js';
|
|
2
|
+
export { snapshotUrl } from './snapshot-url.js';
|
|
2
3
|
export declare const UI_TREE_SNAPSHOT_VERSION = 1;
|
|
3
4
|
/** Default most nodes (elements and texts) a snapshot keeps; the rest is cut and `truncated` is set. */
|
|
4
5
|
export declare const DEFAULT_SNAPSHOT_MAX_NODES = 5000;
|
|
@@ -36,12 +37,6 @@ export interface SerializeTreeSnapshotOptions extends ElementStateProbe {
|
|
|
36
37
|
/** Most nodes kept. Absent means `DEFAULT_SNAPSHOT_MAX_NODES`. */
|
|
37
38
|
maxNodes?: number;
|
|
38
39
|
}
|
|
39
|
-
/**
|
|
40
|
-
* A URL as a snapshot keeps it: http(s) and relative URLs only, without user
|
|
41
|
-
* information, query or fragment, cut after a reset-style path segment, and
|
|
42
|
-
* with recognisable credentials replaced. Anything else is dropped (null).
|
|
43
|
-
*/
|
|
44
|
-
export declare function snapshotUrl(raw: string): string | null;
|
|
45
40
|
/** Serialise a live document into a value-free tree snapshot. */
|
|
46
41
|
export declare function serializeTreeSnapshot(document: Document, options?: SerializeTreeSnapshotOptions): UiTreeSnapshot;
|
|
47
42
|
/** The result of hydration: the probe that reports recorded bounds and visibility to `resolveWebTarget`. */
|
package/dist/target.js
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SNAPSHOT_ROOT_PATH2,
|
|
3
|
+
MAX_SNAPSHOT_PATH_LENGTH2,
|
|
4
|
+
MAX_SNAPSHOT_WALK2,
|
|
5
|
+
MAX_SNAPSHOT_NAME2,
|
|
6
|
+
isSnapshotPath2,
|
|
7
|
+
walkSnapshot2,
|
|
8
|
+
snapshotNodeAt2,
|
|
9
|
+
attributeOf2,
|
|
10
|
+
isSnapshotEditingHost2,
|
|
11
|
+
isSensitiveSnapshotEntry2,
|
|
12
|
+
snapshotText2,
|
|
13
|
+
snapshotRole2,
|
|
14
|
+
indexSnapshot2,
|
|
15
|
+
snapshotName2,
|
|
16
|
+
snapshotHosts2,
|
|
17
|
+
snapshotFrameDepth2,
|
|
18
|
+
MASKED_MARKER2,
|
|
19
|
+
MAX_MASKED_PATHS2,
|
|
20
|
+
maskSnapshot2
|
|
21
|
+
} from "./index-zhbwhdya.js";
|
|
1
22
|
import {
|
|
2
23
|
WEB_TARGET_ERROR_CODES2,
|
|
3
24
|
MAX_CANDIDATES2,
|
|
@@ -17,20 +38,10 @@ import {
|
|
|
17
38
|
DEFAULT_SNAPSHOT_MAX_NODES2,
|
|
18
39
|
MAX_SNAPSHOT_DEPTH2,
|
|
19
40
|
MAX_SNAPSHOT_TEXT2,
|
|
20
|
-
snapshotUrl2,
|
|
21
41
|
serializeTreeSnapshot2,
|
|
22
42
|
hydrateTreeSnapshot2
|
|
23
|
-
} from "./index-
|
|
43
|
+
} from "./index-qg9yfr7r.js";
|
|
24
44
|
import {
|
|
25
|
-
SENSITIVE_MARKERS2,
|
|
26
|
-
hasSensitiveMarker2,
|
|
27
|
-
MAX_COMPARED_TEXT2,
|
|
28
|
-
normaliseText2,
|
|
29
|
-
sameText2,
|
|
30
|
-
containsText2,
|
|
31
|
-
editDistance2,
|
|
32
|
-
textSimilarity2,
|
|
33
|
-
clip2,
|
|
34
45
|
MAX_NAME_LENGTH3,
|
|
35
46
|
MAX_VISIBLE_TEXT2,
|
|
36
47
|
roleOf2,
|
|
@@ -46,25 +57,44 @@ import {
|
|
|
46
57
|
elementsUnder2,
|
|
47
58
|
isSecretFieldName2,
|
|
48
59
|
isSensitiveElement2
|
|
49
|
-
} from "./index-
|
|
60
|
+
} from "./index-mhv6a02p.js";
|
|
61
|
+
import {
|
|
62
|
+
SENSITIVE_MARKERS2,
|
|
63
|
+
hasSensitiveMarker2,
|
|
64
|
+
MAX_COMPARED_TEXT2,
|
|
65
|
+
normaliseText2,
|
|
66
|
+
sameText2,
|
|
67
|
+
containsText2,
|
|
68
|
+
editDistance2,
|
|
69
|
+
textSimilarity2,
|
|
70
|
+
clip2,
|
|
71
|
+
snapshotUrl2
|
|
72
|
+
} from "./index-t55wvhvh.js";
|
|
50
73
|
export {
|
|
51
74
|
ANCHOR_MARGIN_PX2 as ANCHOR_MARGIN_PX,
|
|
52
75
|
DEFAULT_FUZZY_THRESHOLD2 as DEFAULT_FUZZY_THRESHOLD,
|
|
53
76
|
DEFAULT_SNAPSHOT_MAX_NODES2 as DEFAULT_SNAPSHOT_MAX_NODES,
|
|
54
77
|
FUZZY_MARGIN2 as FUZZY_MARGIN,
|
|
55
78
|
INTERACTIVE_ROLES2 as INTERACTIVE_ROLES,
|
|
79
|
+
MASKED_MARKER2 as MASKED_MARKER,
|
|
56
80
|
MAX_CANDIDATES2 as MAX_CANDIDATES,
|
|
57
81
|
MAX_CANDIDATE_NAME2 as MAX_CANDIDATE_NAME,
|
|
58
82
|
MAX_COMPARED_TEXT2 as MAX_COMPARED_TEXT,
|
|
83
|
+
MAX_MASKED_PATHS2 as MAX_MASKED_PATHS,
|
|
59
84
|
MAX_NAME_LENGTH3 as MAX_NAME_LENGTH,
|
|
60
85
|
MAX_SNAPSHOT_DEPTH2 as MAX_SNAPSHOT_DEPTH,
|
|
86
|
+
MAX_SNAPSHOT_NAME2 as MAX_SNAPSHOT_NAME,
|
|
87
|
+
MAX_SNAPSHOT_PATH_LENGTH2 as MAX_SNAPSHOT_PATH_LENGTH,
|
|
61
88
|
MAX_SNAPSHOT_TEXT2 as MAX_SNAPSHOT_TEXT,
|
|
89
|
+
MAX_SNAPSHOT_WALK2 as MAX_SNAPSHOT_WALK,
|
|
62
90
|
MAX_VISIBLE_TEXT2 as MAX_VISIBLE_TEXT,
|
|
63
91
|
MAX_XPATH_RESULTS2 as MAX_XPATH_RESULTS,
|
|
64
92
|
SENSITIVE_MARKERS2 as SENSITIVE_MARKERS,
|
|
93
|
+
SNAPSHOT_ROOT_PATH2 as SNAPSHOT_ROOT_PATH,
|
|
65
94
|
UI_TREE_SNAPSHOT_VERSION2 as UI_TREE_SNAPSHOT_VERSION,
|
|
66
95
|
WEB_TARGET_ERROR_CODES2 as WEB_TARGET_ERROR_CODES,
|
|
67
96
|
accessibleName2 as accessibleName,
|
|
97
|
+
attributeOf2 as attributeOf,
|
|
68
98
|
clip2 as clip,
|
|
69
99
|
containsText2 as containsText,
|
|
70
100
|
describeCandidate2 as describeCandidate,
|
|
@@ -74,12 +104,17 @@ export {
|
|
|
74
104
|
enterFrames2 as enterFrames,
|
|
75
105
|
hasSensitiveMarker2 as hasSensitiveMarker,
|
|
76
106
|
hydrateTreeSnapshot2 as hydrateTreeSnapshot,
|
|
107
|
+
indexSnapshot2 as indexSnapshot,
|
|
77
108
|
isElementEnabled2 as isElementEnabled,
|
|
78
109
|
isElementVisible2 as isElementVisible,
|
|
79
110
|
isSecretFieldName2 as isSecretFieldName,
|
|
80
111
|
isSensitiveElement2 as isSensitiveElement,
|
|
112
|
+
isSensitiveSnapshotEntry2 as isSensitiveSnapshotEntry,
|
|
113
|
+
isSnapshotEditingHost2 as isSnapshotEditingHost,
|
|
114
|
+
isSnapshotPath2 as isSnapshotPath,
|
|
81
115
|
isTypedContent2 as isTypedContent,
|
|
82
116
|
labelName2 as labelName,
|
|
117
|
+
maskSnapshot2 as maskSnapshot,
|
|
83
118
|
matchMethod2 as matchMethod,
|
|
84
119
|
matchesRoleAndName2 as matchesRoleAndName,
|
|
85
120
|
normaliseText2 as normaliseText,
|
|
@@ -90,7 +125,14 @@ export {
|
|
|
90
125
|
roleOf2 as roleOf,
|
|
91
126
|
sameText2 as sameText,
|
|
92
127
|
serializeTreeSnapshot2 as serializeTreeSnapshot,
|
|
128
|
+
snapshotFrameDepth2 as snapshotFrameDepth,
|
|
129
|
+
snapshotHosts2 as snapshotHosts,
|
|
130
|
+
snapshotName2 as snapshotName,
|
|
131
|
+
snapshotNodeAt2 as snapshotNodeAt,
|
|
132
|
+
snapshotRole2 as snapshotRole,
|
|
133
|
+
snapshotText2 as snapshotText,
|
|
93
134
|
snapshotUrl2 as snapshotUrl,
|
|
94
135
|
textSimilarity2 as textSimilarity,
|
|
95
|
-
visibleText2 as visibleText
|
|
136
|
+
visibleText2 as visibleText,
|
|
137
|
+
walkSnapshot2 as walkSnapshot
|
|
96
138
|
};
|
package/dist/testing.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDomDriver2
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-8w31tpfq.js";
|
|
4
4
|
import {
|
|
5
5
|
UiDriverError2,
|
|
6
6
|
createVirtualClock2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-yc0jgph6.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.
|
|
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,
|
|
3
|
+
"version": "2026.1129.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 and UI step healing for FluidGrids RPA and BotManor Stewards.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Burdenoff Consultancy Services Pvt. Ltd.",
|
|
7
7
|
"repository": {
|
|
@@ -50,6 +50,14 @@
|
|
|
50
50
|
"types": "./dist/interpret.d.ts",
|
|
51
51
|
"import": "./dist/interpret.js"
|
|
52
52
|
},
|
|
53
|
+
"./analyze": {
|
|
54
|
+
"types": "./dist/analyze.d.ts",
|
|
55
|
+
"import": "./dist/analyze.js"
|
|
56
|
+
},
|
|
57
|
+
"./heal": {
|
|
58
|
+
"types": "./dist/heal.d.ts",
|
|
59
|
+
"import": "./dist/heal.js"
|
|
60
|
+
},
|
|
53
61
|
"./drivers": {
|
|
54
62
|
"types": "./dist/drivers.d.ts",
|
|
55
63
|
"import": "./dist/drivers.js"
|
|
@@ -68,7 +76,7 @@
|
|
|
68
76
|
"LICENSE"
|
|
69
77
|
],
|
|
70
78
|
"scripts": {
|
|
71
|
-
"build": "rm -rf dist && bun build src/index.ts src/recording.ts src/capture.ts src/resolve.ts src/replay.ts src/script.ts src/target.ts src/dom-runtime.ts src/interpret.ts src/drivers.ts src/testing.ts --outdir dist --root src --target browser --format esm --splitting --packages external && bun build src/dom-runtime/iife.ts --outfile dist/dom-runtime.iife.js --target browser --format iife --minify && tsc -p tsconfig.build.json",
|
|
79
|
+
"build": "rm -rf dist && bun build src/index.ts src/recording.ts src/capture.ts src/resolve.ts src/replay.ts src/script.ts src/target.ts src/dom-runtime.ts src/interpret.ts src/analyze.ts src/heal.ts src/drivers.ts src/testing.ts --outdir dist --root src --target browser --format esm --splitting --packages external && bun build src/dom-runtime/iife.ts --outfile dist/dom-runtime.iife.js --target browser --format iife --minify && tsc -p tsconfig.build.json",
|
|
72
80
|
"type:check": "boff gate -- bun check --no-pretty",
|
|
73
81
|
"lint": "eslint .",
|
|
74
82
|
"lint:fix": "eslint . --fix",
|