@namzu/computer-use 3.1.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -1
- package/dist/SubprocessComputerUseHost.d.ts +57 -9
- package/dist/SubprocessComputerUseHost.d.ts.map +1 -1
- package/dist/SubprocessComputerUseHost.js +213 -46
- package/dist/SubprocessComputerUseHost.js.map +1 -1
- package/dist/adapters/cua-driver/adapter.d.ts +171 -10
- package/dist/adapters/cua-driver/adapter.d.ts.map +1 -1
- package/dist/adapters/cua-driver/adapter.js +1476 -161
- package/dist/adapters/cua-driver/adapter.js.map +1 -1
- package/dist/adapters/cua-driver/client.d.ts +16 -0
- package/dist/adapters/cua-driver/client.d.ts.map +1 -1
- package/dist/adapters/cua-driver/client.js +54 -5
- package/dist/adapters/cua-driver/client.js.map +1 -1
- package/dist/adapters/cua-driver/escalation.d.ts +67 -0
- package/dist/adapters/cua-driver/escalation.d.ts.map +1 -0
- package/dist/adapters/cua-driver/escalation.js +82 -0
- package/dist/adapters/cua-driver/escalation.js.map +1 -0
- package/dist/adapters/cua-driver/keys.d.ts +5 -0
- package/dist/adapters/cua-driver/keys.d.ts.map +1 -1
- package/dist/adapters/cua-driver/keys.js +23 -0
- package/dist/adapters/cua-driver/keys.js.map +1 -1
- package/dist/adapters/cua-driver/observe.d.ts +99 -0
- package/dist/adapters/cua-driver/observe.d.ts.map +1 -0
- package/dist/adapters/cua-driver/observe.js +227 -0
- package/dist/adapters/cua-driver/observe.js.map +1 -0
- package/dist/adapters/cua-driver/ui-tree.d.ts +75 -2
- package/dist/adapters/cua-driver/ui-tree.d.ts.map +1 -1
- package/dist/adapters/cua-driver/ui-tree.js +142 -14
- package/dist/adapters/cua-driver/ui-tree.js.map +1 -1
- package/dist/adapters/types.d.ts +3 -3
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/adapters/types.js.map +1 -1
- package/dist/adapters/win32.d.ts +10 -0
- package/dist/adapters/win32.d.ts.map +1 -1
- package/dist/adapters/win32.js +12 -2
- package/dist/adapters/win32.js.map +1 -1
- package/dist/errors.d.ts +19 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +26 -0
- package/dist/errors.js.map +1 -1
- package/dist/foreground/guard.d.ts +31 -0
- package/dist/foreground/guard.d.ts.map +1 -0
- package/dist/foreground/guard.js +156 -0
- package/dist/foreground/guard.js.map +1 -0
- package/dist/foreground/index.d.ts +11 -0
- package/dist/foreground/index.d.ts.map +1 -0
- package/dist/foreground/index.js +7 -0
- package/dist/foreground/index.js.map +1 -0
- package/dist/foreground/ladder.d.ts +143 -0
- package/dist/foreground/ladder.d.ts.map +1 -0
- package/dist/foreground/ladder.js +505 -0
- package/dist/foreground/ladder.js.map +1 -0
- package/dist/foreground/lease.d.ts +69 -0
- package/dist/foreground/lease.d.ts.map +1 -0
- package/dist/foreground/lease.js +182 -0
- package/dist/foreground/lease.js.map +1 -0
- package/dist/foreground/types.d.ts +287 -0
- package/dist/foreground/types.d.ts.map +1 -0
- package/dist/foreground/types.js +32 -0
- package/dist/foreground/types.js.map +1 -0
- package/dist/foreground/windows-helper-script.d.ts +19 -0
- package/dist/foreground/windows-helper-script.d.ts.map +1 -0
- package/dist/foreground/windows-helper-script.js +472 -0
- package/dist/foreground/windows-helper-script.js.map +1 -0
- package/dist/foreground/windows-monitor.d.ts +75 -0
- package/dist/foreground/windows-monitor.d.ts.map +1 -0
- package/dist/foreground/windows-monitor.js +216 -0
- package/dist/foreground/windows-monitor.js.map +1 -0
- package/dist/foreground/windows.d.ts +21 -0
- package/dist/foreground/windows.d.ts.map +1 -0
- package/dist/foreground/windows.js +54 -0
- package/dist/foreground/windows.js.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/presence/helper-script.d.ts +39 -0
- package/dist/presence/helper-script.d.ts.map +1 -0
- package/dist/presence/helper-script.js +320 -0
- package/dist/presence/helper-script.js.map +1 -0
- package/dist/presence/index.d.ts +6 -0
- package/dist/presence/index.d.ts.map +1 -0
- package/dist/presence/index.js +4 -0
- package/dist/presence/index.js.map +1 -0
- package/dist/presence/presence.d.ts +70 -0
- package/dist/presence/presence.d.ts.map +1 -0
- package/dist/presence/presence.js +147 -0
- package/dist/presence/presence.js.map +1 -0
- package/dist/presence/windows.d.ts +19 -0
- package/dist/presence/windows.d.ts.map +1 -0
- package/dist/presence/windows.js +39 -0
- package/dist/presence/windows.js.map +1 -0
- package/dist/util/call-scope.d.ts +34 -0
- package/dist/util/call-scope.d.ts.map +1 -0
- package/dist/util/call-scope.js +58 -0
- package/dist/util/call-scope.js.map +1 -0
- package/package.json +2 -2
- package/src/SubprocessComputerUseHost.ts +287 -45
- package/src/adapters/cua-driver/adapter.ts +1751 -175
- package/src/adapters/cua-driver/client.ts +59 -2
- package/src/adapters/cua-driver/escalation.ts +137 -0
- package/src/adapters/cua-driver/keys.ts +20 -0
- package/src/adapters/cua-driver/observe.ts +310 -0
- package/src/adapters/cua-driver/ui-tree.ts +219 -15
- package/src/adapters/types.ts +7 -2
- package/src/adapters/win32.ts +26 -3
- package/src/errors.ts +32 -0
- package/src/foreground/guard.ts +182 -0
- package/src/foreground/index.ts +45 -0
- package/src/foreground/ladder.ts +616 -0
- package/src/foreground/lease.ts +232 -0
- package/src/foreground/types.ts +318 -0
- package/src/foreground/windows-helper-script.ts +471 -0
- package/src/foreground/windows-monitor.ts +288 -0
- package/src/foreground/windows.ts +73 -0
- package/src/index.ts +15 -1
- package/src/presence/helper-script.ts +323 -0
- package/src/presence/index.ts +17 -0
- package/src/presence/presence.ts +195 -0
- package/src/presence/windows.ts +54 -0
- package/src/util/call-scope.ts +73 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { isCut, sameObservation } from './observe.js';
|
|
2
|
+
/** The fewest reads that can show a window holding still. */
|
|
3
|
+
export const MIN_STILL_READS = 2;
|
|
4
|
+
/**
|
|
5
|
+
* What the reads show when no effect of the input was recognised in them: that
|
|
6
|
+
* the input provably did nothing, or that the window changed unexplained.
|
|
7
|
+
* Undefined when the reads cannot tell (too few, nothing to read, a window that
|
|
8
|
+
* changes by itself, a text control that could not be read).
|
|
9
|
+
*/
|
|
10
|
+
export function judgeStillness(reads) {
|
|
11
|
+
if (reads.opened || reads.afters.length < MIN_STILL_READS)
|
|
12
|
+
return undefined;
|
|
13
|
+
if (reads.before.size === 0)
|
|
14
|
+
return undefined;
|
|
15
|
+
if (reads.earlier !== undefined && !sameObservation(reads.earlier, reads.before))
|
|
16
|
+
return undefined;
|
|
17
|
+
if (reads.edit === 'unknown')
|
|
18
|
+
return undefined;
|
|
19
|
+
// A read that left something out (a cut text, a cut walk) cannot show that nothing changed.
|
|
20
|
+
if (isCut(reads.before) || reads.afters.some(isCut))
|
|
21
|
+
return undefined;
|
|
22
|
+
const moved = reads.edit === 'changed' || reads.afters.some((read) => !sameObservation(reads.before, read));
|
|
23
|
+
if (moved)
|
|
24
|
+
return {
|
|
25
|
+
delivery: 'delivered_unverified',
|
|
26
|
+
retrySafety: 'unsafe',
|
|
27
|
+
outcome: 'unexplained',
|
|
28
|
+
detail: 'The window changed after the input, but not in a way that shows this input did it, so sending it again could do it twice. Look at the window before repeating it.',
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
delivery: 'delivered_unverified',
|
|
32
|
+
retrySafety: 'safe',
|
|
33
|
+
outcome: 'no_effect',
|
|
34
|
+
detail: 'The window did not change after the input: nothing in it took the input.',
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** Keys whose effect (where the focus or caret is, how far a view scrolled) the controls of a window do not show. */
|
|
38
|
+
const UNOBSERVABLE_KEYS = /^(tab|up|down|left|right|home|end|pageup|pagedown|shift|ctrl|alt|win)$/i;
|
|
39
|
+
/** The input kinds whose absence of effect a read of the window can show. */
|
|
40
|
+
export function canBeJudgedByStillness(action) {
|
|
41
|
+
if (action.type === 'type_text')
|
|
42
|
+
return true;
|
|
43
|
+
if (action.type !== 'key' || action.keys === undefined)
|
|
44
|
+
return false;
|
|
45
|
+
const main = action.keys.trim().split('+').pop()?.trim() ?? '';
|
|
46
|
+
if (UNOBSERVABLE_KEYS.test(main))
|
|
47
|
+
return false;
|
|
48
|
+
// Enter, Backspace and Delete, and the undo, redo, cut and paste chords, change text a tree read may not show.
|
|
49
|
+
const chord = action.keys.toLowerCase().includes('ctrl') || action.keys.toLowerCase().includes('cmd');
|
|
50
|
+
if (/^(enter|return|backspace|delete|del|space)$/i.test(main))
|
|
51
|
+
return false;
|
|
52
|
+
if (chord && /^(z|y|x|v)$/i.test(main))
|
|
53
|
+
return false;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
/** Whether a first attempt that left no effect is tried again on the screen. */
|
|
57
|
+
export function shouldRetryOnScreen(first, options) {
|
|
58
|
+
return (options.hasScreen &&
|
|
59
|
+
options.explicitMode === undefined &&
|
|
60
|
+
!first.onScreen &&
|
|
61
|
+
first.outcome === 'no_effect' &&
|
|
62
|
+
first.retrySafety === 'safe');
|
|
63
|
+
}
|
|
64
|
+
const WAITING = new Set(['user_active', 'lease_busy']);
|
|
65
|
+
/**
|
|
66
|
+
* The detail of the final result once a background attempt had no effect and
|
|
67
|
+
* the retry on the screen was made (or could not be).
|
|
68
|
+
*/
|
|
69
|
+
export function escalationDetail(second) {
|
|
70
|
+
const base = 'The first attempt, in the background, had no effect: the window did not change.';
|
|
71
|
+
if (second.blocked !== undefined) {
|
|
72
|
+
if (WAITING.has(second.blocked))
|
|
73
|
+
return `Waiting for you to be idle: ${base} Sending it again needs the screen, and it is in use, so nothing more was sent. It is safe to send it again once the keyboard and mouse are still. ${second.detail ?? ''}`.trim();
|
|
74
|
+
return `${base} Sending it again on the screen was not possible, so nothing more was sent. ${second.detail ?? ''}`.trim();
|
|
75
|
+
}
|
|
76
|
+
if (second.outcome === 'no_effect')
|
|
77
|
+
return `${base} It was sent again on the screen and the window still did not change, so nothing in the window takes this input (for text, no field has the focus: click the field first).`;
|
|
78
|
+
if (second.outcome === 'unexplained')
|
|
79
|
+
return `${base} It was sent again on the screen and the window then changed in a way that cannot be tied to the input, so it is not safe to send it again. Look at the window first.`;
|
|
80
|
+
return `${base} It was sent again on the screen. ${second.detail ?? ''}`.trim();
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=escalation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escalation.js","sourceRoot":"","sources":["../../../src/adapters/cua-driver/escalation.ts"],"names":[],"mappings":"AACA,OAAO,EAA0C,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAkC7F,6DAA6D;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAA;AAEhC;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAqB;IACnD,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,eAAe;QAAE,OAAO,SAAS,CAAA;IAC3E,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IAC7C,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAA;IAClG,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IAC9C,4FAA4F;IAC5F,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IACrE,MAAM,KAAK,GACV,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE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KAAqB,EACrB,OAGC;IAED,OAAO,CACN,OAAO,CAAC,SAAS;QACjB,OAAO,CAAC,YAAY,KAAK,SAAS;QAClC,CAAC,KAAK,CAAC,QAAQ;QACf,KAAK,CAAC,OAAO,KAAK,WAAW;QAC7B,KAAK,CAAC,WAAW,KAAK,MAAM,CAC5B,CAAA;AACF,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAA;AAEtD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACtD,MAAM,IAAI,GAAG,iFAAiF,CAAA;IAC9F,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAClC,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC;YAC9B,OAAO,+BAA+B,IAAI,sJAAsJ,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;QAC7N,OAAO,GAAG,IAAI,+EAA+E,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IAC1H,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,KAAK,WAAW;QACjC,OAAO,GAAG,IAAI,4KAA4K,CAAA;IAC3L,IAAI,MAAM,CAAC,OAAO,KAAK,aAAa;QACnC,OAAO,GAAG,IAAI,uKAAuK,CAAA;IACtL,OAAO,GAAG,IAAI,qCAAqC,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;AAChF,CAAC"}
|
|
@@ -21,4 +21,9 @@ export type CuaKeyPlan = {
|
|
|
21
21
|
readonly text: string;
|
|
22
22
|
};
|
|
23
23
|
export declare function translateKeyForCuaDriver(combo: string): CuaKeyPlan;
|
|
24
|
+
/**
|
|
25
|
+
* A combination as a classic menu names it (`Ctrl+O`), or undefined for a key
|
|
26
|
+
* that is not a combination (no modifier) or whose menu name cannot be known.
|
|
27
|
+
*/
|
|
28
|
+
export declare function menuAcceleratorOf(combo: string): string | undefined;
|
|
24
29
|
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/adapters/cua-driver/keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,UAAU,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAqExD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAyBlE"}
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/adapters/cua-driver/keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,UAAU,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAqExD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAyBlE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAcnE"}
|
|
@@ -103,4 +103,27 @@ export function translateKeyForCuaDriver(combo) {
|
|
|
103
103
|
const finalKey = key ?? ([...main].length === 1 ? main.toLowerCase() : lower);
|
|
104
104
|
return { tool: 'hotkey', keys: [...new Set(modifiers), finalKey] };
|
|
105
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* A combination as a classic menu names it (`Ctrl+O`), or undefined for a key
|
|
108
|
+
* that is not a combination (no modifier) or whose menu name cannot be known.
|
|
109
|
+
*/
|
|
110
|
+
export function menuAcceleratorOf(combo) {
|
|
111
|
+
let plan;
|
|
112
|
+
try {
|
|
113
|
+
plan = translateKeyForCuaDriver(combo);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
if (plan.tool !== 'hotkey' || plan.keys.length < 2)
|
|
119
|
+
return undefined;
|
|
120
|
+
const main = plan.keys[plan.keys.length - 1];
|
|
121
|
+
if (!/^([a-z0-9]|f([1-9]|1[0-2]))$/i.test(main))
|
|
122
|
+
return undefined;
|
|
123
|
+
const names = { ctrl: 'Ctrl', alt: 'Alt', shift: 'Shift' };
|
|
124
|
+
const modifiers = plan.keys.slice(0, -1).map((key) => names[key]);
|
|
125
|
+
if (modifiers.some((name) => name === undefined))
|
|
126
|
+
return undefined;
|
|
127
|
+
return [...modifiers, main.toUpperCase()].join('+');
|
|
128
|
+
}
|
|
106
129
|
//# sourceMappingURL=keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../src/adapters/cua-driver/keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,MAAM,SAAS,GAAqC;IACnD,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,MAAM;IACf,gFAAgF;IAChF,GAAG,EAAE,MAAM;IACX,OAAO,EAAE,MAAM;IACf,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,MAAM,EAA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M,CAAC;QACR,OAAO,SAAS,CAAA;IACjB,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,SAAS,CAAA;IACpE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAW,CAAA;IACtD,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAA;IACjE,MAAM,KAAK,GAA2B,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;IAClF,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;IACjE,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC;QAAE,OAAO,SAAS,CAAA;IAClE,OAAO,CAAC,GAAG,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACpD,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { ActionDelivery, ActionRetrySafety } from '@namzu/sdk';
|
|
2
|
+
import type { ParsedUiTree } from './ui-tree.js';
|
|
3
|
+
/**
|
|
4
|
+
* Verifying an input by what it changed.
|
|
5
|
+
*
|
|
6
|
+
* The driver cannot say whether a background input arrived, so the adapter
|
|
7
|
+
* reads the target window before and after and compares the two. What the
|
|
8
|
+
* window shows is the only evidence: the text it holds, as controls name it
|
|
9
|
+
* or give it as their value.
|
|
10
|
+
*
|
|
11
|
+
* An input is verified only by a change that belongs to it:
|
|
12
|
+
* - typed text is verified when that text is now shown where it was not;
|
|
13
|
+
* - any other input (a press, a key) is verified when the window changed and
|
|
14
|
+
* then held still, and nothing was changing it before: a window that
|
|
15
|
+
* changes by itself (a clock, a spinner) proves nothing;
|
|
16
|
+
* - a new window of the same program is verified by its title.
|
|
17
|
+
* Otherwise the input stays unconfirmed. A change of unrelated text is never
|
|
18
|
+
* reported as the effect.
|
|
19
|
+
*/
|
|
20
|
+
/** Every text a window shows, with how many times it shows it. */
|
|
21
|
+
export type Observation = ReadonlyMap<string, number>;
|
|
22
|
+
/** Present in a read that could not show everything: a text cut short, or a walk cut at its cap. */
|
|
23
|
+
export declare const CUT = "\u0002cut";
|
|
24
|
+
/** Whether a read left something out, so that an unchanged read proves nothing. */
|
|
25
|
+
export declare const isCut: (obs: Observation) => boolean;
|
|
26
|
+
/** The texts of one read of a window: each control's name and each value. */
|
|
27
|
+
export declare function observationOf(tree: ParsedUiTree, options?: {
|
|
28
|
+
readonly walkCut?: boolean;
|
|
29
|
+
}): Observation;
|
|
30
|
+
export interface ObservedChange {
|
|
31
|
+
/** Texts shown now that were not (or fewer times) before. */
|
|
32
|
+
readonly added: readonly string[];
|
|
33
|
+
/** Texts shown before that are gone. */
|
|
34
|
+
readonly removed: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
export declare function changeBetween(before: Observation, after: Observation): ObservedChange;
|
|
37
|
+
/** Whether every control's state (selected, disabled) is the same in two reads. */
|
|
38
|
+
export declare const sameState: (a: Observation, b: Observation) => boolean;
|
|
39
|
+
export declare const sameObservation: (a: Observation, b: Observation) => boolean;
|
|
40
|
+
/** Text as a person types it against how a window may show it: case, spaces and operator glyphs differ. */
|
|
41
|
+
export declare function foldText(value: string): string;
|
|
42
|
+
export interface ObservedVerdict {
|
|
43
|
+
readonly delivery: ActionDelivery;
|
|
44
|
+
readonly retrySafety: ActionRetrySafety;
|
|
45
|
+
/** What the window reads now: the evidence, shown to the model as `reads "…"`. */
|
|
46
|
+
readonly observed?: string;
|
|
47
|
+
readonly detail: string;
|
|
48
|
+
/**
|
|
49
|
+
* Set when no effect was seen: `no_effect` means the window provably did not
|
|
50
|
+
* change (a retry is safe); `unexplained` means it changed in a way that cannot
|
|
51
|
+
* be tied to the input (a retry is not safe).
|
|
52
|
+
*/
|
|
53
|
+
readonly outcome?: 'no_effect' | 'unexplained';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Whether the window shows the effect of an input the driver could not
|
|
57
|
+
* confirm. `later` is a read taken a moment after `after`: equal reads mean
|
|
58
|
+
* the window had settled. Undefined means nothing observable followed.
|
|
59
|
+
*/
|
|
60
|
+
export declare function judgeObserved(input: {
|
|
61
|
+
readonly typed?: string;
|
|
62
|
+
}, reads: {
|
|
63
|
+
readonly before: Observation;
|
|
64
|
+
readonly after: Observation;
|
|
65
|
+
/** A read just before `before`: unequal reads mean the window was changing by itself. */
|
|
66
|
+
readonly earlier?: Observation;
|
|
67
|
+
readonly later?: Observation;
|
|
68
|
+
}): ObservedVerdict | undefined;
|
|
69
|
+
/** What a message to a classic edit control did, as the control reads afterwards. */
|
|
70
|
+
export interface EditReading {
|
|
71
|
+
readonly found: boolean;
|
|
72
|
+
readonly reason: string;
|
|
73
|
+
readonly done: boolean;
|
|
74
|
+
readonly seen: string;
|
|
75
|
+
}
|
|
76
|
+
export interface EditVerdict {
|
|
77
|
+
readonly ok: boolean;
|
|
78
|
+
readonly delivery: ActionDelivery;
|
|
79
|
+
readonly retrySafety: ActionRetrySafety;
|
|
80
|
+
readonly detail?: string;
|
|
81
|
+
readonly readBack?: {
|
|
82
|
+
readonly expected?: string;
|
|
83
|
+
readonly observed?: string;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* `set` or `type` on a classic edit control, judged by the text the control
|
|
88
|
+
* reads back: the control is the evidence, not the message that returned.
|
|
89
|
+
*/
|
|
90
|
+
export declare function judgeEdit(op: 'set' | 'type', text: string, reading: EditReading): EditVerdict;
|
|
91
|
+
/** A before and after read of an edit control, for a keyboard delivery the driver could not confirm. */
|
|
92
|
+
export declare function judgeEditBetween(typed: string, before: {
|
|
93
|
+
readonly text: string;
|
|
94
|
+
readonly len: number;
|
|
95
|
+
}, after: {
|
|
96
|
+
readonly text: string;
|
|
97
|
+
readonly len: number;
|
|
98
|
+
}): ObservedVerdict | undefined;
|
|
99
|
+
//# sourceMappingURL=observe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../../src/adapters/cua-driver/observe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD;;;;;;;;;;;;;;;;GAgBG;AAEH,kEAAkE;AAClE,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAMrD,oGAAoG;AACpG,eAAO,MAAM,GAAG,cAAc,CAAA;AAE9B,mFAAmF;AACnF,eAAO,MAAM,KAAK,GAAI,KAAK,WAAW,KAAG,OAAuB,CAAA;AAEhE,6EAA6E;AAC7E,wBAAgB,aAAa,CAC5B,IAAI,EAAE,YAAY,EAClB,OAAO,GAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1C,WAAW,CAgBb;AAED,MAAM,WAAW,cAAc;IAC9B,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CACnC;AAUD,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAG,cAAc,CAQrF;AAED,mFAAmF;AACnF,eAAO,MAAM,SAAS,GAAI,GAAG,WAAW,EAAE,GAAG,WAAW,KAAG,OAI1D,CA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MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9E;AAKD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,KAAK,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,WAAW,CA4C7F;AAKD,wGAAwG;AACxG,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACvD,KAAK,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACpD,eAAe,GAAG,SAAS,CA4B7B"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
const MAX_TEXT = 240;
|
|
2
|
+
const SEP = '\u0000';
|
|
3
|
+
/** Keys that carry a control's state (selected, disabled), not text: they never count as text shown. */
|
|
4
|
+
const STATE = '\u0001';
|
|
5
|
+
/** Present in a read that could not show everything: a text cut short, or a walk cut at its cap. */
|
|
6
|
+
export const CUT = '\u0002cut';
|
|
7
|
+
/** Whether a read left something out, so that an unchanged read proves nothing. */
|
|
8
|
+
export const isCut = (obs) => obs.has(CUT);
|
|
9
|
+
/** The texts of one read of a window: each control's name and each value. */
|
|
10
|
+
export function observationOf(tree, options = {}) {
|
|
11
|
+
const out = new Map();
|
|
12
|
+
if (options.walkCut === true)
|
|
13
|
+
out.set(CUT, 1);
|
|
14
|
+
const add = (key) => {
|
|
15
|
+
out.set(key, (out.get(key) ?? 0) + 1);
|
|
16
|
+
};
|
|
17
|
+
for (const node of tree.nodes) {
|
|
18
|
+
const name = node.name.trim();
|
|
19
|
+
const value = node.element.value?.trim();
|
|
20
|
+
if (name.length > MAX_TEXT || (value?.length ?? 0) > MAX_TEXT)
|
|
21
|
+
out.set(CUT, 1);
|
|
22
|
+
if (name !== '')
|
|
23
|
+
add(`${node.role}${SEP}${name.slice(0, MAX_TEXT)}`);
|
|
24
|
+
if (value !== undefined && value !== '')
|
|
25
|
+
add(`${node.role}${SEP}=${value.slice(0, MAX_TEXT)}`);
|
|
26
|
+
for (const state of node.element.states ?? [])
|
|
27
|
+
add(`${STATE}${node.role}${SEP}${name.slice(0, MAX_TEXT)}${SEP}${state}`);
|
|
28
|
+
}
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
const isMeta = (key) => key.startsWith(STATE) || key === CUT;
|
|
32
|
+
const textOf = (key) => {
|
|
33
|
+
const at = key.indexOf(SEP);
|
|
34
|
+
const text = at < 0 ? key : key.slice(at + 1);
|
|
35
|
+
return text.startsWith('=') ? text.slice(1) : text;
|
|
36
|
+
};
|
|
37
|
+
export function changeBetween(before, after) {
|
|
38
|
+
const added = [];
|
|
39
|
+
const removed = [];
|
|
40
|
+
for (const [key, count] of after)
|
|
41
|
+
if (!isMeta(key) && count > (before.get(key) ?? 0))
|
|
42
|
+
added.push(textOf(key));
|
|
43
|
+
for (const [key, count] of before)
|
|
44
|
+
if (!isMeta(key) && count > (after.get(key) ?? 0))
|
|
45
|
+
removed.push(textOf(key));
|
|
46
|
+
return { added, removed };
|
|
47
|
+
}
|
|
48
|
+
/** Whether every control's state (selected, disabled) is the same in two reads. */
|
|
49
|
+
export const sameState = (a, b) => {
|
|
50
|
+
for (const [key, count] of a)
|
|
51
|
+
if (key.startsWith(STATE) && b.get(key) !== count)
|
|
52
|
+
return false;
|
|
53
|
+
for (const [key, count] of b)
|
|
54
|
+
if (key.startsWith(STATE) && a.get(key) !== count)
|
|
55
|
+
return false;
|
|
56
|
+
return true;
|
|
57
|
+
};
|
|
58
|
+
export const sameObservation = (a, b) => {
|
|
59
|
+
const { added, removed } = changeBetween(a, b);
|
|
60
|
+
return added.length === 0 && removed.length === 0 && sameState(a, b);
|
|
61
|
+
};
|
|
62
|
+
/** Text as a person types it against how a window may show it: case, spaces and operator glyphs differ. */
|
|
63
|
+
export function foldText(value) {
|
|
64
|
+
return value.toLowerCase().replace(/\s+/g, '').replace(/\*/g, '×').replace(/\//g, '÷');
|
|
65
|
+
}
|
|
66
|
+
const quote = (value, max = 80) => JSON.stringify(value.length > max ? `${value.slice(0, max - 1)}…` : value);
|
|
67
|
+
/** How many times a folded text occurs in everything a window shows. */
|
|
68
|
+
function occurrences(obs, want) {
|
|
69
|
+
let total = 0;
|
|
70
|
+
for (const [key, count] of obs) {
|
|
71
|
+
if (isMeta(key))
|
|
72
|
+
continue;
|
|
73
|
+
const text = foldText(textOf(key));
|
|
74
|
+
let at = text.indexOf(want);
|
|
75
|
+
while (at >= 0) {
|
|
76
|
+
total += count;
|
|
77
|
+
at = text.indexOf(want, at + want.length);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return total;
|
|
81
|
+
}
|
|
82
|
+
const countOf = (text, want) => {
|
|
83
|
+
if (want === '')
|
|
84
|
+
return 0;
|
|
85
|
+
let n = 0;
|
|
86
|
+
for (let at = text.indexOf(want); at >= 0; at = text.indexOf(want, at + want.length))
|
|
87
|
+
n++;
|
|
88
|
+
return n;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Whether the window shows the effect of an input the driver could not
|
|
92
|
+
* confirm. `later` is a read taken a moment after `after`: equal reads mean
|
|
93
|
+
* the window had settled. Undefined means nothing observable followed.
|
|
94
|
+
*/
|
|
95
|
+
export function judgeObserved(input, reads) {
|
|
96
|
+
const change = changeBetween(reads.before, reads.after);
|
|
97
|
+
if (input.typed !== undefined) {
|
|
98
|
+
const want = foldText(input.typed);
|
|
99
|
+
if (want !== '') {
|
|
100
|
+
// Typed text counts only when the window shows it more often than before; a
|
|
101
|
+
// short text (a letter, a digit) is no evidence inside other text, so it
|
|
102
|
+
// must appear as a text of its own.
|
|
103
|
+
const short = want.length < 3;
|
|
104
|
+
const shown = occurrences(reads.after, want) > occurrences(reads.before, want)
|
|
105
|
+
? change.added.find((text) => short ? foldText(text) === want : foldText(text).includes(want))
|
|
106
|
+
: undefined;
|
|
107
|
+
if (shown !== undefined)
|
|
108
|
+
return {
|
|
109
|
+
delivery: 'delivered_verified',
|
|
110
|
+
retrySafety: 'unsafe',
|
|
111
|
+
observed: shown,
|
|
112
|
+
detail: 'The window shows the text typed.',
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const stateOnly = change.added.length === 0 && change.removed.length === 0;
|
|
118
|
+
if (stateOnly && sameState(reads.before, reads.after))
|
|
119
|
+
return undefined;
|
|
120
|
+
// A window still changing a moment later, or one that changed before the input, says nothing.
|
|
121
|
+
if (reads.later !== undefined && !sameObservation(reads.after, reads.later))
|
|
122
|
+
return undefined;
|
|
123
|
+
if (reads.earlier !== undefined && !sameObservation(reads.earlier, reads.before))
|
|
124
|
+
return undefined;
|
|
125
|
+
if (stateOnly)
|
|
126
|
+
return {
|
|
127
|
+
delivery: 'delivered_verified',
|
|
128
|
+
retrySafety: 'unsafe',
|
|
129
|
+
detail: 'A control of the window changed state (selected or enabled) after the input and then held still.',
|
|
130
|
+
};
|
|
131
|
+
const now = change.added[0];
|
|
132
|
+
const was = change.removed[0];
|
|
133
|
+
const said = was !== undefined
|
|
134
|
+
? now !== undefined
|
|
135
|
+
? `It read ${quote(was)} before the input.`
|
|
136
|
+
: `The window no longer shows ${quote(was)}.`
|
|
137
|
+
: 'The window showed nothing like it before the input.';
|
|
138
|
+
return {
|
|
139
|
+
delivery: 'delivered_verified',
|
|
140
|
+
retrySafety: 'unsafe',
|
|
141
|
+
...(now !== undefined ? { observed: now } : {}),
|
|
142
|
+
detail: `The window changed after the input and then held still. ${said}`,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const UIPI_TEXT = 'this window belongs to a program running with higher rights, so text cannot be sent to it. Ask the user; do not try to get around it.';
|
|
146
|
+
/**
|
|
147
|
+
* `set` or `type` on a classic edit control, judged by the text the control
|
|
148
|
+
* reads back: the control is the evidence, not the message that returned.
|
|
149
|
+
*/
|
|
150
|
+
export function judgeEdit(op, text, reading) {
|
|
151
|
+
const expected = trimOf(text);
|
|
152
|
+
if (reading.reason === 'uipi')
|
|
153
|
+
return { ok: false, delivery: 'not_delivered', retrySafety: 'safe', detail: UIPI_TEXT };
|
|
154
|
+
if (reading.reason === 'read_only')
|
|
155
|
+
return {
|
|
156
|
+
ok: false,
|
|
157
|
+
delivery: 'not_delivered',
|
|
158
|
+
retrySafety: 'safe',
|
|
159
|
+
detail: 'this text control is read-only, so nothing was sent.',
|
|
160
|
+
};
|
|
161
|
+
if (reading.reason === 'hung')
|
|
162
|
+
return {
|
|
163
|
+
ok: true,
|
|
164
|
+
delivery: 'delivered_unverified',
|
|
165
|
+
retrySafety: 'unsafe',
|
|
166
|
+
detail: 'the program did not answer the text in time. It may have arrived; look at the window before sending it again.',
|
|
167
|
+
};
|
|
168
|
+
if (reading.reason !== '')
|
|
169
|
+
return {
|
|
170
|
+
ok: true,
|
|
171
|
+
delivery: 'delivered_unverified',
|
|
172
|
+
retrySafety: 'unsafe',
|
|
173
|
+
detail: 'the text was sent, but the control could not be read back. Look at the window before sending it again.',
|
|
174
|
+
};
|
|
175
|
+
if (reading.done)
|
|
176
|
+
return {
|
|
177
|
+
ok: true,
|
|
178
|
+
delivery: 'delivered_verified',
|
|
179
|
+
retrySafety: op === 'set' ? 'safe' : 'unsafe',
|
|
180
|
+
readBack: { expected, observed: trimOf(reading.seen) },
|
|
181
|
+
};
|
|
182
|
+
return {
|
|
183
|
+
ok: true,
|
|
184
|
+
delivery: 'delivered_unverified',
|
|
185
|
+
retrySafety: 'unsafe',
|
|
186
|
+
readBack: { expected, observed: trimOf(reading.seen) },
|
|
187
|
+
detail: op === 'set'
|
|
188
|
+
? `the control changed, but it reads ${quote(reading.seen)} instead of the text sent; it may have reformatted it. Check before setting it again.`
|
|
189
|
+
: `the control does not read as having received the text (around the caret it reads ${quote(reading.seen)}). Look at the window before typing it again.`,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
const trimOf = (value, max = 80) => value.length > max ? `${value.slice(0, max - 1)}…` : value;
|
|
193
|
+
/** A before and after read of an edit control, for a keyboard delivery the driver could not confirm. */
|
|
194
|
+
export function judgeEditBetween(typed, before, after) {
|
|
195
|
+
const norm = (value) => value.replace(/\r\n?/g, '\n');
|
|
196
|
+
const a = norm(after.text);
|
|
197
|
+
const want = norm(typed);
|
|
198
|
+
if (after.len === before.len && a === norm(before.text))
|
|
199
|
+
return undefined;
|
|
200
|
+
// The text must occur more often than before: a change elsewhere in a control
|
|
201
|
+
// that already held it proves nothing, and a longer text alone is not evidence.
|
|
202
|
+
if (want === '')
|
|
203
|
+
return undefined;
|
|
204
|
+
// A read keeps only the start of a very long text: when both reads were cut, the
|
|
205
|
+
// length is all that is left to compare, and it must have grown by exactly the typed text.
|
|
206
|
+
const cut = after.len > after.text.length && before.len > before.text.length;
|
|
207
|
+
if (cut && after.len - before.len === want.length)
|
|
208
|
+
return {
|
|
209
|
+
delivery: 'delivered_verified',
|
|
210
|
+
retrySafety: 'unsafe',
|
|
211
|
+
detail: 'The text control grew by the length of the text typed.',
|
|
212
|
+
};
|
|
213
|
+
const at = a.indexOf(want);
|
|
214
|
+
if (at < 0)
|
|
215
|
+
return undefined;
|
|
216
|
+
if (countOf(a, want) <= countOf(norm(before.text), want))
|
|
217
|
+
return undefined;
|
|
218
|
+
const from = Math.max(0, at - 40);
|
|
219
|
+
const seen = a.slice(from, from + want.length + 80);
|
|
220
|
+
return {
|
|
221
|
+
delivery: 'delivered_verified',
|
|
222
|
+
retrySafety: 'unsafe',
|
|
223
|
+
observed: seen,
|
|
224
|
+
detail: 'The text control now holds the text typed.',
|
|
225
|
+
};
|
|
226
|
+
}
|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AE,OAAO,SAAS,CAAA;IACjC,iFAAiF;IACjF,2FAA2F;IAC3F,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAA;IAC5E,IAAI,GAAG,IAAI,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,KAAK,IAAI,CAAC,MAAM;QAChD,OAAO;YACN,QAAQ,EAAE,oBAAoB;YAC9B,WAAW,EAAE,QAAQ;YACrB,MAAM,EAAE,wDAAwD;SAChE,CAAA;IACF,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,IAAI,EAAE,GAAG,CAAC;QAAE,OAAO,SAAS,CAAA;IAC5B,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;QAAE,OAAO,SAAS,CAAA;IAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;IACjC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IACnD,OAAO;QACN,QAAQ,EAAE,oBAAoB;QAC9B,WAAW,EAAE,QAAQ;QACrB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,4CAA4C;KACpD,CAAA;AACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UiElement } from '@namzu/sdk';
|
|
1
|
+
import type { UiElement, UiElementAction } from '@namzu/sdk';
|
|
2
2
|
/**
|
|
3
3
|
* cua-driver's `get_window_state` → the host's `UiElement` tree.
|
|
4
4
|
*
|
|
@@ -27,16 +27,89 @@ export interface CuaUiElement {
|
|
|
27
27
|
readonly frame?: unknown;
|
|
28
28
|
readonly parent_index?: unknown;
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* What `uiAct` knows about a ref: the element's identity evidence (role, name,
|
|
32
|
+
* automation id), which finds it again in a later tree, and the state it had
|
|
33
|
+
* when it was read, which a read-back compares against.
|
|
34
|
+
*/
|
|
31
35
|
export interface UiRefFacts {
|
|
36
|
+
readonly role: string;
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly automationId?: string;
|
|
32
39
|
readonly value?: string;
|
|
40
|
+
readonly selected: boolean;
|
|
41
|
+
readonly actions: readonly UiElementAction[];
|
|
42
|
+
/** Child indexes from the root to the element when it was read: its place in the tree. */
|
|
43
|
+
readonly path: readonly number[];
|
|
44
|
+
/**
|
|
45
|
+
* Another control with this role and name (and no id of its own to tell them
|
|
46
|
+
* apart) was in the window when this one was read. Such a control is found
|
|
47
|
+
* again by its place only while the tree has not changed shape.
|
|
48
|
+
*/
|
|
49
|
+
readonly twin?: boolean;
|
|
50
|
+
/** How many children the node had; tells a nameless container from another one of its role. */
|
|
51
|
+
readonly childCount?: number;
|
|
52
|
+
/** The shape of the whole tree this was read from; absent for a partial (query) read. */
|
|
53
|
+
readonly treeSig?: string;
|
|
54
|
+
}
|
|
55
|
+
/** One node of a read tree, whether or not it can be acted on. */
|
|
56
|
+
export interface UiNode {
|
|
57
|
+
readonly path: readonly number[];
|
|
58
|
+
readonly role: string;
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly automationId?: string;
|
|
61
|
+
/** The driver's handle for the node; empty for one the host cannot act on. */
|
|
62
|
+
readonly token: string;
|
|
63
|
+
/** The node with its subtree, driver tokens still in `ref`. */
|
|
64
|
+
readonly element: UiElement;
|
|
65
|
+
/** Present when `token` is. */
|
|
66
|
+
readonly facts?: UiRefFacts;
|
|
33
67
|
}
|
|
34
68
|
export interface ParsedUiTree {
|
|
35
69
|
readonly root: UiElement;
|
|
36
70
|
/** Every ref in the tree, with what `uiAct` needs about it. */
|
|
37
71
|
readonly refs: ReadonlyMap<string, UiRefFacts>;
|
|
72
|
+
/** Every node, in tree order, with its path. */
|
|
73
|
+
readonly nodes: readonly UiNode[];
|
|
38
74
|
readonly count: number;
|
|
75
|
+
/** A digest of every node's place, role, name and id: equal for a tree that kept its shape. */
|
|
76
|
+
readonly signature: string;
|
|
77
|
+
}
|
|
78
|
+
/** What finds a control again: the evidence a ref carries. */
|
|
79
|
+
export interface UiEvidence {
|
|
80
|
+
readonly role: string;
|
|
81
|
+
readonly name: string;
|
|
82
|
+
readonly automationId?: string;
|
|
83
|
+
readonly path: readonly number[];
|
|
84
|
+
readonly twin?: boolean;
|
|
85
|
+
readonly childCount?: number;
|
|
86
|
+
readonly treeSig?: string;
|
|
39
87
|
}
|
|
88
|
+
export type Located = {
|
|
89
|
+
readonly kind: 'found';
|
|
90
|
+
readonly node: UiNode;
|
|
91
|
+
} | {
|
|
92
|
+
readonly kind: 'ambiguous';
|
|
93
|
+
readonly count: number;
|
|
94
|
+
} | {
|
|
95
|
+
readonly kind: 'gone';
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* The control `evidence` described, found in a newer read of its window.
|
|
99
|
+
*
|
|
100
|
+
* A native id with the same role and name is the control when it is unique;
|
|
101
|
+
* the same id under another name is not (it may be another action), so a
|
|
102
|
+
* control whose name carries a changing value is found again only by taking a
|
|
103
|
+
* new snapshot. Without an id, the stored path is walked and the
|
|
104
|
+
* node there is accepted if it is the same role and name; failing that the
|
|
105
|
+
* whole tree is searched for that role and name. One match is the control;
|
|
106
|
+
* several are AMBIGUOUS (never a guess); none is gone. `actionable` asks for a
|
|
107
|
+
* node that has a driver handle, since a control that lost its patterns cannot
|
|
108
|
+
* be acted on.
|
|
109
|
+
*/
|
|
110
|
+
export declare function locate(evidence: UiEvidence, tree: ParsedUiTree, options: {
|
|
111
|
+
readonly actionable: boolean;
|
|
112
|
+
}): Located;
|
|
40
113
|
/** The whole tree of one `get_window_state` answer. */
|
|
41
114
|
export declare function toUiTree(state: Record<string, unknown>): ParsedUiTree;
|
|
42
115
|
//# sourceMappingURL=ui-tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-tree.d.ts","sourceRoot":"","sources":["../../../src/adapters/cua-driver/ui-tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui-tree.d.ts","sourceRoot":"","sources":["../../../src/adapters/cua-driver/ui-tree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAElE;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,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