@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
package/dist/index.js
CHANGED
|
@@ -49,18 +49,12 @@ import {
|
|
|
49
49
|
UI_EXPRESSION_ARITY2,
|
|
50
50
|
parseUiScript2,
|
|
51
51
|
safeParseUiScript2
|
|
52
|
-
} from "./index-
|
|
52
|
+
} from "./index-qmv3ar39.js";
|
|
53
53
|
import {
|
|
54
54
|
UI_SCRIPT_SCHEMA_HASH2,
|
|
55
55
|
schemaHashOf2,
|
|
56
56
|
UI_SCRIPT_SCHEMA_TITLE2,
|
|
57
57
|
uiScriptJsonSchema2,
|
|
58
|
-
UI_SCRIPT_STEP_KEY_PREFIX2,
|
|
59
|
-
UI_SCRIPT_STEP_MESSAGES2,
|
|
60
|
-
stepMessageKey2,
|
|
61
|
-
describeTarget2,
|
|
62
|
-
describeExpression2,
|
|
63
|
-
describeStep2,
|
|
64
58
|
BROWSER_STEP_ACTIONS2,
|
|
65
59
|
fromBrowserActionSteps2,
|
|
66
60
|
toBrowserActionSteps2,
|
|
@@ -68,7 +62,25 @@ import {
|
|
|
68
62
|
fromRemoteBrowserSteps2,
|
|
69
63
|
fromRecording2,
|
|
70
64
|
toRecording2
|
|
71
|
-
} from "./index-
|
|
65
|
+
} from "./index-2g060ryg.js";
|
|
66
|
+
import {
|
|
67
|
+
UI_HEAL_MODES2,
|
|
68
|
+
UI_HEAL_MODE_RANK2,
|
|
69
|
+
UI_CONSEQUENCES2,
|
|
70
|
+
UI_HEAL_FAILURE_CODES2,
|
|
71
|
+
UI_HEAL_CHECK_REASONS2,
|
|
72
|
+
parseHealMode2,
|
|
73
|
+
capHealMode2,
|
|
74
|
+
decideHeal2,
|
|
75
|
+
POPUP_HANDLER_ACTIONS2,
|
|
76
|
+
popupHandlerScript2,
|
|
77
|
+
parseUiPopupHandler2,
|
|
78
|
+
analyzeUiPopupHandler2,
|
|
79
|
+
usablePopupHandlers2,
|
|
80
|
+
matchesUrlPattern2,
|
|
81
|
+
HEAL_POSITION_TOLERANCE_PX2,
|
|
82
|
+
verifyHealCandidate2
|
|
83
|
+
} from "./index-w9jc25y9.js";
|
|
72
84
|
import {
|
|
73
85
|
MAX_CALL_DEPTH2,
|
|
74
86
|
COMPILED_NAME_PREFIX2,
|
|
@@ -76,7 +88,16 @@ import {
|
|
|
76
88
|
stripBreakpoints2,
|
|
77
89
|
inlineCalls2,
|
|
78
90
|
compileUiScript2
|
|
79
|
-
} from "./index-
|
|
91
|
+
} from "./index-6kva2gvd.js";
|
|
92
|
+
import {
|
|
93
|
+
MAX_HEAL_QUESTION_NODES2,
|
|
94
|
+
MAX_HEAL_NODE_NAME2,
|
|
95
|
+
HEAL_SYSTEM_PROMPT2,
|
|
96
|
+
buildHealQuestion2,
|
|
97
|
+
targetFromSnapshotNode2,
|
|
98
|
+
MAX_HEAL_ANSWER_LENGTH2,
|
|
99
|
+
parseHealAnswer2
|
|
100
|
+
} from "./index-6h7ah1dw.js";
|
|
80
101
|
import {
|
|
81
102
|
MAX_VALUE_TEXT2,
|
|
82
103
|
MAX_VALUE_ITEMS2,
|
|
@@ -99,7 +120,35 @@ import {
|
|
|
99
120
|
MAX_PAGE_TEXT2,
|
|
100
121
|
DEFAULT_LIST_ITEMS2,
|
|
101
122
|
runUiScript2
|
|
102
|
-
} from "./index-
|
|
123
|
+
} from "./index-eff47v1g.js";
|
|
124
|
+
import {
|
|
125
|
+
MAX_HEAL_KEYWORDS2,
|
|
126
|
+
MAX_HEAL_KEYWORD_LENGTH2,
|
|
127
|
+
CONSEQUENCE_KEYWORDS2,
|
|
128
|
+
keywordWords2,
|
|
129
|
+
usableKeywords2,
|
|
130
|
+
classifyConsequence2,
|
|
131
|
+
elementInfoFromTarget2,
|
|
132
|
+
stepNumber2,
|
|
133
|
+
UI_SCRIPT_PROBLEM_KEY_PREFIX2,
|
|
134
|
+
UI_SCRIPT_PROBLEM_MESSAGES2,
|
|
135
|
+
problemMessageKey2,
|
|
136
|
+
problemMessage2,
|
|
137
|
+
HEALABLE_ACTIONS2,
|
|
138
|
+
compatibleRoles2,
|
|
139
|
+
VALUE_ACTIONS2,
|
|
140
|
+
MAX_POPUP_HANDLERS_PER_STEP2,
|
|
141
|
+
MAX_POPUP_HANDLERS_PER_APPLICATION2,
|
|
142
|
+
MAX_POPUP_HANDLER_STEPS2,
|
|
143
|
+
MAX_POPUP_URL_PATTERN2,
|
|
144
|
+
POPUP_HANDLER_STEP_WAIT_MS2,
|
|
145
|
+
UI_ANALYZER_RULES2,
|
|
146
|
+
UI_PROBLEM_SEVERITIES2,
|
|
147
|
+
UI_ANALYZER_RULE_GROUPS2,
|
|
148
|
+
UI_ANALYZER_RULE_IDS2,
|
|
149
|
+
UI_ANALYZER_DEFAULT_SEVERITY2,
|
|
150
|
+
analyzeUiScript2
|
|
151
|
+
} from "./index-xdtanv9b.js";
|
|
103
152
|
import {
|
|
104
153
|
UI_ERROR_FAMILIES2,
|
|
105
154
|
UI_ERROR_CODES2,
|
|
@@ -111,16 +160,22 @@ import {
|
|
|
111
160
|
UiDriverError2,
|
|
112
161
|
realClock2,
|
|
113
162
|
createVirtualClock2
|
|
114
|
-
} from "./index-
|
|
163
|
+
} from "./index-yc0jgph6.js";
|
|
164
|
+
import {
|
|
165
|
+
UI_SCRIPT_STEP_KEY_PREFIX2,
|
|
166
|
+
UI_SCRIPT_STEP_MESSAGES2,
|
|
167
|
+
stepMessageKey2,
|
|
168
|
+
describeTarget2,
|
|
169
|
+
describeExpression2,
|
|
170
|
+
describeStep2
|
|
171
|
+
} from "./index-gvavb597.js";
|
|
172
|
+
import {
|
|
173
|
+
CAPABILITY_IDS2,
|
|
174
|
+
SCRIPT_CAPABILITY2,
|
|
175
|
+
requiredCapabilities2,
|
|
176
|
+
missingCapabilities2
|
|
177
|
+
} from "./index-hw5npwsv.js";
|
|
115
178
|
import {
|
|
116
|
-
UI_EXPRESSION_OPS2,
|
|
117
|
-
UI_ANCHOR_RELATIONS2,
|
|
118
|
-
UI_TARGET_METHOD_KINDS2,
|
|
119
|
-
UI_WEB_ACTIONS2,
|
|
120
|
-
UI_DESKTOP_ACTIONS2,
|
|
121
|
-
UI_FLOW_ACTIONS2,
|
|
122
|
-
UI_STEP_ACTIONS2,
|
|
123
|
-
UI_VALUE_TYPES2,
|
|
124
179
|
UI_SCRIPT_VERSION2,
|
|
125
180
|
MAX_SCRIPT_STEPS2,
|
|
126
181
|
MAX_SCRIPT_BYTES2,
|
|
@@ -152,19 +207,36 @@ import {
|
|
|
152
207
|
LEGACY_MAX_BROWSER_STEPS2,
|
|
153
208
|
LEGACY_MAX_STEPS_BYTES2,
|
|
154
209
|
LEGACY_MAX_STEP_TIMEOUT_MS2,
|
|
155
|
-
jsonByteLength2
|
|
210
|
+
jsonByteLength2
|
|
211
|
+
} from "./index-20bbwwc9.js";
|
|
212
|
+
import {
|
|
213
|
+
UI_EXPRESSION_OPS2,
|
|
214
|
+
UI_ANCHOR_RELATIONS2,
|
|
215
|
+
UI_TARGET_METHOD_KINDS2,
|
|
216
|
+
UI_WEB_ACTIONS2,
|
|
217
|
+
UI_DESKTOP_ACTIONS2,
|
|
218
|
+
UI_FLOW_ACTIONS2,
|
|
219
|
+
UI_STEP_ACTIONS2,
|
|
220
|
+
UI_VALUE_TYPES2,
|
|
156
221
|
childBlocks2,
|
|
157
222
|
walkSteps2,
|
|
158
223
|
countSteps2,
|
|
159
224
|
stepAtPath2,
|
|
160
225
|
stepTargets2,
|
|
161
226
|
stepExpressions2,
|
|
162
|
-
visitExpression2
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
227
|
+
visitExpression2
|
|
228
|
+
} from "./index-g7724awk.js";
|
|
229
|
+
import {
|
|
230
|
+
SNAPSHOT_ROOT_PATH2,
|
|
231
|
+
MAX_SNAPSHOT_PATH_LENGTH2,
|
|
232
|
+
isSnapshotPath2,
|
|
233
|
+
walkSnapshot2,
|
|
234
|
+
snapshotNodeAt2,
|
|
235
|
+
indexSnapshot2,
|
|
236
|
+
MASKED_MARKER2,
|
|
237
|
+
MAX_MASKED_PATHS2,
|
|
238
|
+
maskSnapshot2
|
|
239
|
+
} from "./index-zhbwhdya.js";
|
|
168
240
|
import {
|
|
169
241
|
REDACTED2,
|
|
170
242
|
redactCredentials2
|
|
@@ -173,6 +245,7 @@ export {
|
|
|
173
245
|
BROWSER_STEP_ACTIONS2 as BROWSER_STEP_ACTIONS,
|
|
174
246
|
CAPABILITY_IDS2 as CAPABILITY_IDS,
|
|
175
247
|
COMPILED_NAME_PREFIX2 as COMPILED_NAME_PREFIX,
|
|
248
|
+
CONSEQUENCE_KEYWORDS2 as CONSEQUENCE_KEYWORDS,
|
|
176
249
|
DEFAULT_FIRST_WAIT_MS2 as DEFAULT_FIRST_WAIT_MS,
|
|
177
250
|
DEFAULT_LIST_ITEMS2 as DEFAULT_LIST_ITEMS,
|
|
178
251
|
DEFAULT_MAX_EVENTS2 as DEFAULT_MAX_EVENTS,
|
|
@@ -180,9 +253,13 @@ export {
|
|
|
180
253
|
DEFAULT_RETRY_DELAY_MS2 as DEFAULT_RETRY_DELAY_MS,
|
|
181
254
|
DEFAULT_WAIT_MS2 as DEFAULT_WAIT_MS,
|
|
182
255
|
ELEMENT_KEY_PATTERN2 as ELEMENT_KEY_PATTERN,
|
|
256
|
+
HEALABLE_ACTIONS2 as HEALABLE_ACTIONS,
|
|
257
|
+
HEAL_POSITION_TOLERANCE_PX2 as HEAL_POSITION_TOLERANCE_PX,
|
|
258
|
+
HEAL_SYSTEM_PROMPT2 as HEAL_SYSTEM_PROMPT,
|
|
183
259
|
LEGACY_MAX_BROWSER_STEPS2 as LEGACY_MAX_BROWSER_STEPS,
|
|
184
260
|
LEGACY_MAX_STEPS_BYTES2 as LEGACY_MAX_STEPS_BYTES,
|
|
185
261
|
LEGACY_MAX_STEP_TIMEOUT_MS2 as LEGACY_MAX_STEP_TIMEOUT_MS,
|
|
262
|
+
MASKED_MARKER2 as MASKED_MARKER,
|
|
186
263
|
MAX_CALL_DEPTH2 as MAX_CALL_DEPTH,
|
|
187
264
|
MAX_DELAY_MS2 as MAX_DELAY_MS,
|
|
188
265
|
MAX_EVENTS_LIMIT2 as MAX_EVENTS_LIMIT,
|
|
@@ -192,15 +269,25 @@ export {
|
|
|
192
269
|
MAX_EXTRACT_FIELDS2 as MAX_EXTRACT_FIELDS,
|
|
193
270
|
MAX_FLOW_DEPTH2 as MAX_FLOW_DEPTH,
|
|
194
271
|
MAX_FRAME_DEPTH2 as MAX_FRAME_DEPTH,
|
|
272
|
+
MAX_HEAL_ANSWER_LENGTH2 as MAX_HEAL_ANSWER_LENGTH,
|
|
273
|
+
MAX_HEAL_KEYWORDS2 as MAX_HEAL_KEYWORDS,
|
|
274
|
+
MAX_HEAL_KEYWORD_LENGTH2 as MAX_HEAL_KEYWORD_LENGTH,
|
|
275
|
+
MAX_HEAL_NODE_NAME2 as MAX_HEAL_NODE_NAME,
|
|
276
|
+
MAX_HEAL_QUESTION_NODES2 as MAX_HEAL_QUESTION_NODES,
|
|
195
277
|
MAX_INTENT_LENGTH2 as MAX_INTENT_LENGTH,
|
|
196
278
|
MAX_KEYS2 as MAX_KEYS,
|
|
197
279
|
MAX_LABEL_LENGTH2 as MAX_LABEL_LENGTH,
|
|
198
280
|
MAX_LIST_ITEMS2 as MAX_LIST_ITEMS,
|
|
199
281
|
MAX_LIST_PAGES2 as MAX_LIST_PAGES,
|
|
200
282
|
MAX_LOOP_ITERATIONS2 as MAX_LOOP_ITERATIONS,
|
|
283
|
+
MAX_MASKED_PATHS2 as MAX_MASKED_PATHS,
|
|
201
284
|
MAX_NAME_LENGTH2 as MAX_NAME_LENGTH,
|
|
202
285
|
MAX_OPERATOR_ARGS2 as MAX_OPERATOR_ARGS,
|
|
203
286
|
MAX_PAGE_TEXT2 as MAX_PAGE_TEXT,
|
|
287
|
+
MAX_POPUP_HANDLERS_PER_APPLICATION2 as MAX_POPUP_HANDLERS_PER_APPLICATION,
|
|
288
|
+
MAX_POPUP_HANDLERS_PER_STEP2 as MAX_POPUP_HANDLERS_PER_STEP,
|
|
289
|
+
MAX_POPUP_HANDLER_STEPS2 as MAX_POPUP_HANDLER_STEPS,
|
|
290
|
+
MAX_POPUP_URL_PATTERN2 as MAX_POPUP_URL_PATTERN,
|
|
204
291
|
MAX_RECORDED_STEPS2 as MAX_RECORDED_STEPS,
|
|
205
292
|
MAX_RETRY_ATTEMPTS2 as MAX_RETRY_ATTEMPTS,
|
|
206
293
|
MAX_SCRIPT_BYTES2 as MAX_SCRIPT_BYTES,
|
|
@@ -212,6 +299,7 @@ export {
|
|
|
212
299
|
MAX_SELECTOR_LENGTH2 as MAX_SELECTOR_LENGTH,
|
|
213
300
|
MAX_SELECT_VALUES2 as MAX_SELECT_VALUES,
|
|
214
301
|
MAX_SNAPSHOT_NODES2 as MAX_SNAPSHOT_NODES,
|
|
302
|
+
MAX_SNAPSHOT_PATH_LENGTH2 as MAX_SNAPSHOT_PATH_LENGTH,
|
|
215
303
|
MAX_STEP_LOG_ENTRIES2 as MAX_STEP_LOG_ENTRIES,
|
|
216
304
|
MAX_STEP_TIMEOUT_MS2 as MAX_STEP_TIMEOUT_MS,
|
|
217
305
|
MAX_TARGET_METHODS2 as MAX_TARGET_METHODS,
|
|
@@ -220,6 +308,8 @@ export {
|
|
|
220
308
|
MAX_VALUE_ITEMS2 as MAX_VALUE_ITEMS,
|
|
221
309
|
MAX_VALUE_TEXT2 as MAX_VALUE_TEXT,
|
|
222
310
|
NAME_PATTERN2 as NAME_PATTERN,
|
|
311
|
+
POPUP_HANDLER_ACTIONS2 as POPUP_HANDLER_ACTIONS,
|
|
312
|
+
POPUP_HANDLER_STEP_WAIT_MS2 as POPUP_HANDLER_STEP_WAIT_MS,
|
|
223
313
|
RECORDING_ACTION_OF2 as RECORDING_ACTION_OF,
|
|
224
314
|
RECORDING_VERSION2 as RECORDING_VERSION,
|
|
225
315
|
REDACTED2 as REDACTED,
|
|
@@ -227,8 +317,14 @@ export {
|
|
|
227
317
|
RecordingError2 as RecordingError,
|
|
228
318
|
SAVED_STEP_AUTHORS2 as SAVED_STEP_AUTHORS,
|
|
229
319
|
SCRIPT_CAPABILITY2 as SCRIPT_CAPABILITY,
|
|
320
|
+
SNAPSHOT_ROOT_PATH2 as SNAPSHOT_ROOT_PATH,
|
|
230
321
|
STEP_ID_PATTERN2 as STEP_ID_PATTERN,
|
|
322
|
+
UI_ANALYZER_DEFAULT_SEVERITY2 as UI_ANALYZER_DEFAULT_SEVERITY,
|
|
323
|
+
UI_ANALYZER_RULES2 as UI_ANALYZER_RULES,
|
|
324
|
+
UI_ANALYZER_RULE_GROUPS2 as UI_ANALYZER_RULE_GROUPS,
|
|
325
|
+
UI_ANALYZER_RULE_IDS2 as UI_ANALYZER_RULE_IDS,
|
|
231
326
|
UI_ANCHOR_RELATIONS2 as UI_ANCHOR_RELATIONS,
|
|
327
|
+
UI_CONSEQUENCES2 as UI_CONSEQUENCES,
|
|
232
328
|
UI_DESKTOP_ACTIONS2 as UI_DESKTOP_ACTIONS,
|
|
233
329
|
UI_ERROR_CODES2 as UI_ERROR_CODES,
|
|
234
330
|
UI_ERROR_CODE_LIST2 as UI_ERROR_CODE_LIST,
|
|
@@ -236,7 +332,14 @@ export {
|
|
|
236
332
|
UI_EXPRESSION_ARITY2 as UI_EXPRESSION_ARITY,
|
|
237
333
|
UI_EXPRESSION_OPS2 as UI_EXPRESSION_OPS,
|
|
238
334
|
UI_FLOW_ACTIONS2 as UI_FLOW_ACTIONS,
|
|
335
|
+
UI_HEAL_CHECK_REASONS2 as UI_HEAL_CHECK_REASONS,
|
|
336
|
+
UI_HEAL_FAILURE_CODES2 as UI_HEAL_FAILURE_CODES,
|
|
337
|
+
UI_HEAL_MODES2 as UI_HEAL_MODES,
|
|
338
|
+
UI_HEAL_MODE_RANK2 as UI_HEAL_MODE_RANK,
|
|
339
|
+
UI_PROBLEM_SEVERITIES2 as UI_PROBLEM_SEVERITIES,
|
|
239
340
|
UI_RUN_EVENT_KINDS2 as UI_RUN_EVENT_KINDS,
|
|
341
|
+
UI_SCRIPT_PROBLEM_KEY_PREFIX2 as UI_SCRIPT_PROBLEM_KEY_PREFIX,
|
|
342
|
+
UI_SCRIPT_PROBLEM_MESSAGES2 as UI_SCRIPT_PROBLEM_MESSAGES,
|
|
240
343
|
UI_SCRIPT_SCHEMA_HASH2 as UI_SCRIPT_SCHEMA_HASH,
|
|
241
344
|
UI_SCRIPT_SCHEMA_TITLE2 as UI_SCRIPT_SCHEMA_TITLE,
|
|
242
345
|
UI_SCRIPT_STEP_KEY_PREFIX2 as UI_SCRIPT_STEP_KEY_PREFIX,
|
|
@@ -249,34 +352,54 @@ export {
|
|
|
249
352
|
UiDriverError2 as UiDriverError,
|
|
250
353
|
UiRunError2 as UiRunError,
|
|
251
354
|
UiScriptError2 as UiScriptError,
|
|
355
|
+
VALUE_ACTIONS2 as VALUE_ACTIONS,
|
|
252
356
|
afterReplayCall2 as afterReplayCall,
|
|
357
|
+
analyzeUiPopupHandler2 as analyzeUiPopupHandler,
|
|
358
|
+
analyzeUiScript2 as analyzeUiScript,
|
|
253
359
|
applyPins2 as applyPins,
|
|
360
|
+
buildHealQuestion2 as buildHealQuestion,
|
|
254
361
|
canonicalJson2 as canonicalJson,
|
|
362
|
+
capHealMode2 as capHealMode,
|
|
255
363
|
captureRecording2 as captureRecording,
|
|
256
364
|
childBlocks2 as childBlocks,
|
|
365
|
+
classifyConsequence2 as classifyConsequence,
|
|
366
|
+
compatibleRoles2 as compatibleRoles,
|
|
257
367
|
compileUiScript2 as compileUiScript,
|
|
258
368
|
countSteps2 as countSteps,
|
|
259
369
|
createVirtualClock2 as createVirtualClock,
|
|
370
|
+
decideHeal2 as decideHeal,
|
|
260
371
|
describeExpression2 as describeExpression,
|
|
261
372
|
describeStep2 as describeStep,
|
|
262
373
|
describeTarget2 as describeTarget,
|
|
374
|
+
elementInfoFromTarget2 as elementInfoFromTarget,
|
|
263
375
|
errorFamilyOf2 as errorFamilyOf,
|
|
264
376
|
evaluateExpression2 as evaluateExpression,
|
|
265
377
|
finishFallback2 as finishFallback,
|
|
266
378
|
fromBrowserActionSteps2 as fromBrowserActionSteps,
|
|
267
379
|
fromRecording2 as fromRecording,
|
|
268
380
|
fromRemoteBrowserSteps2 as fromRemoteBrowserSteps,
|
|
381
|
+
indexSnapshot2 as indexSnapshot,
|
|
269
382
|
inlineCalls2 as inlineCalls,
|
|
270
383
|
isRetryableInScript2 as isRetryableInScript,
|
|
271
384
|
isSavedStepAuthor2 as isSavedStepAuthor,
|
|
385
|
+
isSnapshotPath2 as isSnapshotPath,
|
|
272
386
|
isUiErrorCode2 as isUiErrorCode,
|
|
273
387
|
jsonByteLength2 as jsonByteLength,
|
|
388
|
+
keywordWords2 as keywordWords,
|
|
274
389
|
markFallbackAsked2 as markFallbackAsked,
|
|
390
|
+
maskSnapshot2 as maskSnapshot,
|
|
275
391
|
maskUrl2 as maskUrl,
|
|
392
|
+
matchesUrlPattern2 as matchesUrlPattern,
|
|
276
393
|
missingCapabilities2 as missingCapabilities,
|
|
394
|
+
parseHealAnswer2 as parseHealAnswer,
|
|
395
|
+
parseHealMode2 as parseHealMode,
|
|
277
396
|
parseRecording2 as parseRecording,
|
|
397
|
+
parseUiPopupHandler2 as parseUiPopupHandler,
|
|
278
398
|
parseUiScript2 as parseUiScript,
|
|
279
399
|
planReplay2 as planReplay,
|
|
400
|
+
popupHandlerScript2 as popupHandlerScript,
|
|
401
|
+
problemMessage2 as problemMessage,
|
|
402
|
+
problemMessageKey2 as problemMessageKey,
|
|
280
403
|
readPath2 as readPath,
|
|
281
404
|
readReplayState2 as readReplayState,
|
|
282
405
|
readSnapshotNodes2 as readSnapshotNodes,
|
|
@@ -293,13 +416,16 @@ export {
|
|
|
293
416
|
safeParseUiScript2 as safeParseUiScript,
|
|
294
417
|
schemaHashOf2 as schemaHashOf,
|
|
295
418
|
sha256Hex2 as sha256Hex,
|
|
419
|
+
snapshotNodeAt2 as snapshotNodeAt,
|
|
296
420
|
stepAtPath2 as stepAtPath,
|
|
297
421
|
stepExpressions2 as stepExpressions,
|
|
298
422
|
stepMessageKey2 as stepMessageKey,
|
|
423
|
+
stepNumber2 as stepNumber,
|
|
299
424
|
stepTargets2 as stepTargets,
|
|
300
425
|
stripBreakpoints2 as stripBreakpoints,
|
|
301
426
|
targetFingerprint2 as targetFingerprint,
|
|
302
427
|
targetFromPlaywrightSelector2 as targetFromPlaywrightSelector,
|
|
428
|
+
targetFromSnapshotNode2 as targetFromSnapshotNode,
|
|
303
429
|
toBrowserActionSteps2 as toBrowserActionSteps,
|
|
304
430
|
toNumber2 as toNumber,
|
|
305
431
|
toRecording2 as toRecording,
|
|
@@ -315,8 +441,12 @@ export {
|
|
|
315
441
|
uiTargetMethodSchema2 as uiTargetMethodSchema,
|
|
316
442
|
uiTargetRefSchema2 as uiTargetRefSchema,
|
|
317
443
|
uiTargetSchema2 as uiTargetSchema,
|
|
444
|
+
usableKeywords2 as usableKeywords,
|
|
445
|
+
usablePopupHandlers2 as usablePopupHandlers,
|
|
318
446
|
valuesEqual2 as valuesEqual,
|
|
447
|
+
verifyHealCandidate2 as verifyHealCandidate,
|
|
319
448
|
visitExpression2 as visitExpression,
|
|
449
|
+
walkSnapshot2 as walkSnapshot,
|
|
320
450
|
walkSteps2 as walkSteps,
|
|
321
451
|
withFingerprint2 as withFingerprint
|
|
322
452
|
};
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import type { DomAction, DomActionProblem } from '../dom-runtime/actions.js';
|
|
19
19
|
import type { DomResolution } from '../dom-runtime/runtime.js';
|
|
20
20
|
import type { UiStepAction, UiTarget } from '../script/types.js';
|
|
21
|
+
import type { UiTreeSnapshot } from '../target/snapshot.js';
|
|
21
22
|
import type { WebElementState, WebTargetErrorCode } from '../target/types.js';
|
|
22
23
|
/** Where the interpreter is when it calls the driver. */
|
|
23
24
|
export interface UiStepContext {
|
|
@@ -159,6 +160,19 @@ export interface UiDriver {
|
|
|
159
160
|
target?: UiTarget;
|
|
160
161
|
fullPage?: boolean;
|
|
161
162
|
}, context: UiStepContext): Promise<string | null>;
|
|
163
|
+
/**
|
|
164
|
+
* The page's tree snapshot now (`serializeTreeSnapshot`), for healing (plan
|
|
165
|
+
* P4-06a). The interpreter masks it before it leaves the desk. Absent, or
|
|
166
|
+
* null, means the desk cannot heal.
|
|
167
|
+
*/
|
|
168
|
+
treeSnapshot?(context: UiStepContext): Promise<UiTreeSnapshot | null>;
|
|
169
|
+
/**
|
|
170
|
+
* The origin of the document a frame chain leads to (an empty or absent
|
|
171
|
+
* chain is the top document), or null when the chain cannot be followed. The
|
|
172
|
+
* heal verifier compares origins with it; without it, only identical frame
|
|
173
|
+
* chains count as the same frame.
|
|
174
|
+
*/
|
|
175
|
+
frameOrigin?(frame: readonly string[] | undefined, context: UiStepContext): Promise<string | null>;
|
|
162
176
|
}
|
|
163
177
|
/** Real time. */
|
|
164
178
|
export declare const realClock: UiClock;
|
|
@@ -31,7 +31,8 @@ export interface UiErrorCodeInfo {
|
|
|
31
31
|
/**
|
|
32
32
|
* Every run-time error code, with its family. Spec 05 section 10 lists the
|
|
33
33
|
* first ten; the rest are the engine's own codes for web desks, and
|
|
34
|
-
* `INTERRUPTED` and `STOPPED_BY_USER` come from the contract (README section 7)
|
|
34
|
+
* `INTERRUPTED` and `STOPPED_BY_USER` come from the contract (README section 7),
|
|
35
|
+
* and `HEAL_APPROVAL_REQUIRED` from the phase 4 contract (README section 24).
|
|
35
36
|
*/
|
|
36
37
|
export declare const UI_ERROR_CODES: {
|
|
37
38
|
readonly ELEMENT_NOT_FOUND: {
|
|
@@ -164,6 +165,11 @@ export declare const UI_ERROR_CODES: {
|
|
|
164
165
|
readonly preflight: false;
|
|
165
166
|
readonly meaning: "A person sent STOP to a paused TEST run; the clean-up steps ran";
|
|
166
167
|
};
|
|
168
|
+
readonly HEAL_APPROVAL_REQUIRED: {
|
|
169
|
+
readonly family: "DEPENDENCY";
|
|
170
|
+
readonly preflight: false;
|
|
171
|
+
readonly meaning: "Healing found and checked a new target, but a person must approve it first (heal with approval, an always-ask step or keyword, or a consequential control); the run stops with the candidate in error.heal and the desk parks it for approval. Never retried in the script";
|
|
172
|
+
};
|
|
167
173
|
};
|
|
168
174
|
export type UiErrorCode = keyof typeof UI_ERROR_CODES;
|
|
169
175
|
/** Every error code, in table order. */
|
|
@@ -172,7 +178,10 @@ export declare const UI_ERROR_CODE_LIST: UiErrorCode[];
|
|
|
172
178
|
export declare function isUiErrorCode(value: unknown): value is UiErrorCode;
|
|
173
179
|
/** The node error family of a code. */
|
|
174
180
|
export declare function errorFamilyOf(code: UiErrorCode): UiErrorFamily;
|
|
175
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Whether a failure with this code may be retried by a step `retry` or a retry
|
|
183
|
+
* scope. A heal that needs a person's approval is never retried: it ends the run.
|
|
184
|
+
*/
|
|
176
185
|
export declare function isRetryableInScript(code: UiErrorCode): boolean;
|
|
177
186
|
/** Detail a failure carries: what was looked for and what was found. Plain JSON, never typed values or secrets. */
|
|
178
187
|
export type UiErrorDetail = Readonly<Record<string, unknown>>;
|
|
@@ -55,6 +55,10 @@ export interface UiStepLogEntry {
|
|
|
55
55
|
screenshotFileId?: string;
|
|
56
56
|
/** The short error code of a failed step. */
|
|
57
57
|
error?: UiErrorCode;
|
|
58
|
+
/** The step passed on a target healing found (plan P4-06a). */
|
|
59
|
+
healed?: boolean;
|
|
60
|
+
/** The pop-up handler that cleared the way before the step passed. */
|
|
61
|
+
popupHandlerId?: string;
|
|
58
62
|
}
|
|
59
63
|
/** Numbers, stamps and caps events, and delivers them in order. */
|
|
60
64
|
export declare class EventEmitter {
|
package/dist/interpret/run.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { type UiPopupHandler } from '../heal/popup.js';
|
|
2
|
+
import { type UiHealHook, type UiHealReport, type UiHealSettings } from '../heal/types.js';
|
|
3
|
+
import type { UiTarget } from '../script/types.js';
|
|
1
4
|
import { type UiDriver } from './driver.js';
|
|
2
5
|
import { type UiErrorCode, type UiErrorFamily } from './errors.js';
|
|
3
6
|
import { type UiRunEvent, type UiStepLogEntry } from './events.js';
|
|
@@ -44,6 +47,26 @@ export interface RunUiScriptOptions {
|
|
|
44
47
|
pollIntervalMs?: number;
|
|
45
48
|
/** Skip the clean-up steps after a cancel (a worker shutting down). Absent means they run. */
|
|
46
49
|
skipCleanupOnCancel?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Heals a step whose own target is not found or ambiguous (plan P4-06a).
|
|
52
|
+
* Called at most once per step id per run, after the step's retries and
|
|
53
|
+
* pop-up handlers, with the masked snapshot. Absent means no healing.
|
|
54
|
+
*/
|
|
55
|
+
onTargetNotFound?: UiHealHook;
|
|
56
|
+
/** The node's and workspace's healing settings: always-ask step ids, keyword phrases, extra masked paths. */
|
|
57
|
+
healing?: UiHealSettings;
|
|
58
|
+
/**
|
|
59
|
+
* Pop-up handlers of the application (`workerResolveUiAssets.popupHandlers`).
|
|
60
|
+
* Each is parsed and checked by the `popupHandlerLoop` rule; a handler that
|
|
61
|
+
* fails is not used and is reported in a LOG event. At most 50 are used.
|
|
62
|
+
*/
|
|
63
|
+
popupHandlers?: readonly UiPopupHandler[];
|
|
64
|
+
/**
|
|
65
|
+
* Targets that replace steps' own targets, by step id (an approved heal's
|
|
66
|
+
* rerun, D-P4-11). Each must be a valid target of a step healing repairs;
|
|
67
|
+
* otherwise the run fails with INVALID_SCRIPT before any step runs.
|
|
68
|
+
*/
|
|
69
|
+
targetOverrides?: Readonly<Record<string, UiTarget>>;
|
|
47
70
|
}
|
|
48
71
|
/** Why a run did not succeed. */
|
|
49
72
|
export interface UiRunFailure {
|
|
@@ -52,6 +75,15 @@ export interface UiRunFailure {
|
|
|
52
75
|
message: string;
|
|
53
76
|
stepPath?: string;
|
|
54
77
|
stepId?: string;
|
|
78
|
+
/** What healing did for the failed step, when it was asked (plan P4-06a). */
|
|
79
|
+
heal?: UiHealReport;
|
|
80
|
+
}
|
|
81
|
+
/** The repairs of a run (plan P4-06a); in the result only when there was one. */
|
|
82
|
+
export interface UiRunRepairs {
|
|
83
|
+
/** Steps (distinct step ids) that passed on a healed target. */
|
|
84
|
+
healed: number;
|
|
85
|
+
/** Pop-up handlers that ran and let a step pass. */
|
|
86
|
+
popupsHandled: number;
|
|
55
87
|
}
|
|
56
88
|
export interface UiRunResult {
|
|
57
89
|
status: 'succeeded' | 'failed' | 'cancelled' | 'stopped';
|
|
@@ -72,6 +104,7 @@ export interface UiRunResult {
|
|
|
72
104
|
truncated: boolean;
|
|
73
105
|
};
|
|
74
106
|
durationMs: number;
|
|
107
|
+
repairs?: UiRunRepairs;
|
|
75
108
|
}
|
|
76
109
|
/** Run a UI script on a desk. Never throws for a script problem: the result carries it. */
|
|
77
110
|
export declare function runUiScript(script: unknown, driver: UiDriver, options?: RunUiScriptOptions): Promise<UiRunResult>;
|
package/dist/interpret.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import"./index-cs6acyjn.js";
|
|
2
|
-
import"./index-
|
|
2
|
+
import"./index-qmv3ar39.js";
|
|
3
|
+
import"./index-w9jc25y9.js";
|
|
3
4
|
import {
|
|
4
5
|
MAX_CALL_DEPTH2,
|
|
5
6
|
COMPILED_NAME_PREFIX2,
|
|
@@ -7,7 +8,7 @@ import {
|
|
|
7
8
|
stripBreakpoints2,
|
|
8
9
|
inlineCalls2,
|
|
9
10
|
compileUiScript2
|
|
10
|
-
} from "./index-
|
|
11
|
+
} from "./index-6kva2gvd.js";
|
|
11
12
|
import {
|
|
12
13
|
MAX_VALUE_TEXT2,
|
|
13
14
|
MAX_VALUE_ITEMS2,
|
|
@@ -30,7 +31,7 @@ import {
|
|
|
30
31
|
MAX_PAGE_TEXT2,
|
|
31
32
|
DEFAULT_LIST_ITEMS2,
|
|
32
33
|
runUiScript2
|
|
33
|
-
} from "./index-
|
|
34
|
+
} from "./index-eff47v1g.js";
|
|
34
35
|
import {
|
|
35
36
|
UI_ERROR_FAMILIES2,
|
|
36
37
|
UI_ERROR_CODES2,
|
|
@@ -42,7 +43,7 @@ import {
|
|
|
42
43
|
UiDriverError2,
|
|
43
44
|
realClock2,
|
|
44
45
|
createVirtualClock2
|
|
45
|
-
} from "./index-
|
|
46
|
+
} from "./index-yc0jgph6.js";
|
|
46
47
|
export {
|
|
47
48
|
COMPILED_NAME_PREFIX2 as COMPILED_NAME_PREFIX,
|
|
48
49
|
DEFAULT_FIRST_WAIT_MS2 as DEFAULT_FIRST_WAIT_MS,
|
package/dist/script.js
CHANGED
|
@@ -17,19 +17,13 @@ import {
|
|
|
17
17
|
UI_EXPRESSION_ARITY2,
|
|
18
18
|
parseUiScript2,
|
|
19
19
|
safeParseUiScript2
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-qmv3ar39.js";
|
|
21
21
|
import"./index-cs6acyjn.js";
|
|
22
22
|
import {
|
|
23
23
|
UI_SCRIPT_SCHEMA_HASH2,
|
|
24
24
|
schemaHashOf2,
|
|
25
25
|
UI_SCRIPT_SCHEMA_TITLE2,
|
|
26
26
|
uiScriptJsonSchema2,
|
|
27
|
-
UI_SCRIPT_STEP_KEY_PREFIX2,
|
|
28
|
-
UI_SCRIPT_STEP_MESSAGES2,
|
|
29
|
-
stepMessageKey2,
|
|
30
|
-
describeTarget2,
|
|
31
|
-
describeExpression2,
|
|
32
|
-
describeStep2,
|
|
33
27
|
BROWSER_STEP_ACTIONS2,
|
|
34
28
|
fromBrowserActionSteps2,
|
|
35
29
|
toBrowserActionSteps2,
|
|
@@ -37,16 +31,22 @@ import {
|
|
|
37
31
|
fromRemoteBrowserSteps2,
|
|
38
32
|
fromRecording2,
|
|
39
33
|
toRecording2
|
|
40
|
-
} from "./index-
|
|
34
|
+
} from "./index-2g060ryg.js";
|
|
35
|
+
import {
|
|
36
|
+
UI_SCRIPT_STEP_KEY_PREFIX2,
|
|
37
|
+
UI_SCRIPT_STEP_MESSAGES2,
|
|
38
|
+
stepMessageKey2,
|
|
39
|
+
describeTarget2,
|
|
40
|
+
describeExpression2,
|
|
41
|
+
describeStep2
|
|
42
|
+
} from "./index-gvavb597.js";
|
|
43
|
+
import {
|
|
44
|
+
CAPABILITY_IDS2,
|
|
45
|
+
SCRIPT_CAPABILITY2,
|
|
46
|
+
requiredCapabilities2,
|
|
47
|
+
missingCapabilities2
|
|
48
|
+
} from "./index-hw5npwsv.js";
|
|
41
49
|
import {
|
|
42
|
-
UI_EXPRESSION_OPS2,
|
|
43
|
-
UI_ANCHOR_RELATIONS2,
|
|
44
|
-
UI_TARGET_METHOD_KINDS2,
|
|
45
|
-
UI_WEB_ACTIONS2,
|
|
46
|
-
UI_DESKTOP_ACTIONS2,
|
|
47
|
-
UI_FLOW_ACTIONS2,
|
|
48
|
-
UI_STEP_ACTIONS2,
|
|
49
|
-
UI_VALUE_TYPES2,
|
|
50
50
|
UI_SCRIPT_VERSION2,
|
|
51
51
|
MAX_SCRIPT_STEPS2,
|
|
52
52
|
MAX_SCRIPT_BYTES2,
|
|
@@ -78,19 +78,25 @@ import {
|
|
|
78
78
|
LEGACY_MAX_BROWSER_STEPS2,
|
|
79
79
|
LEGACY_MAX_STEPS_BYTES2,
|
|
80
80
|
LEGACY_MAX_STEP_TIMEOUT_MS2,
|
|
81
|
-
jsonByteLength2
|
|
81
|
+
jsonByteLength2
|
|
82
|
+
} from "./index-20bbwwc9.js";
|
|
83
|
+
import {
|
|
84
|
+
UI_EXPRESSION_OPS2,
|
|
85
|
+
UI_ANCHOR_RELATIONS2,
|
|
86
|
+
UI_TARGET_METHOD_KINDS2,
|
|
87
|
+
UI_WEB_ACTIONS2,
|
|
88
|
+
UI_DESKTOP_ACTIONS2,
|
|
89
|
+
UI_FLOW_ACTIONS2,
|
|
90
|
+
UI_STEP_ACTIONS2,
|
|
91
|
+
UI_VALUE_TYPES2,
|
|
82
92
|
childBlocks2,
|
|
83
93
|
walkSteps2,
|
|
84
94
|
countSteps2,
|
|
85
95
|
stepAtPath2,
|
|
86
96
|
stepTargets2,
|
|
87
97
|
stepExpressions2,
|
|
88
|
-
visitExpression2
|
|
89
|
-
|
|
90
|
-
SCRIPT_CAPABILITY2,
|
|
91
|
-
requiredCapabilities2,
|
|
92
|
-
missingCapabilities2
|
|
93
|
-
} from "./index-3jymbm5t.js";
|
|
98
|
+
visitExpression2
|
|
99
|
+
} from "./index-g7724awk.js";
|
|
94
100
|
export {
|
|
95
101
|
BROWSER_STEP_ACTIONS2 as BROWSER_STEP_ACTIONS,
|
|
96
102
|
CAPABILITY_IDS2 as CAPABILITY_IDS,
|
package/dist/target/index.d.ts
CHANGED
|
@@ -11,3 +11,5 @@ export { type ElementStateProbe, SENSITIVE_MARKERS, type WebSearchRoot, elementR
|
|
|
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
12
|
export { type ResolveWebTargetOptions, type WebFrameEntry, type WebTargetMatches, describeCandidate, enterFrames, resolveAllWebTargets, resolveWebTarget, } from './resolve.js';
|
|
13
13
|
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
|
+
export { MASKED_MARKER, MAX_MASKED_PATHS, type MaskSnapshotOptions, type MaskedSnapshot, maskSnapshot, } from './snapshot-mask.js';
|
|
15
|
+
export { MAX_SNAPSHOT_NAME, MAX_SNAPSHOT_PATH_LENGTH, MAX_SNAPSHOT_WALK, SNAPSHOT_ROOT_PATH, type SnapshotEdge, type SnapshotEntry, type SnapshotIndex, attributeOf, indexSnapshot, isSensitiveSnapshotEntry, isSnapshotEditingHost, isSnapshotPath, snapshotFrameDepth, snapshotHosts, snapshotName, snapshotNodeAt, snapshotRole, snapshotText, walkSnapshot, } from './snapshot-tree.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Implicit ARIA roles by tag and input type, and the roles that take their
|
|
3
|
+
* name from their content (WAI-ARIA 1.2, accname 1.2 step 2F). Pure tables
|
|
4
|
+
* with no DOM use, shared by the DOM role computation (`aria.ts`) and the
|
|
5
|
+
* snapshot role computation the heal question uses (`snapshot-tree.ts`), so
|
|
6
|
+
* both report the same role for the same element.
|
|
7
|
+
*/
|
|
8
|
+
export declare const INPUT_ROLES: Record<string, string>;
|
|
9
|
+
export declare const TAG_ROLES: Record<string, string>;
|
|
10
|
+
/** Roles whose accessible name comes from their content (accname step 2F). */
|
|
11
|
+
export declare const NAME_FROM_CONTENT: Set<string>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `maskSnapshot` (plan P4-06a, threat R1 of document 24): the copy of a tree
|
|
3
|
+
* snapshot that may leave the desk for healing.
|
|
4
|
+
*
|
|
5
|
+
* A snapshot already holds no form values (`serializeTreeSnapshot`), but it
|
|
6
|
+
* keeps the visible text of the page. Before a heal sends the tree to the
|
|
7
|
+
* service (and from there, masked again, to a model), every element that is
|
|
8
|
+
* masked loses its words and keeps only what places it on the page:
|
|
9
|
+
*
|
|
10
|
+
* - elements named in `maskedPaths` (a desk or a person marked them), and
|
|
11
|
+
* with `sensitive` (the default), every password, one-time-code, card or
|
|
12
|
+
* secret field, anything inside such a field, and anything marked
|
|
13
|
+
* sensitive (`data-fg-sensitive`, `data-sensitive`, `data-private`);
|
|
14
|
+
* - a masked element keeps its tag, bounds, hidden flag and identifying
|
|
15
|
+
* attributes (role, type, id, name, test ids, structural ARIA); it loses
|
|
16
|
+
* its texts (each becomes an empty text, so node paths do not move), its descriptive attributes (labels, titles, placeholders,
|
|
17
|
+
* alt, value, href and free-text ARIA), and so do all its descendants,
|
|
18
|
+
* shadow content and frames included; it gains `data-fg-sensitive` so a
|
|
19
|
+
* later reader (the heal question, a hydrated replay) treats it as sensitive;
|
|
20
|
+
* - the bounds of every outermost masked element are returned as
|
|
21
|
+
* `screenshotMask`, in the top page's coordinates (an element inside a
|
|
22
|
+
* frame is moved by its frame's position; frame borders are not added),
|
|
23
|
+
* for the desk to paint over the screenshot before it uploads it (the
|
|
24
|
+
* worker and the extension do the painting).
|
|
25
|
+
*
|
|
26
|
+
* The input is never changed. Pure: no DOM is needed.
|
|
27
|
+
*/
|
|
28
|
+
import type { UiTreeSnapshot } from './snapshot.js';
|
|
29
|
+
import type { WebRect } from './types.js';
|
|
30
|
+
/** The marker a masked element gains. */
|
|
31
|
+
export declare const MASKED_MARKER = "data-fg-sensitive";
|
|
32
|
+
/** Most paths `maskedPaths` may name; more are ignored. */
|
|
33
|
+
export declare const MAX_MASKED_PATHS = 1000;
|
|
34
|
+
export interface MaskSnapshotOptions {
|
|
35
|
+
/** Node paths to mask, with everything inside them. Paths that are not valid or name no element are ignored. */
|
|
36
|
+
maskedPaths?: readonly string[];
|
|
37
|
+
/** Also mask sensitive elements and secret fields. Absent means true. */
|
|
38
|
+
sensitive?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface MaskedSnapshot {
|
|
41
|
+
/** The masked copy. */
|
|
42
|
+
snapshot: UiTreeSnapshot;
|
|
43
|
+
/** The paths of the outermost masked elements, in document order. */
|
|
44
|
+
maskedPaths: string[];
|
|
45
|
+
/** The bounds of the outermost masked elements that have bounds: the rectangles to paint over a screenshot. */
|
|
46
|
+
screenshotMask: WebRect[];
|
|
47
|
+
}
|
|
48
|
+
/** Mask a snapshot for healing. See the module comment for what is masked and what is kept. */
|
|
49
|
+
export declare function maskSnapshot(snapshot: UiTreeSnapshot, options?: MaskSnapshotOptions): MaskedSnapshot;
|