@daytonaio/sdk 0.170.0 → 0.171.0-alpha.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 (237) hide show
  1. package/LICENSE +190 -0
  2. package/cjs/CodeInterpreter.d.ts +95 -0
  3. package/cjs/CodeInterpreter.d.ts.map +1 -0
  4. package/cjs/CodeInterpreter.js +297 -0
  5. package/cjs/CodeInterpreter.js.map +1 -0
  6. package/cjs/ComputerUse.d.ts +539 -0
  7. package/cjs/ComputerUse.d.ts.map +1 -0
  8. package/cjs/ComputerUse.js +808 -0
  9. package/cjs/ComputerUse.js.map +1 -0
  10. package/cjs/Daytona.d.ts +355 -0
  11. package/cjs/Daytona.d.ts.map +1 -0
  12. package/cjs/Daytona.js +527 -0
  13. package/cjs/Daytona.js.map +1 -0
  14. package/cjs/FileSystem.d.ts +371 -0
  15. package/cjs/FileSystem.d.ts.map +1 -0
  16. package/cjs/FileSystem.js +489 -0
  17. package/cjs/FileSystem.js.map +1 -0
  18. package/cjs/Git.d.ts +203 -0
  19. package/cjs/Git.d.ts.map +1 -0
  20. package/cjs/Git.js +326 -0
  21. package/cjs/Git.js.map +1 -0
  22. package/cjs/Image.d.ts +265 -0
  23. package/cjs/Image.d.ts.map +1 -0
  24. package/cjs/Image.js +586 -0
  25. package/cjs/Image.js.map +1 -0
  26. package/cjs/LspServer.d.ts +172 -0
  27. package/cjs/LspServer.d.ts.map +1 -0
  28. package/cjs/LspServer.js +259 -0
  29. package/cjs/LspServer.js.map +1 -0
  30. package/cjs/ObjectStorage.d.ts +79 -0
  31. package/cjs/ObjectStorage.d.ts.map +1 -0
  32. package/cjs/ObjectStorage.js +199 -0
  33. package/cjs/ObjectStorage.js.map +1 -0
  34. package/cjs/Process.d.ts +490 -0
  35. package/cjs/Process.d.ts.map +1 -0
  36. package/cjs/Process.js +647 -0
  37. package/cjs/Process.js.map +1 -0
  38. package/cjs/PtyHandle.d.ts +155 -0
  39. package/cjs/PtyHandle.d.ts.map +1 -0
  40. package/cjs/PtyHandle.js +416 -0
  41. package/cjs/PtyHandle.js.map +1 -0
  42. package/cjs/README.md +180 -0
  43. package/cjs/Sandbox.d.ts +476 -0
  44. package/cjs/Sandbox.d.ts.map +1 -0
  45. package/cjs/Sandbox.js +905 -0
  46. package/cjs/Sandbox.js.map +1 -0
  47. package/cjs/Snapshot.d.ts +140 -0
  48. package/cjs/Snapshot.d.ts.map +1 -0
  49. package/cjs/Snapshot.js +248 -0
  50. package/cjs/Snapshot.js.map +1 -0
  51. package/cjs/Volume.d.ts +84 -0
  52. package/cjs/Volume.d.ts.map +1 -0
  53. package/cjs/Volume.js +119 -0
  54. package/cjs/Volume.js.map +1 -0
  55. package/cjs/__tests__/helpers.d.ts +6 -0
  56. package/cjs/__tests__/helpers.d.ts.map +1 -0
  57. package/cjs/__tests__/helpers.js +26 -0
  58. package/cjs/__tests__/helpers.js.map +1 -0
  59. package/cjs/errors/DaytonaError.d.ts +171 -0
  60. package/cjs/errors/DaytonaError.d.ts.map +1 -0
  61. package/cjs/errors/DaytonaError.js +258 -0
  62. package/cjs/errors/DaytonaError.js.map +1 -0
  63. package/cjs/index.d.ts +22 -0
  64. package/cjs/index.d.ts.map +1 -0
  65. package/cjs/index.js +49 -0
  66. package/cjs/index.js.map +1 -0
  67. package/cjs/package.json +3 -0
  68. package/cjs/types/Charts.d.ts +38 -0
  69. package/cjs/types/Charts.d.ts.map +1 -0
  70. package/cjs/types/Charts.js +37 -0
  71. package/cjs/types/Charts.js.map +1 -0
  72. package/cjs/types/CodeInterpreter.d.ts +77 -0
  73. package/cjs/types/CodeInterpreter.d.ts.map +1 -0
  74. package/cjs/types/CodeInterpreter.js +7 -0
  75. package/cjs/types/CodeInterpreter.js.map +1 -0
  76. package/cjs/types/ExecuteResponse.d.ts +26 -0
  77. package/cjs/types/ExecuteResponse.d.ts.map +1 -0
  78. package/cjs/types/ExecuteResponse.js +7 -0
  79. package/cjs/types/ExecuteResponse.js.map +1 -0
  80. package/cjs/types/Pty.d.ts +48 -0
  81. package/cjs/types/Pty.d.ts.map +1 -0
  82. package/cjs/types/Pty.js +7 -0
  83. package/cjs/types/Pty.js.map +1 -0
  84. package/cjs/utils/Binary.d.ts +39 -0
  85. package/cjs/utils/Binary.d.ts.map +1 -0
  86. package/cjs/utils/Binary.js +168 -0
  87. package/cjs/utils/Binary.js.map +1 -0
  88. package/cjs/utils/FileTransfer.d.ts +15 -0
  89. package/cjs/utils/FileTransfer.d.ts.map +1 -0
  90. package/cjs/utils/FileTransfer.js +261 -0
  91. package/cjs/utils/FileTransfer.js.map +1 -0
  92. package/cjs/utils/Import.d.ts +125 -0
  93. package/cjs/utils/Import.d.ts.map +1 -0
  94. package/cjs/utils/Import.js +112 -0
  95. package/cjs/utils/Import.js.map +1 -0
  96. package/cjs/utils/Multipart.d.ts +29 -0
  97. package/cjs/utils/Multipart.d.ts.map +1 -0
  98. package/cjs/utils/Multipart.js +115 -0
  99. package/cjs/utils/Multipart.js.map +1 -0
  100. package/cjs/utils/Runtime.d.ts +44 -0
  101. package/cjs/utils/Runtime.d.ts.map +1 -0
  102. package/cjs/utils/Runtime.js +95 -0
  103. package/cjs/utils/Runtime.js.map +1 -0
  104. package/cjs/utils/Stream.d.ts +20 -0
  105. package/cjs/utils/Stream.d.ts.map +1 -0
  106. package/cjs/utils/Stream.js +364 -0
  107. package/cjs/utils/Stream.js.map +1 -0
  108. package/cjs/utils/WebSocket.d.ts +10 -0
  109. package/cjs/utils/WebSocket.d.ts.map +1 -0
  110. package/cjs/utils/WebSocket.js +26 -0
  111. package/cjs/utils/WebSocket.js.map +1 -0
  112. package/cjs/utils/otel.decorator.d.ts +83 -0
  113. package/cjs/utils/otel.decorator.d.ts.map +1 -0
  114. package/cjs/utils/otel.decorator.js +141 -0
  115. package/cjs/utils/otel.decorator.js.map +1 -0
  116. package/esm/CodeInterpreter.d.ts +95 -0
  117. package/esm/CodeInterpreter.d.ts.map +1 -0
  118. package/esm/CodeInterpreter.js +292 -0
  119. package/esm/CodeInterpreter.js.map +1 -0
  120. package/esm/ComputerUse.d.ts +539 -0
  121. package/esm/ComputerUse.d.ts.map +1 -0
  122. package/esm/ComputerUse.js +799 -0
  123. package/esm/ComputerUse.js.map +1 -0
  124. package/esm/Daytona.d.ts +355 -0
  125. package/esm/Daytona.d.ts.map +1 -0
  126. package/esm/Daytona.js +523 -0
  127. package/esm/Daytona.js.map +1 -0
  128. package/esm/FileSystem.d.ts +371 -0
  129. package/esm/FileSystem.d.ts.map +1 -0
  130. package/esm/FileSystem.js +485 -0
  131. package/esm/FileSystem.js.map +1 -0
  132. package/esm/Git.d.ts +203 -0
  133. package/esm/Git.d.ts.map +1 -0
  134. package/esm/Git.js +322 -0
  135. package/esm/Git.js.map +1 -0
  136. package/esm/Image.d.ts +265 -0
  137. package/esm/Image.d.ts.map +1 -0
  138. package/esm/Image.js +581 -0
  139. package/esm/Image.js.map +1 -0
  140. package/esm/LspServer.d.ts +172 -0
  141. package/esm/LspServer.d.ts.map +1 -0
  142. package/esm/LspServer.js +255 -0
  143. package/esm/LspServer.js.map +1 -0
  144. package/esm/ObjectStorage.d.ts +79 -0
  145. package/esm/ObjectStorage.d.ts.map +1 -0
  146. package/esm/ObjectStorage.js +195 -0
  147. package/esm/ObjectStorage.js.map +1 -0
  148. package/esm/Process.d.ts +490 -0
  149. package/esm/Process.d.ts.map +1 -0
  150. package/esm/Process.js +642 -0
  151. package/esm/Process.js.map +1 -0
  152. package/esm/PtyHandle.d.ts +155 -0
  153. package/esm/PtyHandle.d.ts.map +1 -0
  154. package/esm/PtyHandle.js +412 -0
  155. package/esm/PtyHandle.js.map +1 -0
  156. package/esm/README.md +180 -0
  157. package/esm/Sandbox.d.ts +476 -0
  158. package/esm/Sandbox.d.ts.map +1 -0
  159. package/esm/Sandbox.js +901 -0
  160. package/esm/Sandbox.js.map +1 -0
  161. package/esm/Snapshot.d.ts +140 -0
  162. package/esm/Snapshot.d.ts.map +1 -0
  163. package/esm/Snapshot.js +244 -0
  164. package/esm/Snapshot.js.map +1 -0
  165. package/esm/Volume.d.ts +84 -0
  166. package/esm/Volume.d.ts.map +1 -0
  167. package/esm/Volume.js +115 -0
  168. package/esm/Volume.js.map +1 -0
  169. package/esm/__tests__/helpers.d.ts +6 -0
  170. package/esm/__tests__/helpers.d.ts.map +1 -0
  171. package/esm/__tests__/helpers.js +20 -0
  172. package/esm/__tests__/helpers.js.map +1 -0
  173. package/esm/errors/DaytonaError.d.ts +171 -0
  174. package/esm/errors/DaytonaError.d.ts.map +1 -0
  175. package/esm/errors/DaytonaError.js +243 -0
  176. package/esm/errors/DaytonaError.js.map +1 -0
  177. package/esm/index.d.ts +22 -0
  178. package/esm/index.d.ts.map +1 -0
  179. package/esm/index.js +21 -0
  180. package/esm/index.js.map +1 -0
  181. package/esm/package.json +3 -0
  182. package/esm/types/Charts.d.ts +38 -0
  183. package/esm/types/Charts.d.ts.map +1 -0
  184. package/esm/types/Charts.js +33 -0
  185. package/esm/types/Charts.js.map +1 -0
  186. package/esm/types/CodeInterpreter.d.ts +77 -0
  187. package/esm/types/CodeInterpreter.d.ts.map +1 -0
  188. package/esm/types/CodeInterpreter.js +6 -0
  189. package/esm/types/CodeInterpreter.js.map +1 -0
  190. package/esm/types/ExecuteResponse.d.ts +26 -0
  191. package/esm/types/ExecuteResponse.d.ts.map +1 -0
  192. package/esm/types/ExecuteResponse.js +6 -0
  193. package/esm/types/ExecuteResponse.js.map +1 -0
  194. package/esm/types/Pty.d.ts +48 -0
  195. package/esm/types/Pty.d.ts.map +1 -0
  196. package/esm/types/Pty.js +6 -0
  197. package/esm/types/Pty.js.map +1 -0
  198. package/esm/utils/Binary.d.ts +39 -0
  199. package/esm/utils/Binary.d.ts.map +1 -0
  200. package/esm/utils/Binary.js +157 -0
  201. package/esm/utils/Binary.js.map +1 -0
  202. package/esm/utils/FileTransfer.d.ts +15 -0
  203. package/esm/utils/FileTransfer.d.ts.map +1 -0
  204. package/esm/utils/FileTransfer.js +254 -0
  205. package/esm/utils/FileTransfer.js.map +1 -0
  206. package/esm/utils/Import.d.ts +95 -0
  207. package/esm/utils/Import.d.ts.map +1 -0
  208. package/esm/utils/Import.js +77 -0
  209. package/esm/utils/Import.js.map +1 -0
  210. package/esm/utils/Multipart.d.ts +29 -0
  211. package/esm/utils/Multipart.d.ts.map +1 -0
  212. package/esm/utils/Multipart.js +109 -0
  213. package/esm/utils/Multipart.js.map +1 -0
  214. package/esm/utils/Runtime.d.ts +44 -0
  215. package/esm/utils/Runtime.d.ts.map +1 -0
  216. package/esm/utils/Runtime.js +89 -0
  217. package/esm/utils/Runtime.js.map +1 -0
  218. package/esm/utils/Stream.d.ts +20 -0
  219. package/esm/utils/Stream.d.ts.map +1 -0
  220. package/esm/utils/Stream.js +360 -0
  221. package/esm/utils/Stream.js.map +1 -0
  222. package/esm/utils/WebSocket.d.ts +10 -0
  223. package/esm/utils/WebSocket.d.ts.map +1 -0
  224. package/esm/utils/WebSocket.js +22 -0
  225. package/esm/utils/WebSocket.js.map +1 -0
  226. package/esm/utils/otel.decorator.d.ts +83 -0
  227. package/esm/utils/otel.decorator.d.ts.map +1 -0
  228. package/esm/utils/otel.decorator.js +136 -0
  229. package/esm/utils/otel.decorator.js.map +1 -0
  230. package/package.json +20 -8
  231. package/src/ComputerUse.d.ts +4 -4
  232. package/src/ComputerUse.js +4 -4
  233. package/src/Sandbox.d.ts +1 -18
  234. package/src/Sandbox.js +0 -29
  235. package/src/Sandbox.js.map +1 -1
  236. package/src/__tests__/helpers.js +0 -2
  237. package/src/__tests__/helpers.js.map +1 -1
