@daytonaio/sdk 0.127.0 → 0.128.0-alpha.1

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 (277) hide show
  1. package/LICENSE +190 -0
  2. package/{src → cjs}/CodeInterpreter.d.ts +1 -0
  3. package/cjs/CodeInterpreter.d.ts.map +1 -0
  4. package/cjs/CodeInterpreter.js.map +1 -0
  5. package/{src → cjs}/ComputerUse.d.ts +1 -0
  6. package/cjs/ComputerUse.d.ts.map +1 -0
  7. package/cjs/ComputerUse.js.map +1 -0
  8. package/{src → cjs}/Daytona.d.ts +1 -0
  9. package/cjs/Daytona.d.ts.map +1 -0
  10. package/{src → cjs}/Daytona.js +1 -0
  11. package/cjs/Daytona.js.map +1 -0
  12. package/{src → cjs}/FileSystem.d.ts +1 -0
  13. package/cjs/FileSystem.d.ts.map +1 -0
  14. package/cjs/FileSystem.js.map +1 -0
  15. package/{src → cjs}/Git.d.ts +1 -0
  16. package/cjs/Git.d.ts.map +1 -0
  17. package/cjs/Git.js.map +1 -0
  18. package/{src → cjs}/Image.d.ts +21 -0
  19. package/cjs/Image.d.ts.map +1 -0
  20. package/{src → cjs}/Image.js +123 -91
  21. package/cjs/Image.js.map +1 -0
  22. package/{src → cjs}/LspServer.d.ts +1 -0
  23. package/cjs/LspServer.d.ts.map +1 -0
  24. package/cjs/LspServer.js.map +1 -0
  25. package/{src → cjs}/ObjectStorage.d.ts +1 -0
  26. package/cjs/ObjectStorage.d.ts.map +1 -0
  27. package/cjs/ObjectStorage.js.map +1 -0
  28. package/{src → cjs}/Process.d.ts +1 -0
  29. package/cjs/Process.d.ts.map +1 -0
  30. package/cjs/Process.js.map +1 -0
  31. package/{src → cjs}/PtyHandle.d.ts +1 -0
  32. package/cjs/PtyHandle.d.ts.map +1 -0
  33. package/cjs/PtyHandle.js.map +1 -0
  34. package/cjs/README.md +147 -0
  35. package/{src → cjs}/Sandbox.d.ts +2 -17
  36. package/cjs/Sandbox.d.ts.map +1 -0
  37. package/{src → cjs}/Sandbox.js +1 -27
  38. package/cjs/Sandbox.js.map +1 -0
  39. package/{src → cjs}/Snapshot.d.ts +2 -0
  40. package/cjs/Snapshot.d.ts.map +1 -0
  41. package/{src → cjs}/Snapshot.js +9 -1
  42. package/cjs/Snapshot.js.map +1 -0
  43. package/{src → cjs}/Volume.d.ts +1 -0
  44. package/cjs/Volume.d.ts.map +1 -0
  45. package/cjs/Volume.js.map +1 -0
  46. package/{src → cjs}/code-toolbox/SandboxJsCodeToolbox.d.ts +1 -0
  47. package/cjs/code-toolbox/SandboxJsCodeToolbox.d.ts.map +1 -0
  48. package/cjs/code-toolbox/SandboxJsCodeToolbox.js.map +1 -0
  49. package/{src → cjs}/code-toolbox/SandboxPythonCodeToolbox.d.ts +1 -0
  50. package/cjs/code-toolbox/SandboxPythonCodeToolbox.d.ts.map +1 -0
  51. package/cjs/code-toolbox/SandboxPythonCodeToolbox.js.map +1 -0
  52. package/{src → cjs}/code-toolbox/SandboxTsCodeToolbox.d.ts +1 -0
  53. package/cjs/code-toolbox/SandboxTsCodeToolbox.d.ts.map +1 -0
  54. package/cjs/code-toolbox/SandboxTsCodeToolbox.js.map +1 -0
  55. package/{src → cjs}/errors/DaytonaError.d.ts +1 -0
  56. package/cjs/errors/DaytonaError.d.ts.map +1 -0
  57. package/cjs/errors/DaytonaError.js.map +1 -0
  58. package/{src → cjs}/index.d.ts +1 -0
  59. package/cjs/index.d.ts.map +1 -0
  60. package/cjs/index.js.map +1 -0
  61. package/cjs/package.json +3 -0
  62. package/{src → cjs}/types/Charts.d.ts +1 -0
  63. package/cjs/types/Charts.d.ts.map +1 -0
  64. package/cjs/types/Charts.js.map +1 -0
  65. package/{src → cjs}/types/CodeInterpreter.d.ts +1 -0
  66. package/cjs/types/CodeInterpreter.d.ts.map +1 -0
  67. package/cjs/types/CodeInterpreter.js.map +1 -0
  68. package/{src → cjs}/types/ExecuteResponse.d.ts +1 -0
  69. package/cjs/types/ExecuteResponse.d.ts.map +1 -0
  70. package/cjs/types/ExecuteResponse.js.map +1 -0
  71. package/{src → cjs}/types/Pty.d.ts +1 -0
  72. package/cjs/types/Pty.d.ts.map +1 -0
  73. package/cjs/types/Pty.js.map +1 -0
  74. package/{src → cjs}/utils/ArtifactParser.d.ts +1 -0
  75. package/cjs/utils/ArtifactParser.d.ts.map +1 -0
  76. package/cjs/utils/ArtifactParser.js.map +1 -0
  77. package/{src → cjs}/utils/Binary.d.ts +1 -0
  78. package/cjs/utils/Binary.d.ts.map +1 -0
  79. package/cjs/utils/Binary.js.map +1 -0
  80. package/{src → cjs}/utils/FileTransfer.d.ts +1 -0
  81. package/cjs/utils/FileTransfer.d.ts.map +1 -0
  82. package/cjs/utils/FileTransfer.js.map +1 -0
  83. package/{src → cjs}/utils/Import.d.ts +2 -15
  84. package/cjs/utils/Import.d.ts.map +1 -0
  85. package/cjs/utils/Import.js +81 -0
  86. package/cjs/utils/Import.js.map +1 -0
  87. package/{src → cjs}/utils/Multipart.d.ts +1 -0
  88. package/cjs/utils/Multipart.d.ts.map +1 -0
  89. package/cjs/utils/Multipart.js.map +1 -0
  90. package/{src → cjs}/utils/Runtime.d.ts +1 -0
  91. package/cjs/utils/Runtime.d.ts.map +1 -0
  92. package/cjs/utils/Runtime.js.map +1 -0
  93. package/{src → cjs}/utils/Stream.d.ts +1 -0
  94. package/cjs/utils/Stream.d.ts.map +1 -0
  95. package/cjs/utils/Stream.js.map +1 -0
  96. package/{src → cjs}/utils/WebSocket.d.ts +1 -0
  97. package/cjs/utils/WebSocket.d.ts.map +1 -0
  98. package/cjs/utils/WebSocket.js.map +1 -0
  99. package/esm/CodeInterpreter.d.ts +96 -0
  100. package/esm/CodeInterpreter.d.ts.map +1 -0
  101. package/esm/CodeInterpreter.js +295 -0
  102. package/esm/CodeInterpreter.js.map +1 -0
  103. package/esm/ComputerUse.d.ts +443 -0
  104. package/esm/ComputerUse.d.ts.map +1 -0
  105. package/esm/ComputerUse.js +509 -0
  106. package/esm/ComputerUse.js.map +1 -0
  107. package/esm/Daytona.d.ts +354 -0
  108. package/esm/Daytona.d.ts.map +1 -0
  109. package/esm/Daytona.js +410 -0
  110. package/esm/Daytona.js.map +1 -0
  111. package/esm/FileSystem.d.ts +328 -0
  112. package/esm/FileSystem.d.ts.map +1 -0
  113. package/esm/FileSystem.js +331 -0
  114. package/esm/FileSystem.js.map +1 -0
  115. package/esm/Git.d.ts +203 -0
  116. package/esm/Git.d.ts.map +1 -0
  117. package/esm/Git.js +260 -0
  118. package/esm/Git.js.map +1 -0
  119. package/esm/Image.d.ts +285 -0
  120. package/esm/Image.d.ts.map +1 -0
  121. package/esm/Image.js +569 -0
  122. package/esm/Image.js.map +1 -0
  123. package/esm/LspServer.d.ts +172 -0
  124. package/esm/LspServer.d.ts.map +1 -0
  125. package/esm/LspServer.js +204 -0
  126. package/esm/LspServer.js.map +1 -0
  127. package/esm/ObjectStorage.d.ts +79 -0
  128. package/esm/ObjectStorage.d.ts.map +1 -0
  129. package/esm/ObjectStorage.js +187 -0
  130. package/esm/ObjectStorage.js.map +1 -0
  131. package/esm/Process.d.ts +442 -0
  132. package/esm/Process.d.ts.map +1 -0
  133. package/esm/Process.js +644 -0
  134. package/esm/Process.js.map +1 -0
  135. package/esm/PtyHandle.d.ts +155 -0
  136. package/esm/PtyHandle.d.ts.map +1 -0
  137. package/esm/PtyHandle.js +374 -0
  138. package/esm/PtyHandle.js.map +1 -0
  139. package/esm/README.md +147 -0
  140. package/esm/Sandbox.d.ts +359 -0
  141. package/esm/Sandbox.d.ts.map +1 -0
  142. package/esm/Sandbox.js +532 -0
  143. package/esm/Sandbox.js.map +1 -0
  144. package/esm/Snapshot.d.ts +138 -0
  145. package/esm/Snapshot.d.ts.map +1 -0
  146. package/esm/Snapshot.js +207 -0
  147. package/esm/Snapshot.js.map +1 -0
  148. package/esm/Volume.d.ts +84 -0
  149. package/esm/Volume.d.ts.map +1 -0
  150. package/esm/Volume.js +95 -0
  151. package/esm/Volume.js.map +1 -0
  152. package/esm/code-toolbox/SandboxJsCodeToolbox.d.ts +6 -0
  153. package/esm/code-toolbox/SandboxJsCodeToolbox.d.ts.map +1 -0
  154. package/esm/code-toolbox/SandboxJsCodeToolbox.js +13 -0
  155. package/esm/code-toolbox/SandboxJsCodeToolbox.js.map +1 -0
  156. package/esm/code-toolbox/SandboxPythonCodeToolbox.d.ts +12 -0
  157. package/esm/code-toolbox/SandboxPythonCodeToolbox.d.ts.map +1 -0
  158. package/esm/code-toolbox/SandboxPythonCodeToolbox.js +355 -0
  159. package/esm/code-toolbox/SandboxPythonCodeToolbox.js.map +1 -0
  160. package/esm/code-toolbox/SandboxTsCodeToolbox.d.ts +6 -0
  161. package/esm/code-toolbox/SandboxTsCodeToolbox.d.ts.map +1 -0
  162. package/esm/code-toolbox/SandboxTsCodeToolbox.js +14 -0
  163. package/esm/code-toolbox/SandboxTsCodeToolbox.js.map +1 -0
  164. package/esm/errors/DaytonaError.d.ts +32 -0
  165. package/esm/errors/DaytonaError.d.ts.map +1 -0
  166. package/esm/errors/DaytonaError.js +44 -0
  167. package/esm/errors/DaytonaError.js.map +1 -0
  168. package/esm/index.d.ts +22 -0
  169. package/esm/index.d.ts.map +1 -0
  170. package/esm/index.js +22 -0
  171. package/esm/index.js.map +1 -0
  172. package/esm/package.json +3 -0
  173. package/esm/types/Charts.d.ts +152 -0
  174. package/esm/types/Charts.d.ts.map +1 -0
  175. package/esm/types/Charts.js +42 -0
  176. package/esm/types/Charts.js.map +1 -0
  177. package/esm/types/CodeInterpreter.d.ts +77 -0
  178. package/esm/types/CodeInterpreter.d.ts.map +1 -0
  179. package/esm/types/CodeInterpreter.js +6 -0
  180. package/esm/types/CodeInterpreter.js.map +1 -0
  181. package/esm/types/ExecuteResponse.d.ts +26 -0
  182. package/esm/types/ExecuteResponse.d.ts.map +1 -0
  183. package/esm/types/ExecuteResponse.js +6 -0
  184. package/esm/types/ExecuteResponse.js.map +1 -0
  185. package/esm/types/Pty.d.ts +48 -0
  186. package/esm/types/Pty.d.ts.map +1 -0
  187. package/esm/types/Pty.js +6 -0
  188. package/esm/types/Pty.js.map +1 -0
  189. package/esm/utils/ArtifactParser.d.ts +14 -0
  190. package/esm/utils/ArtifactParser.d.ts.map +1 -0
  191. package/esm/utils/ArtifactParser.js +51 -0
  192. package/esm/utils/ArtifactParser.js.map +1 -0
  193. package/esm/utils/Binary.d.ts +39 -0
  194. package/esm/utils/Binary.d.ts.map +1 -0
  195. package/esm/utils/Binary.js +157 -0
  196. package/esm/utils/Binary.js.map +1 -0
  197. package/esm/utils/FileTransfer.d.ts +15 -0
  198. package/esm/utils/FileTransfer.d.ts.map +1 -0
  199. package/esm/utils/FileTransfer.js +209 -0
  200. package/esm/utils/FileTransfer.js.map +1 -0
  201. package/esm/utils/Import.d.ts +211 -0
  202. package/esm/utils/Import.d.ts.map +1 -0
  203. package/esm/utils/Import.js +45 -0
  204. package/esm/utils/Import.js.map +1 -0
  205. package/esm/utils/Multipart.d.ts +27 -0
  206. package/esm/utils/Multipart.d.ts.map +1 -0
  207. package/esm/utils/Multipart.js +107 -0
  208. package/esm/utils/Multipart.js.map +1 -0
  209. package/esm/utils/Runtime.d.ts +37 -0
  210. package/esm/utils/Runtime.d.ts.map +1 -0
  211. package/esm/utils/Runtime.js +57 -0
  212. package/esm/utils/Runtime.js.map +1 -0
  213. package/esm/utils/Stream.d.ts +20 -0
  214. package/esm/utils/Stream.d.ts.map +1 -0
  215. package/esm/utils/Stream.js +360 -0
  216. package/esm/utils/Stream.js.map +1 -0
  217. package/esm/utils/WebSocket.d.ts +10 -0
  218. package/esm/utils/WebSocket.d.ts.map +1 -0
  219. package/esm/utils/WebSocket.js +22 -0
  220. package/esm/utils/WebSocket.js.map +1 -0
  221. package/package.json +20 -8
  222. package/src/CodeInterpreter.js.map +0 -1
  223. package/src/ComputerUse.js.map +0 -1
  224. package/src/Daytona.js.map +0 -1
  225. package/src/FileSystem.js.map +0 -1
  226. package/src/Git.js.map +0 -1
  227. package/src/Image.js.map +0 -1
  228. package/src/LspServer.js.map +0 -1
  229. package/src/ObjectStorage.js.map +0 -1
  230. package/src/Process.js.map +0 -1
  231. package/src/PtyHandle.js.map +0 -1
  232. package/src/Sandbox.js.map +0 -1
  233. package/src/Snapshot.js.map +0 -1
  234. package/src/Volume.js.map +0 -1
  235. package/src/code-toolbox/SandboxJsCodeToolbox.js.map +0 -1
  236. package/src/code-toolbox/SandboxPythonCodeToolbox.js.map +0 -1
  237. package/src/code-toolbox/SandboxTsCodeToolbox.js.map +0 -1
  238. package/src/errors/DaytonaError.js.map +0 -1
  239. package/src/index.js.map +0 -1
  240. package/src/types/Charts.js.map +0 -1
  241. package/src/types/CodeInterpreter.js.map +0 -1
  242. package/src/types/ExecuteResponse.js.map +0 -1
  243. package/src/types/Pty.js.map +0 -1
  244. package/src/utils/ArtifactParser.js.map +0 -1
  245. package/src/utils/Binary.js.map +0 -1
  246. package/src/utils/FileTransfer.js.map +0 -1
  247. package/src/utils/Import.js +0 -77
  248. package/src/utils/Import.js.map +0 -1
  249. package/src/utils/Multipart.js.map +0 -1
  250. package/src/utils/Runtime.js.map +0 -1
  251. package/src/utils/Stream.js.map +0 -1
  252. package/src/utils/WebSocket.js.map +0 -1
  253. /package/{src → cjs}/CodeInterpreter.js +0 -0
  254. /package/{src → cjs}/ComputerUse.js +0 -0
  255. /package/{src → cjs}/FileSystem.js +0 -0
  256. /package/{src → cjs}/Git.js +0 -0
  257. /package/{src → cjs}/LspServer.js +0 -0
  258. /package/{src → cjs}/ObjectStorage.js +0 -0
  259. /package/{src → cjs}/Process.js +0 -0
  260. /package/{src → cjs}/PtyHandle.js +0 -0
  261. /package/{src → cjs}/Volume.js +0 -0
  262. /package/{src → cjs}/code-toolbox/SandboxJsCodeToolbox.js +0 -0
  263. /package/{src → cjs}/code-toolbox/SandboxPythonCodeToolbox.js +0 -0
  264. /package/{src → cjs}/code-toolbox/SandboxTsCodeToolbox.js +0 -0
  265. /package/{src → cjs}/errors/DaytonaError.js +0 -0
  266. /package/{src → cjs}/index.js +0 -0
  267. /package/{src → cjs}/types/Charts.js +0 -0
  268. /package/{src → cjs}/types/CodeInterpreter.js +0 -0
  269. /package/{src → cjs}/types/ExecuteResponse.js +0 -0
  270. /package/{src → cjs}/types/Pty.js +0 -0
  271. /package/{src → cjs}/utils/ArtifactParser.js +0 -0
  272. /package/{src → cjs}/utils/Binary.js +0 -0
  273. /package/{src → cjs}/utils/FileTransfer.js +0 -0
  274. /package/{src → cjs}/utils/Multipart.js +0 -0
  275. /package/{src → cjs}/utils/Runtime.js +0 -0
  276. /package/{src → cjs}/utils/Stream.js +0 -0
  277. /package/{src → cjs}/utils/WebSocket.js +0 -0
