@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.
Files changed (176) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -0
  3. package/dist/actions/clipboard.d.ts +22 -0
  4. package/dist/actions/clipboard.d.ts.map +1 -0
  5. package/dist/actions/progress.d.ts +26 -0
  6. package/dist/actions/progress.d.ts.map +1 -0
  7. package/dist/actions/use-computer-agent.d.ts +113 -0
  8. package/dist/actions/use-computer-agent.d.ts.map +1 -0
  9. package/dist/actions/use-computer.d.ts.map +1 -1
  10. package/dist/actions/window-handlers.d.ts +11 -0
  11. package/dist/actions/window-handlers.d.ts.map +1 -0
  12. package/dist/actions/window.d.ts +11 -0
  13. package/dist/actions/window.d.ts.map +1 -0
  14. package/dist/actor/actor.d.ts +84 -0
  15. package/dist/actor/actor.d.ts.map +1 -0
  16. package/dist/actor/agent-callbacks.d.ts +128 -0
  17. package/dist/actor/agent-callbacks.d.ts.map +1 -0
  18. package/dist/actor/agent-loop.d.ts +134 -0
  19. package/dist/actor/agent-loop.d.ts.map +1 -0
  20. package/dist/actor/aosp-input-actor.d.ts +87 -0
  21. package/dist/actor/aosp-input-actor.d.ts.map +1 -0
  22. package/dist/actor/brain.d.ts +195 -0
  23. package/dist/actor/brain.d.ts.map +1 -0
  24. package/dist/actor/cascade.d.ts +92 -0
  25. package/dist/actor/cascade.d.ts.map +1 -0
  26. package/dist/actor/computer-interface.d.ts +276 -0
  27. package/dist/actor/computer-interface.d.ts.map +1 -0
  28. package/dist/actor/dispatch.d.ts +24 -0
  29. package/dist/actor/dispatch.d.ts.map +1 -0
  30. package/dist/actor/index.d.ts +12 -0
  31. package/dist/actor/index.d.ts.map +1 -0
  32. package/dist/actor/types.d.ts +94 -0
  33. package/dist/actor/types.d.ts.map +1 -0
  34. package/dist/approval-manager.d.ts.map +1 -1
  35. package/dist/index.d.ts +19 -6
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +12001 -5484
  38. package/dist/index.js.map +59 -25
  39. package/dist/mcp/index.d.ts +8 -0
  40. package/dist/mcp/index.d.ts.map +1 -0
  41. package/dist/mcp/server.d.ts +42 -0
  42. package/dist/mcp/server.d.ts.map +1 -0
  43. package/dist/mcp/tools.d.ts +53 -0
  44. package/dist/mcp/tools.d.ts.map +1 -0
  45. package/dist/mobile/android-bridge.d.ts +263 -0
  46. package/dist/mobile/android-bridge.d.ts.map +1 -0
  47. package/dist/mobile/android-scene.d.ts +52 -0
  48. package/dist/mobile/android-scene.d.ts.map +1 -0
  49. package/dist/mobile/android-trajectory.d.ts +66 -0
  50. package/dist/mobile/android-trajectory.d.ts.map +1 -0
  51. package/dist/mobile/index.d.ts +19 -0
  52. package/dist/mobile/index.d.ts.map +1 -0
  53. package/dist/mobile/ios-app-intent-registry.d.ts +20 -0
  54. package/dist/mobile/ios-app-intent-registry.d.ts.map +1 -0
  55. package/dist/mobile/ios-bridge.d.ts +359 -0
  56. package/dist/mobile/ios-bridge.d.ts.map +1 -0
  57. package/dist/mobile/ios-computer-interface.d.ts +160 -0
  58. package/dist/mobile/ios-computer-interface.d.ts.map +1 -0
  59. package/dist/mobile/mobile-computer-interface.d.ts +142 -0
  60. package/dist/mobile/mobile-computer-interface.d.ts.map +1 -0
  61. package/dist/mobile/mobile-screen-capture.d.ts +64 -0
  62. package/dist/mobile/mobile-screen-capture.d.ts.map +1 -0
  63. package/dist/mobile/ocr-provider.d.ts +187 -0
  64. package/dist/mobile/ocr-provider.d.ts.map +1 -0
  65. package/dist/mobile/ocr-provider.js +111 -0
  66. package/dist/mobile/ocr-provider.js.map +10 -0
  67. package/dist/osworld/action-converter.d.ts +4 -1
  68. package/dist/osworld/action-converter.d.ts.map +1 -1
  69. package/dist/osworld/adapter.d.ts +1 -0
  70. package/dist/osworld/adapter.d.ts.map +1 -1
  71. package/dist/parity/index.d.ts +9 -0
  72. package/dist/parity/index.d.ts.map +1 -0
  73. package/dist/parity/parity-matrix.d.ts +82 -0
  74. package/dist/parity/parity-matrix.d.ts.map +1 -0
  75. package/dist/parity/screenspot.d.ts +56 -0
  76. package/dist/parity/screenspot.d.ts.map +1 -0
  77. package/dist/platform/a11y.d.ts +29 -1
  78. package/dist/platform/a11y.d.ts.map +1 -1
  79. package/dist/platform/browser.d.ts +1 -1
  80. package/dist/platform/browser.d.ts.map +1 -1
  81. package/dist/platform/capabilities.d.ts +23 -0
  82. package/dist/platform/capabilities.d.ts.map +1 -1
  83. package/dist/platform/capture.d.ts +65 -0
  84. package/dist/platform/capture.d.ts.map +1 -0
  85. package/dist/platform/clipboard.d.ts +24 -0
  86. package/dist/platform/clipboard.d.ts.map +1 -0
  87. package/dist/platform/coords.d.ts +73 -0
  88. package/dist/platform/coords.d.ts.map +1 -0
  89. package/dist/platform/desktop.d.ts +23 -0
  90. package/dist/platform/desktop.d.ts.map +1 -1
  91. package/dist/platform/displays.d.ts +97 -0
  92. package/dist/platform/displays.d.ts.map +1 -0
  93. package/dist/platform/driver.d.ts +22 -0
  94. package/dist/platform/driver.d.ts.map +1 -1
  95. package/dist/platform/file-ops.d.ts +17 -0
  96. package/dist/platform/file-ops.d.ts.map +1 -1
  97. package/dist/platform/helpers.d.ts +2 -3
  98. package/dist/platform/helpers.d.ts.map +1 -1
  99. package/dist/platform/launch.d.ts +54 -0
  100. package/dist/platform/launch.d.ts.map +1 -0
  101. package/dist/platform/normalized-coords.d.ts +46 -0
  102. package/dist/platform/normalized-coords.d.ts.map +1 -0
  103. package/dist/platform/nut-driver.d.ts +67 -0
  104. package/dist/platform/nut-driver.d.ts.map +1 -1
  105. package/dist/platform/permissions.d.ts +12 -0
  106. package/dist/platform/permissions.d.ts.map +1 -1
  107. package/dist/platform/process-list.d.ts +32 -0
  108. package/dist/platform/process-list.d.ts.map +1 -0
  109. package/dist/platform/ps-host.d.ts +77 -0
  110. package/dist/platform/ps-host.d.ts.map +1 -0
  111. package/dist/platform/screenshot-errors.d.ts +54 -0
  112. package/dist/platform/screenshot-errors.d.ts.map +1 -0
  113. package/dist/platform/screenshot-quality.d.ts +11 -0
  114. package/dist/platform/screenshot-quality.d.ts.map +1 -0
  115. package/dist/platform/screenshot.d.ts.map +1 -1
  116. package/dist/platform/security.d.ts +8 -0
  117. package/dist/platform/security.d.ts.map +1 -1
  118. package/dist/platform/wayland-portal.d.ts +25 -0
  119. package/dist/platform/wayland-portal.d.ts.map +1 -0
  120. package/dist/platform/windows-list.d.ts +43 -1
  121. package/dist/platform/windows-list.d.ts.map +1 -1
  122. package/dist/providers/computer-state.d.ts.map +1 -1
  123. package/dist/providers/scene.d.ts +21 -0
  124. package/dist/providers/scene.d.ts.map +1 -0
  125. package/dist/register-routes.js +11715 -4990
  126. package/dist/register-routes.js.map +61 -24
  127. package/dist/routes/computer-use-compat-routes.d.ts +1 -1
  128. package/dist/routes/computer-use-compat-routes.d.ts.map +1 -1
  129. package/dist/sandbox/docker-backend.d.ts +69 -0
  130. package/dist/sandbox/docker-backend.d.ts.map +1 -0
  131. package/dist/sandbox/index.d.ts +62 -0
  132. package/dist/sandbox/index.d.ts.map +1 -0
  133. package/dist/sandbox/qemu-backend.d.ts +48 -0
  134. package/dist/sandbox/qemu-backend.d.ts.map +1 -0
  135. package/dist/sandbox/remote-guest.d.ts +72 -0
  136. package/dist/sandbox/remote-guest.d.ts.map +1 -0
  137. package/dist/sandbox/sandbox-driver.d.ts +41 -0
  138. package/dist/sandbox/sandbox-driver.d.ts.map +1 -0
  139. package/dist/sandbox/surface-types.d.ts +17 -0
  140. package/dist/sandbox/surface-types.d.ts.map +1 -0
  141. package/dist/sandbox/types.d.ts +138 -0
  142. package/dist/sandbox/types.d.ts.map +1 -0
  143. package/dist/sandbox/wsb-backend.d.ts +48 -0
  144. package/dist/sandbox/wsb-backend.d.ts.map +1 -0
  145. package/dist/scene/a11y-provider.d.ts +83 -0
  146. package/dist/scene/a11y-provider.d.ts.map +1 -0
  147. package/dist/scene/apps.d.ts +39 -0
  148. package/dist/scene/apps.d.ts.map +1 -0
  149. package/dist/scene/dhash.d.ts +105 -0
  150. package/dist/scene/dhash.d.ts.map +1 -0
  151. package/dist/scene/ocr-adapter.d.ts +64 -0
  152. package/dist/scene/ocr-adapter.d.ts.map +1 -0
  153. package/dist/scene/scene-builder.d.ts +107 -0
  154. package/dist/scene/scene-builder.d.ts.map +1 -0
  155. package/dist/scene/scene-types.d.ts +70 -0
  156. package/dist/scene/scene-types.d.ts.map +1 -0
  157. package/dist/scene/screen-state.d.ts +105 -0
  158. package/dist/scene/screen-state.d.ts.map +1 -0
  159. package/dist/scene/serialize.d.ts +28 -0
  160. package/dist/scene/serialize.d.ts.map +1 -0
  161. package/dist/security/browser-script-policy.d.ts +9 -0
  162. package/dist/security/browser-script-policy.d.ts.map +1 -0
  163. package/dist/services/computer-use-service.d.ts +78 -2
  164. package/dist/services/computer-use-service.d.ts.map +1 -1
  165. package/dist/services/index.d.ts +7 -0
  166. package/dist/services/index.d.ts.map +1 -0
  167. package/dist/services/vision-context-provider.d.ts +32 -0
  168. package/dist/services/vision-context-provider.d.ts.map +1 -0
  169. package/dist/types.d.ts +115 -5
  170. package/dist/types.d.ts.map +1 -1
  171. package/package.json +47 -10
  172. package/registry-entry.json +74 -0
  173. package/dist/actions/desktop-handlers.d.ts +0 -20
  174. package/dist/actions/desktop-handlers.d.ts.map +0 -1
  175. package/dist/actions/desktop.d.ts +0 -11
  176. package/dist/actions/desktop.d.ts.map +0 -1
