@elizaos/plugin-computeruse 2.0.0-beta.1 → 2.0.3-beta.3
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/LICENSE +21 -0
- package/README.md +80 -0
- package/dist/actions/clipboard.d.ts +22 -0
- package/dist/actions/clipboard.d.ts.map +1 -0
- package/dist/actions/progress.d.ts +26 -0
- package/dist/actions/progress.d.ts.map +1 -0
- package/dist/actions/use-computer-agent.d.ts +113 -0
- package/dist/actions/use-computer-agent.d.ts.map +1 -0
- package/dist/actions/use-computer.d.ts.map +1 -1
- package/dist/actions/window-handlers.d.ts +11 -0
- package/dist/actions/window-handlers.d.ts.map +1 -0
- package/dist/actions/window.d.ts +11 -0
- package/dist/actions/window.d.ts.map +1 -0
- package/dist/actor/actor.d.ts +84 -0
- package/dist/actor/actor.d.ts.map +1 -0
- package/dist/actor/agent-callbacks.d.ts +128 -0
- package/dist/actor/agent-callbacks.d.ts.map +1 -0
- package/dist/actor/agent-loop.d.ts +134 -0
- package/dist/actor/agent-loop.d.ts.map +1 -0
- package/dist/actor/aosp-input-actor.d.ts +87 -0
- package/dist/actor/aosp-input-actor.d.ts.map +1 -0
- package/dist/actor/brain.d.ts +195 -0
- package/dist/actor/brain.d.ts.map +1 -0
- package/dist/actor/cascade.d.ts +92 -0
- package/dist/actor/cascade.d.ts.map +1 -0
- package/dist/actor/computer-interface.d.ts +276 -0
- package/dist/actor/computer-interface.d.ts.map +1 -0
- package/dist/actor/dispatch.d.ts +24 -0
- package/dist/actor/dispatch.d.ts.map +1 -0
- package/dist/actor/index.d.ts +12 -0
- package/dist/actor/index.d.ts.map +1 -0
- package/dist/actor/types.d.ts +94 -0
- package/dist/actor/types.d.ts.map +1 -0
- package/dist/approval-manager.d.ts.map +1 -1
- package/dist/index.d.ts +19 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12001 -5484
- package/dist/index.js.map +59 -25
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/server.d.ts +42 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/tools.d.ts +53 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mobile/android-bridge.d.ts +263 -0
- package/dist/mobile/android-bridge.d.ts.map +1 -0
- package/dist/mobile/android-scene.d.ts +52 -0
- package/dist/mobile/android-scene.d.ts.map +1 -0
- package/dist/mobile/android-trajectory.d.ts +66 -0
- package/dist/mobile/android-trajectory.d.ts.map +1 -0
- package/dist/mobile/index.d.ts +19 -0
- package/dist/mobile/index.d.ts.map +1 -0
- package/dist/mobile/ios-app-intent-registry.d.ts +20 -0
- package/dist/mobile/ios-app-intent-registry.d.ts.map +1 -0
- package/dist/mobile/ios-bridge.d.ts +359 -0
- package/dist/mobile/ios-bridge.d.ts.map +1 -0
- package/dist/mobile/ios-computer-interface.d.ts +160 -0
- package/dist/mobile/ios-computer-interface.d.ts.map +1 -0
- package/dist/mobile/mobile-computer-interface.d.ts +142 -0
- package/dist/mobile/mobile-computer-interface.d.ts.map +1 -0
- package/dist/mobile/mobile-screen-capture.d.ts +64 -0
- package/dist/mobile/mobile-screen-capture.d.ts.map +1 -0
- package/dist/mobile/ocr-provider.d.ts +187 -0
- package/dist/mobile/ocr-provider.d.ts.map +1 -0
- package/dist/mobile/ocr-provider.js +111 -0
- package/dist/mobile/ocr-provider.js.map +10 -0
- package/dist/osworld/action-converter.d.ts +4 -1
- package/dist/osworld/action-converter.d.ts.map +1 -1
- package/dist/osworld/adapter.d.ts +1 -0
- package/dist/osworld/adapter.d.ts.map +1 -1
- package/dist/parity/index.d.ts +9 -0
- package/dist/parity/index.d.ts.map +1 -0
- package/dist/parity/parity-matrix.d.ts +82 -0
- package/dist/parity/parity-matrix.d.ts.map +1 -0
- package/dist/parity/screenspot.d.ts +56 -0
- package/dist/parity/screenspot.d.ts.map +1 -0
- package/dist/platform/a11y.d.ts +29 -1
- package/dist/platform/a11y.d.ts.map +1 -1
- package/dist/platform/browser.d.ts +1 -1
- package/dist/platform/browser.d.ts.map +1 -1
- package/dist/platform/capabilities.d.ts +23 -0
- package/dist/platform/capabilities.d.ts.map +1 -1
- package/dist/platform/capture.d.ts +65 -0
- package/dist/platform/capture.d.ts.map +1 -0
- package/dist/platform/clipboard.d.ts +24 -0
- package/dist/platform/clipboard.d.ts.map +1 -0
- package/dist/platform/coords.d.ts +73 -0
- package/dist/platform/coords.d.ts.map +1 -0
- package/dist/platform/desktop.d.ts +23 -0
- package/dist/platform/desktop.d.ts.map +1 -1
- package/dist/platform/displays.d.ts +97 -0
- package/dist/platform/displays.d.ts.map +1 -0
- package/dist/platform/driver.d.ts +22 -0
- package/dist/platform/driver.d.ts.map +1 -1
- package/dist/platform/file-ops.d.ts +17 -0
- package/dist/platform/file-ops.d.ts.map +1 -1
- package/dist/platform/helpers.d.ts +2 -3
- package/dist/platform/helpers.d.ts.map +1 -1
- package/dist/platform/launch.d.ts +54 -0
- package/dist/platform/launch.d.ts.map +1 -0
- package/dist/platform/normalized-coords.d.ts +46 -0
- package/dist/platform/normalized-coords.d.ts.map +1 -0
- package/dist/platform/nut-driver.d.ts +67 -0
- package/dist/platform/nut-driver.d.ts.map +1 -1
- package/dist/platform/permissions.d.ts +12 -0
- package/dist/platform/permissions.d.ts.map +1 -1
- package/dist/platform/process-list.d.ts +32 -0
- package/dist/platform/process-list.d.ts.map +1 -0
- package/dist/platform/ps-host.d.ts +77 -0
- package/dist/platform/ps-host.d.ts.map +1 -0
- package/dist/platform/screenshot-errors.d.ts +54 -0
- package/dist/platform/screenshot-errors.d.ts.map +1 -0
- package/dist/platform/screenshot-quality.d.ts +11 -0
- package/dist/platform/screenshot-quality.d.ts.map +1 -0
- package/dist/platform/screenshot.d.ts.map +1 -1
- package/dist/platform/security.d.ts +8 -0
- package/dist/platform/security.d.ts.map +1 -1
- package/dist/platform/wayland-portal.d.ts +25 -0
- package/dist/platform/wayland-portal.d.ts.map +1 -0
- package/dist/platform/windows-list.d.ts +43 -1
- package/dist/platform/windows-list.d.ts.map +1 -1
- package/dist/providers/computer-state.d.ts.map +1 -1
- package/dist/providers/scene.d.ts +21 -0
- package/dist/providers/scene.d.ts.map +1 -0
- package/dist/register-routes.js +11715 -4990
- package/dist/register-routes.js.map +61 -24
- package/dist/routes/computer-use-compat-routes.d.ts +1 -1
- package/dist/routes/computer-use-compat-routes.d.ts.map +1 -1
- package/dist/sandbox/docker-backend.d.ts +69 -0
- package/dist/sandbox/docker-backend.d.ts.map +1 -0
- package/dist/sandbox/index.d.ts +62 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/qemu-backend.d.ts +48 -0
- package/dist/sandbox/qemu-backend.d.ts.map +1 -0
- package/dist/sandbox/remote-guest.d.ts +72 -0
- package/dist/sandbox/remote-guest.d.ts.map +1 -0
- package/dist/sandbox/sandbox-driver.d.ts +41 -0
- package/dist/sandbox/sandbox-driver.d.ts.map +1 -0
- package/dist/sandbox/surface-types.d.ts +17 -0
- package/dist/sandbox/surface-types.d.ts.map +1 -0
- package/dist/sandbox/types.d.ts +138 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/sandbox/wsb-backend.d.ts +48 -0
- package/dist/sandbox/wsb-backend.d.ts.map +1 -0
- package/dist/scene/a11y-provider.d.ts +83 -0
- package/dist/scene/a11y-provider.d.ts.map +1 -0
- package/dist/scene/apps.d.ts +39 -0
- package/dist/scene/apps.d.ts.map +1 -0
- package/dist/scene/dhash.d.ts +105 -0
- package/dist/scene/dhash.d.ts.map +1 -0
- package/dist/scene/ocr-adapter.d.ts +64 -0
- package/dist/scene/ocr-adapter.d.ts.map +1 -0
- package/dist/scene/scene-builder.d.ts +107 -0
- package/dist/scene/scene-builder.d.ts.map +1 -0
- package/dist/scene/scene-types.d.ts +70 -0
- package/dist/scene/scene-types.d.ts.map +1 -0
- package/dist/scene/screen-state.d.ts +105 -0
- package/dist/scene/screen-state.d.ts.map +1 -0
- package/dist/scene/serialize.d.ts +28 -0
- package/dist/scene/serialize.d.ts.map +1 -0
- package/dist/security/browser-script-policy.d.ts +9 -0
- package/dist/security/browser-script-policy.d.ts.map +1 -0
- package/dist/services/computer-use-service.d.ts +78 -2
- package/dist/services/computer-use-service.d.ts.map +1 -1
- package/dist/services/index.d.ts +7 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/vision-context-provider.d.ts +32 -0
- package/dist/services/vision-context-provider.d.ts.map +1 -0
- package/dist/types.d.ts +115 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +47 -10
- package/registry-entry.json +74 -0
- package/dist/actions/desktop-handlers.d.ts +0 -20
- package/dist/actions/desktop-handlers.d.ts.map +0 -1
- package/dist/actions/desktop.d.ts +0 -11
- package/dist/actions/desktop.d.ts.map +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Machine-checkable trycua/cua parity matrix (#9170 M14).
|
|
3
|
+
*
|
|
4
|
+
* The tracking issue maps every cua computer-use capability to its elizaOS
|
|
5
|
+
* status. That map is only trustworthy if it can't silently drift from the
|
|
6
|
+
* code, so this module encodes it as DATA plus a validator: every capability
|
|
7
|
+
* marked `have` with a promoted action verb must actually be registered on the
|
|
8
|
+
* plugin. `validateParityMatrix(actionNames)` is wired into the test suite, so
|
|
9
|
+
* adding a verb to the matrix without registering it (or vice-versa) fails CI.
|
|
10
|
+
*
|
|
11
|
+
* Per-OS coverage records where each capability is exercised (scenario-runner
|
|
12
|
+
* cases + the gated real-driver lanes). `covered` = has evidence today,
|
|
13
|
+
* `planned` = on the M14 backlog, `na` = intentionally out of scope for that OS.
|
|
14
|
+
*/
|
|
15
|
+
export type ParityStatus = "have" | "partial" | "na";
|
|
16
|
+
export type OsName = "windows" | "linux" | "macos" | "aosp";
|
|
17
|
+
export type OsCoverage = "covered" | "planned" | "na";
|
|
18
|
+
export interface ParityCapability {
|
|
19
|
+
/** cua capability / verb id. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Promoted elizaOS action verb (when `have`/`partial`), else omitted. */
|
|
22
|
+
elizaVerb?: string;
|
|
23
|
+
status: ParityStatus;
|
|
24
|
+
/** Milestone that delivered it (M7–M13), for traceability. */
|
|
25
|
+
milestone?: string;
|
|
26
|
+
os: Record<OsName, OsCoverage>;
|
|
27
|
+
note?: string;
|
|
28
|
+
}
|
|
29
|
+
/** The canonical capability → status map. */
|
|
30
|
+
export declare const PARITY_MATRIX: readonly ParityCapability[];
|
|
31
|
+
export interface ParityValidationProblem {
|
|
32
|
+
capability: string;
|
|
33
|
+
problem: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ParityValidationResult {
|
|
36
|
+
ok: boolean;
|
|
37
|
+
problems: ParityValidationProblem[];
|
|
38
|
+
/** Count of `have` capabilities whose verb was confirmed registered. */
|
|
39
|
+
confirmed: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Cross-check the matrix against the live action surface. Every `have`/`partial`
|
|
43
|
+
* capability whose `elizaVerb` is a promoted action (COMPUTER_USE_* / WINDOW_* /
|
|
44
|
+
* CLIPBOARD_*) must appear in `actionNames`. Pure — the caller passes the
|
|
45
|
+
* plugin's registered action names.
|
|
46
|
+
*/
|
|
47
|
+
export declare function validateParityMatrix(actionNames: readonly string[]): ParityValidationResult;
|
|
48
|
+
/** Summary counts for reporting / dashboards. */
|
|
49
|
+
export declare function parityMatrixSummary(): {
|
|
50
|
+
have: number;
|
|
51
|
+
partial: number;
|
|
52
|
+
na: number;
|
|
53
|
+
total: number;
|
|
54
|
+
};
|
|
55
|
+
/** Per-OS coverage rollup for the parity matrix. */
|
|
56
|
+
export interface ParityCoverageByOs {
|
|
57
|
+
os: OsName;
|
|
58
|
+
covered: number;
|
|
59
|
+
planned: number;
|
|
60
|
+
na: number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Roll up per-OS coverage across every `have`/`partial` capability. `na`
|
|
64
|
+
* capabilities are excluded (they are not part of any OS's parity surface).
|
|
65
|
+
* Pure — derives only from PARITY_MATRIX. Useful for a "what still needs a
|
|
66
|
+
* macOS/Linux real-lane case" dashboard and the M14 coverage report.
|
|
67
|
+
*/
|
|
68
|
+
export declare function parityCoverageByOs(): ParityCoverageByOs[];
|
|
69
|
+
/**
|
|
70
|
+
* Structural invariants on the per-OS coverage records — the `os` field was
|
|
71
|
+
* free-form data with no guard, so a typo or a capability that claims
|
|
72
|
+
* `covered` on a platform it can't run on could drift in silently. Pure; the
|
|
73
|
+
* test suite asserts `ok`. Invariants:
|
|
74
|
+
* 1. every `have`/`partial` capability declares all four OS keys with a valid
|
|
75
|
+
* OsCoverage value;
|
|
76
|
+
* 2. an `na` capability is `os: na` on every axis (it is out of scope, not
|
|
77
|
+
* "covered/planned" anywhere);
|
|
78
|
+
* 3. a non-`na` capability must have at least one OS that is `covered` or
|
|
79
|
+
* `planned` (a verb that is `na` on every OS should be status `na`).
|
|
80
|
+
*/
|
|
81
|
+
export declare function validateParityCoverage(): ParityValidationResult;
|
|
82
|
+
//# sourceMappingURL=parity-matrix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parity-matrix.d.ts","sourceRoot":"","sources":["../../src/parity/parity-matrix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AACrD,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAC5D,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAgBD,6CAA6C;AAC7C,eAAO,MAAM,aAAa,EAAE,SAAS,gBAAgB,EAyQpD,CAAC;AAMF,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;CACnB;AAKD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,SAAS,MAAM,EAAE,GAC7B,sBAAsB,CA+BxB;AAED,iDAAiD;AACjD,wBAAgB,mBAAmB,IAAI;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAUA;AAED,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,kBAAkB,EAAE,CAsBzD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,IAAI,sBAAsB,CAyC/D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ScreenSpot grounding harness (#9170 M14).
|
|
3
|
+
*
|
|
4
|
+
* ScreenSpot scores click-grounding: given an instruction + screenshot, a model
|
|
5
|
+
* predicts a click point; the sample is correct iff the point lands inside the
|
|
6
|
+
* ground-truth element bbox. This module is the scorer + harness — it consumes a
|
|
7
|
+
* grounder function (e.g. the M9 Set-of-Marks marks → `center`, or the M10
|
|
8
|
+
* `predictClick` seam) and reports point-in-bbox accuracy.
|
|
9
|
+
*
|
|
10
|
+
* The dataset itself is NOT vendored (the real ScreenSpot images are large and
|
|
11
|
+
* licensed separately); a runner provides samples + a grounder and gets a score.
|
|
12
|
+
* Pure scoring is unit-tested with synthetic samples.
|
|
13
|
+
*/
|
|
14
|
+
export interface ScreenSpotSample {
|
|
15
|
+
id: string;
|
|
16
|
+
instruction: string;
|
|
17
|
+
/** Ground-truth target bbox `[x, y, w, h]` in image pixels. */
|
|
18
|
+
bbox: [number, number, number, number];
|
|
19
|
+
imageWidth: number;
|
|
20
|
+
imageHeight: number;
|
|
21
|
+
/** Optional source group (e.g. "icon" / "text" / platform) for breakdowns. */
|
|
22
|
+
group?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ScreenSpotPrediction {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}
|
|
28
|
+
/** A predicted point lands inside the bbox (inclusive of edges). Pure. */
|
|
29
|
+
export declare function pointInBbox(point: ScreenSpotPrediction, bbox: readonly [number, number, number, number]): boolean;
|
|
30
|
+
export interface ScreenSpotSampleResult {
|
|
31
|
+
id: string;
|
|
32
|
+
group?: string;
|
|
33
|
+
predicted: ScreenSpotPrediction | null;
|
|
34
|
+
correct: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface ScreenSpotScore {
|
|
37
|
+
total: number;
|
|
38
|
+
correct: number;
|
|
39
|
+
/** correct / total (0 when total is 0). */
|
|
40
|
+
accuracy: number;
|
|
41
|
+
/** Per-group accuracy breakdown. */
|
|
42
|
+
byGroup: Record<string, {
|
|
43
|
+
total: number;
|
|
44
|
+
correct: number;
|
|
45
|
+
accuracy: number;
|
|
46
|
+
}>;
|
|
47
|
+
results: ScreenSpotSampleResult[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Run a grounder over the samples and score point-in-bbox accuracy. The grounder
|
|
51
|
+
* returns a predicted click point (or `null` when it abstains — counted wrong).
|
|
52
|
+
* Samples run sequentially so a real grounder's per-call I/O is not blasted in
|
|
53
|
+
* parallel.
|
|
54
|
+
*/
|
|
55
|
+
export declare function scoreScreenSpot(samples: readonly ScreenSpotSample[], predict: (sample: ScreenSpotSample) => Promise<ScreenSpotPrediction | null> | ScreenSpotPrediction | null): Promise<ScreenSpotScore>;
|
|
56
|
+
//# sourceMappingURL=screenspot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenspot.d.ts","sourceRoot":"","sources":["../../src/parity/screenspot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CACzB,KAAK,EAAE,oBAAoB,EAC3B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAC9C,OAAO,CAGT;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACvC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9E,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,OAAO,EAAE,CACP,MAAM,EAAE,gBAAgB,KACrB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,GAAG,oBAAoB,GAAG,IAAI,GACtE,OAAO,CAAC,eAAe,CAAC,CAsC1B"}
|
package/dist/platform/a11y.d.ts
CHANGED
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
* using native platform tools.
|
|
7
7
|
*
|
|
8
8
|
* macOS — System Accessibility API via osascript / swift
|
|
9
|
-
* Linux — AT-SPI via python3-atspi
|
|
9
|
+
* Linux — AT-SPI via python3-atspi (X11 + GNOME-Wayland). Wayland-only
|
|
10
|
+
* environments without AT-SPI fall back to a structured snapshot
|
|
11
|
+
* built from `listWindows()` + `listProcesses()` and tagged with
|
|
12
|
+
* `source: "compositor-fallback"`.
|
|
10
13
|
* Windows — UIAutomation via PowerShell
|
|
11
14
|
*/
|
|
12
15
|
export interface A11yNode {
|
|
@@ -22,6 +25,31 @@ export interface A11yNode {
|
|
|
22
25
|
};
|
|
23
26
|
children?: A11yNode[];
|
|
24
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Structured snapshot returned by the Wayland compositor fallback. Callers
|
|
30
|
+
* inspect `source` to discriminate AT-SPI quality from the cheaper
|
|
31
|
+
* window-list join used when AT-SPI is unavailable.
|
|
32
|
+
*/
|
|
33
|
+
export interface WaylandA11ySnapshot {
|
|
34
|
+
source: "compositor-fallback";
|
|
35
|
+
role: "desktop";
|
|
36
|
+
name: string;
|
|
37
|
+
focusedWindow: {
|
|
38
|
+
app: string;
|
|
39
|
+
title: string;
|
|
40
|
+
id: string;
|
|
41
|
+
} | null;
|
|
42
|
+
focusedApp: {
|
|
43
|
+
pid: number;
|
|
44
|
+
name: string;
|
|
45
|
+
} | null;
|
|
46
|
+
children: Array<{
|
|
47
|
+
role: "window";
|
|
48
|
+
name: string;
|
|
49
|
+
app: string;
|
|
50
|
+
id: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
25
53
|
/**
|
|
26
54
|
* Extract the accessibility tree of the focused window / screen.
|
|
27
55
|
* Returns a simplified plain-text accessibility tree suitable for LLM consumption.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../src/platform/a11y.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../src/platform/a11y.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,UAAU,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,QAAQ,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC,CAAC;CACJ;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAkB/C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAezC"}
|
|
@@ -27,7 +27,7 @@ export declare function getBrowserInfo(): Promise<BrowserInfo>;
|
|
|
27
27
|
export declare function getBrowserDom(): Promise<string>;
|
|
28
28
|
export declare function getBrowserClickables(): Promise<ClickableElement[]>;
|
|
29
29
|
export declare function screenshotBrowser(): Promise<string>;
|
|
30
|
-
export declare function executeBrowser(
|
|
30
|
+
export declare function executeBrowser(_code: string): Promise<string>;
|
|
31
31
|
export declare function waitBrowser(selector?: string, text?: string, timeout?: number): Promise<void>;
|
|
32
32
|
export declare function browserWait(selector?: string, text?: string, timeout?: number): Promise<{
|
|
33
33
|
success: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/platform/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,EACjB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/platform/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,EACjB,MAAM,aAAa,CAAC;AA+BrB,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,QAAQ,CAAC,EAAE,OA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eAAO,MAAM,iBAAiB,wBAAkB,CAAC;AACjD,eAAO,MAAM,gBAAgB,uBAAiB,CAAC;AAC/C,eAAO,MAAM,iBAAiB,wBAAkB,CAAC;AACjD,eAAO,MAAM,kBAAkB,yBAAmB,CAAC"}
|
|
@@ -6,5 +6,28 @@ export interface CapabilityDetectionOptions {
|
|
|
6
6
|
isBrowserAvailable: () => boolean;
|
|
7
7
|
shell?: string;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Per-capability parity classification, kept in lock-step with
|
|
11
|
+
* `plugins/plugin-computeruse/src/mobile/parity-status.md`.
|
|
12
|
+
*
|
|
13
|
+
* verified — exercised on real hardware (Linux/macOS in CI today)
|
|
14
|
+
* code-parity — feature-equivalent code path exists, runtime untested
|
|
15
|
+
* unavailable — surface present but not available in this delivery model
|
|
16
|
+
* blocked — OS does not allow the operation in our delivery model
|
|
17
|
+
*
|
|
18
|
+
* iOS / Android live in `mobile/parity-status.md`; they are not desktop OSes
|
|
19
|
+
* and don't pass through `detectPlatformCapabilities`.
|
|
20
|
+
*/
|
|
21
|
+
export type ParityStatus = "verified" | "code-parity" | "unavailable" | "blocked";
|
|
22
|
+
export interface ParityNote {
|
|
23
|
+
readonly status: ParityStatus;
|
|
24
|
+
readonly note?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Static parity table for desktop targets, derived from the per-file audit.
|
|
28
|
+
* Linux is the reference implementation.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DESKTOP_PARITY: Readonly<Record<PlatformOS, Readonly<Record<keyof PlatformCapabilities, ParityNote>>>>;
|
|
31
|
+
export declare function parityFor(osName: PlatformOS, capability: keyof PlatformCapabilities): ParityNote;
|
|
9
32
|
export declare function detectPlatformCapabilities(options: CapabilityDetectionOptions): PlatformCapabilities;
|
|
10
33
|
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/platform/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,UAAU,CAAC;IACnB,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,kBAAkB,EAAE,MAAM,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,0BAA0B,GAClC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/platform/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,UAAU,CAAC;IACnB,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC5C,kBAAkB,EAAE,MAAM,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,aAAa,GACb,aAAa,GACb,SAAS,CAAC;AAEd,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,oBAAoB,EAAE,UAAU,CAAC,CAAC,CAAC,CA4C7E,CAAC;AAEF,wBAAgB,SAAS,CACvB,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,MAAM,oBAAoB,GACrC,UAAU,CAEZ;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,0BAA0B,GAClC,oBAAoB,CAoFtB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-display capture (WS5).
|
|
3
|
+
*
|
|
4
|
+
* Canonical capture entry point. Replaces `screenshot.ts` for any caller that
|
|
5
|
+
* cares about multi-monitor or DPI. The legacy `captureScreenshot()` keeps
|
|
6
|
+
* working (single-display, primary only) for back-compat.
|
|
7
|
+
*
|
|
8
|
+
* Returned `frame` is a PNG buffer at backing-store resolution:
|
|
9
|
+
* - macOS retina — 2× the logical bounds (e.g. 5120×2880 for a 2560×1440
|
|
10
|
+
* display reported as scaleFactor 2).
|
|
11
|
+
* - Windows/Linux — pixel-equivalent to logical bounds.
|
|
12
|
+
*
|
|
13
|
+
* Implementation notes:
|
|
14
|
+
* - macOS uses `screencapture -D <displayIndex+1>` to pick a specific
|
|
15
|
+
* display (1-indexed). For ScreenCaptureKit follow-up, replace this
|
|
16
|
+
* dispatch with the Swift sidecar.
|
|
17
|
+
* - Linux/Wayland prefers the xdg-desktop-portal screenshot sidecar. X11
|
|
18
|
+
* uses `import` (ImageMagick) or `scrot` cropped to the display's xrandr
|
|
19
|
+
* rect.
|
|
20
|
+
* - Windows uses PowerShell + System.Drawing to crop the virtual desktop
|
|
21
|
+
* to the screen bounds.
|
|
22
|
+
*
|
|
23
|
+
* Every code path is conditional on the current platform — a Linux test host
|
|
24
|
+
* can exercise the Linux paths; macOS / Windows paths are typechecked but
|
|
25
|
+
* exercised only in CI on those OSes.
|
|
26
|
+
*/
|
|
27
|
+
import type { ScreenRegion } from "../types.js";
|
|
28
|
+
import type { DisplayInfo } from "./displays.js";
|
|
29
|
+
export interface DisplayCapture {
|
|
30
|
+
display: DisplayInfo;
|
|
31
|
+
/** PNG bytes at backing-store resolution. */
|
|
32
|
+
frame: Buffer;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Capture every attached display in parallel. Returns one entry per display.
|
|
36
|
+
* Errors on any display are surfaced as rejected promises — caller decides
|
|
37
|
+
* whether to retry or partial-fail.
|
|
38
|
+
*/
|
|
39
|
+
export declare function captureAllDisplays(): Promise<DisplayCapture[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Capture a specific display by id.
|
|
42
|
+
*/
|
|
43
|
+
export declare function captureDisplay(displayId: number): Promise<DisplayCapture>;
|
|
44
|
+
/**
|
|
45
|
+
* Capture a region within a specific display. Region coordinates are LOCAL
|
|
46
|
+
* to that display.
|
|
47
|
+
*/
|
|
48
|
+
export declare function captureDisplayRegion(displayId: number, region: ScreenRegion): Promise<DisplayCapture>;
|
|
49
|
+
/**
|
|
50
|
+
* Convenience: capture the primary display.
|
|
51
|
+
*/
|
|
52
|
+
export declare function capturePrimaryDisplay(): Promise<DisplayCapture>;
|
|
53
|
+
/**
|
|
54
|
+
* Coerce a capture region to integer pixels and reject empty/degenerate sizes.
|
|
55
|
+
*
|
|
56
|
+
* `New-Object System.Drawing.Bitmap(w, h)` throws an opaque "Parameter is not
|
|
57
|
+
* valid" GDI+ error for a zero/negative/non-integer width or height, so we
|
|
58
|
+
* validate up front and surface a clear message. `x`/`y` may legitimately be
|
|
59
|
+
* negative — secondary monitors placed left of / above the primary live in the
|
|
60
|
+
* negative quadrant of the Windows virtual-desktop coordinate space — so only
|
|
61
|
+
* the dimensions are bounds-checked. Exported for cross-platform unit tests.
|
|
62
|
+
*/
|
|
63
|
+
export declare function normalizeCaptureRegion(region: ScreenRegion): ScreenRegion;
|
|
64
|
+
export { captureScreenshot } from "./screenshot.js";
|
|
65
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/platform/capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAkBjD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAGpE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,CAAC,CA4CzB;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,cAAc,CAAC,CA6BzB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,cAAc,CAAC,CAErE;AA4GD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAmBzE;AAuDD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare class ClipboardUnavailableError extends Error {
|
|
2
|
+
readonly tool: string;
|
|
3
|
+
constructor(tool: string, hint: string);
|
|
4
|
+
}
|
|
5
|
+
type LinuxBackend = "wayland" | "x11";
|
|
6
|
+
declare function detectLinuxBackend(): LinuxBackend;
|
|
7
|
+
interface ClipboardCommand {
|
|
8
|
+
command: string;
|
|
9
|
+
args: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
interface ClipboardPlan {
|
|
12
|
+
read: ClipboardCommand;
|
|
13
|
+
write: ClipboardCommand;
|
|
14
|
+
}
|
|
15
|
+
declare function pickPlan(): ClipboardPlan;
|
|
16
|
+
export declare function readClipboard(): Promise<string>;
|
|
17
|
+
export declare function writeClipboard(text: string): Promise<void>;
|
|
18
|
+
/** Internal hook for unit tests — re-exported for parity with helpers.ts. */
|
|
19
|
+
export declare const __testing: {
|
|
20
|
+
detectLinuxBackend: typeof detectLinuxBackend;
|
|
21
|
+
pickPlan: typeof pickPlan;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/platform/clipboard.ts"],"names":[],"mappings":"AA6BA,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBACV,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAKvC;AAED,KAAK,YAAY,GAAG,SAAS,GAAG,KAAK,CAAC;AAEtC,iBAAS,kBAAkB,IAAI,YAAY,CAI1C;AAED,UAAU,gBAAgB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED,iBAAS,QAAQ,IAAI,aAAa,CAiDjC;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAmBrD;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8ChE;AAED,6EAA6E;AAC7E,eAAO,MAAM,SAAS;;;CAGrB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coordinate translation between display-local and OS-global pixel space (WS5).
|
|
3
|
+
*
|
|
4
|
+
* Contract:
|
|
5
|
+
* - Every public mouse-bearing action accepts `{displayId, x, y}` where
|
|
6
|
+
* `(x, y)` is LOCAL to that display (top-left = 0,0, units = pixels of the
|
|
7
|
+
* display's logical bounds).
|
|
8
|
+
* - This module translates to the OS-global space the input drivers expect.
|
|
9
|
+
*
|
|
10
|
+
* Why local-first:
|
|
11
|
+
* - The model sees each display independently (one capture, no virtual
|
|
12
|
+
* desktop stitching). Local coords match what the model just looked at.
|
|
13
|
+
* - Virtual-desktop coords are a perpetual DPI / negative-origin bug source.
|
|
14
|
+
*
|
|
15
|
+
* Per-OS behavior of the input drivers we wrap (nutjs / xdotool / cliclick /
|
|
16
|
+
* PowerShell `SetCursorPos`):
|
|
17
|
+
* - Linux/X11: drivers expect global pixel coords matching xrandr origins.
|
|
18
|
+
* Translation = display.x + local.x. No DPI conversion.
|
|
19
|
+
* - Windows: `SetCursorPos` and nutjs both take physical pixel coords
|
|
20
|
+
* when the process is PerMonitorV2 DPI aware. Translation = display.x +
|
|
21
|
+
* local.x. No multiplier here — caller is responsible for declaring
|
|
22
|
+
* dpiAwareness.
|
|
23
|
+
* - macOS: Quartz event coords are in points (logical), not backing-
|
|
24
|
+
* store pixels. Translation = display.x + local.x with no scale multiply
|
|
25
|
+
* IF the local coords are also in points. We document the local coord
|
|
26
|
+
* space as "logical pixels" matching the capture's render at logical
|
|
27
|
+
* resolution; for retina captures the screenshot is upsampled to backing-
|
|
28
|
+
* store pixels and the model is expected to scale clicks back down
|
|
29
|
+
* before sending. The translator divides by scaleFactor when local
|
|
30
|
+
* coords were sourced from a backing-store-resolution screenshot.
|
|
31
|
+
*/
|
|
32
|
+
export interface LocalPoint {
|
|
33
|
+
displayId: number;
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
}
|
|
37
|
+
export interface GlobalPoint {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Resolve a LocalPoint to a GlobalPoint the input driver can act on.
|
|
43
|
+
*
|
|
44
|
+
* `coordSource` describes the coordinate reference:
|
|
45
|
+
* - `"logical"` (default) — local coords are in logical pixels matching the
|
|
46
|
+
* display's `bounds[2..3]`. No scale conversion is applied.
|
|
47
|
+
* - `"backing"` — local coords were taken against a capture rendered at
|
|
48
|
+
* `bounds * scaleFactor` (e.g. raw retina PNG). They are divided by
|
|
49
|
+
* scaleFactor before translation. macOS-only relevant.
|
|
50
|
+
*/
|
|
51
|
+
export declare function localToGlobal(point: LocalPoint, coordSource?: "logical" | "backing"): GlobalPoint;
|
|
52
|
+
/**
|
|
53
|
+
* As `localToGlobal`, but tolerates a missing displayId by defaulting to the
|
|
54
|
+
* primary display. Logs nothing — callers should warn before using this.
|
|
55
|
+
*/
|
|
56
|
+
export declare function localToGlobalDefault(point: {
|
|
57
|
+
displayId?: number;
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
}, coordSource?: "logical" | "backing"): GlobalPoint;
|
|
61
|
+
/**
|
|
62
|
+
* Inverse: given an OS-global point, return the (displayId, x, y) of the
|
|
63
|
+
* display containing it. Returns null if no display contains the point.
|
|
64
|
+
* Useful for translating OS-reported cursor positions back to local coords.
|
|
65
|
+
*/
|
|
66
|
+
export declare function globalToLocal(point: GlobalPoint): LocalPoint | null;
|
|
67
|
+
/**
|
|
68
|
+
* Validate a local point is inside its display's bounds. Returns the clamped
|
|
69
|
+
* point — never throws. Use this before sending to drivers that crash on
|
|
70
|
+
* out-of-bounds coords on some Linux versions.
|
|
71
|
+
*/
|
|
72
|
+
export declare function clampToDisplay(point: LocalPoint): LocalPoint;
|
|
73
|
+
//# sourceMappingURL=coords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coords.d.ts","sourceRoot":"","sources":["../../src/platform/coords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAMH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,UAAU,EACjB,WAAW,GAAE,SAAS,GAAG,SAAqB,GAC7C,WAAW,CAUb;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACnD,WAAW,GAAE,SAAS,GAAG,SAAqB,GAC7C,WAAW,CASb;AAuBD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,IAAI,CAQnE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAS5D"}
|
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
*
|
|
12
12
|
* All coordinate inputs are validated via validateInt() to prevent injection.
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* Read the current OS cursor position (legacy shell driver). Returns global
|
|
16
|
+
* logical pixels. Windows uses `System.Windows.Forms.Cursor` (must Add-Type the
|
|
17
|
+
* assembly first or the type is unresolved); macOS uses `cliclick p:.`; Linux
|
|
18
|
+
* uses `xdotool getmouselocation`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function legacyGetCursorPosition(): {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
14
24
|
export declare function desktopClick(x: number, y: number): void;
|
|
15
25
|
export declare function desktopClickWithModifiers(x: number, y: number, modifiers: string[]): void;
|
|
16
26
|
export declare function desktopDoubleClick(x: number, y: number): void;
|
|
@@ -30,4 +40,17 @@ export declare function desktopKeyPress(key: string): void;
|
|
|
30
40
|
* Ported from open-computer-use desktopKeyCombo().
|
|
31
41
|
*/
|
|
32
42
|
export declare function desktopKeyCombo(combo: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Windows fast-path for `set_value` (#9170 — trycua/cua `set_value`): use UI
|
|
45
|
+
* Automation `ValuePattern.SetValue` on the element under (x,y) to set its value
|
|
46
|
+
* directly, without synthesizing keystrokes. Returns `true` if the element
|
|
47
|
+
* exposed ValuePattern and was set; `false` (incl. on any error) so the caller
|
|
48
|
+
* falls back to the universal focus → select-all → type path.
|
|
49
|
+
*
|
|
50
|
+
* Uses `Add-Type -AssemblyName` (signed framework assemblies), not a
|
|
51
|
+
* runtime-compiled inline class. Real actuation is exercised by the interactive
|
|
52
|
+
* real-driver lane; this box's session can't host a ValuePattern control to
|
|
53
|
+
* probe it (see #9170).
|
|
54
|
+
*/
|
|
55
|
+
export declare function win32TrySetValueByPattern(x: number, y: number, value: string): boolean;
|
|
33
56
|
//# sourceMappingURL=desktop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"desktop.d.ts","sourceRoot":"","sources":["../../src/platform/desktop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA+JH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAwCvD;AAED,wBAAgB,yBAAyB,CACvC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EAAE,GAClB,IAAI,CAmHN;AAID,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAmD7D;AAID,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAuC5D;AAID,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CA6B3D;AAID,wBAAgB,WAAW,CACzB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACT,IAAI,CAgEN;AAID,wBAAgB,aAAa,CAC3B,CAAC,EAA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AAC,EAAE,MAAM,EACT,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,EAC3C,MAAM,SAAI,GACT,IAAI,CAwDN;AAID,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAqC9C;AAID;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAgFjD;AAID;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAuHnD;AA8DD;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,GACZ,OAAO,CAsBT"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-monitor display enumeration (WS5).
|
|
3
|
+
*
|
|
4
|
+
* Returns the live set of physical displays attached to the host, in a
|
|
5
|
+
* single, OS-agnostic shape:
|
|
6
|
+
*
|
|
7
|
+
* { id, bounds: [x, y, w, h], scaleFactor, primary, name }
|
|
8
|
+
*
|
|
9
|
+
* Notes on `id`:
|
|
10
|
+
* - macOS — `CGDirectDisplayID` (32-bit unsigned). Stable across reboots.
|
|
11
|
+
* - Windows — `Screen.DeviceName` hash → small integer. We expose a 0-based
|
|
12
|
+
* index because PowerShell `System.Windows.Forms.Screen` does
|
|
13
|
+
* not surface a kernel handle, and the device name (e.g.
|
|
14
|
+
* `\\.\DISPLAY1`) is a string. The index is stable for a given
|
|
15
|
+
* process but may shift across hot-plug events.
|
|
16
|
+
* - Linux X — `xrandr --listmonitors` ordinal. Stable per process.
|
|
17
|
+
* - Linux W — compositor-specific output id (Hyprland/Sway). Best effort.
|
|
18
|
+
*
|
|
19
|
+
* Coordinate space:
|
|
20
|
+
* `bounds` is in OS-global pixel space. On macOS, that means scaled
|
|
21
|
+
* "points" by default — we record the backing-store scale factor in
|
|
22
|
+
* `scaleFactor` so callers can translate to pixel-perfect coords when
|
|
23
|
+
* composing captures.
|
|
24
|
+
*
|
|
25
|
+
* This module never executes input. It is read-only.
|
|
26
|
+
*/
|
|
27
|
+
export interface DisplayInfo {
|
|
28
|
+
/** OS-stable identifier or a 0-based fallback index. */
|
|
29
|
+
id: number;
|
|
30
|
+
/** [x, y, width, height] in OS-global pixel space. */
|
|
31
|
+
bounds: [number, number, number, number];
|
|
32
|
+
/** Backing-store scale factor. 1 on Linux, 1..N on HiDPI macOS/Windows. */
|
|
33
|
+
scaleFactor: number;
|
|
34
|
+
/** Whether this is the primary display. */
|
|
35
|
+
primary: boolean;
|
|
36
|
+
/** Human-readable name (e.g. `eDP-1`, `Built-in Retina Display`). */
|
|
37
|
+
name: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Error thrown when the host has no usable display surface. Headless Linux
|
|
41
|
+
* (no `DISPLAY` and no `WAYLAND_DISPLAY`), CI containers without an X
|
|
42
|
+
* server, and macOS/Windows hosts that report zero active displays all
|
|
43
|
+
* surface as this typed error so callers can distinguish "no monitors" from
|
|
44
|
+
* a transient enumeration failure.
|
|
45
|
+
*/
|
|
46
|
+
export declare class NoDisplayError extends Error {
|
|
47
|
+
readonly code: "NO_DISPLAY";
|
|
48
|
+
constructor(message: string);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* List all attached displays. Cached to avoid spamming xrandr / PowerShell on
|
|
52
|
+
* burst calls (provider runs every turn; see {@link CACHE_MS}).
|
|
53
|
+
*
|
|
54
|
+
* Returns a single-display fallback when the OS reports nothing — most
|
|
55
|
+
* callers want a sensible default, not an empty array. Use `isHeadless()`
|
|
56
|
+
* or `assertHasDisplays()` to distinguish the truly-headless case from a
|
|
57
|
+
* single attached monitor.
|
|
58
|
+
*/
|
|
59
|
+
export declare function listDisplays(): DisplayInfo[];
|
|
60
|
+
/** Force a fresh enumeration, ignoring cache. */
|
|
61
|
+
export declare function refreshDisplays(): DisplayInfo[];
|
|
62
|
+
/** Convenience: the primary display, or the first one if none is flagged. */
|
|
63
|
+
export declare function getPrimaryDisplay(): DisplayInfo;
|
|
64
|
+
/** Look up a display by id, or null if unknown. */
|
|
65
|
+
export declare function findDisplay(id: number): DisplayInfo | null;
|
|
66
|
+
/**
|
|
67
|
+
* Detect a truly headless host. Returns true when:
|
|
68
|
+
* - Linux: neither `DISPLAY` nor `WAYLAND_DISPLAY` is set, AND no
|
|
69
|
+
* compositor / X server enumeration tool reports anything.
|
|
70
|
+
* - macOS / Windows: enumeration via system_profiler / PowerShell yields
|
|
71
|
+
* zero displays.
|
|
72
|
+
* The single-display fallback returned by `listDisplays()` does NOT count as
|
|
73
|
+
* a real display for this check.
|
|
74
|
+
*/
|
|
75
|
+
export declare function isHeadless(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Capture-path guard: throws `NoDisplayError` on a truly headless host.
|
|
78
|
+
* Callers that hit "no monitor" should surface this typed error rather than
|
|
79
|
+
* returning an empty buffer or a generic `Error`.
|
|
80
|
+
*/
|
|
81
|
+
export declare function assertHasDisplays(): void;
|
|
82
|
+
export declare function parseXrandrMonitors(output: string): DisplayInfo[];
|
|
83
|
+
export declare function parseHyprlandMonitors(output: string): DisplayInfo[];
|
|
84
|
+
export declare function parseSwayOutputs(output: string): DisplayInfo[];
|
|
85
|
+
export declare function parseDarwinDisplays(output: string): DisplayInfo[];
|
|
86
|
+
export declare function parseSystemProfilerDisplays(output: string): DisplayInfo[];
|
|
87
|
+
export declare function parseWindowsScreens(output: string): DisplayInfo[];
|
|
88
|
+
/**
|
|
89
|
+
* Asynchronously populate the display cache via the warm PowerShell host
|
|
90
|
+
* (Windows only). Lets the service pre-seed the cache at init without the
|
|
91
|
+
* blocking ~10-16s cold `powershell.exe` spawn that the sync
|
|
92
|
+
* {@link listDisplays} path would otherwise pay on the first turn. No-op (and
|
|
93
|
+
* never throws) when the host is unavailable — the sync path remains the
|
|
94
|
+
* fallback. Override the resulting TTL with `COMPUTERUSE_DISPLAYS_CACHE_MS`.
|
|
95
|
+
*/
|
|
96
|
+
export declare function warmDisplaysCache(): Promise<void>;
|
|
97
|
+
//# sourceMappingURL=displays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"displays.d.ts","sourceRoot":"","sources":["../../src/platform/displays.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,sDAAsD;IACtD,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAG,YAAY,CAAU;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAiBD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,IAAI,WAAW,EAAE,CAQ5C;AAED,iDAAiD;AACjD,wBAAgB,eAAe,IAAI,WAAW,EAAE,CAG/C;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,IAAI,WAAW,CAU/C;AAED,mDAAmD;AACnD,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAE1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAQpC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC;AAuCD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CA+BjE;AAiED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CA2BnE;AAUD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CA4B9D;AAsBD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CAuCjE;AAyED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CAiDzE;AAgBD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CAiCjE;AAkCD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAYvD"}
|
|
@@ -17,11 +17,33 @@ export declare function driverClick(x: number, y: number): Promise<void>;
|
|
|
17
17
|
export declare function driverClickWithModifiers(x: number, y: number, modifiers: string[]): Promise<void>;
|
|
18
18
|
export declare function driverDoubleClick(x: number, y: number): Promise<void>;
|
|
19
19
|
export declare function driverRightClick(x: number, y: number): Promise<void>;
|
|
20
|
+
export declare function driverMiddleClick(x: number, y: number): Promise<void>;
|
|
21
|
+
export declare function driverMouseDown(x: number, y: number, button?: "left" | "middle" | "right"): Promise<void>;
|
|
22
|
+
export declare function driverMouseUp(x: number, y: number, button?: "left" | "middle" | "right"): Promise<void>;
|
|
20
23
|
export declare function driverMouseMove(x: number, y: number): Promise<void>;
|
|
24
|
+
export declare function driverGetCursorPosition(): Promise<{
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}>;
|
|
21
28
|
export declare function driverDrag(x1: number, y1: number, x2: number, y2: number): Promise<void>;
|
|
29
|
+
export declare function driverDragPath(path: Array<{
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
}>): Promise<void>;
|
|
22
33
|
export declare function driverScroll(x: number, y: number, direction: "up" | "down" | "left" | "right", amount?: number): Promise<void>;
|
|
23
34
|
export declare function driverType(text: string): Promise<void>;
|
|
24
35
|
export declare function driverKeyPress(key: string): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Set the value of the UI element at (x,y) (#9170 — trycua/cua `set_value`).
|
|
38
|
+
* On Windows, first try UI Automation `ValuePattern.SetValue` (direct, no
|
|
39
|
+
* keystrokes — best for text inputs / combo boxes). Universal fallback (all
|
|
40
|
+
* platforms, incl. elements without ValuePattern): click to focus, select-all,
|
|
41
|
+
* then type the value — composed of the already-verified click/key-combo/type
|
|
42
|
+
* primitives. `value` is validated by the underlying type primitive.
|
|
43
|
+
*/
|
|
44
|
+
export declare function driverSetValue(x: number, y: number, value: string): Promise<void>;
|
|
25
45
|
export declare function driverKeyCombo(combo: string): Promise<void>;
|
|
46
|
+
export declare function driverKeyDown(key: string): Promise<void>;
|
|
47
|
+
export declare function driverKeyUp(key: string): Promise<void>;
|
|
26
48
|
export declare function driverCaptureScreenshot(region?: ScreenRegion): Promise<Buffer>;
|
|
27
49
|
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/platform/driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/platform/driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAuChD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAI5C,wBAAgB,cAAc,IAAI,UAAU,CA0B3C;AAID,wBAAsB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGrE;AAED,wBAAsB,wBAAwB,CAC5C,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,SAAS,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,wBAAsB,iBAAiB,CAAC,CA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