@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
package/esm/Sandbox.js ADDED
@@ -0,0 +1,532 @@
1
+ /*
2
+ * Copyright 2025 Daytona Platforms Inc.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { SandboxState, } from '@daytonaio/api-client';
6
+ import { FileSystemApi, GitApi, ProcessApi, LspApi, InfoApi, ComputerUseApi, InterpreterApi, } from '@daytonaio/toolbox-api-client';
7
+ import { FileSystem } from './FileSystem.js';
8
+ import { Git } from './Git.js';
9
+ import { Process } from './Process.js';
10
+ import { LspServer } from './LspServer.js';
11
+ import { DaytonaError, DaytonaNotFoundError } from './errors/DaytonaError.js';
12
+ import { ComputerUse } from './ComputerUse.js';
13
+ import { CodeInterpreter } from './CodeInterpreter.js';
14
+ const TOOLBOX_URL_PLACEHOLDER = 'dtn-placeholder';
15
+ /**
16
+ * Represents a Daytona Sandbox.
17
+ *
18
+ * @property {FileSystem} fs - File system operations interface
19
+ * @property {Git} git - Git operations interface
20
+ * @property {Process} process - Process execution interface
21
+ * @property {CodeInterpreter} codeInterpreter - Stateful interpreter interface for executing code.
22
+ * Currently supports only Python. For other languages, use the `process.codeRun` method.
23
+ * @property {ComputerUse} computerUse - Computer use operations interface for desktop automation
24
+ * @property {string} id - Unique identifier for the Sandbox
25
+ * @property {string} organizationId - Organization ID of the Sandbox
26
+ * @property {string} [snapshot] - Daytona snapshot used to create the Sandbox
27
+ * @property {string} user - OS user running in the Sandbox
28
+ * @property {Record<string, string>} env - Environment variables set in the Sandbox
29
+ * @property {Record<string, string>} labels - Custom labels attached to the Sandbox
30
+ * @property {boolean} public - Whether the Sandbox is publicly accessible
31
+ * @property {string} target - Target location of the runner where the Sandbox runs
32
+ * @property {number} cpu - Number of CPUs allocated to the Sandbox
33
+ * @property {number} gpu - Number of GPUs allocated to the Sandbox
34
+ * @property {number} memory - Amount of memory allocated to the Sandbox in GiB
35
+ * @property {number} disk - Amount of disk space allocated to the Sandbox in GiB
36
+ * @property {SandboxState} state - Current state of the Sandbox (e.g., "started", "stopped")
37
+ * @property {string} [errorReason] - Error message if Sandbox is in error state
38
+ * @property {SandboxBackupStateEnum} [backupState] - Current state of Sandbox backup
39
+ * @property {string} [backupCreatedAt] - When the backup was created
40
+ * @property {number} [autoStopInterval] - Auto-stop interval in minutes
41
+ * @property {number} [autoArchiveInterval] - Auto-archive interval in minutes
42
+ * @property {number} [autoDeleteInterval] - Auto-delete interval in minutes
43
+ * @property {Array<SandboxVolume>} [volumes] - Volumes attached to the Sandbox
44
+ * @property {BuildInfo} [buildInfo] - Build information for the Sandbox if it was created from dynamic build
45
+ * @property {string} [createdAt] - When the Sandbox was created
46
+ * @property {string} [updatedAt] - When the Sandbox was last updated
47
+ * @property {boolean} networkBlockAll - Whether to block all network access for the Sandbox
48
+ * @property {string} [networkAllowList] - Comma-separated list of allowed CIDR network addresses for the Sandbox
49
+ *
50
+ * @class
51
+ */
52
+ export class Sandbox {
53
+ clientConfig;
54
+ axiosInstance;
55
+ sandboxApi;
56
+ codeToolbox;
57
+ getToolboxBaseUrl;
58
+ fs;
59
+ git;
60
+ process;
61
+ computerUse;
62
+ codeInterpreter;
63
+ id;
64
+ name;
65
+ organizationId;
66
+ snapshot;
67
+ user;
68
+ env;
69
+ labels;
70
+ public;
71
+ target;
72
+ cpu;
73
+ gpu;
74
+ memory;
75
+ disk;
76
+ state;
77
+ errorReason;
78
+ backupState;
79
+ backupCreatedAt;
80
+ autoStopInterval;
81
+ autoArchiveInterval;
82
+ autoDeleteInterval;
83
+ volumes;
84
+ buildInfo;
85
+ createdAt;
86
+ updatedAt;
87
+ networkBlockAll;
88
+ networkAllowList;
89
+ infoApi;
90
+ /**
91
+ * Creates a new Sandbox instance
92
+ *
93
+ * @param {SandboxDto} sandboxDto - The API Sandbox instance
94
+ * @param {SandboxApi} sandboxApi - API client for Sandbox operations
95
+ * @param {InfoApi} infoApi - API client for info operations
96
+ * @param {SandboxCodeToolbox} codeToolbox - Language-specific toolbox implementation
97
+ */
98
+ constructor(sandboxDto, clientConfig, axiosInstance, sandboxApi, codeToolbox, getToolboxBaseUrl) {
99
+ this.clientConfig = clientConfig;
100
+ this.axiosInstance = axiosInstance;
101
+ this.sandboxApi = sandboxApi;
102
+ this.codeToolbox = codeToolbox;
103
+ this.getToolboxBaseUrl = getToolboxBaseUrl;
104
+ this.processSandboxDto(sandboxDto);
105
+ // Lazy load the base URL for the toolbox
106
+ this.axiosInstance.defaults.baseURL = TOOLBOX_URL_PLACEHOLDER;
107
+ this.axiosInstance.interceptors.request.use(async (config) => {
108
+ if (this.axiosInstance.defaults.baseURL === TOOLBOX_URL_PLACEHOLDER) {
109
+ await this.ensureToolboxUrl();
110
+ config.baseURL = this.axiosInstance.defaults.baseURL;
111
+ }
112
+ return config;
113
+ });
114
+ // Initialize Services
115
+ const getPreviewToken = async () => (await this.getPreviewLink(1)).token;
116
+ this.fs = new FileSystem(this.clientConfig, new FileSystemApi(this.clientConfig, '', this.axiosInstance), this.ensureToolboxUrl.bind(this));
117
+ this.git = new Git(new GitApi(this.clientConfig, '', this.axiosInstance));
118
+ this.process = new Process(this.clientConfig, this.codeToolbox, new ProcessApi(this.clientConfig, '', this.axiosInstance), getPreviewToken, this.ensureToolboxUrl.bind(this));
119
+ this.codeInterpreter = new CodeInterpreter(this.clientConfig, new InterpreterApi(this.clientConfig, '', this.axiosInstance), getPreviewToken, this.ensureToolboxUrl.bind(this));
120
+ this.computerUse = new ComputerUse(new ComputerUseApi(this.clientConfig, '', this.axiosInstance));
121
+ this.infoApi = new InfoApi(this.clientConfig, '', this.axiosInstance);
122
+ }
123
+ /**
124
+ * Gets the user's home directory path for the logged in user inside the Sandbox.
125
+ *
126
+ * @returns {Promise<string | undefined>} The absolute path to the Sandbox user's home directory for the logged in user
127
+ *
128
+ * @example
129
+ * const userHomeDir = await sandbox.getUserHomeDir();
130
+ * console.log(`Sandbox user home: ${userHomeDir}`);
131
+ */
132
+ async getUserHomeDir() {
133
+ const response = await this.infoApi.getUserHomeDir();
134
+ return response.data.dir;
135
+ }
136
+ /**
137
+ * @deprecated Use `getUserHomeDir` instead. This method will be removed in a future version.
138
+ */
139
+ async getUserRootDir() {
140
+ return this.getUserHomeDir();
141
+ }
142
+ /**
143
+ * Gets the working directory path inside the Sandbox.
144
+ *
145
+ * @returns {Promise<string | undefined>} The absolute path to the Sandbox working directory. Uses the WORKDIR specified
146
+ * in the Dockerfile if present, or falling back to the user's home directory if not.
147
+ *
148
+ * @example
149
+ * const workDir = await sandbox.getWorkDir();
150
+ * console.log(`Sandbox working directory: ${workDir}`);
151
+ */
152
+ async getWorkDir() {
153
+ const response = await this.infoApi.getWorkDir();
154
+ return response.data.dir;
155
+ }
156
+ /**
157
+ * Creates a new Language Server Protocol (LSP) server instance.
158
+ *
159
+ * The LSP server provides language-specific features like code completion,
160
+ * diagnostics, and more.
161
+ *
162
+ * @param {LspLanguageId} languageId - The language server type (e.g., "typescript")
163
+ * @param {string} pathToProject - Path to the project root directory. Relative paths are resolved based on the sandbox working directory.
164
+ * @returns {LspServer} A new LSP server instance configured for the specified language
165
+ *
166
+ * @example
167
+ * const lsp = await sandbox.createLspServer('typescript', 'workspace/project');
168
+ */
169
+ async createLspServer(languageId, pathToProject) {
170
+ return new LspServer(languageId, pathToProject, new LspApi(this.clientConfig, '', this.axiosInstance));
171
+ }
172
+ /**
173
+ * Sets labels for the Sandbox.
174
+ *
175
+ * Labels are key-value pairs that can be used to organize and identify Sandboxes.
176
+ *
177
+ * @param {Record<string, string>} labels - Dictionary of key-value pairs representing Sandbox labels
178
+ * @returns {Promise<void>}
179
+ *
180
+ * @example
181
+ * // Set sandbox labels
182
+ * await sandbox.setLabels({
183
+ * project: 'my-project',
184
+ * environment: 'development',
185
+ * team: 'backend'
186
+ * });
187
+ */
188
+ async setLabels(labels) {
189
+ this.labels = (await this.sandboxApi.replaceLabels(this.id, { labels })).data.labels;
190
+ return this.labels;
191
+ }
192
+ /**
193
+ * Start the Sandbox.
194
+ *
195
+ * This method starts the Sandbox and waits for it to be ready.
196
+ *
197
+ * @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
198
+ * Defaults to 60-second timeout.
199
+ * @returns {Promise<void>}
200
+ * @throws {DaytonaError} - `DaytonaError` - If Sandbox fails to start or times out
201
+ *
202
+ * @example
203
+ * const sandbox = await daytona.getCurrentSandbox('my-sandbox');
204
+ * await sandbox.start(40); // Wait up to 40 seconds
205
+ * console.log('Sandbox started successfully');
206
+ */
207
+ async start(timeout = 60) {
208
+ if (timeout < 0) {
209
+ throw new DaytonaError('Timeout must be a non-negative number');
210
+ }
211
+ const startTime = Date.now();
212
+ const response = await this.sandboxApi.startSandbox(this.id, undefined, { timeout: timeout * 1000 });
213
+ this.processSandboxDto(response.data);
214
+ const timeElapsed = Date.now() - startTime;
215
+ await this.waitUntilStarted(timeout ? Math.max(0.001, timeout - timeElapsed / 1000) : timeout);
216
+ }
217
+ /**
218
+ * Stops the Sandbox.
219
+ *
220
+ * This method stops the Sandbox and waits for it to be fully stopped.
221
+ *
222
+ * @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
223
+ * Defaults to 60-second timeout.
224
+ * @returns {Promise<void>}
225
+ *
226
+ * @example
227
+ * const sandbox = await daytona.getCurrentSandbox('my-sandbox');
228
+ * await sandbox.stop();
229
+ * console.log('Sandbox stopped successfully');
230
+ */
231
+ async stop(timeout = 60) {
232
+ if (timeout < 0) {
233
+ throw new DaytonaError('Timeout must be a non-negative number');
234
+ }
235
+ const startTime = Date.now();
236
+ await this.sandboxApi.stopSandbox(this.id, undefined, { timeout: timeout * 1000 });
237
+ await this.refreshDataSafe();
238
+ const timeElapsed = Date.now() - startTime;
239
+ await this.waitUntilStopped(timeout ? Math.max(0.001, timeout - timeElapsed / 1000) : timeout);
240
+ }
241
+ /**
242
+ * Deletes the Sandbox.
243
+ * @returns {Promise<void>}
244
+ */
245
+ async delete(timeout = 60) {
246
+ await this.sandboxApi.deleteSandbox(this.id, undefined, { timeout: timeout * 1000 });
247
+ this.refreshDataSafe();
248
+ }
249
+ /**
250
+ * Waits for the Sandbox to reach the 'started' state.
251
+ *
252
+ * This method polls the Sandbox status until it reaches the 'started' state
253
+ * or encounters an error.
254
+ *
255
+ * @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
256
+ * Defaults to 60 seconds.
257
+ * @returns {Promise<void>}
258
+ * @throws {DaytonaError} - `DaytonaError` - If the sandbox ends up in an error state or fails to start within the timeout period.
259
+ */
260
+ async waitUntilStarted(timeout = 60) {
261
+ if (timeout < 0) {
262
+ throw new DaytonaError('Timeout must be a non-negative number');
263
+ }
264
+ const checkInterval = 100; // Wait 100 ms between checks
265
+ const startTime = Date.now();
266
+ while (this.state !== 'started') {
267
+ await this.refreshData();
268
+ // @ts-expect-error this.refreshData() can modify this.state so this check is fine
269
+ if (this.state === 'started') {
270
+ return;
271
+ }
272
+ if (this.state === 'error') {
273
+ const errMsg = `Sandbox ${this.id} failed to start with status: ${this.state}, error reason: ${this.errorReason}`;
274
+ throw new DaytonaError(errMsg);
275
+ }
276
+ if (timeout !== 0 && Date.now() - startTime > timeout * 1000) {
277
+ throw new DaytonaError('Sandbox failed to become ready within the timeout period');
278
+ }
279
+ await new Promise((resolve) => setTimeout(resolve, checkInterval));
280
+ }
281
+ }
282
+ /**
283
+ * Wait for Sandbox to reach 'stopped' state.
284
+ *
285
+ * This method polls the Sandbox status until it reaches the 'stopped' state
286
+ * or encounters an error.
287
+ *
288
+ * @param {number} [timeout] - Maximum time to wait in seconds. 0 means no timeout.
289
+ * Defaults to 60 seconds.
290
+ * @returns {Promise<void>}
291
+ * @throws {DaytonaError} - `DaytonaError` - If the sandbox fails to stop within the timeout period.
292
+ */
293
+ async waitUntilStopped(timeout = 60) {
294
+ if (timeout < 0) {
295
+ throw new DaytonaError('Timeout must be a non-negative number');
296
+ }
297
+ const checkInterval = 100; // Wait 100 ms between checks
298
+ const startTime = Date.now();
299
+ // Treat destroyed as stopped to cover ephemeral sandboxes that are automatically deleted after stopping
300
+ while (this.state !== 'stopped' && this.state !== 'destroyed') {
301
+ this.refreshDataSafe();
302
+ // @ts-expect-error this.refreshData() can modify this.state so this check is fine
303
+ if (this.state === 'stopped' || this.state === 'destroyed') {
304
+ return;
305
+ }
306
+ if (this.state === 'error') {
307
+ const errMsg = `Sandbox failed to stop with status: ${this.state}, error reason: ${this.errorReason}`;
308
+ throw new DaytonaError(errMsg);
309
+ }
310
+ if (timeout !== 0 && Date.now() - startTime > timeout * 1000) {
311
+ throw new DaytonaError('Sandbox failed to become stopped within the timeout period');
312
+ }
313
+ await new Promise((resolve) => setTimeout(resolve, checkInterval));
314
+ }
315
+ }
316
+ /**
317
+ * Refreshes the Sandbox data from the API.
318
+ *
319
+ * @returns {Promise<void>}
320
+ *
321
+ * @example
322
+ * await sandbox.refreshData();
323
+ * console.log(`Sandbox ${sandbox.id}:`);
324
+ * console.log(`State: ${sandbox.state}`);
325
+ * console.log(`Resources: ${sandbox.cpu} CPU, ${sandbox.memory} GiB RAM`);
326
+ */
327
+ async refreshData() {
328
+ const response = await this.sandboxApi.getSandbox(this.id);
329
+ this.processSandboxDto(response.data);
330
+ }
331
+ /**
332
+ * Refreshes the sandbox activity to reset the timer for automated lifecycle management actions.
333
+ *
334
+ * This method updates the sandbox's last activity timestamp without changing its state.
335
+ * It is useful for keeping long-running sessions alive while there is still user activity.
336
+ *
337
+ * @returns {Promise<void>}
338
+ *
339
+ * @example
340
+ * // Keep sandbox activity alive
341
+ * await sandbox.refreshActivity();
342
+ */
343
+ async refreshActivity() {
344
+ await this.sandboxApi.updateLastActivity(this.id);
345
+ }
346
+ /**
347
+ * Set the auto-stop interval for the Sandbox.
348
+ *
349
+ * The Sandbox will automatically stop after being idle (no new events) for the specified interval.
350
+ * Events include any state changes or interactions with the Sandbox through the sdk.
351
+ * Interactions using Sandbox Previews are not included.
352
+ *
353
+ * @param {number} interval - Number of minutes of inactivity before auto-stopping.
354
+ * Set to 0 to disable auto-stop. Default is 15 minutes.
355
+ * @returns {Promise<void>}
356
+ * @throws {DaytonaError} - `DaytonaError` - If interval is not a non-negative integer
357
+ *
358
+ * @example
359
+ * // Auto-stop after 1 hour
360
+ * await sandbox.setAutostopInterval(60);
361
+ * // Or disable auto-stop
362
+ * await sandbox.setAutostopInterval(0);
363
+ */
364
+ async setAutostopInterval(interval) {
365
+ if (!Number.isInteger(interval) || interval < 0) {
366
+ throw new DaytonaError('autoStopInterval must be a non-negative integer');
367
+ }
368
+ await this.sandboxApi.setAutostopInterval(this.id, interval);
369
+ this.autoStopInterval = interval;
370
+ }
371
+ /**
372
+ * Set the auto-archive interval for the Sandbox.
373
+ *
374
+ * The Sandbox will automatically archive after being continuously stopped for the specified interval.
375
+ *
376
+ * @param {number} interval - Number of minutes after which a continuously stopped Sandbox will be auto-archived.
377
+ * Set to 0 for the maximum interval. Default is 7 days.
378
+ * @returns {Promise<void>}
379
+ * @throws {DaytonaError} - `DaytonaError` - If interval is not a non-negative integer
380
+ *
381
+ * @example
382
+ * // Auto-archive after 1 hour
383
+ * await sandbox.setAutoArchiveInterval(60);
384
+ * // Or use the maximum interval
385
+ * await sandbox.setAutoArchiveInterval(0);
386
+ */
387
+ async setAutoArchiveInterval(interval) {
388
+ if (!Number.isInteger(interval) || interval < 0) {
389
+ throw new DaytonaError('autoArchiveInterval must be a non-negative integer');
390
+ }
391
+ await this.sandboxApi.setAutoArchiveInterval(this.id, interval);
392
+ this.autoArchiveInterval = interval;
393
+ }
394
+ /**
395
+ * Set the auto-delete interval for the Sandbox.
396
+ *
397
+ * The Sandbox will automatically delete after being continuously stopped for the specified interval.
398
+ *
399
+ * @param {number} interval - Number of minutes after which a continuously stopped Sandbox will be auto-deleted.
400
+ * Set to negative value to disable auto-delete. Set to 0 to delete immediately upon stopping.
401
+ * By default, auto-delete is disabled.
402
+ * @returns {Promise<void>}
403
+ *
404
+ * @example
405
+ * // Auto-delete after 1 hour
406
+ * await sandbox.setAutoDeleteInterval(60);
407
+ * // Or delete immediately upon stopping
408
+ * await sandbox.setAutoDeleteInterval(0);
409
+ * // Or disable auto-delete
410
+ * await sandbox.setAutoDeleteInterval(-1);
411
+ */
412
+ async setAutoDeleteInterval(interval) {
413
+ await this.sandboxApi.setAutoDeleteInterval(this.id, interval);
414
+ this.autoDeleteInterval = interval;
415
+ }
416
+ /**
417
+ * Retrieves the preview link for the sandbox at the specified port. If the port is closed,
418
+ * it will be opened automatically. For private sandboxes, a token is included to grant access
419
+ * to the URL.
420
+ *
421
+ * @param {number} port - The port to open the preview link on.
422
+ * @returns {PortPreviewUrl} The response object for the preview link, which includes the `url`
423
+ * and the `token` (to access private sandboxes).
424
+ *
425
+ * @example
426
+ * const previewLink = await sandbox.getPreviewLink(3000);
427
+ * console.log(`Preview URL: ${previewLink.url}`);
428
+ * console.log(`Token: ${previewLink.token}`);
429
+ */
430
+ async getPreviewLink(port) {
431
+ return (await this.sandboxApi.getPortPreviewUrl(this.id, port)).data;
432
+ }
433
+ /**
434
+ * Archives the sandbox, making it inactive and preserving its state. When sandboxes are archived, the entire filesystem
435
+ * state is moved to cost-effective object storage, making it possible to keep sandboxes available for an extended period.
436
+ * The tradeoff between archived and stopped states is that starting an archived sandbox takes more time, depending on its size.
437
+ * Sandbox must be stopped before archiving.
438
+ */
439
+ async archive() {
440
+ await this.sandboxApi.archiveSandbox(this.id);
441
+ await this.refreshData();
442
+ }
443
+ /**
444
+ * Creates an SSH access token for the sandbox.
445
+ *
446
+ * @param {number} expiresInMinutes - The number of minutes the SSH access token will be valid for.
447
+ * @returns {Promise<SshAccessDto>} The SSH access token.
448
+ */
449
+ async createSshAccess(expiresInMinutes) {
450
+ return (await this.sandboxApi.createSshAccess(this.id, undefined, expiresInMinutes)).data;
451
+ }
452
+ /**
453
+ * Revokes an SSH access token for the sandbox.
454
+ *
455
+ * @param {string} token - The token to revoke.
456
+ * @returns {Promise<void>}
457
+ */
458
+ async revokeSshAccess(token) {
459
+ await this.sandboxApi.revokeSshAccess(this.id, undefined, token);
460
+ }
461
+ /**
462
+ * Validates an SSH access token for the sandbox.
463
+ *
464
+ * @param {string} token - The token to validate.
465
+ * @returns {Promise<SshAccessValidationDto>} The SSH access validation result.
466
+ */
467
+ async validateSshAccess(token) {
468
+ return (await this.sandboxApi.validateSshAccess(token)).data;
469
+ }
470
+ /**
471
+ * Assigns the API sandbox data to the Sandbox object.
472
+ *
473
+ * @param {SandboxDto} sandboxDto - The API sandbox instance to assign data from
474
+ * @returns {void}
475
+ */
476
+ processSandboxDto(sandboxDto) {
477
+ this.id = sandboxDto.id;
478
+ this.name = sandboxDto.name;
479
+ this.organizationId = sandboxDto.organizationId;
480
+ this.snapshot = sandboxDto.snapshot;
481
+ this.user = sandboxDto.user;
482
+ this.env = sandboxDto.env;
483
+ this.labels = sandboxDto.labels;
484
+ this.public = sandboxDto.public;
485
+ this.target = sandboxDto.target;
486
+ this.cpu = sandboxDto.cpu;
487
+ this.gpu = sandboxDto.gpu;
488
+ this.memory = sandboxDto.memory;
489
+ this.disk = sandboxDto.disk;
490
+ this.state = sandboxDto.state;
491
+ this.errorReason = sandboxDto.errorReason;
492
+ this.backupState = sandboxDto.backupState;
493
+ this.backupCreatedAt = sandboxDto.backupCreatedAt;
494
+ this.autoStopInterval = sandboxDto.autoStopInterval;
495
+ this.autoArchiveInterval = sandboxDto.autoArchiveInterval;
496
+ this.autoDeleteInterval = sandboxDto.autoDeleteInterval;
497
+ this.volumes = sandboxDto.volumes;
498
+ this.buildInfo = sandboxDto.buildInfo;
499
+ this.createdAt = sandboxDto.createdAt;
500
+ this.updatedAt = sandboxDto.updatedAt;
501
+ this.networkBlockAll = sandboxDto.networkBlockAll;
502
+ this.networkAllowList = sandboxDto.networkAllowList;
503
+ }
504
+ /**
505
+ * Refreshes the Sandbox data from the API, but does not throw an error if the sandbox has been deleted.
506
+ * Instead, it sets the state to destroyed.
507
+ *
508
+ * @returns {Promise<void>}
509
+ */
510
+ async refreshDataSafe() {
511
+ try {
512
+ await this.refreshData();
513
+ }
514
+ catch (error) {
515
+ if (error instanceof DaytonaNotFoundError) {
516
+ this.state = SandboxState.DESTROYED;
517
+ }
518
+ }
519
+ }
520
+ async ensureToolboxUrl() {
521
+ if (this.axiosInstance.defaults.baseURL !== TOOLBOX_URL_PLACEHOLDER) {
522
+ return;
523
+ }
524
+ this.axiosInstance.defaults.baseURL = await this.getToolboxBaseUrl();
525
+ if (!this.axiosInstance.defaults.baseURL.endsWith('/')) {
526
+ this.axiosInstance.defaults.baseURL += '/';
527
+ }
528
+ this.axiosInstance.defaults.baseURL += this.id;
529
+ this.clientConfig.basePath = this.axiosInstance.defaults.baseURL;
530
+ }
531
+ }
532
+ //# sourceMappingURL=Sandbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sandbox.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/Sandbox.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,YAAY,GAWb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,aAAa,EACb,MAAM,EACN,UAAU,EACV,MAAM,EACN,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAiB,OAAO,EAAE,MAAM,W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