@@ -7,4 +7,21 @@ export declare function deleteFile(targetPath: string): Promise<FileActionResult
7
7
  export declare function fileExists(targetPath: string): Promise<FileActionResult>;
8
8
  export declare function listDirectory(targetPath: string): Promise<FileActionResult>;
9
9
  export declare function deleteDirectory(targetPath: string): Promise<FileActionResult>;
10
+ /**
11
+ * Read raw bytes as base64 (#9170 — cua `read_bytes`). Optional byte `offset` /
12
+ * `length` window for chunked transfer of a sandbox guest file. Unlike `readFile`
13
+ * (text, truncated to 10k chars) this is binary-safe and returns the exact bytes.
14
+ */
15
+ export declare function readBytes(targetPath: string, offset?: number, length?: number): Promise<FileActionResult>;
16
+ /**
17
+ * Write base64-encoded bytes to a file (#9170 — cua `write_bytes`), creating
18
+ * parent directories. Binary-safe counterpart to `writeFile`.
19
+ */
20
+ export declare function writeBytes(targetPath: string, base64: string): Promise<FileActionResult>;
21
+ /** Create a directory (recursive) (#9170 — cua `create_dir`). */
22
+ export declare function createDirectory(targetPath: string): Promise<FileActionResult>;
23
+ /** Whether a path exists AND is a directory (#9170 — cua `directory_exists`). */
24
+ export declare function directoryExists(targetPath: string): Promise<FileActionResult>;
25
+ /** File/dir size in bytes (#9170 — cua `get_file_size`). */
26
+ export declare function getFileSize(targetPath: string): Promise<FileActionResult>;
10
27
  //# sourceMappingURL=file-ops.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-ops.d.ts","sourceRoot":"","sources":["../../src/platform/file-ops.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,aAAa,CAAC;AAG/D,wBAAsB,QAAQ,CAC5B,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,cAAuB,GAChC,OAAO,CAAC,gBAAgB,CAAC,CAmB3B;AAED,wBAAsB,SAAS,CAC7B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAoB3B;AAED,wBAAsB,QAAQ,CAC5B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CA0B3B;AAED,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAoB3B;AAED,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC,CAmB3B;AAED,wBAAsB,UAAU,CAC9B,UA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AM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAwB3B;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,CAAC,CAkB3B;AAED,iEAAiE;AACjE,wBAAsB,eAAe,CACnC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC,CAiB3B;AAED,iFAAiF;AACjF,wBAAsB,eAAe,CACnC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC,CAwB3B;AAED,4DAA4D;AAC5D,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC,CAmB3B"}