@@ -0,0 +1,443 @@
1
+ import { ComputerUseApi, MousePositionResponse, MouseClickResponse, MouseDragResponse, ScreenshotResponse, DisplayInfoResponse, WindowsResponse, ComputerUseStartResponse, ComputerUseStopResponse, ComputerUseStatusResponse, ProcessStatusResponse, ProcessRestartResponse, ProcessLogsResponse, ProcessErrorsResponse } from '@daytonaio/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(`Dragged from ${result.from.x},${result.from.y} to ${result.to.x},${result.to.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 (e.g., 'Enter', 'Escape', 'Tab', 'a', 'A')
147
+ * @param {string[]} [modifiers=[]] - Modifier keys ('ctrl', 'alt', 'meta', 'shift')
148
+ * @throws {DaytonaError} If the press operation fails
149
+ *
150
+ * @example
151
+ * ```typescript
152
+ * // Press Enter
153
+ * try {
154
+ * await sandbox.computerUse.keyboard.press('Return');
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 - The hotkey combination (e.g., 'ctrl+c', 'alt+tab', 'cmd+shift+t')
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
+ * Computer Use functionality for interacting with the desktop environment.
336
+ *
337
+ * Provides access to mouse, keyboard, screenshot, and display operations
338
+ * for automating desktop interactions within a sandbox.
339
+ *
340
+ * @property {Mouse} mouse - Mouse operations interface
341
+ * @property {Keyboard} keyboard - Keyboard operations interface
342
+ * @property {Screenshot} screenshot - Screenshot operations interface
343
+ * @property {Display} display - Display operations interface
344
+ *
345
+ * @class
346
+ */
347
+ export declare class ComputerUse {
348
+ private readonly apiClient;
349
+ readonly mouse: Mouse;
350
+ readonly keyboard: Keyboard;
351
+ readonly screenshot: Screenshot;
352
+ readonly display: Display;
353
+ constructor(apiClient: ComputerUseApi);
354
+ /**
355
+ * Starts all computer use processes (Xvfb, xfce4, x11vnc, novnc)
356
+ *
357
+ * @returns {Promise<ComputerUseStartResponse>} Computer use start response
358
+ *
359
+ * @example
360
+ * ```typescript
361
+ * const result = await sandbox.computerUse.start();
362
+ * console.log('Computer use processes started:', result.message);
363
+ * ```
364
+ */
365
+ start(): Promise<ComputerUseStartResponse>;
366
+ /**
367
+ * Stops all computer use processes
368
+ *
369
+ * @returns {Promise<ComputerUseStopResponse>} Computer use stop response
370
+ *
371
+ * @example
372
+ * ```typescript
373
+ * const result = await sandbox.computerUse.stop();
374
+ * console.log('Computer use processes stopped:', result.message);
375
+ * ```
376
+ */
377
+ stop(): Promise<ComputerUseStopResponse>;
378
+ /**
379
+ * Gets the status of all computer use processes
380
+ *
381
+ * @returns {Promise<ComputerUseStatusResponse>} Status information about all VNC desktop processes
382
+ *
383
+ * @example
384
+ * ```typescript
385
+ * const status = await sandbox.computerUse.getStatus();
386
+ * console.log('Computer use status:', status.status);
387
+ * ```
388
+ */
389
+ getStatus(): Promise<ComputerUseStatusResponse>;
390
+ /**
391
+ * Gets the status of a specific VNC process
392
+ *
393
+ * @param {string} processName - Name of the process to check
394
+ * @returns {Promise<ProcessStatusResponse>} Status information about the specific process
395
+ *
396
+ * @example
397
+ * ```typescript
398
+ * const xvfbStatus = await sandbox.computerUse.getProcessStatus('xvfb');
399
+ * const noVncStatus = await sandbox.computerUse.getProcessStatus('novnc');
400
+ * ```
401
+ */
402
+ getProcessStatus(processName: string): Promise<ProcessStatusResponse>;
403
+ /**
404
+ * Restarts a specific VNC process
405
+ *
406
+ * @param {string} processName - Name of the process to restart
407
+ * @returns {Promise<ProcessRestartResponse>} Process restart response
408
+ *
409
+ * @example
410
+ * ```typescript
411
+ * const result = await sandbox.computerUse.restartProcess('xfce4');
412
+ * console.log('XFCE4 process restarted:', result.message);
413
+ * ```
414
+ */
415
+ restartProcess(processName: string): Promise<ProcessRestartResponse>;
416
+ /**
417
+ * Gets logs for a specific VNC process
418
+ *
419
+ * @param {string} processName - Name of the process to get logs for
420
+ * @returns {Promise<ProcessLogsResponse>} Process logs
421
+ *
422
+ * @example
423
+ * ```typescript
424
+ * const logsResp = await sandbox.computerUse.getProcessLogs('novnc');
425
+ * console.log('NoVNC logs:', logsResp.logs);
426
+ * ```
427
+ */
428
+ getProcessLogs(processName: string): Promise<ProcessLogsResponse>;
429
+ /**
430
+ * Gets error logs for a specific VNC process
431
+ *
432
+ * @param {string} processName - Name of the process to get error logs for
433
+ * @returns {Promise<ProcessErrorsResponse>} Process error logs
434
+ *
435
+ * @example
436
+ * ```typescript
437
+ * const errorsResp = await sandbox.computerUse.getProcessErrors('x11vnc');
438
+ * console.log('X11VNC errors:', errorsResp.errors);
439
+ * ```
440
+ */
441
+ getProcessErrors(processName: string): Promise<ProcessErrorsResponse>;
442
+ }
443
+ //# 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":"AAKA,OAAO,EACL,cAAc,EACd,qBAAqB,EAGrB,kBAAkB,EAElB,iBAAiB,EAKjB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,+BAA+B,C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