@@ -0,0 +1,539 @@
1
+ import { ComputerUseApi, MousePositionResponse, MouseClickResponse, MouseDragResponse, ScreenshotResponse, DisplayInfoResponse, WindowsResponse, ComputerUseStartResponse, ComputerUseStopResponse, ComputerUseStatusResponse, ProcessStatusResponse, ProcessRestartResponse, ProcessLogsResponse, ProcessErrorsResponse, Recording, ListRecordingsResponse } from '@daytona/toolbox-api-client';
2
+ /**
3
+ * Interface for region coordinates used in screenshot operations
4
+ */
5
+ export interface ScreenshotRegion {
6
+ x: number;
7
+ y: number;
8
+ width: number;
9
+ height: number;
10
+ }
11
+ /**
12
+ * Interface for screenshot compression options
13
+ */
14
+ export interface ScreenshotOptions {
15
+ showCursor?: boolean;
16
+ format?: string;
17
+ quality?: number;
18
+ scale?: number;
19
+ }
20
+ /**
21
+ * Mouse operations for computer use functionality
22
+ */
23
+ export declare class Mouse {
24
+ private readonly apiClient;
25
+ constructor(apiClient: ComputerUseApi);
26
+ /**
27
+ * Gets the current mouse cursor position
28
+ *
29
+ * @returns {Promise<MousePositionResponse>} Current mouse position with x and y coordinates
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * const position = await sandbox.computerUse.mouse.getPosition();
34
+ * console.log(`Mouse is at: ${position.x}, ${position.y}`);
35
+ * ```
36
+ */
37
+ getPosition(): Promise<MousePositionResponse>;
38
+ /**
39
+ * Moves the mouse cursor to the specified coordinates
40
+ *
41
+ * @param {number} x - The x coordinate to move to
42
+ * @param {number} y - The y coordinate to move to
43
+ * @returns {Promise<MousePositionResponse>} Position after move
44
+ *
45
+ * @example
46
+ * ```typescript
47
+ * const result = await sandbox.computerUse.mouse.move(100, 200);
48
+ * console.log(`Mouse moved to: ${result.x}, ${result.y}`);
49
+ * ```
50
+ */
51
+ move(x: number, y: number): Promise<MousePositionResponse>;
52
+ /**
53
+ * Clicks the mouse at the specified coordinates
54
+ *
55
+ * @param {number} x - The x coordinate to click at
56
+ * @param {number} y - The y coordinate to click at
57
+ * @param {string} [button='left'] - The mouse button to click ('left', 'right', 'middle')
58
+ * @param {boolean} [double=false] - Whether to perform a double-click
59
+ * @returns {Promise<MouseClickResponse>} Click operation result
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * // Single left click
64
+ * const result = await sandbox.computerUse.mouse.click(100, 200);
65
+ *
66
+ * // Double click
67
+ * const doubleClick = await sandbox.computerUse.mouse.click(100, 200, 'left', true);
68
+ *
69
+ * // Right click
70
+ * const rightClick = await sandbox.computerUse.mouse.click(100, 200, 'right');
71
+ * ```
72
+ */
73
+ click(x: number, y: number, button?: string, double?: boolean): Promise<MouseClickResponse>;
74
+ /**
75
+ * Drags the mouse from start coordinates to end coordinates
76
+ *
77
+ * @param {number} startX - The starting x coordinate
78
+ * @param {number} startY - The starting y coordinate
79
+ * @param {number} endX - The ending x coordinate
80
+ * @param {number} endY - The ending y coordinate
81
+ * @param {string} [button='left'] - The mouse button to use for dragging
82
+ * @returns {Promise<MouseDragResponse>} Drag operation result
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * const result = await sandbox.computerUse.mouse.drag(50, 50, 150, 150);
87
+ * console.log(`Drag ended at: ${result.x}, ${result.y}`);
88
+ * ```
89
+ */
90
+ drag(startX: number, startY: number, endX: number, endY: number, button?: string): Promise<MouseDragResponse>;
91
+ /**
92
+ * Scrolls the mouse wheel at the specified coordinates
93
+ *
94
+ * @param {number} x - The x coordinate to scroll at
95
+ * @param {number} y - The y coordinate to scroll at
96
+ * @param {'up' | 'down'} direction - The direction to scroll
97
+ * @param {number} [amount=1] - The amount to scroll
98
+ * @returns {Promise<boolean>} Whether the scroll operation was successful
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * // Scroll up
103
+ * const scrollUp = await sandbox.computerUse.mouse.scroll(100, 200, 'up', 3);
104
+ *
105
+ * // Scroll down
106
+ * const scrollDown = await sandbox.computerUse.mouse.scroll(100, 200, 'down', 5);
107
+ * ```
108
+ */
109
+ scroll(x: number, y: number, direction: 'up' | 'down', amount?: number): Promise<boolean>;
110
+ }
111
+ /**
112
+ * Keyboard operations for computer use functionality
113
+ */
114
+ export declare class Keyboard {
115
+ private readonly apiClient;
116
+ constructor(apiClient: ComputerUseApi);
117
+ /**
118
+ * Types the specified text
119
+ *
120
+ * @param {string} text - The text to type
121
+ * @param {number} [delay=0] - Delay between characters in milliseconds
122
+ * @throws {DaytonaError} If the type operation fails
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * try {
127
+ * await sandbox.computerUse.keyboard.type('Hello, World!');
128
+ * console.log('Operation success');
129
+ * } catch (e) {
130
+ * console.log('Operation failed:', e);
131
+ * }
132
+ *
133
+ * // With delay between characters
134
+ * try {
135
+ * await sandbox.computerUse.keyboard.type('Slow typing', 100);
136
+ * console.log('Operation success');
137
+ * } catch (e) {
138
+ * console.log('Operation failed:', e);
139
+ * }
140
+ * ```
141
+ */
142
+ type(text: string, delay?: number): Promise<void>;
143
+ /**
144
+ * Presses a key with optional modifiers
145
+ *
146
+ * @param {string} key - The key to press. Canonical names include 'enter', 'escape', 'tab', letters, digits, unshifted punctuation, function keys, and grammar-safe numpad names such as 'num_plus'. Named keys are case-insensitive, and common aliases such as 'Return' and 'Escape' are normalized.
147
+ * @param {string[]} [modifiers=[]] - Canonical modifier names are 'ctrl', 'alt', 'shift', and 'cmd'. Common aliases such as 'control', 'option', 'meta', and 'win' are normalized.
148
+ * @throws {DaytonaError} If the press operation fails
149
+ *
150
+ * @example
151
+ * ```typescript
152
+ * // Press Enter
153
+ * try {
154
+ * await sandbox.computerUse.keyboard.press('enter');
155
+ * console.log('Operation success');
156
+ * } catch (e) {
157
+ * console.log('Operation failed:', e);
158
+ * }
159
+ *
160
+ * // Press Ctrl+C
161
+ * try {
162
+ * await sandbox.computerUse.keyboard.press('c', ['ctrl']);
163
+ * console.log('Operation success');
164
+ * } catch (e) {
165
+ * console.log('Operation failed:', e);
166
+ * }
167
+ *
168
+ * // Press Ctrl+Shift+T
169
+ * try {
170
+ * await sandbox.computerUse.keyboard.press('t', ['ctrl', 'shift']);
171
+ * console.log('Operation success');
172
+ * } catch (e) {
173
+ * console.log('Operation failed:', e);
174
+ * }
175
+ * ```
176
+ */
177
+ press(key: string, modifiers?: string[]): Promise<void>;
178
+ /**
179
+ * Presses a hotkey combination
180
+ *
181
+ * @param {string} keys - A single atomic hotkey chord (e.g., 'ctrl+c', 'alt+tab', 'cmd+shift+t', 'ctrl + c', 'shift'). Uses the same normalized key contract as `press()`.
182
+ * @throws {DaytonaError} If the hotkey operation fails
183
+ *
184
+ * @example
185
+ * ```typescript
186
+ * // Copy
187
+ * try {
188
+ * await sandbox.computerUse.keyboard.hotkey('ctrl+c');
189
+ * console.log('Operation success');
190
+ * } catch (e) {
191
+ * console.log('Operation failed:', e);
192
+ * }
193
+ *
194
+ * // Paste
195
+ * try {
196
+ * await sandbox.computerUse.keyboard.hotkey('ctrl+v');
197
+ * console.log('Operation success');
198
+ * } catch (e) {
199
+ * console.log('Operation failed:', e);
200
+ * }
201
+ *
202
+ * // Alt+Tab
203
+ * try {
204
+ * await sandbox.computerUse.keyboard.hotkey('alt+tab');
205
+ * console.log('Operation success');
206
+ * } catch (e) {
207
+ * console.log('Operation failed:', e);
208
+ * }
209
+ * ```
210
+ */
211
+ hotkey(keys: string): Promise<void>;
212
+ }
213
+ /**
214
+ * Screenshot operations for computer use functionality
215
+ */
216
+ export declare class Screenshot {
217
+ private readonly apiClient;
218
+ constructor(apiClient: ComputerUseApi);
219
+ /**
220
+ * Takes a screenshot of the entire screen
221
+ *
222
+ * @param {boolean} [showCursor=false] - Whether to show the cursor in the screenshot
223
+ * @returns {Promise<ScreenshotResponse>} Screenshot data with base64 encoded image
224
+ *
225
+ * @example
226
+ * ```typescript
227
+ * const screenshot = await sandbox.computerUse.screenshot.takeFullScreen();
228
+ * console.log(`Screenshot size: ${screenshot.width}x${screenshot.height}`);
229
+ *
230
+ * // With cursor visible
231
+ * const withCursor = await sandbox.computerUse.screenshot.takeFullScreen(true);
232
+ * ```
233
+ */
234
+ takeFullScreen(showCursor?: boolean): Promise<ScreenshotResponse>;
235
+ /**
236
+ * Takes a screenshot of a specific region
237
+ *
238
+ * @param {ScreenshotRegion} region - The region to capture
239
+ * @param {boolean} [showCursor=false] - Whether to show the cursor in the screenshot
240
+ * @returns {Promise<RegionScreenshotResponse>} Screenshot data with base64 encoded image
241
+ *
242
+ * @example
243
+ * ```typescript
244
+ * const region = { x: 100, y: 100, width: 300, height: 200 };
245
+ * const screenshot = await sandbox.computerUse.screenshot.takeRegion(region);
246
+ * console.log(`Captured region: ${screenshot.region.width}x${screenshot.region.height}`);
247
+ * ```
248
+ */
249
+ takeRegion(region: ScreenshotRegion, showCursor?: boolean): Promise<ScreenshotResponse>;
250
+ /**
251
+ * Takes a compressed screenshot of the entire screen
252
+ *
253
+ * @param {ScreenshotOptions} [options={}] - Compression and display options
254
+ * @returns {Promise<CompressedScreenshotResponse>} Compressed screenshot data
255
+ *
256
+ * @example
257
+ * ```typescript
258
+ * // Default compression
259
+ * const screenshot = await sandbox.computerUse.screenshot.takeCompressed();
260
+ *
261
+ * // High quality JPEG
262
+ * const jpeg = await sandbox.computerUse.screenshot.takeCompressed({
263
+ * format: 'jpeg',
264
+ * quality: 95,
265
+ * showCursor: true
266
+ * });
267
+ *
268
+ * // Scaled down PNG
269
+ * const scaled = await sandbox.computerUse.screenshot.takeCompressed({
270
+ * format: 'png',
271
+ * scale: 0.5
272
+ * });
273
+ * ```
274
+ */
275
+ takeCompressed(options?: ScreenshotOptions): Promise<ScreenshotResponse>;
276
+ /**
277
+ * Takes a compressed screenshot of a specific region
278
+ *
279
+ * @param {ScreenshotRegion} region - The region to capture
280
+ * @param {ScreenshotOptions} [options={}] - Compression and display options
281
+ * @returns {Promise<CompressedScreenshotResponse>} Compressed screenshot data
282
+ *
283
+ * @example
284
+ * ```typescript
285
+ * const region = { x: 0, y: 0, width: 800, height: 600 };
286
+ * const screenshot = await sandbox.computerUse.screenshot.takeCompressedRegion(region, {
287
+ * format: 'webp',
288
+ * quality: 80,
289
+ * showCursor: true
290
+ * });
291
+ * console.log(`Compressed size: ${screenshot.size_bytes} bytes`);
292
+ * ```
293
+ */
294
+ takeCompressedRegion(region: ScreenshotRegion, options?: ScreenshotOptions): Promise<ScreenshotResponse>;
295
+ }
296
+ /**
297
+ * Display operations for computer use functionality
298
+ */
299
+ export declare class Display {
300
+ private readonly apiClient;
301
+ constructor(apiClient: ComputerUseApi);
302
+ /**
303
+ * Gets information about the displays
304
+ *
305
+ * @returns {Promise<DisplayInfoResponse>} Display information including primary display and all available displays
306
+ *
307
+ * @example
308
+ * ```typescript
309
+ * const info = await sandbox.computerUse.display.getInfo();
310
+ * console.log(`Primary display: ${info.primary_display.width}x${info.primary_display.height}`);
311
+ * console.log(`Total displays: ${info.total_displays}`);
312
+ * info.displays.forEach((display, index) => {
313
+ * console.log(`Display ${index}: ${display.width}x${display.height} at ${display.x},${display.y}`);
314
+ * });
315
+ * ```
316
+ */
317
+ getInfo(): Promise<DisplayInfoResponse>;
318
+ /**
319
+ * Gets the list of open windows
320
+ *
321
+ * @returns {Promise<WindowsResponse>} List of open windows with their IDs and titles
322
+ *
323
+ * @example
324
+ * ```typescript
325
+ * const windows = await sandbox.computerUse.display.getWindows();
326
+ * console.log(`Found ${windows.count} open windows:`);
327
+ * windows.windows.forEach(window => {
328
+ * console.log(`- ${window.title} (ID: ${window.id})`);
329
+ * });
330
+ * ```
331
+ */
332
+ getWindows(): Promise<WindowsResponse>;
333
+ }
334
+ /**
335
+ * Recording operations for computer use functionality.
336
+ */
337
+ export declare class RecordingService {
338
+ private readonly apiClient;
339
+ constructor(apiClient: ComputerUseApi);
340
+ /**
341
+ * Starts a new screen recording session
342
+ *
343
+ * @param {string} [label] - Optional custom label for the recording
344
+ * @returns {Promise<Recording>} Started recording details
345
+ *
346
+ * @example
347
+ * ```typescript
348
+ * // Start a recording with a label
349
+ * const recording = await sandbox.computerUse.recording.start('my-test-recording');
350
+ * console.log(`Recording started: ${recording.id}`);
351
+ * console.log(`File: ${recording.filePath}`);
352
+ * ```
353
+ */
354
+ start(label?: string): Promise<Recording>;
355
+ /**
356
+ * Stops an active screen recording session
357
+ *
358
+ * @param {string} id - The ID of the recording to stop
359
+ * @returns {Promise<Recording>} Stopped recording details
360
+ *
361
+ * @example
362
+ * ```typescript
363
+ * const result = await sandbox.computerUse.recording.stop(recording.id);
364
+ * console.log(`Recording stopped: ${result.durationSeconds} seconds`);
365
+ * console.log(`Saved to: ${result.filePath}`);
366
+ * ```
367
+ */
368
+ stop(id: string): Promise<Recording>;
369
+ /**
370
+ * Lists all recordings (active and completed)
371
+ *
372
+ * @returns {Promise<ListRecordingsResponse>} List of all recordings
373
+ *
374
+ * @example
375
+ * ```typescript
376
+ * const recordings = await sandbox.computerUse.recording.list();
377
+ * console.log(`Found ${recordings.recordings.length} recordings`);
378
+ * recordings.recordings.forEach(rec => {
379
+ * console.log(`- ${rec.fileName}: ${rec.status}`);
380
+ * });
381
+ * ```
382
+ */
383
+ list(): Promise<ListRecordingsResponse>;
384
+ /**
385
+ * Gets details of a specific recording by ID
386
+ *
387
+ * @param {string} id - The ID of the recording to retrieve
388
+ * @returns {Promise<Recording>} Recording details
389
+ *
390
+ * @example
391
+ * ```typescript
392
+ * const recording = await sandbox.computerUse.recording.get(recordingId);
393
+ * console.log(`Recording: ${recording.fileName}`);
394
+ * console.log(`Status: ${recording.status}`);
395
+ * console.log(`Duration: ${recording.durationSeconds} seconds`);
396
+ * ```
397
+ */
398
+ get(id: string): Promise<Recording>;
399
+ /**
400
+ * Deletes a recording by ID
401
+ *
402
+ * @param {string} id - The ID of the recording to delete
403
+ *
404
+ * @example
405
+ * ```typescript
406
+ * await sandbox.computerUse.recording.delete(recordingId);
407
+ * console.log('Recording deleted');
408
+ * ```
409
+ */
410
+ delete(id: string): Promise<void>;
411
+ /**
412
+ * Downloads a recording file and saves it to a local path
413
+ *
414
+ * The file is streamed directly to disk without loading the entire content into memory.
415
+ *
416
+ * @param {string} id - The ID of the recording to download
417
+ * @param {string} localPath - Path to save the recording file locally
418
+ *
419
+ * @example
420
+ * ```typescript
421
+ * // Download recording to file
422
+ * await sandbox.computerUse.recording.download(recordingId, 'local_recording.mp4');
423
+ * console.log('Recording downloaded');
424
+ * ```
425
+ */
426
+ download(id: string, localPath: string): Promise<void>;
427
+ }
428
+ /**
429
+ * Computer Use functionality for interacting with the desktop environment.
430
+ *
431
+ * Provides access to mouse, keyboard, screenshot, display, and recording operations
432
+ * for automating desktop interactions within a sandbox.
433
+ *
434
+ * @property {Mouse} mouse - Mouse operations interface
435
+ * @property {Keyboard} keyboard - Keyboard operations interface
436
+ * @property {Screenshot} screenshot - Screenshot operations interface
437
+ * @property {Display} display - Display operations interface
438
+ * @property {RecordingService} recording - Screen recording operations interface
439
+ *
440
+ * @class
441
+ */
442
+ export declare class ComputerUse {
443
+ private readonly apiClient;
444
+ readonly mouse: Mouse;
445
+ readonly keyboard: Keyboard;
446
+ readonly screenshot: Screenshot;
447
+ readonly display: Display;
448
+ readonly recording: RecordingService;
449
+ constructor(apiClient: ComputerUseApi);
450
+ /**
451
+ * Starts all computer use processes (Xvfb, xfce4, x11vnc, novnc)
452
+ *
453
+ * @returns {Promise<ComputerUseStartResponse>} Computer use start response
454
+ *
455
+ * @example
456
+ * ```typescript
457
+ * const result = await sandbox.computerUse.start();
458
+ * console.log('Computer use processes started:', result.message);
459
+ * ```
460
+ */
461
+ start(): Promise<ComputerUseStartResponse>;
462
+ /**
463
+ * Stops all computer use processes
464
+ *
465
+ * @returns {Promise<ComputerUseStopResponse>} Computer use stop response
466
+ *
467
+ * @example
468
+ * ```typescript
469
+ * const result = await sandbox.computerUse.stop();
470
+ * console.log('Computer use processes stopped:', result.message);
471
+ * ```
472
+ */
473
+ stop(): Promise<ComputerUseStopResponse>;
474
+ /**
475
+ * Gets the status of all computer use processes
476
+ *
477
+ * @returns {Promise<ComputerUseStatusResponse>} Status information about all VNC desktop processes
478
+ *
479
+ * @example
480
+ * ```typescript
481
+ * const status = await sandbox.computerUse.getStatus();
482
+ * console.log('Computer use status:', status.status);
483
+ * ```
484
+ */
485
+ getStatus(): Promise<ComputerUseStatusResponse>;
486
+ /**
487
+ * Gets the status of a specific VNC process
488
+ *
489
+ * @param {string} processName - Name of the process to check
490
+ * @returns {Promise<ProcessStatusResponse>} Status information about the specific process
491
+ *
492
+ * @example
493
+ * ```typescript
494
+ * const xvfbStatus = await sandbox.computerUse.getProcessStatus('xvfb');
495
+ * const noVncStatus = await sandbox.computerUse.getProcessStatus('novnc');
496
+ * ```
497
+ */
498
+ getProcessStatus(processName: string): Promise<ProcessStatusResponse>;
499
+ /**
500
+ * Restarts a specific VNC process
501
+ *
502
+ * @param {string} processName - Name of the process to restart
503
+ * @returns {Promise<ProcessRestartResponse>} Process restart response
504
+ *
505
+ * @example
506
+ * ```typescript
507
+ * const result = await sandbox.computerUse.restartProcess('xfce4');
508
+ * console.log('XFCE4 process restarted:', result.message);
509
+ * ```
510
+ */
511
+ restartProcess(processName: string): Promise<ProcessRestartResponse>;
512
+ /**
513
+ * Gets logs for a specific VNC process
514
+ *
515
+ * @param {string} processName - Name of the process to get logs for
516
+ * @returns {Promise<ProcessLogsResponse>} Process logs
517
+ *
518
+ * @example
519
+ * ```typescript
520
+ * const logsResp = await sandbox.computerUse.getProcessLogs('novnc');
521
+ * console.log('NoVNC logs:', logsResp.logs);
522
+ * ```
523
+ */
524
+ getProcessLogs(processName: string): Promise<ProcessLogsResponse>;
525
+ /**
526
+ * Gets error logs for a specific VNC process
527
+ *
528
+ * @param {string} processName - Name of the process to get error logs for
529
+ * @returns {Promise<ProcessErrorsResponse>} Process error logs
530
+ *
531
+ * @example
532
+ * ```typescript
533
+ * const errorsResp = await sandbox.computerUse.getProcessErrors('x11vnc');
534
+ * console.log('X11VNC errors:', errorsResp.errors);
535
+ * ```
536
+ */
537
+ getProcessErrors(processName: string): Promise<ProcessErrorsResponse>;
538
+ }
539
+ //# sourceMappingURL=ComputerUse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComputerUse.d.ts","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/ComputerUse.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,cAAc,EACd,qBAAqB,EAGrB,kBAAkB,EAElB,iBAAiB,EAKjB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,s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