@@ -4,10 +4,9 @@
4
4
  * Ported from coasty-ai/open-computer-use desktop-automation.ts
5
5
  * and eliza sandbox-routes.ts (Apache 2.0 / MIT).
6
6
  */
7
- /**
8
- * Check if a CLI tool is available on the system.
9
- */
10
7
  export declare function commandExists(cmd: string): boolean;
8
+ /** Reset the {@link commandExists} memo (test-only / PATH change). */
9
+ export declare function clearCommandExistsCache(): void;
11
10
  /**
12
11
  * Run a command via execFileSync (no shell) with timeout.
13
12
  * Throws on non-zero exit or timeout.
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/platform/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAQlD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,MAAM,GACd,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAA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AgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGrD;AAmBD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMpD;AAmBD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMpD;AAID,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAEtD,wBAAgB,eAAe,IAAI,UAAU,CAM5C"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Open a target (file / URL / folder) and launch applications (#9170 M12).
3
+ *
4
+ * trycua/cua exposes `open(target)` and `launch(app, args) -> pid`. Eliza had
5
+ * neither as a COMPUTER_USE verb. These are real desktop automation (the agent
6
+ * opening a document or starting an app), so they live in the COMPUTER_USE
7
+ * action and pass through the approval manager like every other non-read verb.
8
+ *
9
+ * Implementation notes:
10
+ * - `open` shells the OS default-handler (`open` / `xdg-open` / `start`), so a
11
+ * URL opens in the browser, a file in its default app, a folder in the file
12
+ * manager — exactly the OS double-click behavior.
13
+ * - `launch` spawns the executable DETACHED and returns its pid so the caller
14
+ * can track / focus it. The child is unref'd so it outlives the agent turn.
15
+ */
16
+ /** Result of a launch — the spawned process id (and the resolved command). */
17
+ export interface LaunchResult {
18
+ pid: number;
19
+ command: string;
20
+ args: string[];
21
+ }
22
+ /**
23
+ * Open a file / URL / folder with the OS default handler. Resolves once the
24
+ * launcher returns (the launcher exits immediately; the opened app keeps
25
+ * running). Rejects on a non-zero launcher exit.
26
+ */
27
+ export declare function openTarget(target: string): Promise<void>;
28
+ /**
29
+ * Launch an application detached and return its pid. `app` is an executable
30
+ * name/path (or, on macOS, an app-bundle name launched via `open -a`). The
31
+ * child is unref'd so it survives the agent turn.
32
+ */
33
+ export declare function launchApp(app: string, args?: string[]): Promise<LaunchResult>;
34
+ /** Result of a kill — the resolved target and how it was addressed. */
35
+ export interface KillResult {
36
+ target: string;
37
+ /** Numeric pid when the target was a pid; omitted for a process-name kill. */
38
+ pid?: number;
39
+ killed: true;
40
+ }
41
+ /**
42
+ * Terminate a running application by pid (all-digits) or process name
43
+ * (#9170 — trycua/cua `kill_app`). Pairs with `launchApp`. Destructive, so it
44
+ * routes through the approval manager like every other non-read verb. Uses
45
+ * `execFile` (no shell) so the target can't inject a command.
46
+ *
47
+ * - Windows: `taskkill /F /PID <n>` or `/F /IM <name>.exe`.
48
+ * - macOS / Linux: `kill -9 <pid>` or `pkill -f <name>`.
49
+ *
50
+ * Rejects when the target does not exist (non-zero exit) so the caller gets
51
+ * clear feedback rather than a silent no-op.
52
+ */
53
+ export declare function killApp(target: string): Promise<KillResult>;
54
+ //# sourceMappingURL=launch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../src/platform/launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAID;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BxD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,GAClB,OAAO,CAAC,YAAY,CAAC,CA6CvB;AAED,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;CACd;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAwC3D"}
@@ -0,0 +1,46 @@
1
+ import type { ScreenRegion } from "../types.js";
2
+ /** Upper bound of each normalized axis (inclusive). 0 = left/top, 1000 = right/bottom. */
3
+ export declare const NORMALIZED_COORD_MAX = 1000;
4
+ /** A point in the 0–1000 normalized coordinate space. */
5
+ export interface NormalizedPoint {
6
+ nx: number;
7
+ ny: number;
8
+ }
9
+ /** A box in the 0–1000 normalized coordinate space (inclusive corners). */
10
+ export interface NormalizedBox {
11
+ nx0: number;
12
+ ny0: number;
13
+ nx1: number;
14
+ ny1: number;
15
+ }
16
+ /** A pixel point in some display/capture space. */
17
+ export interface PixelPoint {
18
+ x: number;
19
+ y: number;
20
+ }
21
+ /** The pixel extent a normalized point is measured against. */
22
+ export interface PixelBounds {
23
+ width: number;
24
+ height: number;
25
+ }
26
+ /** Clamp a normalized point into [0, 1000] on both axes. */
27
+ export declare function clampNormalized(point: NormalizedPoint): NormalizedPoint;
28
+ /**
29
+ * Map a pixel point in `bounds` to the 0–1000 normalized space. The input is
30
+ * clamped to the bounds first, so an off-screen coordinate maps to the nearest
31
+ * edge rather than escaping the canonical range.
32
+ */
33
+ export declare function toNormalized(point: PixelPoint, bounds: PixelBounds): NormalizedPoint;
34
+ /**
35
+ * Map a normalized point back to a pixel point in `bounds`. Rounds to the nearest
36
+ * pixel and clamps into the bounds. Round-trips with {@link toNormalized} to
37
+ * within one pixel (the quantization error of the 1000-bucket grid).
38
+ */
39
+ export declare function fromNormalized(point: NormalizedPoint, bounds: PixelBounds): PixelPoint;
40
+ /** Map a pixel rectangle (`ScreenRegion`) to a normalized box. */
41
+ export declare function boxToNormalized(region: ScreenRegion, bounds: PixelBounds): NormalizedBox;
42
+ /** Map a normalized box back to a pixel `ScreenRegion` (non-negative width/height). */
43
+ export declare function boxFromNormalized(box: NormalizedBox, bounds: PixelBounds): ScreenRegion;
44
+ /** The pixel center of a normalized box — the click target a grounded element resolves to. */
45
+ export declare function normalizedBoxCenter(box: NormalizedBox, bounds: PixelBounds): PixelPoint;
46
+ //# sourceMappingURL=normalized-coords.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalized-coords.d.ts","sourceRoot":"","sources":["../../src/platform/normalized-coords.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,0FAA0F;AAC1F,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,+DAA+D;AAC/D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAOD,4DAA4D;AAC5D,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAKvE;AAcD;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,GAClB,eAAe,CAKjB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,WAAW,GAClB,UAAU,CAKZ;AAED,kEAAkE;AAClE,wBAAgB,eAAe,CAC7B,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,WAAW,GAClB,aAAa,CAOf;AAED,uFAAuF;AACvF,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,WAAW,GAClB,YAAY,CAMd;AAED,8FAA8F;AAC9F,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,WAAW,GAClB,UAAU,CAKZ"}
@@ -1,3 +1,16 @@
1
+ /**
2
+ * Cross-platform desktop driver backed by @nut-tree-fork/nut-js.
3
+ *
4
+ * Wraps native libnut bindings into the same input surface exposed by
5
+ * the legacy per-OS shell drivers in `desktop.ts` and `screenshot.ts`.
6
+ * Selected at runtime via `ELIZA_COMPUTERUSE_DRIVER=nutjs` (default) — the
7
+ * legacy shell drivers remain the fallback when the env var is set to
8
+ * `legacy` or when the native module fails to load.
9
+ *
10
+ * Native module loading: nut-js ships prebuilt binaries via `libnut`. We
11
+ * load it eagerly at module init and surface a clean diagnostic if the
12
+ * binary is missing for the current arch (`isAvailable()` reports false).
13
+ */
1
14
  import type { ScreenRegion } from "../types.js";
