@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
@@ -0,0 +1,276 @@
1
+ /**
2
+ * WS7 — BaseComputerInterface (TypeScript port).
3
+ *
4
+ * Shape ported from trycua/cua's `BaseComputerInterface` (MIT). The original
5
+ * provides one standard API surface for screenshot + mouse + keyboard + screen
6
+ * geometry that the Brain/Actor cascade can call without knowing what OS or
7
+ * driver is underneath.
8
+ *
9
+ * Origin: https://github.com/trycua/cua/blob/main/libs/python/computer/
10
+ * computer/interface/base.py
11
+ * License: MIT, Copyright (c) 2025 trycua
12
+ *
13
+ * This is NOT a verbatim re-implementation — Eliza's underlying drivers
14
+ * (`platform/driver.ts`, `platform/capture.ts`) already cover most of the same
15
+ * surface. We give the cascade one well-typed seam so tests can swap in a
16
+ * fake driver, and so the Brain doesn't need to know about display-id
17
+ * resolution, retina scaling, or coord-source switches.
18
+ *
19
+ * Coordinate contract (matches WS5):
20
+ * - Every method that takes `(displayId, x, y)` uses LOCAL pixel coords for
21
+ * that display. The interface routes those through `localToGlobalDefault`
22
+ * before any input fires.
23
+ * - VLMs producing coords in image-space (i.e. against the downscaled max-
24
+ * pixels frame) MUST first call `toScreenCoordinates(...)` to get the
25
+ * real OS-pixel coord. The inverse `toScreenshotCoordinates(...)` is for
26
+ * logging / replay.
27
+ * - `displayId` must be a known display from `listDisplays()`. Unknown ids
28
+ * throw — this is the safety net the dispatch layer relies on.
29
+ */
30
+ import { type DisplayCapture } from "../platform/capture.js";
31
+ import type { Scene, SceneAxNode } from "../scene/scene-types.js";
32
+ import type { DisplayDescriptor } from "../types.js";
33
+ /** A POSIX-style mouse button. */
34
+ export type MouseButton = "left" | "middle" | "right";
35
+ export interface ScreenshotResult {
36
+ displayId: number;
37
+ /** PNG bytes at backing-store resolution. */
38
+ frame: Buffer;
39
+ /** Backing-store / logical-pixel ratio. */
40
+ scaleFactor: number;
41
+ /** [x, y, w, h] in OS-global pixel space, for the display this frame belongs to. */
42
+ bounds: [number, number, number, number];
43
+ }
44
+ export interface DisplayPoint {
45
+ displayId: number;
46
+ /** LOCAL pixel coords inside the display's logical bounds. */
47
+ x: number;
48
+ y: number;
49
+ }
50
+ export interface DragPath {
51
+ displayId: number;
52
+ path: Array<{
53
+ x: number;
54
+ y: number;
55
+ }>;
56
+ }
57
+ export interface ScrollDelta {
58
+ displayId: number;
59
+ x: number;
60
+ y: number;
61
+ /** Negative = scroll up/left, positive = scroll down/right. */
62
+ dx: number;
63
+ dy: number;
64
+ }
65
+ export interface CursorPosition {
66
+ displayId: number;
67
+ x: number;
68
+ y: number;
69
+ }
70
+ /**
71
+ * The single seam the cascade calls. All methods are safe to await
72
+ * concurrently within one display (driver semantics permitting); callers
73
+ * serialize at the dispatch layer.
74
+ */
75
+ export interface ComputerInterface {
76
+ screenshot(opts?: {
77
+ displayId?: number;
78
+ }): Promise<ScreenshotResult>;
79
+ mouseDown(point: DisplayPoint & {
80
+ button?: MouseButton;
81
+ }): Promise<void>;
82
+ mouseUp(point: DisplayPoint & {
83
+ button?: MouseButton;
84
+ }): Promise<void>;
85
+ leftClick(point: DisplayPoint): Promise<void>;
86
+ rightClick(point: DisplayPoint): Promise<void>;
87
+ doubleClick(point: DisplayPoint): Promise<void>;
88
+ moveCursor(point: DisplayPoint): Promise<void>;
89
+ dragTo(point: DisplayPoint): Promise<void>;
90
+ drag(path: DragPath): Promise<void>;
91
+ keyDown(args: {
92
+ key: string;
93
+ }): Promise<void>;
94
+ keyUp(args: {
95
+ key: string;
96
+ }): Promise<void>;
97
+ typeText(args: {
98
+ text: string;
99
+ }): Promise<void>;
100
+ pressKey(args: {
101
+ key: string;
102
+ }): Promise<void>;
103
+ hotkey(args: {
104
+ keys: string[];
105
+ }): Promise<void>;
106
+ scroll(delta: ScrollDelta): Promise<void>;
107
+ scrollUp(args: {
108
+ displayId: number;
109
+ clicks: number;
110
+ }): Promise<void>;
111
+ scrollDown(args: {
112
+ displayId: number;
113
+ clicks: number;
114
+ }): Promise<void>;
115
+ getScreenSize(args: {
116
+ displayId: number;
117
+ }): {
118
+ w: number;
119
+ h: number;
120
+ };
121
+ getCursorPosition(): CursorPosition;
122
+ /**
123
+ * Convert from VLM-image-space (the downscaled max-pixels frame the model
124
+ * was shown) into OS-LOCAL-pixel-space for the same display.
125
+ *
126
+ * `(imgX, imgY)` are pixel coords inside an `imgW × imgH` image. Returned
127
+ * `(x, y)` are the same physical point but in the display's logical bounds.
128
+ */
129
+ toScreenCoordinates(args: {
130
+ displayId: number;
131
+ imgX: number;
132
+ imgY: number;
133
+ imgW: number;
134
+ imgH: number;
135
+ }): {
136
+ x: number;
137
+ y: number;
138
+ };
139
+ /** Inverse of `toScreenCoordinates`. */
140
+ toScreenshotCoordinates(args: {
141
+ displayId: number;
142
+ x: number;
143
+ y: number;
144
+ imgW: number;
145
+ imgH: number;
146
+ }): {
147
+ imgX: number;
148
+ imgY: number;
149
+ };
150
+ /**
151
+ * Return the AX (accessibility) tree the scene-builder snapshot already
152
+ * collected. We don't re-snapshot here — that's WS6's job. Cascade calls
153
+ * this to enumerate clickable AX nodes by display.
154
+ */
155
+ getAccessibilityTree(args: {
156
+ displayId?: number;
157
+ }): SceneAxNode[];
158
+ }
159
+ /**
160
+ * Reference implementation that delegates to `platform/driver.ts` and
161
+ * `platform/capture.ts`. The constructor takes a `Scene` accessor so the
162
+ * AX tree is read from the latest WS6 snapshot without re-walking the OS.
163
+ */
164
+ export interface ComputerInterfaceDeps {
165
+ /** Latest scene accessor — used for `getAccessibilityTree`. */
166
+ getScene?: () => Scene | null;
167
+ /** Capture override (mostly for tests). */
168
+ capture?: (displayId: number) => Promise<DisplayCapture>;
169
+ /** Driver overrides for tests. */
170
+ driver?: Partial<{
171
+ click: (x: number, y: number) => Promise<void>;
172
+ doubleClick: (x: number, y: number) => Promise<void>;
173
+ rightClick: (x: number, y: number) => Promise<void>;
174
+ mouseMove: (x: number, y: number) => Promise<void>;
175
+ mouseDown: (x: number, y: number, button: MouseButton) => Promise<void>;
176
+ mouseUp: (x: number, y: number, button: MouseButton) => Promise<void>;
177
+ drag: (x1: number, y1: number, x2: number, y2: number) => Promise<void>;
178
+ dragPath: (path: Array<{
179
+ x: number;
180
+ y: number;
181
+ }>) => Promise<void>;
182
+ scroll: (x: number, y: number, direction: "up" | "down" | "left" | "right", amount: number) => Promise<void>;
183
+ type: (text: string) => Promise<void>;
184
+ keyPress: (key: string) => Promise<void>;
185
+ keyCombo: (combo: string) => Promise<void>;
186
+ keyDown: (key: string) => Promise<void>;
187
+ keyUp: (key: string) => Promise<void>;
188
+ }>;
189
+ listDisplays?: () => DisplayDescriptor[];
190
+ /**
191
+ * Where the implementation should remember the last cursor target.
192
+ * Set whenever a movement-bearing call resolves successfully.
193
+ */
194
+ cursorState?: {
195
+ current: CursorPosition;
196
+ };
197
+ }
198
+ export declare class DefaultComputerInterface implements ComputerInterface {
199
+ private readonly deps;
200
+ constructor(deps?: ComputerInterfaceDeps);
201
+ screenshot(opts?: {
202
+ displayId?: number;
203
+ }): Promise<ScreenshotResult>;
204
+ mouseDown(point: DisplayPoint & {
205
+ button?: MouseButton;
206
+ }): Promise<void>;
207
+ mouseUp(point: DisplayPoint & {
208
+ button?: MouseButton;
209
+ }): Promise<void>;
210
+ leftClick(point: DisplayPoint): Promise<void>;
211
+ rightClick(point: DisplayPoint): Promise<void>;
212
+ doubleClick(point: DisplayPoint): Promise<void>;
213
+ moveCursor(point: DisplayPoint): Promise<void>;
214
+ dragTo(point: DisplayPoint): Promise<void>;
215
+ drag(args: DragPath): Promise<void>;
216
+ keyDown(args: {
217
+ key: string;
218
+ }): Promise<void>;
219
+ keyUp(args: {
220
+ key: string;
221
+ }): Promise<void>;
222
+ typeText(args: {
223
+ text: string;
224
+ }): Promise<void>;
225
+ pressKey(args: {
226
+ key: string;
227
+ }): Promise<void>;
228
+ hotkey(args: {
229
+ keys: string[];
230
+ }): Promise<void>;
231
+ scroll(delta: ScrollDelta): Promise<void>;
232
+ scrollUp(args: {
233
+ displayId: number;
234
+ clicks: number;
235
+ }): Promise<void>;
236
+ scrollDown(args: {
237
+ displayId: number;
238
+ clicks: number;
239
+ }): Promise<void>;
240
+ getScreenSize(args: {
241
+ displayId: number;
242
+ }): {
243
+ w: number;
244
+ h: number;
245
+ };
246
+ getCursorPosition(): CursorPosition;
247
+ toScreenCoordinates(args: {
248
+ displayId: number;
249
+ imgX: number;
250
+ imgY: number;
251
+ imgW: number;
252
+ imgH: number;
253
+ }): {
254
+ x: number;
255
+ y: number;
256
+ };
257
+ toScreenshotCoordinates(args: {
258
+ displayId: number;
259
+ x: number;
260
+ y: number;
261
+ imgW: number;
262
+ imgH: number;
263
+ }): {
264
+ imgX: number;
265
+ imgY: number;
266
+ };
267
+ getAccessibilityTree(args: {
268
+ displayId?: number;
269
+ }): SceneAxNode[];
270
+ private primaryId;
271
+ private requireDisplay;
272
+ private toGlobalChecked;
273
+ }
274
+ /** Convenience factory used by the cascade. */
275
+ export declare function makeComputerInterface(deps?: ComputerInterfaceDeps): ComputerInterface;
276
+ //# sourceMappingURL=computer-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computer-interface.d.ts","sourceRoot":"","sources":["../../src/actor/computer-interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAkB7E,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,kCAAkC;AAClC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAA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,wBAAgB,qBAAqB,CACnC,IAAI,GAAE,qBAA0B,GAC/B,iBAAiB,CAEnB"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * WS7 — Dispatch layer.
3
+ *
4
+ * Single entry point that validates a resolved `ProposedAction` and routes
5
+ * it to a `ComputerInterface`. Errors are returned as structured
6
+ * `ActionResult.error` values — we don't let exceptions escape the cascade
7
+ * boundary, so the agent loop can recover by re-prompting the Brain.
8
+ *
9
+ * Validation:
10
+ * - displayId must exist
11
+ * - point coords (when present) must be inside the display's local bounds
12
+ * - text/key/keys/dx/dy must match the action kind
13
+ *
14
+ * No business logic lives here. The dispatcher is dumb on purpose.
15
+ */
16
+ import type { DisplayDescriptor } from "../types.js";
17
+ import type { ComputerInterface } from "./computer-interface.js";
18
+ import type { ActionResult, ProposedAction } from "./types.js";
19
+ export interface DispatchDeps {
20
+ interface: ComputerInterface;
21
+ listDisplays: () => DisplayDescriptor[];
22
+ }
23
+ export declare function dispatch(action: ProposedAction, deps: DispatchDeps): Promise<ActionResult>;
24
+ //# sourceMappingURL=dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/actor/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAgB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/D,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,iBAAiB,CAAC;IAC7B,YAAY,EAAE,MAAM,iBAAiB,EAAE,CAAC;CACzC;AAED,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,YAAY,CAAC,CAmJvB"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * WS7 — Brain / Actor / Cascade public surface.
3
+ */
4
+ export { type Actor, type ActorGroundArgs, OcrCoordinateGroundingActor, OsAtlasProActor, type OsAtlasProActorOptions, resolveReference, } from "./actor.js";
5
+ export { type AgentDispatchContext, type AgentMiddleware, type AgentRunContext, type AgentRunSummary, type AgentStepContext, type AgentStepDecision, type BudgetCapOptions, createBudgetCapMiddleware, createImageRetentionMiddleware, createOperatorNormalizerMiddleware, createTrajectoryMiddleware, type ImageRetentionMiddleware, normalizeProposedAction, type TrajectoryEntry, type TrajectoryMiddleware, } from "./agent-callbacks.js";
6
+ export { _resetAgentLoopsForTests, AGENT_LOOP_SETTING, type AgentLoop, type AgentLoopDeps, type AgentLoopRegistration, type AgentStepInput, createAgentLoop, DEFAULT_AGENT_LOOP_MODEL, LocalGrounderLoop, listAgentLoops, matchesModelFamily, type PredictClickInput, registerAgentLoop, selectAgentLoopRegistration, unregisterAgentLoop, } from "./agent-loop.js";
7
+ export { BRAIN_MAX_PIXELS, BRAIN_MAX_ROIS, Brain, type BrainDeps, type BrainInput, BrainParseError, brainPromptFor, encodeForBrain, parseBrainOutput, } from "./brain.js";
8
+ export { Cascade, type CascadeDeps, type CascadeInput, getRegisteredActor, setActor, } from "./cascade.js";
9
+ export { type ComputerInterface, type ComputerInterfaceDeps, type CursorPosition, DefaultComputerInterface, type DisplayPoint, type DragPath, type MouseButton, makeComputerInterface, type ScreenshotResult, type ScrollDelta, } from "./computer-interface.js";
10
+ export { type DispatchDeps, dispatch } from "./dispatch.js";
11
+ export type { ActionResult as ActorActionResult, BrainActionKind, BrainOutput, BrainProposedAction, BrainRoi, CascadeResult, GroundingResult, ProposedAction, ReferenceTarget, } from "./types.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actor/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,2BAA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,iBAAiB,EACjC,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,aAAa,EACb,eAAe,EACf,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * WS7 — Shared types for Brain / Actor / Cascade / Dispatch.
3
+ *
4
+ * These are the JSON contracts the planner and the cascade exchange. The
5
+ * Brain MUST emit `BrainOutput`; the cascade resolves it into a concrete
6
+ * `ProposedAction` with display-local OS-pixel coords; the dispatcher
7
+ * validates and forwards it through `ComputerInterface`.
8
+ */
9
+ import type { SceneAxNode, SceneOcrBox } from "../scene/scene-types.js";
10
+ export type BrainActionKind = "click" | "double_click" | "right_click" | "type" | "hotkey" | "key" | "scroll" | "drag" | "wait" | "finish";
11
+ export interface BrainRoi {
12
+ displayId: number;
13
+ /** [x, y, w, h] in DISPLAY-LOCAL pixel space. */
14
+ bbox: [number, number, number, number];
15
+ reason: string;
16
+ }
17
+ export interface BrainProposedAction {
18
+ kind: BrainActionKind;
19
+ /** Stable id of an OCR box (`t<displayId>-<seq>`) or AX node (`a<displayId>-<seq>`). */
20
+ ref?: string;
21
+ /**
22
+ * Action-specific args. For `type`: { text }. For `hotkey`: { keys }. For
23
+ * `key`: { key }. For `scroll`: { dx, dy }. For `drag`: { from: {x,y}, to:
24
+ * {x,y} }. Coordinates here are display-local pixel space.
25
+ */
26
+ args?: Record<string, unknown>;
27
+ rationale: string;
28
+ }
29
+ export interface BrainOutput {
30
+ scene_summary: string;
31
+ target_display_id: number;
32
+ /** Up to N (cap enforced by cascade) ROIs the Brain wants the Actor to ground. */
33
+ roi: BrainRoi[];
34
+ proposed_action: BrainProposedAction;
35
+ }
36
+ /**
37
+ * Concrete action after the cascade has resolved coords. The dispatcher
38
+ * accepts only this shape.
39
+ */
40
+ export interface ProposedAction {
41
+ kind: BrainActionKind;
42
+ displayId: number;
43
+ /** Display-local pixel coords, resolved by the cascade. */
44
+ x?: number;
45
+ y?: number;
46
+ /** For drag: start point. */
47
+ startX?: number;
48
+ startY?: number;
49
+ text?: string;
50
+ key?: string;
51
+ keys?: string[];
52
+ dx?: number;
53
+ dy?: number;
54
+ ref?: string;
55
+ rationale: string;
56
+ }
57
+ export interface ActionResult {
58
+ success: boolean;
59
+ /** Structured error code; absent on success. */
60
+ error?: {
61
+ code: "unknown_display" | "out_of_bounds" | "invalid_args" | "driver_error" | "brain_error" | "actor_error" | "timeout" | "internal";
62
+ message: string;
63
+ };
64
+ /** Action that was actually issued (mirrors input on success). */
65
+ issued?: ProposedAction;
66
+ }
67
+ export interface CascadeResult {
68
+ scene_summary: string;
69
+ proposed: ProposedAction;
70
+ /** ROIs the Brain produced, kept for trajectory logging. */
71
+ rois: BrainRoi[];
72
+ }
73
+ /**
74
+ * What the Actor returns when grounding a ROI / ref to a coord.
75
+ * `coords` are display-local pixel space.
76
+ */
77
+ export interface GroundingResult {
78
+ displayId: number;
79
+ x: number;
80
+ y: number;
81
+ /** 0..1 confidence — informational only; the dispatcher does not gate on it. */
82
+ confidence: number;
83
+ /** Human-readable explanation, for trajectory + retries. */
84
+ reason: string;
85
+ }
86
+ /** Picked OCR/AX target — used by the deterministic OCR/AX grounding actor. */
87
+ export interface ReferenceTarget {
88
+ displayId: number;
89
+ bbox: [number, number, number, number];
90
+ kind: "ocr" | "ax";
91
+ label: string;
92
+ source: SceneOcrBox | SceneAxNode;
93
+ }
94
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/actor/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAExE,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,cAAc,GACd,aAAa,GACb,MAAM,GACN,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,MAAM,GACN,MAAM,GACN,QAAQ,CAAC;AAEb,MAAM,WAAW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,CAEnE;AAED,qBAAa,0BAA0B;IACrC,OAAO,CAAC,IAAI,CAAiC;IAC7C,OAAO,CAAC,OAAO,CAA4C;IAC3D,OAAO,CAAC,SAAS,CAA+B;IAChD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAIzB;;IAMF,OAAO,IAAI,YAAY;IAIvB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IASnC,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAY3C,SAAS,IAAI,OAAO;IAIpB,eAAe,CACb,OAAO,EAAE,MAAM,EACf,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACvC,OAAO,CAAC,gBAAgB,CAAC;IAgB5B,WAAW,IAAI,gBAAgB;IAe/B,eAAe,CACb,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,OAAO,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,kBAAkB,GAAG,IAAI;IAsB5B,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAQhC,SAAS,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAQjD,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,IAAI;CAMb"}
package/dist/index.d.ts CHANGED
@@ -2,8 +2,10 @@
2
2
  * @elizaos/plugin-computeruse
3
3
  *
4
4
  * Desktop automation plugin for elizaOS agents — screenshots, mouse/keyboard
5
- * control, browser CDP automation, terminal access, file operations, and
6
- * window management.
5
+ * control, browser CDP automation, and window management.
6
+ *
7
+ * File operations belong on the FILE action; shell/terminal access belongs on
8
+ * the SHELL action. They are not exposed by this plugin.
7
9
  *
8
10
  * Deeply ported from coasty-ai/open-computer-use (Apache 2.0).
9
11
  *
@@ -23,11 +25,22 @@ import type { Plugin } from "@elizaos/core";
23
25
  export declare const computerUsePlugin: Plugin;
24
26
  export declare const computerusePlugin: Plugin;
25
27
  export default computerUsePlugin;
26
- export { ComputerUseService } from "./services/computer-use-service.js";
27
- export { captureDesktopScreenshot, commandExists, detectDesktopControlCapabilities, getDesktopPlatformName, isHeadfulGuiAvailable, listDesktopWindows, performDesktopClick, performDesktopDoubleClick, performDesktopKeypress, performDesktopMouseMove, performDesktopScroll, performDesktopTextInput, } from "./services/desktop-control.js";
28
- export type { DesktopControlCapabilities, DesktopControlCapability, DesktopInputButton, DesktopScreenshotRegion, DesktopWindowInfo, } from "./services/desktop-control.js";
28
+ export { type ComputerUseAgentParams, type ComputerUseAgentReport, computerUseAgentAction, runComputerUseAgentLoop, } from "./actions/use-computer-agent.js";
29
+ export * from "./actor/index.js";
30
+ export * from "./mobile/index.js";
31
+ export { listProcesses, type ProcessInfo, parsePsOutput, parseWindowsProcessJson, } from "./platform/process-list.js";
32
+ export { sceneProvider } from "./providers/scene.js";
29
33
  export { handleComputerUseRoutes } from "./routes/computer-use-routes.js";