2
15
  export declare function isAvailable(): boolean;
3
16
  export declare function loadFailureReason(): string | null;
@@ -5,11 +18,65 @@ export declare function nutClick(x: number, y: number): Promise<void>;
5
18
  export declare function nutClickWithModifiers(x: number, y: number, modifiers: string[]): Promise<void>;
6
19
  export declare function nutDoubleClick(x: number, y: number): Promise<void>;
7
20
  export declare function nutRightClick(x: number, y: number): Promise<void>;
21
+ export declare function nutMiddleClick(x: number, y: number): Promise<void>;
8
22
  export declare function nutMouseMove(x: number, y: number): Promise<void>;
23
+ /**
24
+ * Press (and hold) a mouse button at `(x, y)` without releasing it. Pairs with
25
+ * `nutMouseUp` to express hold-drags, marquee selection, and press-and-hold
26
+ * gestures that a single `click` cannot. The caller is responsible for the
27
+ * matching release.
28
+ */
29
+ export declare function nutMouseDown(x: number, y: number, button?: "left" | "middle" | "right"): Promise<void>;
30
+ /** Release a previously-held mouse button at `(x, y)`. See {@link nutMouseDown}. */
31
+ export declare function nutMouseUp(x: number, y: number, button?: "left" | "middle" | "right"): Promise<void>;
32
+ /** Clamp a requested scroll amount to a safe per-notch count (1..20). Pure. */
33
+ export declare function clampScrollNotches(amount: number): number;
34
+ /**
35
+ * Interpolated integer waypoints from (x1,y1) to (x2,y2) over `steps` moves
36
+ * (excludes the start, includes the end). Pure — exported for unit tests.
37
+ */
38
+ export declare function interpolateDragSteps(x1: number, y1: number, x2: number, y2: number, steps?: number): Array<{
39
+ x: number;
40
+ y: number;
41
+ }>;
9
42
  export declare function nutDrag(x1: number, y1: number, x2: number, y2: number): Promise<void>;
43
+ /**
44
+ * Densify a polyline by interpolating integer waypoints along every segment so
45
+ * a held-button drag traces curves/corners instead of teleporting corner to
46
+ * corner. Includes the very first point and every segment endpoint. Pure —
47
+ * exported for unit tests.
48
+ *
49
+ * `perSegmentSteps` controls how many intermediate points are inserted between
50
+ * consecutive vertices (≥1; the endpoint is always included).
51
+ */
52
+ export declare function densifyDragPath(path: Array<{
53
+ x: number;
54
+ y: number;
55
+ }>, perSegmentSteps?: number): Array<{
56
+ x: number;
57
+ y: number;
58
+ }>;
59
+ /**
60
+ * Press the left button at the first point, move through every interpolated
61
+ * waypoint with the button held, then release at the last point. Backs
62
+ * multi-point `drag(path)` and AOSP swipe paths. Requires ≥2 points.
63
+ */
64
+ export declare function nutDragPath(path: Array<{
65
+ x: number;
66
+ y: number;
67
+ }>): Promise<void>;
68
+ export declare function nutGetCursorPosition(): Promise<{
69
+ x: number;
70
+ y: number;
71
+ }>;
10
72
  export declare function nutScroll(x: number, y: number, direction: "up" | "down" | "left" | "right", amount: number): Promise<void>;
11
73
  export declare function nutType(text: string): Promise<void>;
12
74
  export declare function nutKeyPress(key: string): Promise<void>;
75
+ /** Press (and hold) a single key without releasing it. Pairs with `nutKeyUp`
76
+ * to express press-and-hold (e.g. holding Shift while issuing other input). */
77
+ export declare function nutKeyDown(key: string): Promise<void>;
78
+ /** Release a previously-held key. See {@link nutKeyDown}. */
79
+ export declare function nutKeyUp(key: string): Promise<void>;
13
80
  export declare function nutKeyCombo(combo: string): Promise<void>;
14
81
  export declare function nutCaptureScreenshot(region?: ScreenRegion): Promise<Buffer>;
15
82
  export declare function nutScreenSize(): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"nut-driver.d.ts","sourceRoot":"","sources":["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Bf;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC;IACpD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC,CAID;AAED,wBAAsB,SAAS,CAC7B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,EAC3C,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAcf;AAID,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIzD;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAK5D;AAED;+EAC+E;AAC/E,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3D;AAED,6DAA6D;AAC7D,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGzD;AAED,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B9D;AAID,wBAAsB,oBAAoB,CACxC,MAAM,CAAC,EAAE,YAAY,GACpB,OAAO,CAAC,MAAM,CAAC,CAiCjB;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAOD"}
@@ -17,5 +17,17 @@ export declare function classifyPermissionDeniedError(error: unknown, fallback:
17
17
  permissionType: PermissionType;
18
18
  operation: string;
19
19
  }): PermissionDeniedError | null;
20
+ export interface PermissionProbeResult {
21
+ /** True if the OS reports the permission is granted for this process. */
22
+ readonly granted: boolean;
23
+ /**
24
+ * `null` when the OS doesn't expose a probe (Linux desktop, headless, etc.)
25
+ * — caller should treat this as "unknown, attempt the operation and rely on
26
+ * runtime classification".
27
+ */
28
+ readonly probed: boolean;
29
+ readonly details?: string;
30
+ }
31
+ export declare function probePermission(permissionType: PermissionType): PermissionProbeResult;
20
32
  export {};