30
34
  export { handleSandboxRoute } from "./routes/sandbox-routes.js";
35
+ export { type AccessibilityProvider, DarwinAccessibilityProvider, LinuxAccessibilityProvider, NullAccessibilityProvider, parseHyprlandClients, parseSwayTree, resolveAccessibilityProvider, setAccessibilityProvider, WindowsAccessibilityProvider, } from "./scene/a11y-provider.js";
36
+ export { enumerateApps, joinAppsAndWindows } from "./scene/apps.js";
37
+ export { type BlockGrid, blockGrid, type DirtyBlock, decodePng, diffBlocks, frameDhash, hamming, } from "./scene/dhash.js";
38
+ export { _resetDefaultSceneBuilderForTests, getDefaultSceneBuilder, SceneBuilder, type SceneBuilderDeps, type SceneUpdateEvent, } from "./scene/scene-builder.js";
39
+ export type { Scene, SceneApp, SceneAppWindow, SceneAxNode, SceneFocusedWindow, SceneOcrBox, SceneVlmElement, } from "./scene/scene-types.js";
40
+ export { serializeSceneForPrompt } from "./scene/serialize.js";
41
+ export { ComputerUseService } from "./services/computer-use-service.js";
42
+ export type { DesktopControlCapabilities, DesktopControlCapability, DesktopInputButton, DesktopScreenshotRegion, DesktopWindowInfo, } from "./services/desktop-control.js";
43
+ export { captureDesktopScreenshot, commandExists, detectDesktopControlCapabilities, getDesktopPlatformName, isHeadfulGuiAvailable, listDesktopWindows, performDesktopClick, performDesktopDoubleClick, performDesktopKeypress, performDesktopMouseMove, performDesktopScroll, performDesktopTextInput, } from "./services/desktop-control.js";
44
+ export { VISION_CONTEXT_SERVICE_TYPE, VISION_CONTEXT_TASK_GOAL_CACHE_KEY, type VisionContext, type VisionContextBBox, type VisionContextFocusedWindow, VisionContextProvider, type VisionContextRecentAction, } from "./services/vision-context-provider.js";
31
45
  export type { ActionHistoryEntry, ApprovalMode, ApprovalResolution, ApprovalSnapshot, BrowserActionParams, BrowserActionResult, BrowserActionType, BrowserInfo, BrowserState, BrowserTab, ClickableElement, ComputerActionResult, ComputerUseConfig, ComputerUseResult, DesktopActionParams, DesktopActionType, FileActionParams, FileActionResult, FileActionType, FileEntry, PendingApproval, PermissionType, PlatformCapabilities, ScreenRegion, ScreenSize, TerminalActionParams, TerminalActionResult, TerminalActionType, WindowActionParams, WindowActionResult, WindowActionType, WindowInfo, } from "./types.js";
32
- export * from "./register-routes.js";
33
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AAsCnD,eAAO,MAAM,iBAAiB,EAAE,MA2B/B,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAoB,CAAC;AAEnD,eAAe,iBAAiB,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,gCAAgC,EAChC,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,G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