21
33
  //# sourceMappingURL=permissions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/platform/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,KAAK,sBAAsB,GAAG;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG;IAC1C,gBAAgB,EAAE,IAAI,CAAC;IACvB,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AASF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,sBAAsB,GAC9B,qBAAqB,CAUvB;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,qBAAqB,CAQhC;AAcD,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE;IACR,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB,GACA,qBAAqB,GAAG,IAAI,CAkC9B"}
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/platform/permissions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,KAAK,sBAAsB,GAAG;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG;IAC1C,gBAAgB,EAAE,IAAI,CAAC;IACvB,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAkCF,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,sBAAsB,GAC9B,qBAAqB,CAUvB;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,qBAAqB,CAQhC;AAcD,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE;IACR,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB,GACA,qBAAqB,GAAG,IAAI,CAiF9B;AASD,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAmCD,wBAAgB,eAAe,CAC7B,cAAc,EAAE,cAAc,GAC7B,qBAAqB,CA2BvB"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Cross-platform process listing.
3
+ *
4
+ * The WS6 scene-builder joins running processes with windows to produce the
5
+ * `apps[]` field of a Scene. The contract is intentionally minimal — pid,
6
+ * executable/display name, and a best-effort foreground flag if cheap to
7
+ * obtain. Anything richer (memory, cpu, parent pid) is out of scope here
8
+ * because the scene-builder runs every active-poll frame and must stay
9
+ * cheap.
10
+ *
11
+ * Per-OS source:
12
+ * - Linux : `/proc/<pid>/comm` and `/proc/<pid>/status`. Pure FS read,
13
+ * no shell out. ~5ms for 300 processes.
14
+ * - macOS : `ps -axo pid=,comm=` — built-in BSD ps.
15
+ * - Windows: PowerShell `Get-Process | Select Id, ProcessName`.
16
+ * - Android: returns `[]` in this JS helper; the `UsageStatsManager`
17
+ * integration is owned by WS8's native side. We expose the
18
+ * function shape so the scene-builder doesn't have to branch.
19
+ *
20
+ * Failure semantics:
21
+ * - A single un-readable process is skipped, not propagated.
22
+ * - A complete enumeration failure returns `[]` and the scene-builder logs
23
+ * once per platform-mode at warn.
24
+ */
25
+ export interface ProcessInfo {
26
+ pid: number;
27
+ name: string;
28
+ }
29
+ export declare function listProcesses(): ProcessInfo[];
30
+ export declare function parsePsOutput(text: string): ProcessInfo[];
31
+ export declare function parseWindowsProcessJson(text: string): ProcessInfo[];
32
+ //# sourceMappingURL=process-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-list.d.ts","sourceRoot":"","sources":["../../src/platform/process-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,aAAa,IAAI,WAAW,EAAE,CAM7C;AAmDD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAkBzD;AAmBD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAmBnE"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Warm PowerShell host (Windows-only) — eliminates the cold-spawn tax.
3
+ *
4
+ * On Windows, every capability that shells out to `powershell.exe`
5
+ * (screen capture, clipboard, window/display enumeration) pays the cost of
6
+ * starting a fresh process. On Defender-heavy hosts real-time AV scans each new
7
+ * process image, which measured **~10-12s per cold `powershell.exe` spawn** on a
8
+ * build box (see #9581). The CUA scene pipeline grabs the screen — and several
9
+ * dirty regions — every turn, so that tax compounds.
10
+ *
11
+ * This module keeps ONE long-lived `powershell.exe` alive and feeds it commands
12
+ * over stdin, reading results back over stdout. The first call pays the cold
13
+ * spawn once; every call after that runs in the already-warm process
14
+ * (sub-second). It is a pure latency optimization: callers wrap their existing
15
+ * one-shot PowerShell invocation and fall back to it transparently whenever the
16
+ * host is unavailable, disabled, or errors — so behavior is unchanged, only
17
+ * faster.
18
+ *
19
+ * The loop runs from a temp `.ps1` via `powershell -File` (NOT `-Command -`,
20
+ * which would consume stdin to build the program and starve the loop's own
21
+ * `ReadLine`). `-File` reads the program from disk, leaving stdin free for the
22
+ * loop to read request lines.
23
+ *
24
+ * Protocol (host side is a tiny ReadLine server loop, see `SERVER_LOOP`):
25
+ * - JS writes ONE line per request: `<token> <base64-utf8-script>\n`.
26
+ * base64 guarantees the payload is single-line and escaping-free.
27
+ * - The host decodes the script, runs it in a child scope (`& {…}` via a
28
+ * fresh ScriptBlock, so request state never leaks), then writes the script's
29
+ * stdout followed by the bare `<token>` (no newline). On a terminating
30
+ * error it writes `PSHOSTERR:<message>` before the token.
31
+ * - JS accumulates stdout until it sees `<token>`; everything before it is the
32
+ * response. A `PSHOSTERR:` prefix is surfaced as a rejection so the caller
33
+ * falls back to its one-shot path.
34
+ *
35
+ * Requests are serialized through a single promise chain — one in flight at a
36
+ * time over the one pipe. That is fine: each request is now sub-second, so even
37
+ * a handful of dirty-region captures per turn complete far faster than a single
38
+ * cold spawn used to.
39
+ *
40
+ * Disable entirely with `COMPUTERUSE_PS_HOST=0`.
41
+ */
42
+ /**
43
+ * Whether the warm host is usable on this platform / configuration. Callers
44
+ * should check this before attempting {@link runPsHost} and skip straight to
45
+ * their one-shot path when false.
46
+ */
47
+ export declare function psHostAvailable(): boolean;
48
+ /** Tear the host down (test cleanup / unrecoverable state). */
49
+ export declare function shutdownPsHost(): void;
50
+ /**
51
+ * Run a PowerShell script in the warm host and resolve with its stdout (UTF-8).
52
+ * Serialized against other in-flight requests. Rejects (so the caller can fall
53
+ * back to a one-shot spawn) on host-start failure, script error, timeout, or
54
+ * unexpected host exit.
55
+ *
56
+ * @param script PowerShell source. Runs in a child scope; assemblies
57
+ * `System.Windows.Forms` + `System.Drawing` are preloaded.
58
+ * @param timeoutMs Per-request budget.
59
+ */
60
+ export declare function runPsHost(script: string, timeoutMs: number): Promise<string>;
61
+ /**
62
+ * Best-effort pre-warm: pay the one-time cold spawn during service init instead
63
+ * of on the first capture/clipboard call. Never rejects — if the host can't
64
+ * start, callers transparently fall back to one-shot spawns.
65
+ */
66
+ export declare function warmPsHost(): Promise<void>;
67
+ /**
68
+ * Owner-initiated dispose (service stop). Unlike {@link shutdownPsHost} (which
69
+ * leaves the host respawnable for the next call — used by the timeout path),
70
+ * this latches spawning OFF so an in-flight fire-and-forget warm continuation
71
+ * cannot resurrect a powershell.exe after the service has stopped. A later
72
+ * {@link warmPsHost} re-enables it.
73
+ */
74
+ export declare function disposePsHost(): void;
75
+ /** Test-only: reset failure latch so a fresh attempt can be made. */
76
+ export declare function __resetPsHostFailures(): void;
77
+ //# sourceMappingURL=ps-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ps-host.d.ts","sourceRoot":"","sources":["../../src/platform/ps-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAkEH;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAKzC;AAiCD,+DAA+D;AAC/D,wBAAgB,cAAc,IAAI,IAAI,CAsBrC;AAsGD;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ5E;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAS1C;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED,qEAAqE;AACrE,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Structured screenshot error contract (issue #9105, M3.5).
3
+ *
4
+ * Capture can fail for several distinct reasons, and a caller (the CUA Brain,
5
+ * the GET_SCREEN op, the approval/telemetry layer) wants to react differently
6
+ * to each: a missing OS permission needs a "grant access" prompt; a missing CLI
7
+ * tool needs an "install scrot/ImageMagick" hint; an empty buffer or a timeout
8
+ * is a transient retry. Before this contract, those were indistinguishable —
9
+ * callers had to regex the human-readable message.
10
+ *
11
+ * This module adds a machine-readable {@link ScreenshotErrorCode} **additively**:
12
+ * `tagScreenshotError` annotates the *existing* thrown error object with a code
13
+ * rather than replacing it, so a `PermissionDeniedError` keeps its identity
14
+ * (`isPermissionDeniedError` stays true) while also gaining a
15
+ * `screenshotErrorCode` of `"permission_denied"`. No existing caller breaks; new
16
+ * callers can switch on the code.
17
+ */
18
+ export type ScreenshotErrorCode =
19
+ /** An OS privacy permission (Screen Recording / Accessibility) is denied. */
20
+ "permission_denied"
21
+ /** No screenshot CLI tool is installed (e.g. Linux without scrot/import). */
22
+ | "tool_missing"
23
+ /** The capture tool ran but produced an empty/zero-byte image. */
24
+ | "empty_output"
25
+ /** The capture command exceeded its timeout. */
26
+ | "timeout"
27
+ /** Any other capture failure. */
28
+ | "capture_failed";
29
+ /** An `Error` carrying a machine-readable {@link ScreenshotErrorCode}. */
30
+ export interface ScreenshotError extends Error {
31
+ readonly screenshotErrorCode: ScreenshotErrorCode;
32
+ /** The capture operation that failed (e.g. `screenshot_capture`). */
33
+ readonly operation: string;
34
+ /** Underlying error message, when this wraps a lower-level failure. */
35
+ readonly details?: string;
36
+ }
37
+ export declare function isScreenshotError(value: unknown): value is ScreenshotError;
38
+ export declare function createScreenshotError(code: ScreenshotErrorCode, operation: string, message: string, details?: string): ScreenshotError;
39
+ /**
40
+ * Map any thrown value to a {@link ScreenshotErrorCode} by inspecting its type
41
+ * and message. Permission denials win first (they are typed); the rest are
42
+ * recognized from the well-known message shapes the capture functions throw.
43
+ * Pure — exported so the mapping has a single, testable source of truth.
44
+ */
45
+ export declare function classifyScreenshotErrorCode(error: unknown): ScreenshotErrorCode;
46
+ /**
47
+ * Annotate `error` with a {@link ScreenshotErrorCode} and return it. Additive:
48
+ * an `Error` (including a `PermissionDeniedError`) is mutated in place so its
49
+ * identity and existing fields are preserved; a non-`Error` value is wrapped in
50
+ * a fresh {@link ScreenshotError}. Idempotent — an already-tagged error is
51
+ * returned unchanged.
52
+ */
53
+ export declare function tagScreenshotError(error: unknown, operation: string): ScreenshotError;
54
+ //# sourceMappingURL=screenshot-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshot-errors.d.ts","sourceRoot":"","sources":["../../src/platform/screenshot-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,MAAM,mBAAmB;AAC7B,6EAA6E;AAC3E,mBAAmB;AACrB,6EAA6E;GAC3E,cAAc;AAChB,kEAAkE;GAChE,cAAc;AAChB,gDAAgD;GAC9C,SAAS;AACX,iCAAiC;GAC/B,gBAAgB,CAAC;AAErB,0EAA0E;AAC1E,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAClD,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAO1E;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,mBAAmB,EACzB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,eAAe,CAOjB;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,mBAAmB,CAuBrB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,GAChB,eAAe,CAWjB"}
@@ -0,0 +1,11 @@
1
+ export interface ScreenshotQuality {
2
+ width: number;
3
+ height: number;
4
+ sampledPixels: number;
5
+ colorBuckets: number;
6
+ dominantRatio: number;
7
+ }
8
+ export declare function analyzePngScreenshot(buffer: Buffer): ScreenshotQuality;
9
+ export declare function screenshotQualityIssues(label: string, quality: ScreenshotQuality): string[];
10
+ export declare function assertScreenshotBase64NotBlank(screenshot: string | undefined, label: string, minBytes?: number): void;
11
+ //# sourceMappingURL=screenshot-quality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshot-quality.d.ts","sourceRoot":"","sources":["../../src/platform/screenshot-quality.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB;AAoDD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CA8EtE;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,iBAAiB,GACzB,MAAM,EAAE,CAeV;AAED,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,MAAM,EACb,QAAQ,SAAM,GACb,IAAI,CAoBN"}
@@ -1 +1 @@
1
- {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/platform/screenshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAWhD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAkD/D"}
1
+ {"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../src/platform/screenshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAiBhD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAoD/D"}
@@ -7,6 +7,14 @@ export interface CommandRiskResult {
7
7
  reason?: string;
8
8
  }
9
9
  export declare function validateFilePath(filePath: string, operation: "read" | "write" | "delete"): PathValidationResult;
10
+ export type SafeFileTargetResult = PathValidationResult & {
11
+ resolvedPath?: string;
12
+ };
13
+ /**
14
+ * Resolve and re-validate file paths after lstat/realpath to reduce TOCTOU /
15
+ * symlink escapes (GHSA-qmf5-p9x5-9xr5).
16
+ */
17
+ export declare function resolveSafeFileTarget(filePath: string, operation: "read" | "write" | "delete"): Promise<SafeFileTargetResult>;
10
18
  export declare function sanitizeChildEnv(): Record<string, string | undefined>;
11
19
  export declare function checkDangerousCommand(command: string): CommandRiskResult;
12
20
  //# sourceMappingURL=security.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/platform/security.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA4ID,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GACrC,oBAAoB,CAkFtB;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAerE;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAkBxE"}
1
+ {"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/platform/security.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA+LD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GACrC,oBAAoB,CA8FtB;AAED,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAQF;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GACrC,OAAO,CAAC,oBAAoB,CAAC,CAuE/B;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAerE;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAkBxE"}
@@ -0,0 +1,25 @@
1
+ export interface WaylandPortalCaptureOptions {
2
+ readonly interactive?: boolean;
3
+ readonly timeoutMs?: number;
4
+ }
5
+ export interface PortalScreenshotResponse {
6
+ readonly responseCode: number;
7
+ readonly uri?: string;
8
+ }
9
+ interface WaylandSessionEnv {
10
+ readonly WAYLAND_DISPLAY?: string;
11
+ readonly XDG_SESSION_TYPE?: string;
12
+ }
13
+ export declare function isWaylandSession(env?: WaylandSessionEnv): boolean;
14
+ export declare function canUseWaylandScreenshotPortal(): boolean;
15
+ export declare function captureWaylandPortalScreenshot(tmpFile: string, options?: WaylandPortalCaptureOptions): void;
16
+ export declare function parsePortalRequestHandle(output: string): string | null;
17
+ export declare function parsePortalScreenshotResponse(output: string, handle?: string): PortalScreenshotResponse | null;
18
+ export declare function portalFileUriToPath(uri: string): string;
19
+ export declare const WAYLAND_PORTAL_DBUS_TARGET: {
20
+ readonly busName: "org.freedesktop.portal.Desktop";
21
+ readonly objectPath: "/org/freedesktop/portal/desktop";
22
+ readonly method: "org.freedesktop.portal.Screenshot.Screenshot";
23
+ };
24
+ export {};
25
+ //# sourceMappingURL=wayland-portal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wayland-portal.d.ts","sourceRoot":"","sources":["../../src/platform/wayland-portal.ts"],"names":[],"mappings":"AAyGA,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAOjE;AAED,wBAAgB,6BAA6B,IAAI,OAAO,CAIvD;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,2BAAgC,GACxC,IAAI,CAyCN;AAoBD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEtE;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,wBAAwB,GAAG,IAAI,CAajC;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED,eAAO,MAAM,0BAA0B;;;;CAI7B,CAAC"}
@@ -5,10 +5,42 @@
5
5
  * - coasty-ai/open-computer-use local-executor.ts window handlers (Apache 2.0)
6
6
  * - eliza sandbox-routes.ts listWindows()
7
7
  */
8
- import type { ScreenSize, WindowInfo } from "../types.js";
8
+ import type { ScreenRegion, ScreenSize, WindowInfo } from "../types.js";
9
9
  export declare function findWindowsByQuery(query: string, windows?: WindowInfo[]): WindowInfo[];
10
10
  export declare function resolveWindowMatch(queryOrId: string, windows?: WindowInfo[]): WindowInfo | null;
11
11
  export declare function listWindows(): WindowInfo[];
12
+ /**
13
+ * The currently-focused / frontmost window (#9170 M12 — cua
14
+ * `get_current_window_id`). Best-effort per-OS query; returns `null` when no
15
+ * window is focused or the platform query is unavailable.
16
+ */
17
+ export declare function getActiveWindow(): WindowInfo | null;
18
+ /**
19
+ * Windows belonging to a given application name (#9170 M12 — cua
20
+ * `get_application_windows`). Pure filter over `listWindows()`; case-insensitive
21
+ * substring match on the window's `app` (with a `title` fallback).
22
+ */
23
+ export declare function getApplicationWindows(appName: string): WindowInfo[];
24
+ /**
25
+ * Set a window's position AND size in one call (#9170 M12 — cua set window
26
+ * size+position). Position is required; width/height optional (position-only
27
+ * when omitted).
28
+ */
29
+ export declare function resizeWindow(windowId: string, x: number, y: number, width?: number, height?: number): {
30
+ success: true;
31
+ message: string;
32
+ };
33
+ /**
34
+ * Read a window's bounds — position AND size — in OS-global logical pixels
35
+ * (#9170 M12 — cua `get_window_size` / `get_window_position`). When `windowId`
36
+ * is omitted, reads the currently-focused/foreground window. Returns
37
+ * `{ x, y, width, height }`.
38
+ *
39
+ * Windows: `GetWindowRect` via the window's `MainWindowHandle`. macOS: AppleScript
40
+ * `position`/`size` of the matched process window. Linux: `xdotool
41
+ * getwindowgeometry --shell`.
42
+ */
43
+ export declare function getWindowBounds(windowId?: string): ScreenRegion;
12
44
  export declare function focusWindow(windowId: string): void;
13
45
  export declare function switchWindow(windowQuery: string): void;
14
46
  export declare function arrangeWindows(arrangement?: string): {
@@ -32,5 +64,15 @@ export declare const minimize_window: typeof minimizeWindow;
32
64
  export declare const maximize_window: typeof maximizeWindow;
33
65
  export declare const restore_window: typeof restoreWindow;
34
66
  export declare const close_window: typeof closeWindow;
67
+ /**
68
+ * PowerShell command that reads the primary screen bounds on Windows.
69
+ *
70
+ * `Add-Type -AssemblyName System.Windows.Forms` MUST run before
71
+ * `[System.Windows.Forms.Screen]` is referenced — on a clean PowerShell session
72
+ * the type is otherwise unresolved (`TypeNotFound`) and the screen size silently
73
+ * falls back to a hard-coded default. Exported so a cross-platform unit test can
74
+ * guard against the assembly-load regression without spawning PowerShell.
75
+ */
76
+ export declare const WINDOWS_PRIMARY_SCREEN_SIZE_COMMAND: string;
35
77
  export declare function getScreenSize(): ScreenSize;
36
78
  //# sourceMappingURL=windows-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"windows-list.d.ts","sourceRoot":"","sources":["../../src/platform/windows-list.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA2B1D,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,UAAU,EAAkB,GACpC,UAAU,EAAE,CAUd;AAoBD,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,UAAU,EAAkB,GACpC,UAAU,GAAG,IAAI,CAEnB;AAmDD,wBAAgB,WAAW,IAAI,UAAU,EAAE,CAa1C;AA4FD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAqClD;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAEtD;AAoFD,wBAAgB,cAAc,CAAC,WAAW,SAAS,GAAG;IACpD,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAuDA;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,CAAC,CAAC,EAAE,MAAM,EACV,CAAC,CAAC,EAAE,MAAM,GACT;IACD,OAAO,EAAE,IAAI,CAAC;I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WAAW,mBAAa,CAAC;AACtC,eAAO,MAAM,eAAe,uBAAiB,CAAC;AAC9C,eAAO,MAAM,eAAe,uBAAiB,CAAC;AAC9C,eAAO,MAAM,cAAc,sBAAgB,CAAC;AAC5C,eAAO,MAAM,YAAY,oBAAc,CAAC;AAIxC;;;;;;;;GAQG;AACH,eAAO,MAAM,mCAAmC,QAEmC,CAAC;AAEpF,wBAAgB,aAAa,IAAI,UAAU,CA+H1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"computer-state.d.ts","sourceRoot":"","sources":["../../src/providers/computer-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAGV,QAAQ,EAGT,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,qBAAqB,EAAE,QAiGnC,CAAC"}
1
+ {"version":3,"file":"computer-state.d.ts","sourceRoot":"","sources":["../../src/providers/computer-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAGV,QAAQ,EAGT,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,qBAAqB,EAAE,QA4GnC,CAAC"}